mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 05:14:12 +03:00
parent
97f592aa41
commit
31e2737cfd
@ -36,6 +36,8 @@ function writeConfigFile() {
|
|||||||
|
|
||||||
function validateConfigEnvironment() {
|
function validateConfigEnvironment() {
|
||||||
var envVal = process.env.NODE_ENV || 'undefined',
|
var envVal = process.env.NODE_ENV || 'undefined',
|
||||||
|
hasHostAndPort,
|
||||||
|
hasSocket,
|
||||||
config,
|
config,
|
||||||
parsedUrl;
|
parsedUrl;
|
||||||
|
|
||||||
@ -45,6 +47,7 @@ function validateConfigEnvironment() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Check if we don't even have a config
|
// Check if we don't even have a config
|
||||||
if (!config) {
|
if (!config) {
|
||||||
errors.logError(new Error('Cannot find the configuration for the current NODE_ENV'), "NODE_ENV=" + envVal, 'Ensure your config.js has a section for the current NODE_ENV value');
|
errors.logError(new Error('Cannot find the configuration for the current NODE_ENV'), "NODE_ENV=" + envVal, 'Ensure your config.js has a section for the current NODE_ENV value');
|
||||||
@ -64,9 +67,12 @@ function validateConfigEnvironment() {
|
|||||||
return when.reject();
|
return when.reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hasHostAndPort = config.server && !!config.server.host && !!config.server.port;
|
||||||
|
hasSocket = config.server && !!config.server.socket;
|
||||||
|
|
||||||
// Check for valid server host and port values
|
// Check for valid server host and port values
|
||||||
if (!config.server || !config.server.host || !config.server.port) {
|
if (!config.server || !(hasHostAndPort || hasSocket)) {
|
||||||
errors.logError(new Error('Your server values (host and port) in config.js are invalid.'), JSON.stringify(config.server), 'Please provide them before restarting.');
|
errors.logError(new Error('Your server values (socket, or host and port) in config.js are invalid.'), JSON.stringify(config.server), 'Please provide them before restarting.');
|
||||||
return when.reject();
|
return when.reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user