From 1947692746c3672e567b358c75e0523a1157ff05 Mon Sep 17 00:00:00 2001 From: Timmo Date: Wed, 12 Dec 2018 13:14:11 +0000 Subject: [PATCH] :fire: :hammer: Remove no longer required init script and update api run script --- home-panel/rootfs/etc/cont-init.d/30-api.sh | 16 ---------------- home-panel/rootfs/etc/services.d/api/run | 10 +++++++++- 2 files changed, 9 insertions(+), 17 deletions(-) delete mode 100644 home-panel/rootfs/etc/cont-init.d/30-api.sh diff --git a/home-panel/rootfs/etc/cont-init.d/30-api.sh b/home-panel/rootfs/etc/cont-init.d/30-api.sh deleted file mode 100644 index 4392dde..0000000 --- a/home-panel/rootfs/etc/cont-init.d/30-api.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/with-contenv bash -# ============================================================================== -# Timmo Hass.io Add-ons: Home Panel -# This copies the api files to their respective locations -# ============================================================================== -# shellcheck disable=SC1091 -source /usr/lib/hassio-addons/base.sh - -certfile="/ssl/$(hass.config.get 'certfile')" -keyfile="/ssl/$(hass.config.get 'keyfile')" - -if hass.config.true 'ssl'; then - hass.log.info "Copy SSL certs to API directory.." - cp "$certfile" /opt/api/fullchain.pem - cp "$keyfile" /opt/api/privkey.pem -fi diff --git a/home-panel/rootfs/etc/services.d/api/run b/home-panel/rootfs/etc/services.d/api/run index c2fb662..4e2b986 100644 --- a/home-panel/rootfs/etc/services.d/api/run +++ b/home-panel/rootfs/etc/services.d/api/run @@ -11,4 +11,12 @@ hass.log.info "Run API.." # shellcheck disable=SC2164 cd /opt/api -DB_PATH=/config/home-panel.db CONFIG_PATH=/config/$(hass.config.get 'config_file') node index.js +DB_PATH=/config/home-panel.db +CONFIG_PATH=/config/$(hass.config.get 'config_file') + +if hass.config.true 'ssl'; then + SSL_PATH_CERT="/ssl/$(hass.config.get 'certfile')" + SSL_PATH_KEY="/ssl/$(hass.config.get 'keyfile')" +fi + +exec node index.js