fix: Allow migration with minimal config

Config fails to load if no baseurl is set. This blocks migration:dev
This commit is contained in:
Norbert Szulc 2024-07-07 19:28:51 +02:00
parent c8ccf64c54
commit 4d45d2770f

View file

@ -39,7 +39,7 @@ let config = {
const configContent = fs.readFileSync(config_path)
config = Object.assign(config, JSON.parse(configContent))
config.status = 'CONFIGURED'
if (!config.hostname) {
if (!config.hostname && config.baseurl) {
config.hostname = new URL.URL(config.baseurl).hostname
}
} else {
@ -50,4 +50,4 @@ let config = {
}
config.load()
module.exports = config
module.exports = config