diff --git a/filebrowser_quantum/CHANGELOG.md b/filebrowser_quantum/CHANGELOG.md index b7c9aa0bc9..883d56a4e9 100644 --- a/filebrowser_quantum/CHANGELOG.md +++ b/filebrowser_quantum/CHANGELOG.md @@ -1,6 +1,6 @@ ## 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`), drop the deprecated `FILEBROWSER_DATABASE` variable, and migrate an existing 1.x `/config/database.db` to `/config/database.sqlite` on first start (#3109) +- 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 ## 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/rootfs/etc/cont-init.d/99-run.sh b/filebrowser_quantum/rootfs/etc/cont-init.d/99-run.sh index c1c4f445e7..e75c75b92e 100755 --- a/filebrowser_quantum/rootfs/etc/cont-init.d/99-run.sh +++ b/filebrowser_quantum/rootfs/etc/cont-init.d/99-run.sh @@ -79,6 +79,13 @@ 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 +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" +fi + # Copy default config if not existing if [ ! -f "$FILEBROWSER_CONFIG" ]; then cp /home/filebrowser/data/config.yaml "$FILEBROWSER_CONFIG" @@ -88,8 +95,6 @@ bashio::log.info "Updating FileBrowser config..." # --- Server (hardcoded values) --- bashio::log.info "... set server" -# v2 moved port/listen/baseURL under http: and rejects the 1.x keys -yq e -i "del(.server.port, .server.listen, .server.baseURL)" "$FILEBROWSER_CONFIG" yq e -i ".http.port = 8080" "$FILEBROWSER_CONFIG" yq e -i ".http.listen = \"0.0.0.0\"" "$FILEBROWSER_CONFIG" yq e -i ".server.database = {\"path\": \"/config/database.sqlite\"}" "$FILEBROWSER_CONFIG"