mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-08-26 06:43:31 +02:00
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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)
|
## 2.63.18.4 (22-07-2026)
|
||||||
- Minor bugs fixed
|
- Minor bugs fixed
|
||||||
## 2.63.18.3 (22-07-2026)
|
## 2.63.18.3 (22-07-2026)
|
||||||
|
|||||||
@@ -134,4 +134,4 @@ HEALTHCHECK \
|
|||||||
--retries=5 \
|
--retries=5 \
|
||||||
--start-period=30s \
|
--start-period=30s \
|
||||||
--timeout=25s \
|
--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
|
||||||
|
|||||||
@@ -126,4 +126,4 @@ schema:
|
|||||||
slug: filebrowser
|
slug: filebrowser
|
||||||
udev: true
|
udev: true
|
||||||
url: https://github.com/alexbelgium/hassio-addons
|
url: https://github.com/alexbelgium/hassio-addons
|
||||||
version: "2.63.18.4"
|
version: "2.63.18.5"
|
||||||
|
|||||||
@@ -51,6 +51,10 @@ if bashio::config.true 'ssl'; then
|
|||||||
ADDON_PROTOCOL=https
|
ADDON_PROTOCOL=https
|
||||||
fi
|
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)
|
#port=$(bashio::addon.port 80)
|
||||||
ingress_port=$(bashio::addon.ingress_port)
|
ingress_port=$(bashio::addon.ingress_port)
|
||||||
ingress_interface=$(bashio::addon.ip_address)
|
ingress_interface=$(bashio::addon.ip_address)
|
||||||
|
|||||||
Reference in New Issue
Block a user