mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 21:31:36 +02:00
Add support for bindIp and idleTimeout to config object
This commit is contained in:
@@ -24,6 +24,8 @@ public class Config implements JSONSource {
|
||||
static Config asSanitised(Config config) {
|
||||
return new Config(
|
||||
config.port,
|
||||
config.bindIp,
|
||||
config.idleTimeout,
|
||||
config.rootGitDirectory,
|
||||
config.apiBaseURL,
|
||||
config.postbackURL,
|
||||
@@ -36,6 +38,8 @@ public class Config implements JSONSource {
|
||||
}
|
||||
|
||||
private int port;
|
||||
private String bindIp;
|
||||
private int idleTimeout;
|
||||
private String rootGitDirectory;
|
||||
private String apiBaseURL;
|
||||
private String postbackURL;
|
||||
@@ -62,6 +66,8 @@ public class Config implements JSONSource {
|
||||
|
||||
public Config(
|
||||
int port,
|
||||
String bindIp,
|
||||
int idleTimeout,
|
||||
String rootGitDirectory,
|
||||
String apiBaseURL,
|
||||
String postbackURL,
|
||||
@@ -72,6 +78,8 @@ public class Config implements JSONSource {
|
||||
SwapJobConfig swapJob
|
||||
) {
|
||||
this.port = port;
|
||||
this.bindIp = bindIp;
|
||||
this.idleTimeout = idleTimeout;
|
||||
this.rootGitDirectory = rootGitDirectory;
|
||||
this.apiBaseURL = apiBaseURL;
|
||||
this.postbackURL = postbackURL;
|
||||
@@ -86,6 +94,8 @@ public class Config implements JSONSource {
|
||||
public void fromJSON(JsonElement json) {
|
||||
JsonObject configObject = json.getAsJsonObject();
|
||||
port = getElement(configObject, "port").getAsInt();
|
||||
bindIp = getElement(configObject, "bindIp").getAsString();
|
||||
idleTimeout = getElement(configObject, "idleTimeout").getAsInt();
|
||||
rootGitDirectory = getElement(
|
||||
configObject,
|
||||
"rootGitDirectory"
|
||||
@@ -124,6 +134,14 @@ public class Config implements JSONSource {
|
||||
return port;
|
||||
}
|
||||
|
||||
public String getBindIp() {
|
||||
return bindIp;
|
||||
}
|
||||
|
||||
public int getIdleTimeout() {
|
||||
return idleTimeout;
|
||||
}
|
||||
|
||||
public String getRootGitDirectory() {
|
||||
return rootGitDirectory;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user