warning/errors on invalid ports config

v1.18.x
barisusakli 10 years ago
parent 5d04cd0bef
commit 0d6772c30b

@ -33,6 +33,21 @@ if(nconf.get('ssl')) {
(function (app) {
var port = nconf.get('port');
if (Array.isArray(port)) {
if (!port.length) {
winston.error('[startup] empty ports array in config.json');
process.exit();
}
winston.warn('[startup] If you want to start nodebb on multiple ports please use loader.js');
winston.warn('[startup] Defaulting to first port in array, ' + port[0]);
port = port[0];
if (!port) {
winston.error('[startup] Invalid port, exiting');
process.exit();
}
}
module.exports.init = function() {
var skipJS, skipLess, fromFile = nconf.get('from-file') || '';
@ -164,6 +179,10 @@ if(nconf.get('ssl')) {
};
module.exports.testSocket = function(socketPath, callback) {
if (typeof socketPath !== 'string') {
return callback(new Error('invalid socket path : ' + socketPath));
}
async.series([
function(next) {
fs.exists(socketPath, function(exists) {

Loading…
Cancel
Save