mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-22 00:10:25 +01:00
warning/errors on invalid ports config
This commit is contained in:
@@ -33,6 +33,21 @@ if(nconf.get('ssl')) {
|
|||||||
(function (app) {
|
(function (app) {
|
||||||
var port = nconf.get('port');
|
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() {
|
module.exports.init = function() {
|
||||||
var skipJS, skipLess, fromFile = nconf.get('from-file') || '';
|
var skipJS, skipLess, fromFile = nconf.get('from-file') || '';
|
||||||
|
|
||||||
@@ -164,6 +179,10 @@ if(nconf.get('ssl')) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
module.exports.testSocket = function(socketPath, callback) {
|
module.exports.testSocket = function(socketPath, callback) {
|
||||||
|
if (typeof socketPath !== 'string') {
|
||||||
|
return callback(new Error('invalid socket path : ' + socketPath));
|
||||||
|
}
|
||||||
|
|
||||||
async.series([
|
async.series([
|
||||||
function(next) {
|
function(next) {
|
||||||
fs.exists(socketPath, function(exists) {
|
fs.exists(socketPath, function(exists) {
|
||||||
|
|||||||
Reference in New Issue
Block a user