⬆️ Upgrade to base 3.0.0 and migrate to bashio

This commit is contained in:
Timmo 2019-03-19 22:01:23 +00:00
parent a2244c6529
commit 1e23014cbd
6 changed files with 28 additions and 52 deletions

View file

@ -6,9 +6,10 @@ variables:
ADDON_SLUG: "thelounge" ADDON_SLUG: "thelounge"
ADDON_TARGET: "thelounge" ADDON_TARGET: "thelounge"
ADDON_ARMV7: "false" ADDON_LEGACY_TAGS: "true"
ADDON_AARCH64_BASE: "hassioaddons/base-aarch64:2.3.1" ADDON_AARCH64_BASE: "hassioaddons/base-aarch64:3.0.0"
ADDON_AMD64_BASE: "hassioaddons/base-amd64:2.3.1" ADDON_AMD64_BASE: "hassioaddons/base-amd64:3.0.0"
ADDON_ARMHF_BASE: "hassioaddons/base-armhf:2.3.1" ADDON_ARMHF_BASE: "hassioaddons/base-armhf:3.0.0"
ADDON_I386_BASE: "hassioaddons/base-i386:2.3.1" ADDON_ARMV7_BASE: "hassioaddons/base-armv7:3.0.0"
ADDON_I386_BASE: "hassioaddons/base-i386:3.0.0"

View file

@ -1,4 +1,4 @@
ARG BUILD_FROM=hassioaddons/base:2.3.1 ARG BUILD_FROM=hassioaddons/base:3.0.0
# hadolint ignore=DL3006 # hadolint ignore=DL3006
FROM ${BUILD_FROM} FROM ${BUILD_FROM}
@ -6,8 +6,8 @@ FROM ${BUILD_FROM}
# hadolint ignore=DL3003 # hadolint ignore=DL3003
RUN \ RUN \
apk add --no-cache \ apk add --no-cache \
nodejs-current=9.11.1-r2 \ nodejs-current=11.3.0-r0 \
yarn=1.7.0-r0 \ yarn=1.12.3-r0 \
\ \
&& yarn global add thelounge@3.0.1 \ && yarn global add thelounge@3.0.1 \
\ \

View file

@ -1,10 +1,10 @@
{ {
"args": {}, "args": {},
"build_from": { "build_from": {
"aarch64": "hassioaddons/base-aarch64:2.3.1", "aarch64": "hassioaddons/base-aarch64:3.0.0",
"amd64": "hassioaddons/base-amd64:2.3.1", "amd64": "hassioaddons/base-amd64:3.0.0",
"armhf": "hassioaddons/base-armhf:2.3.1", "armhf": "hassioaddons/base-armhf:3.0.0",
"i386": "hassioaddons/base-i386:2.3.1" "i386": "hassioaddons/base-i386:3.0.0"
}, },
"squash": false "squash": false
} }

View file

@ -1,26 +1,7 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bashio
# ============================================================================== # ==============================================================================
# Community Hass.io Add-ons: The Lounge # Community Hass.io Add-ons: The Lounge
# This checks if all user configuration requirements are met # This checks if all user configuration requirements are met
# ============================================================================== # ==============================================================================
# shellcheck disable=SC1091 # Check SSL settings
source /usr/lib/hassio-addons/base.sh bashio::config.require.ssl
# Check SSL requirements, if enabled
if hass.config.true 'ssl'; then
if ! hass.config.has_value 'certfile'; then
hass.die 'SSL is enabled, but no certfile was specified'
fi
if ! hass.config.has_value 'keyfile'; then
hass.die 'SSL is enabled, but no keyfile was specified'
fi
if ! hass.file_exists "/ssl/$(hass.config.get 'certfile')"; then
hass.die 'The configured certfile is not found'
fi
if ! hass.file_exists "/ssl/$(hass.config.get 'keyfile')"; then
hass.die 'The configured keyfile is not found'
fi
fi

View file

@ -1,19 +1,16 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bashio
# ============================================================================== # ==============================================================================
# Community Hass.io Add-ons: The Lounge # Community Hass.io Add-ons: The Lounge
# This adds the default user and installs any requested themes # This adds the default user and installs any requested themes
# ============================================================================== # ==============================================================================
# shellcheck disable=SC1091
source /usr/lib/hassio-addons/base.sh
export THELOUNGE_HOME=/data/thelounge export THELOUNGE_HOME=/data/thelounge
if ! hass.directory_exists "/data/thelounge"; then if ! bashio::fs.directory_exists "/data/thelounge"; then
hass.log.info "Creating default hassio user.." bashio::log.info "Creating default hassio user.."
mkdir -p /data/thelounge/users mkdir -p /data/thelounge/users
cp /etc/thelounge/users/hassio.json /data/thelounge/users cp /etc/thelounge/users/hassio.json /data/thelounge/users
else else
for theme in $(hass.config.get "themes") for theme in $(bashio::config "themes")
do do
/usr/local/bin/thelounge install "$theme" /usr/local/bin/thelounge install "$theme"
done done

View file

@ -1,22 +1,19 @@
#!/bin/bash #!/usr/bin/with-contenv bashio
# ============================================================================== # ==============================================================================
# Community Hass.io Add-ons: The Lounge # Community Hass.io Add-ons: The Lounge
# Runs The Lounge server # Runs The Lounge server
# ============================================================================== # ==============================================================================
# shellcheck disable=SC1091
source /usr/lib/hassio-addons/base.sh
export THELOUNGE_HOME=/data/thelounge export THELOUNGE_HOME=/data/thelounge
hass.log.info "Starting The Lounge server.." bashio::log.info "Starting The Lounge server.."
exec /usr/local/bin/thelounge start \ exec /usr/local/bin/thelounge start \
-c port=15100 \ -c port=15100 \
-c https.enable="$(hass.config.get 'ssl')" \ -c https.enable="$(bashio::config 'ssl')" \
-c https.ca="/ssl/$(hass.config.get 'certfile')" \ -c https.ca="/ssl/$(bashio::config 'certfile')" \
-c https.certificate="/ssl/$(hass.config.get 'certfile')" \ -c https.certificate="/ssl/$(bashio::config 'certfile')" \
-c https.key="/ssl/$(hass.config.get 'keyfile')" \ -c https.key="/ssl/$(bashio::config 'keyfile')" \
-c fileUpload=true \ -c fileUpload=true \
-c prefetch=true \ -c prefetch=true \
-c prefetchStorage=true \ -c prefetchStorage=true \
-c theme="$(hass.config.get 'default_theme')" -c theme="$(bashio::config 'default_theme')"