diff --git a/filebrowser_quantum/CHANGELOG.md b/filebrowser_quantum/CHANGELOG.md index 883d56a4e9..3a3b4db65c 100644 --- a/filebrowser_quantum/CHANGELOG.md +++ b/filebrowser_quantum/CHANGELOG.md @@ -1,6 +1,7 @@ ## 2.0.0.1 (2026-10-11) - Fix startup on 2.0.0 (fresh installs and upgrades): write the v2 config format (`http.port`/`listen`/`baseURL`, `server.database.path`) and drop the deprecated `FILEBROWSER_DATABASE` variable (#3109) - Upgrade from 1.x: the old `/config/config.yaml` is saved as `config.yaml.v1.bak` and replaced by the 2.0 default (1.x keys are rejected by 2.0), and the 1.x `/config/database.db` is migrated to `/config/database.sqlite` on first start +- Set `http.trustProxyHeaders: true` (the add-on always runs behind nginx on a subpath), and use upstream's `/health` endpoint for the container healthcheck ## 2.0.0 (2026-10-10) - Update to latest version from gtsteffaniak/filebrowser (changelog : https://github.com/gtsteffaniak/filebrowser/releases) diff --git a/filebrowser_quantum/Dockerfile b/filebrowser_quantum/Dockerfile index ae928d2076..d2847c4d75 100644 --- a/filebrowser_quantum/Dockerfile +++ b/filebrowser_quantum/Dockerfile @@ -116,4 +116,4 @@ LABEL \ ################# HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \ - CMD curl -f http://localhost:3001/health || exit 1 + CMD b="$(yq '.http.baseURL' /config/config.yaml)" && curl -f "http://localhost:8080${b%/}/health" || exit 1 diff --git a/filebrowser_quantum/rootfs/etc/cont-init.d/99-run.sh b/filebrowser_quantum/rootfs/etc/cont-init.d/99-run.sh index 9f7ccb9af9..6abda17d82 100755 --- a/filebrowser_quantum/rootfs/etc/cont-init.d/99-run.sh +++ b/filebrowser_quantum/rootfs/etc/cont-init.d/99-run.sh @@ -79,8 +79,7 @@ mkdir -p /var/log/nginx && touch /var/log/nginx/error.log mkdir -p /config /cache -# A 1.x config (string server.database, written below before 2.0.0) holds keys -# that v2 rejects: keep a copy and start again from the v2 default +# 1.x config (string server.database) has keys v2 rejects: back it up, use the v2 default if [ -f "$FILEBROWSER_CONFIG" ] && [ "$(yq e '.server.database | tag' "$FILEBROWSER_CONFIG")" = "!!str" ]; then bashio::log.warning "FileBrowser 1.x config saved to ${FILEBROWSER_CONFIG}.v1.bak, starting from the 2.0 default config" mv "$FILEBROWSER_CONFIG" "${FILEBROWSER_CONFIG}.v1.bak" @@ -97,9 +96,11 @@ bashio::log.info "Updating FileBrowser config..." bashio::log.info "... set server" yq e -i ".http.port = 8080" "$FILEBROWSER_CONFIG" yq e -i ".http.listen = \"0.0.0.0\"" "$FILEBROWSER_CONFIG" +yq e -i ".http.trustProxyHeaders = true" "$FILEBROWSER_CONFIG" +# Whole-object assignment also drops migrateFrom once the migration is done yq e -i ".server.database = {\"path\": \"/config/database.sqlite\"}" "$FILEBROWSER_CONFIG" -# Migrate the 1.x BoltDB on first start (done once; v2 keeps checking the file exists) -if [ -s /config/database.db ]; then +# Import the 1.x BoltDB until the SQLite database exists +if [ -s /config/database.db ] && [ ! -s /config/database.sqlite ]; then yq e -i ".server.database.migrateFrom = \"/config/database.db\"" "$FILEBROWSER_CONFIG" fi yq e -i ".server.cacheDir = \"/cache\"" "$FILEBROWSER_CONFIG" diff --git a/filebrowser_quantum/rootfs/etc/nginx/servers/health.conf b/filebrowser_quantum/rootfs/etc/nginx/servers/health.conf deleted file mode 100644 index d39caa1fb0..0000000000 --- a/filebrowser_quantum/rootfs/etc/nginx/servers/health.conf +++ /dev/null @@ -1,8 +0,0 @@ -server { - listen 127.0.0.1:3001; - access_log off; - - location /health { - return 200 'OK'; - } -}