Move the maxSessionAge init for SystemConfig to GerritServer

This is where the rest of the system configuration is stored,
so we should initialize it there, to reduce confusion about
how the default setup is obtained.

Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2009-01-19 10:16:40 -08:00
parent 682fef6a8b
commit 0d54b48e9a
2 changed files with 2 additions and 1 deletions

View File

@@ -55,10 +55,10 @@ public final class SystemConfig {
HTTP;
}
/** Construct a new, unconfigured instance. */
public static SystemConfig create() {
final SystemConfig r = new SystemConfig();
r.singleton = new SystemConfig.Key();
r.maxSessionAge = 12 * 60 * 60 /* seconds */;
return r;
}

View File

@@ -211,6 +211,7 @@ public class GerritServer {
c.accountGroups().insert(Collections.singleton(registered));
final SystemConfig s = SystemConfig.create();
s.maxSessionAge = 12 * 60 * 60 /* seconds */;
s.xsrfPrivateKey = SignedToken.generateRandomKey();
s.accountPrivateKey = SignedToken.generateRandomKey();
s.sshdPort = 29418;