Permalink
Browse files

Hide ports from the outside world if hidePorts = true.

  • Loading branch information...
1 parent dae6ecc commit e0b7c500b52164cb75c463944454f742f92be338 Marcel Waldvogel committed with Jan 7, 2010
@@ -8,6 +8,7 @@ etherpad.SQL_JDBC_DRIVER = com.mysql.jdbc.Driver
etherpad.SQL_JDBC_URL = jdbc:mysql://localhost:3306/etherpad
etherpad.SQL_PASSWORD = password
etherpad.SQL_USERNAME = etherpad
+hidePorts = true
listen = 9000
logDir = ./data/logs
modulePath = ./src
@@ -375,15 +375,15 @@ function isStaticRequest() {
function httpsHost(h) {
h = h.split(":")[0]; // strip any existing port
- if (appjet.config.listenSecurePort != "443") {
+ if (appjet.config.listenSecurePort != "443" && !appjet.config.hidePorts) {
h = (h + ":" + appjet.config.listenSecurePort);
}
return h;
}
function httpHost(h) {
h = h.split(":")[0]; // strip any existing port
- if (appjet.config.listenPort != "80") {
+ if (appjet.config.listenPort != "80" && !appjet.config.hidePorts) {
h = (h + ":" + appjet.config.listenPort);
}
return h;
@@ -114,6 +114,9 @@ object config {
else
("", Integer.parseInt(s))
+ @ConfigParam("Whether to show the port numbers to the outside world (false: assume ports visible from the outside are the default http/ https ports)")
+ def hidePorts = boolOrElse("hidePorts", false);
+
@ConfigParam("[host:]port on which to serve the app. Default: 8080.")
{ val argName = "[host:]port" }
def listen = stringOrElse("listen", "8080");

0 comments on commit e0b7c50

Please sign in to comment.