From 278818970f2097c2dcdddb93bbfed9ae9fe648b1 Mon Sep 17 00:00:00 2001 From: alexbelgium Date: Sun, 26 Jul 2026 07:57:09 +0200 Subject: [PATCH] filebrowser: fix healthcheck protocol detection with ssl enabled The HEALTHCHECK branched on "$ssl", but that variable is never present in the container environment: Supervisor only injects the environment: block from config.yaml (FB_BASEURL, PGID, PUID) plus TZ/SUPERVISOR_TOKEN. The ssl option lives in /data/options.json and is read via bashio inside cont-init, and HEALTHCHECK CMD is spawned by dockerd, so no export from that shell can ever reach it. The test was therefore always false and the healthcheck kept probing http:// against the TLS listener, producing the http: TLS handshake error ... client sent an HTTP request to an HTTPS server spam reported in #2881. Write the resolved protocol to /run/health_protocol from 99-run.sh and read it back in the healthcheck, matching the pattern already used by the gitea addon. Also corrects the 127.0.01 typo (missing octet). Co-Authored-By: Claude --- filebrowser/CHANGELOG.md | 2 ++ filebrowser/Dockerfile | 2 +- filebrowser/config.yaml | 2 +- filebrowser/rootfs/etc/cont-init.d/99-run.sh | 4 ++++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/filebrowser/CHANGELOG.md b/filebrowser/CHANGELOG.md index fd71a89825..c3433ac90a 100644 --- a/filebrowser/CHANGELOG.md +++ b/filebrowser/CHANGELOG.md @@ -1,3 +1,5 @@ +## 2.63.18.5 (26-07-2026) +- Fixed healthcheck log spam when ssl is enabled (#2881) ## 2.63.18.4 (22-07-2026) - Minor bugs fixed ## 2.63.18.3 (22-07-2026) diff --git a/filebrowser/Dockerfile b/filebrowser/Dockerfile index 5b38ffd210..d64f79af48 100644 --- a/filebrowser/Dockerfile +++ b/filebrowser/Dockerfile @@ -134,4 +134,4 @@ HEALTHCHECK \ --retries=5 \ --start-period=30s \ --timeout=25s \ - CMD if [ "$ssl" = "true" ]; then curl -A "HealthCheck: Docker/1.0" -s -f -k https://127.0.01:${HEALTH_PORT}${HEALTH_URL}; else curl -A "HealthCheck: Docker/1.0" -s -f http://127.0.0.1:${HEALTH_PORT}${HEALTH_URL}/; fi + CMD curl -A "HealthCheck: Docker/1.0" -s -f -k "$(cat /run/health_protocol 2>/dev/null || echo http)://127.0.0.1:${HEALTH_PORT}${HEALTH_URL}/" >/dev/null 2>&1 || exit 1 diff --git a/filebrowser/config.yaml b/filebrowser/config.yaml index befe6ac977..5e9be9a133 100644 --- a/filebrowser/config.yaml +++ b/filebrowser/config.yaml @@ -126,4 +126,4 @@ schema: slug: filebrowser udev: true url: https://github.com/alexbelgium/hassio-addons -version: "2.63.18.4" +version: "2.63.18.5" diff --git a/filebrowser/rootfs/etc/cont-init.d/99-run.sh b/filebrowser/rootfs/etc/cont-init.d/99-run.sh index ea9e7f0b3d..3e204693ad 100755 --- a/filebrowser/rootfs/etc/cont-init.d/99-run.sh +++ b/filebrowser/rootfs/etc/cont-init.d/99-run.sh @@ -51,6 +51,10 @@ if bashio::config.true 'ssl'; then ADDON_PROTOCOL=https fi +# Expose the protocol to the docker HEALTHCHECK, which runs outside this +# shell and therefore cannot read the addon options +echo -n "${ADDON_PROTOCOL}" > /run/health_protocol + #port=$(bashio::addon.port 80) ingress_port=$(bashio::addon.ingress_port) ingress_interface=$(bashio::addon.ip_address)