diff --git a/app.js b/app.js index 7a6f68dc7a..a081cd4fa3 100644 --- a/app.js +++ b/app.js @@ -66,6 +66,7 @@ nconf.set('upload_url', nconf.get('url') + 'uploads/'); winston.info('Initializing NodeBB v' + pkg.version + ', on port ' + nconf.get('port') + ', using Redis store at ' + nconf.get('redis:host') + ':' + nconf.get('redis:port') + '.'); + winston.info('NodeBB instance bound to: ' + (nconf.get('bind_address') || 'Any address')); if (process.env.NODE_ENV === 'development') { winston.info('Base Configuration OK.'); diff --git a/src/install.js b/src/install.js index 4a4ef9351f..535e578379 100644 --- a/src/install.js +++ b/src/install.js @@ -18,7 +18,9 @@ var async = require('async'), }, { name: 'port', description: 'Port number of your NodeBB', - 'default': 4567 + 'default': 4567, + pattern: /[0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]/, + message: 'Please enter a value betweeen 1 and 65535' }, { name: 'use_port', description: 'Use a port number to access NodeBB?', @@ -40,7 +42,11 @@ var async = require('async'), }, { name: 'redis:password', description: 'Password of your Redis database' - }], + }, { + name: 'bind_address', + description: 'IP or Hostname to bind to', + 'default': '0.0.0.0' + }], setup: function (callback) { async.series([ function (next) { diff --git a/src/meta.js b/src/meta.js index 1b47d1900a..98867c8f5b 100644 --- a/src/meta.js +++ b/src/meta.js @@ -7,9 +7,12 @@ var utils = require('./../public/src/utils.js'), nconf = require('nconf'); (function (Meta) { + Meta.config = {}; Meta.configs = { init: function (callback) { + delete Meta.config; + Meta.configs.list(function (err, config) { if (!err) { Meta.config = config; diff --git a/src/webserver.js b/src/webserver.js index a9b7488f90..0b07f23f43 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -185,7 +185,7 @@ var express = require('express'), templates['logout'] = parsedTemplate; }); - server.listen(nconf.get('PORT') || nconf.get('port')); + server.listen(nconf.get('PORT') || nconf.get('port'), nconf.get('bind_address')); } app.create_route = function (url, tpl) { // to remove