From 327d29fdd93b729add635d094618dc4d01c79ac5 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 22 Apr 2019 11:01:01 +0200 Subject: [PATCH] :hammer: Refactors add-on to use Hassio ports on the host network --- traccar/config.json | 9 ++++++--- traccar/rootfs/etc/cont-init.d/nginx.sh | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/traccar/config.json b/traccar/config.json index 2ed7501..95c0125 100755 --- a/traccar/config.json +++ b/traccar/config.json @@ -16,21 +16,24 @@ "boot": "auto", "hassio_api": true, "hassio_role": "default", - "homeassistant_api": false, "host_network": true, + "ports": { + "8072/tcp": 8072 + }, + "ports_description": { + "8072/tcp": "Traccar web interface" + }, "map": [ "config:rw", "ssl" ], "options": { - "port": 8072, "ssl": true, "certfile": "fullchain.pem", "keyfile": "privkey.pem" }, "schema": { "log_level": "match(^(trace|debug|info|notice|warning|error|fatal)$)?", - "port": "port", "ssl": "bool", "certfile": "str", "keyfile": "str" diff --git a/traccar/rootfs/etc/cont-init.d/nginx.sh b/traccar/rootfs/etc/cont-init.d/nginx.sh index a1d3573..c41904e 100644 --- a/traccar/rootfs/etc/cont-init.d/nginx.sh +++ b/traccar/rootfs/etc/cont-init.d/nginx.sh @@ -20,5 +20,5 @@ if bashio::config.true 'ssl'; then sed -i "s/%%keyfile%%/${keyfile}/g" /etc/nginx/nginx.conf fi -port=$(bashio::config 'port') +port=$(bashio::addon.port 8072) sed -i "s/%%port%%/${port}/g" /etc/nginx/nginx.conf