mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-01 19:15:52 +01:00
Add configuration for jetty idle timeout
Pushed-by: Rene Pfeuffer<rene.pfeuffer@cloudogu.com> Co-authored-by: René Pfeuffer<rene.pfeuffer@cloudogu.com> Committed-by: René Pfeuffer<rene.pfeuffer@cloudogu.com>
This commit is contained in:
2
gradle/changelog/idleTimeout.yaml
Normal file
2
gradle/changelog/idleTimeout.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
- type: fixed
|
||||||
|
description: Added configuration option for idle timeout
|
||||||
@@ -10,6 +10,9 @@ forwardHeadersEnabled: false
|
|||||||
## increase http header size for mercurial
|
## increase http header size for mercurial
|
||||||
httpHeaderSize: 16384
|
httpHeaderSize: 16384
|
||||||
|
|
||||||
|
## set http idle timeout
|
||||||
|
idleTimeout:
|
||||||
|
|
||||||
# ssl config - ssl is only evaluated if key store path is set
|
# ssl config - ssl is only evaluated if key store path is set
|
||||||
## path to your cert file
|
## path to your cert file
|
||||||
https:
|
https:
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ forwardHeadersEnabled: false
|
|||||||
## increase http header size for mercurial
|
## increase http header size for mercurial
|
||||||
httpHeaderSize: 16384
|
httpHeaderSize: 16384
|
||||||
|
|
||||||
|
## set http idle timeout
|
||||||
|
idleTimeout:
|
||||||
|
|
||||||
# ssl config - ssl is only evaluated if key store path is set
|
# ssl config - ssl is only evaluated if key store path is set
|
||||||
https:
|
https:
|
||||||
## path to your cert file
|
## path to your cert file
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ forwardHeadersEnabled: true
|
|||||||
## increase http header size for mercurial
|
## increase http header size for mercurial
|
||||||
httpHeaderSize: 16384
|
httpHeaderSize: 16384
|
||||||
|
|
||||||
|
## set http idle timeout
|
||||||
|
idleTimeout:
|
||||||
|
|
||||||
# ssl config - ssl is only evaluated if key store path is set
|
# ssl config - ssl is only evaluated if key store path is set
|
||||||
https:
|
https:
|
||||||
## path to your cert file
|
## path to your cert file
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ forwardHeadersEnabled: false
|
|||||||
## increase http header size for mercurial
|
## increase http header size for mercurial
|
||||||
httpHeaderSize: 16384
|
httpHeaderSize: 16384
|
||||||
|
|
||||||
|
## set http idle timeout
|
||||||
|
idleTimeout:
|
||||||
|
|
||||||
# ssl config - ssl is only evaluated if key store path is set
|
# ssl config - ssl is only evaluated if key store path is set
|
||||||
https:
|
https:
|
||||||
## path to your cert file
|
## path to your cert file
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class ServerConfigYaml {
|
|||||||
private String tempDir = "work/scm";
|
private String tempDir = "work/scm";
|
||||||
// Resolves the client ip instead of the reverse proxy ip if the X-Forwarded-For header is present
|
// Resolves the client ip instead of the reverse proxy ip if the X-Forwarded-For header is present
|
||||||
private boolean forwardHeadersEnabled = false;
|
private boolean forwardHeadersEnabled = false;
|
||||||
|
private int idleTimeout = 0;
|
||||||
|
|
||||||
// ### SSL-related config
|
// ### SSL-related config
|
||||||
// Only configure SSL if the key store path is set
|
// Only configure SSL if the key store path is set
|
||||||
@@ -149,6 +150,14 @@ public class ServerConfigYaml {
|
|||||||
this.forwardHeadersEnabled = forwardHeadersEnabled;
|
this.forwardHeadersEnabled = forwardHeadersEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getIdleTimeout() {
|
||||||
|
return getEnvWithDefault("IDLE_TIMEOUT", idleTimeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdleTimeout(int idleTimeout) {
|
||||||
|
this.idleTimeout = idleTimeout;
|
||||||
|
}
|
||||||
|
|
||||||
static int getEnvWithDefault(String envKey, int configValue) {
|
static int getEnvWithDefault(String envKey, int configValue) {
|
||||||
String value = getEnv(envKey);
|
String value = getEnv(envKey);
|
||||||
return value != null ? Integer.parseInt(value) : configValue;
|
return value != null ? Integer.parseInt(value) : configValue;
|
||||||
|
|||||||
@@ -118,6 +118,10 @@ public final class ServerConfiguration {
|
|||||||
connector.setHost(configYaml.getAddressBinding());
|
connector.setHost(configYaml.getAddressBinding());
|
||||||
System.out.println("Set http port to " + configYaml.getPort());
|
System.out.println("Set http port to " + configYaml.getPort());
|
||||||
connector.setPort(configYaml.getPort());
|
connector.setPort(configYaml.getPort());
|
||||||
|
if (configYaml.getIdleTimeout() > 0) {
|
||||||
|
System.out.println("Set http idle timeout to " + configYaml.getIdleTimeout());
|
||||||
|
connector.setIdleTimeout(configYaml.getIdleTimeout());
|
||||||
|
}
|
||||||
server.addConnector(connector);
|
server.addConnector(connector);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user