From da6a039b10aba853d116c0fda65fe0a435c06e2d Mon Sep 17 00:00:00 2001 From: dubo-dubon-duponey Date: Thu, 14 Mar 2024 23:35:13 -0700 Subject: [PATCH] Cleanup --- Dockerfile | 4 ++-- context/runtime/boot/helpers.sh | 20 ++++++++++++++++++++ context/runtime/boot/mdns.sh | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e247281..579c147 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,8 +13,8 @@ FROM $FROM_REGISTRY/$FROM_IMAGE_TOOLS FROM --platform=$BUILDPLATFORM $FROM_REGISTRY/$FROM_IMAGE_BUILDER AS fetcher-lego ARG GIT_REPO=github.com/go-acme/lego -ARG GIT_VERSION=v4.15.0 -ARG GIT_COMMIT=46fe435c2c2e447ae48df712eca8278bbca8986e +ARG GIT_VERSION=v4.16.1 +ARG GIT_COMMIT=40dcce60be3dbbd0ae05b789e486341b6741e2ae ENV WITH_BUILD_SOURCE="./cmd/lego" ENV WITH_BUILD_OUTPUT="lego" diff --git a/context/runtime/boot/helpers.sh b/context/runtime/boot/helpers.sh index ceb987e..6b3e621 100644 --- a/context/runtime/boot/helpers.sh +++ b/context/runtime/boot/helpers.sh @@ -10,3 +10,23 @@ helpers::dir::writable(){ exit 1 } } + +helpers::log::normalize(){ + local lower + lower="$(printf "%s" "${LOG_LEVEL:-}" | tr '[:upper:]' '[:lower:]')" + case "$lower" in + "debug") + ;; + "info") + ;; + "error") + ;; + *) + lower="warning" + ;; + esac + LOG_LEVEL="$lower" + printf "%s" "$LOG_LEVEL" +} + +helpers::log::normalize >/dev/null diff --git a/context/runtime/boot/mdns.sh b/context/runtime/boot/mdns.sh index e8d739e..4afac4a 100755 --- a/context/runtime/boot/mdns.sh +++ b/context/runtime/boot/mdns.sh @@ -61,7 +61,7 @@ mdns::start::avahi(){ # Cleanup leftovers on container restart rm -f "$(dirname "$avahisocket")/pid" - [ "$(printf "%s" "$LOG_LEVEL" | tr '[:upper:]' '[:lower:]')" != "debug" ] || args+=(--debug) + [ "$LOG_LEVEL" != "debug" ] || args+=(--debug) # -D/--daemonize implies -s/--syslog that we do not want, so, just background it avahi-daemon -f /config/avahi/main.conf --no-drop-root --no-chroot "${args[@]}" &