Skip to content

Commit

Permalink
Hide ports from the outside world if hidePorts = true.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Waldvogel authored and cjb committed Jan 7, 2010
1 parent dae6ecc commit e0b7c50
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions etherpad/etc/etherpad.localdev-default.properties
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions etherpad/src/etherpad/utils.js
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions infrastructure/net.appjet.oui/config.scala
Expand Up @@ -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");
Expand Down

0 comments on commit e0b7c50

Please sign in to comment.