diff --git a/loki/Dockerfile b/loki/Dockerfile index f5faa1a..1fa24da 100644 --- a/loki/Dockerfile +++ b/loki/Dockerfile @@ -31,8 +31,8 @@ RUN set -eux; \ apk del .build-deps; \ \ apk add --no-cache \ - ca-certificates=20211220-r0 \ - nginx=1.20.2-r1 \ + ca-certificates=20220614-r0 \ + nginx=1.22.0-r1 \ ; \ update-ca-certificates; \ nginx -v; \ diff --git a/loki/build.yaml b/loki/build.yaml index 6725459..7f4126c 100644 --- a/loki/build.yaml +++ b/loki/build.yaml @@ -1,9 +1,9 @@ --- build_from: - amd64: ghcr.io/hassio-addons/base/amd64:11.1.2 - armhf: ghcr.io/hassio-addons/base/armhf:11.1.2 - armv7: ghcr.io/hassio-addons/base/armv7:11.1.2 - aarch64: ghcr.io/hassio-addons/base/aarch64:11.1.2 + amd64: ghcr.io/hassio-addons/base/amd64:12.2.3 + armhf: ghcr.io/hassio-addons/base/armhf:12.2.3 + armv7: ghcr.io/hassio-addons/base/armv7:12.2.3 + aarch64: ghcr.io/hassio-addons/base/aarch64:12.2.3 codenotary: base_image: codenotary@frenck.dev signer: codenotary@degatano.com diff --git a/loki/rootfs/etc/services.d/loki/finish b/loki/rootfs/etc/services.d/loki/finish index 636489e..782f6ed 100755 --- a/loki/rootfs/etc/services.d/loki/finish +++ b/loki/rootfs/etc/services.d/loki/finish @@ -1,9 +1,14 @@ -#!/usr/bin/execlineb -S0 +#!/usr/bin/env bashio # ============================================================================== # Home Assistant Add-on: Loki # Take down the S6 supervision tree when Loki fails # ============================================================================== -if { s6-test ${1} -ne 0 } -if { s6-test ${1} -ne 256 } -s6-svscanctl -t /var/run/s6/services +declare APP_EXIT_CODE=${1} + +if [[ "${APP_EXIT_CODE}" -ne 0 ]] && [[ "${APP_EXIT_CODE}" -ne 256 ]]; then + bashio::log.warning "Halt add-on with exit code ${APP_EXIT_CODE}" + echo "${APP_EXIT_CODE}" > /run/s6-linux-init-container-results/exitcode + exec /run/s6/basedir/bin/halt +fi + diff --git a/loki/rootfs/etc/services.d/nginx/finish b/loki/rootfs/etc/services.d/nginx/finish index fdfd747..692dde7 100755 --- a/loki/rootfs/etc/services.d/nginx/finish +++ b/loki/rootfs/etc/services.d/nginx/finish @@ -1,9 +1,13 @@ -#!/usr/bin/execlineb -S0 +#!/usr/bin/env bashio # ============================================================================== # Home Assistant Add-on: Loki # Take down the S6 supervision tree when Nginx fails # ============================================================================== -if { s6-test ${1} -ne 0 } -if { s6-test ${1} -ne 256 } -s6-svscanctl -t /var/run/s6/services +declare APP_EXIT_CODE=${1} + +if [[ "${APP_EXIT_CODE}" -ne 0 ]] && [[ "${APP_EXIT_CODE}" -ne 256 ]]; then + bashio::log.warning "Halt add-on with exit code ${APP_EXIT_CODE}" + echo "${APP_EXIT_CODE}" > /run/s6-linux-init-container-results/exitcode + exec /run/s6/basedir/bin/halt +fi