Skip to content

Commit

Permalink
Added DSM_HOSTNAME variable support (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
oznu authored Nov 20, 2017
1 parent 1bf0af3 commit 8e5ef5e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,7 @@ services:
### 1. Verify your config.json and package.json syntax
Many issues appear because of invalid JSON. A good way to verify your config is to use the [jsonlint.com](http://jsonlint.com/) validator.
### 2. When running on Synology DSM set the `DSM_HOSTNAME` environment variable

You may need to provide the server name of your Synology NAS using the `DSM_HOSTNAME` environment variable to prevent [hostname conflict errors](https://github.com/oznu/docker-homebridge/issues/35). The value of the `DSM_HOSTNAME` environment should exactly match the server name as shown under `Synology DSM Control Panel` -> `Info Centre` -> `Server name`, it should contain no spaces or special characters.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[server]
#host-name=
use-ipv4=yes
use-ipv6=no
enable-dbus=yes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@ chown messagebus:messagebus /var/run/dbus
chown avahi:avahi /var/run/avahi-daemon
dbus-uuidgen --ensure
sleep 1

# avahi config
cp /defaults/avahi-daemon.conf /etc/avahi/avahi-daemon.conf

# fix for synology dsm - see #35
if [[ ! -z "$DSM_HOSTNAME" ]]; then
sed -i "s/.*host-name.*/host-name=${DSM_HOSTNAME}/" /etc/avahi/avahi-daemon.conf
else
sed -i "s/.*host-name.*/#host-name=/" /etc/avahi/avahi-daemon.conf
fi

0 comments on commit 8e5ef5e

Please sign in to comment.