diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7295de0..40f0c6c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,9 +6,10 @@ variables: ADDON_SLUG: "thelounge" ADDON_TARGET: "thelounge" - ADDON_ARMV7: "false" + ADDON_LEGACY_TAGS: "true" - ADDON_AARCH64_BASE: "hassioaddons/base-aarch64:2.3.1" - ADDON_AMD64_BASE: "hassioaddons/base-amd64:2.3.1" - ADDON_ARMHF_BASE: "hassioaddons/base-armhf:2.3.1" - ADDON_I386_BASE: "hassioaddons/base-i386:2.3.1" + ADDON_AARCH64_BASE: "hassioaddons/base-aarch64:3.0.0" + ADDON_AMD64_BASE: "hassioaddons/base-amd64:3.0.0" + ADDON_ARMHF_BASE: "hassioaddons/base-armhf:3.0.0" + ADDON_ARMV7_BASE: "hassioaddons/base-armv7:3.0.0" + ADDON_I386_BASE: "hassioaddons/base-i386:3.0.0" diff --git a/thelounge/Dockerfile b/thelounge/Dockerfile index e5316a3..ce963cc 100644 --- a/thelounge/Dockerfile +++ b/thelounge/Dockerfile @@ -1,4 +1,4 @@ -ARG BUILD_FROM=hassioaddons/base:2.3.1 +ARG BUILD_FROM=hassioaddons/base:3.0.0 # hadolint ignore=DL3006 FROM ${BUILD_FROM} @@ -6,8 +6,8 @@ FROM ${BUILD_FROM} # hadolint ignore=DL3003 RUN \ apk add --no-cache \ - nodejs-current=9.11.1-r2 \ - yarn=1.7.0-r0 \ + nodejs-current=11.3.0-r0 \ + yarn=1.12.3-r0 \ \ && yarn global add thelounge@3.0.1 \ \ diff --git a/thelounge/build.json b/thelounge/build.json index a15de00..c45bff1 100644 --- a/thelounge/build.json +++ b/thelounge/build.json @@ -1,10 +1,10 @@ { "args": {}, "build_from": { - "aarch64": "hassioaddons/base-aarch64:2.3.1", - "amd64": "hassioaddons/base-amd64:2.3.1", - "armhf": "hassioaddons/base-armhf:2.3.1", - "i386": "hassioaddons/base-i386:2.3.1" + "aarch64": "hassioaddons/base-aarch64:3.0.0", + "amd64": "hassioaddons/base-amd64:3.0.0", + "armhf": "hassioaddons/base-armhf:3.0.0", + "i386": "hassioaddons/base-i386:3.0.0" }, "squash": false -} \ No newline at end of file +} diff --git a/thelounge/rootfs/etc/cont-init.d/10-requirements.sh b/thelounge/rootfs/etc/cont-init.d/10-requirements.sh index 9ee75d8..5ac326d 100644 --- a/thelounge/rootfs/etc/cont-init.d/10-requirements.sh +++ b/thelounge/rootfs/etc/cont-init.d/10-requirements.sh @@ -1,26 +1,7 @@ -#!/usr/bin/with-contenv bash +#!/usr/bin/with-contenv bashio # ============================================================================== # Community Hass.io Add-ons: The Lounge # This checks if all user configuration requirements are met # ============================================================================== -# shellcheck disable=SC1091 -source /usr/lib/hassio-addons/base.sh - -# 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 +# Check SSL settings +bashio::config.require.ssl diff --git a/thelounge/rootfs/etc/cont-init.d/20-setup.sh b/thelounge/rootfs/etc/cont-init.d/20-setup.sh index d032e24..cb895ff 100644 --- a/thelounge/rootfs/etc/cont-init.d/20-setup.sh +++ b/thelounge/rootfs/etc/cont-init.d/20-setup.sh @@ -1,19 +1,16 @@ -#!/usr/bin/with-contenv bash +#!/usr/bin/with-contenv bashio # ============================================================================== # Community Hass.io Add-ons: The Lounge # 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 -if ! hass.directory_exists "/data/thelounge"; then - hass.log.info "Creating default hassio user.." +if ! bashio::fs.directory_exists "/data/thelounge"; then + bashio::log.info "Creating default hassio user.." mkdir -p /data/thelounge/users cp /etc/thelounge/users/hassio.json /data/thelounge/users else - for theme in $(hass.config.get "themes") + for theme in $(bashio::config "themes") do /usr/local/bin/thelounge install "$theme" done diff --git a/thelounge/rootfs/etc/services.d/server/run b/thelounge/rootfs/etc/services.d/server/run index 5c00772..a910581 100644 --- a/thelounge/rootfs/etc/services.d/server/run +++ b/thelounge/rootfs/etc/services.d/server/run @@ -1,22 +1,19 @@ -#!/bin/bash +#!/usr/bin/with-contenv bashio # ============================================================================== # Community Hass.io Add-ons: The Lounge # Runs The Lounge server # ============================================================================== -# shellcheck disable=SC1091 -source /usr/lib/hassio-addons/base.sh - 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 \ -c port=15100 \ - -c https.enable="$(hass.config.get 'ssl')" \ - -c https.ca="/ssl/$(hass.config.get 'certfile')" \ - -c https.certificate="/ssl/$(hass.config.get 'certfile')" \ - -c https.key="/ssl/$(hass.config.get 'keyfile')" \ + -c https.enable="$(bashio::config 'ssl')" \ + -c https.ca="/ssl/$(bashio::config 'certfile')" \ + -c https.certificate="/ssl/$(bashio::config 'certfile')" \ + -c https.key="/ssl/$(bashio::config 'keyfile')" \ -c fileUpload=true \ -c prefetch=true \ -c prefetchStorage=true \ - -c theme="$(hass.config.get 'default_theme')" + -c theme="$(bashio::config 'default_theme')"