Skip to content

Commit

Permalink
fix #262
Browse files Browse the repository at this point in the history
  • Loading branch information
oznu committed Apr 21, 2019
1 parent 8e5a999 commit c8550c1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <dev@oz.nu>",
Expand Down
16 changes: 11 additions & 5 deletions src/core/config/config.startup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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?: {
Expand All @@ -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)) {
Expand Down

0 comments on commit c8550c1

Please sign in to comment.