Permalink
Browse files

Restrict listening host to configured ``node_host``

  • Loading branch information...
1 parent 9090a19 commit 7fe09935cd10e242eedc34d1f767345246f160ae Sandro Santilli committed Oct 9, 2012
Showing with 10 additions and 6 deletions.
  1. +3 −2 app.js
  2. +4 −2 cluster.js
  3. +2 −1 config/environments/development.js.example
  4. +1 −1 package.json
View
5 app.js
@@ -26,5 +26,6 @@ _.extend(global.settings, env);
// kick off controller
var app = require(global.settings.app_root + '/app/controllers/app');
-app.listen(global.settings.node_port);
-console.log("CartoDB SQL API listening on port " + global.settings.node_port);
+app.listen(global.settings.node_port, global.settings.node_host, function() {
+ console.log("CartoDB SQL API listening on " + global.settings.node_host + ":" + global.settings.node_port);
+});
View
6 cluster.js
@@ -30,11 +30,13 @@ var app = require(global.settings.app_root + '/app/controllers/app');
var cluster = new Cluster({
port: global.settings.node_port,
+ host: global.settings.node_host,
+ monHost: global.settings.node_host,
monPort: global.settings.node_port+1
});
cluster.listen(function(cb) {
cb(app);
+}, function() {
+ console.log("CartoDB SQL API listening on " + global.settings.node_host + ':' + global.settings.node_port);
});
-
-console.log("CartoDB SQL API listening on port " + global.settings.node_port);
View
3 config/environments/development.js.example
@@ -1,4 +1,5 @@
module.exports.node_port = 8080;
+module.exports.node_host = '127.0.0.1';
module.exports.environment = 'development';
module.exports.db_base_name = 'cartodb_dev_user_<%= user_id %>_db';
module.exports.db_user = 'development_cartodb_user_<%= user_id %>';
@@ -9,4 +10,4 @@ module.exports.redis_port = 6379;
module.exports.redisPool = 50;
module.exports.redisIdleTimeoutMillis = 100;
module.exports.redisReapIntervalMillis = 10;
-module.exports.redisLog = false;
+module.exports.redisLog = false;
View
2 package.json
@@ -9,7 +9,7 @@
"email": "simon@vizzuality.com, strk@vizzuality.com"
},
"dependencies": {
- "cluster2": "git://github.com/CartoDB/cluster2.git#28cde11",
+ "cluster2": "git://github.com/CartoDB/cluster2.git#cdb_production",
"express": "~2.5.11",
"underscore" : "1.1.x",
"underscore.string": "1.1.5",

0 comments on commit 7fe0993

Please sign in to comment.