diff --git a/CHANGELOG.md b/CHANGELOG.md index 80dd390c3..762e52d14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/). +## 4.0.5 (2019-04-21) + +### Bug Fixes + +* Fixed issue preventing the web service from loading correctly in config-less [oznu/homebridge](https://github.com/oznu/docker-homebridge) docker containers ([#262](https://github.com/oznu/homebridge-config-ui-x/issues/262)) + ## 4.0.4 (2019-04-20) ### Bug Fixes diff --git a/package-lock.json b/package-lock.json index c28cd119b..ef96f81ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "homebridge-config-ui-x", - "version": "4.0.4", + "version": "4.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 90dfa396d..aa586f2fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-config-ui-x", - "version": "4.0.4", + "version": "4.0.5", "description": "Configuration UI plugin for Homebridge", "license": "MIT", "author": "oznu ", diff --git a/src/core/config/config.startup.ts b/src/core/config/config.startup.ts index 2726c5835..f741d4816 100644 --- a/src/core/config/config.startup.ts +++ b/src/core/config/config.startup.ts @@ -11,10 +11,6 @@ export async function getStartupConfig() { const homebridgeConfig = await fs.readJSON(configPath); const ui = homebridgeConfig.platforms.find(x => x.platform === 'config'); - if (!ui) { - return {}; - } - const config = {} as { host?: '::' | '0.0.0.0' | string; httpsOptions?: { @@ -32,7 +28,17 @@ export async function getStartupConfig() { return addresses.find(x => x.family === 'IPv6'); }).length; - config.host = ui.host || (ipv6 ? '::' : '0.0.0.0'); + config.host = ipv6 ? '::' : '0.0.0.0'; + + // if no ui settings configured - we are done + if (!ui) { + return config; + } + + // preload custom host settings + if (ui.host) { + config.host = ui.host; + } // preload ssl settings if (ui.ssl && ((ui.ssl.key && ui.ssl.cert) || ui.ssl.pfx)) {