mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-21 16:00:26 +01:00
warning/errors on invalid ports config
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user