mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 06:26:35 +02:00
minor fix to upgrade script
This commit is contained in:
@@ -314,11 +314,25 @@ Upgrade.upgrade = function(callback) {
|
|||||||
function(config, next) {
|
function(config, next) {
|
||||||
try {
|
try {
|
||||||
config = JSON.parse(config);
|
config = JSON.parse(config);
|
||||||
|
|
||||||
|
// If the config contains "url", it has already been updated, abort.
|
||||||
|
if (config.hasOwnProperty('url')) {
|
||||||
|
return next();
|
||||||
|
}
|
||||||
|
|
||||||
config.url = config.base_url + (config.use_port ? ':' + config.port : '') + config.relative_path;
|
config.url = config.base_url + (config.use_port ? ':' + config.port : '') + config.relative_path;
|
||||||
if (config.port == '4567') delete config.port;
|
if (config.port == '4567') {
|
||||||
if (config.bcrypt_rounds == 12) delete config.bcrypt_rounds;
|
delete config.port;
|
||||||
if (config.upload_path === '/public/uploads') delete config.upload_path;
|
}
|
||||||
if (config.bind_address === '0.0.0.0') delete config.bind_address;
|
if (config.bcrypt_rounds == 12) {
|
||||||
|
delete config.bcrypt_rounds;
|
||||||
|
}
|
||||||
|
if (config.upload_path === '/public/uploads') {
|
||||||
|
delete config.upload_path;
|
||||||
|
}
|
||||||
|
if (config.bind_address === '0.0.0.0') {
|
||||||
|
delete config.bind_address;
|
||||||
|
}
|
||||||
delete config.base_url;
|
delete config.base_url;
|
||||||
delete config.use_port;
|
delete config.use_port;
|
||||||
delete config.relative_path;
|
delete config.relative_path;
|
||||||
|
|||||||
Reference in New Issue
Block a user