mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-27 12:53:13 +03:00
parent
97f592aa41
commit
31e2737cfd
@ -36,6 +36,8 @@ function writeConfigFile() {
|
||||
|
||||
function validateConfigEnvironment() {
|
||||
var envVal = process.env.NODE_ENV || 'undefined',
|
||||
hasHostAndPort,
|
||||
hasSocket,
|
||||
config,
|
||||
parsedUrl;
|
||||
|
||||
@ -45,6 +47,7 @@ function validateConfigEnvironment() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Check if we don't even have a 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');
|
||||
@ -64,9 +67,12 @@ function validateConfigEnvironment() {
|
||||
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
|
||||
if (!config.server || !config.server.host || !config.server.port) {
|
||||
errors.logError(new Error('Your server values (host and port) in config.js are invalid.'), JSON.stringify(config.server), 'Please provide them before restarting.');
|
||||
if (!config.server || !(hasHostAndPort || hasSocket)) {
|
||||
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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user