diff --git a/configs/standalone.js b/configs/standalone.js index 83af89db..77621155 100644 --- a/configs/standalone.js +++ b/configs/standalone.js @@ -91,10 +91,19 @@ module.exports = function(config, optimist) { var isLocalhost = host == "localhost" || host == "127.0.0.1"; if (!/:/.test(argv.auth) && !isLocalhost) { - console.log("Authentication is required when not running on localhost.\nPlease use -a user:pass or --listen localhost to listen locally."); - console.log("switching to localhost"); + console.log("Authentication is required when not running on localhost."); + console.log("If you would like to expose this service to other hosts or the Internet"); + console.log("at large, please specify -a user:pass to set a username and password"); + console.log("(or use -a : to force no login)."); + console.log("Use --listen localhost to only listen on the localhost interface and"); + console.log("and suppress this message.\n"); host = config.host = "127.0.0.1"; } + if (/:/.test(argv.auth) && !isLocalhost && !process.env.C9_HOSTNAME) { + console.log("Warning: running Cloud9 without using HTTP authentication."); + console.log("Run using --listen localhost instead to only expose Cloud9 to localhost,"); + console.log("or use -a username:password to setup HTTP authentication\n"); + } var auth = (argv.auth || ":").split(":"); var plugins = [ diff --git a/scripts/install-sdk.sh b/scripts/install-sdk.sh index 0d296030..9fd7606c 100755 --- a/scripts/install-sdk.sh +++ b/scripts/install-sdk.sh @@ -164,4 +164,5 @@ updateNodeModules echo -e "c9.*\n.gitignore" > plugins/.gitignore echo "Success!" -echo "run '${yellow}node server.js -p 8181 -l 0.0.0.0 -a :${resetColor}' to launch Cloud9" + +echo "run '${yellow}node server.js -p 8080 -a :${resetColor}' to launch Cloud9" diff --git a/settings/standalone.js b/settings/standalone.js index 6be30d8f..b36f47b0 100644 --- a/settings/standalone.js +++ b/settings/standalone.js @@ -7,6 +7,7 @@ module.exports = function(manifest, installPath) { } var path = require("path"); + var os = require("os"); var runners = require("../plugins/c9.ide.run/runners_list").local; var builders = require("../plugins/c9.ide.run.build/builders_list"); @@ -28,6 +29,7 @@ module.exports = function(manifest, installPath) { var correctedInstallPath = installPath.substr(0, home.length) == home ? "~" + installPath.substr(home.length) : installPath; + var inContainer = os.hostname().match(/-\d+$/); var config = { standalone: true, @@ -45,7 +47,7 @@ module.exports = function(manifest, installPath) { sdk: sdk, pid: process.pid, port: process.env.PORT || 8181, - host: process.env.IP || "0.0.0.0", + host: process.env.IP || (inContainer ? "0.0.0.0" : "127.0.0.1"), testing: false, platform: process.platform, arch: process.arch,