X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Futil%2FServerConstants.java;h=3bf326358e67c7bd304361531f589c4ef0216d31;hb=c3feb67ae28e66765dfcd2e7d50ddbceb64d92db;hp=09317c3ec643f8c53dfc16b3b27309b4b7ac2883;hpb=9994af5b2aee70810acd1e4675c7a7c4a538a961;p=gigi.git diff --git a/src/org/cacert/gigi/util/ServerConstants.java b/src/org/cacert/gigi/util/ServerConstants.java index 09317c3e..3bf32635 100644 --- a/src/org/cacert/gigi/util/ServerConstants.java +++ b/src/org/cacert/gigi/util/ServerConstants.java @@ -12,7 +12,7 @@ public class ServerConstants { private static String apiHostName = "api.cacert.local"; - private static String securePort, port; + private static String securePort, port, secureBindPort, bindPort; private static String suffix = "cacert.local"; @@ -24,6 +24,8 @@ public class ServerConstants { if ( !conf.getProperty("http.port").equals("80")) { port = ":" + conf.getProperty("http.port"); } + secureBindPort = conf.getProperty("https.bindPort", conf.getProperty("https.port")); + bindPort = conf.getProperty("http.bindPort", conf.getProperty("http.port")); wwwHostName = conf.getProperty("name.www"); secureHostName = conf.getProperty("name.secure"); staticHostName = conf.getProperty("name.static"); @@ -73,6 +75,13 @@ public class ServerConstants { } public static int getSecurePort() { + if (secureBindPort != null && !secureBindPort.isEmpty()) { + if (secureBindPort.equals("stdin")) { + return -1; + } else { + return Integer.parseInt(secureBindPort); + } + } if (securePort.isEmpty()) { return 443; } @@ -80,6 +89,13 @@ public class ServerConstants { } public static int getPort() { + if (bindPort != null && !bindPort.isEmpty()) { + if (bindPort.equals("stdin")) { + return -1; + } else { + return Integer.parseInt(bindPort); + } + } if (port.isEmpty()) { return 80; } @@ -94,4 +110,8 @@ public class ServerConstants { return "support@" + ServerConstants.getWwwHostName().replaceFirst("^www\\.", ""); } + public static String getBoardMailAddress() { + return "board@" + ServerConstants.getWwwHostName().replaceFirst("^www\\.", ""); + } + }