Update API to v0.4.2 and remove SSL cert copy (#2)

* ⬆️ Update api to v0.4.2

* 🔥 🔨 Remove no longer required init script and update api run script

* 👕 Fix linter warning

* 👕 fix linter warnings

* 👕 🔥 Fix linter warnings
This commit is contained in:
Timmo 2018-12-15 13:54:45 +00:00 committed by GitHub
parent f6901c2545
commit 712ee031b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 18 deletions

View file

@ -13,7 +13,7 @@ RUN \
nodejs-current=9.11.1-r2 \
nginx=1.14.2-r0 \
\
&& git clone --branch "v0.4.1" --depth=1\
&& git clone --branch "v0.4.2" --depth=1\
"https://github.com/timmo001/home-panel-api.git" /opt/api \
\
&& curl -J -L -o /tmp/panel.zip \

View file

@ -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

View file

@ -11,4 +11,17 @@ 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
export DB_PATH
export CONFIG_PATH
export SSL_PATH_CERT
export SSL_PATH_KEY
exec node index.js