diff --git a/filebrowser_quantum/CHANGELOG.md b/filebrowser_quantum/CHANGELOG.md index 44170d3b06..8381a69129 100644 --- a/filebrowser_quantum/CHANGELOG.md +++ b/filebrowser_quantum/CHANGELOG.md @@ -1,4 +1,12 @@ +## 1.5.1.2 (2026-08-19) +- Fix direct access on port 8071, which was broken in 1.5.1.1: the root + redirect pointed at the container-internal port 8072 instead of the + published one, and the page it led to referenced assets under a path the + add-on did not serve, so every asset returned 404. Requests are now passed + through unchanged, with the bare root and the two previously documented + `/filebrowser_quantum` URLs redirected to the app's configured base path. + ## 1.5.1.1 (2026-08-16) - Expose the web UI on host port 8071, reachable at `:8071` (redirects to `/filebrowser_quantum/`). Direct access is served by a new, diff --git a/filebrowser_quantum/README.md b/filebrowser_quantum/README.md index e15a63a2c6..7477f0523a 100644 --- a/filebrowser_quantum/README.md +++ b/filebrowser_quantum/README.md @@ -42,11 +42,11 @@ comparison to installing any other Home Assistant add-on. 1. Click the `Save` button to store your configuration. 1. Start the add-on. 1. Check the logs of the add-on to see if everything went well. -1. Access the web UI through the sidebar or at `:8071/filebrowser_quantum/`. +1. Access the web UI through the sidebar or at `:8071`. ## Configuration -The web UI can be found at `:8071` (redirects to `/filebrowser_quantum/`) or through the Home Assistant sidebar when using Ingress. +The web UI can be found at `:8071` or through the Home Assistant sidebar when using Ingress. Direct access redirects to the add-on's configured base path, so the address bar will show a longer URL than the one you typed. **Default credentials:** - Username: `admin` diff --git a/filebrowser_quantum/config.yaml b/filebrowser_quantum/config.yaml index 6308c10199..9c50e59943 100644 --- a/filebrowser_quantum/config.yaml +++ b/filebrowser_quantum/config.yaml @@ -118,4 +118,4 @@ schema: slug: filebrowser_quantum udev: true url: https://github.com/alexbelgium/hassio-addons -version: "1.5.1.1" +version: "1.5.1.2" 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 9b90ac1d8b..8e6f1de671 100755 --- a/filebrowser_quantum/rootfs/etc/cont-init.d/99-run.sh +++ b/filebrowser_quantum/rootfs/etc/cont-init.d/99-run.sh @@ -43,13 +43,9 @@ declare ingress_interface declare ingress_port #declare keyfile -# The app's own baseURL is always the Supervisor ingress-entry path — this is -# unchanged from before. FileBrowser Quantum has no known "ignore baseURL for -# routing" leniency the way classic filebrowser's app does, so ingress access -# is left completely untouched here. Direct ip:port access is handled below by -# a second, separate nginx vhost (direct.conf) that rewrites a fixed public -# path onto this same ingress-entry baseURL, instead of changing the baseURL -# itself. +# The app's own baseURL is the Supervisor ingress-entry path, unchanged from +# before: FileBrowser emits that prefix as absolute links in its HTML and JS, +# so it is also the path direct ip:port access has to use (see direct.conf). FB_BASEURL=$(bashio::addon.ingress_entry) export FB_BASEURL @@ -67,11 +63,11 @@ sed -i "s|%%port%%|${ingress_port}|g" /etc/nginx/servers/ingress.conf sed -i "s|%%interface%%|${ingress_interface}|g" /etc/nginx/servers/ingress.conf sed -i "s|%%subpath%%|${FB_BASEURL}/|g" /etc/nginx/servers/ingress.conf -# --- Direct ip:port access (separate from ingress, see comment above) --- -# Publishes a second nginx vhost on a fixed internal port (published to the -# host as 8071 via config.yaml's `ports:`), at a fixed public path -# (/filebrowser_quantum/), that proxies to the same backend the ingress vhost -# uses. This keeps the app's own baseURL, and therefore ingress, unchanged. +# --- Direct ip:port access (separate vhost, ingress untouched) --- +# Listens on 8072, published to the host as 8071 by config.yaml's `ports:`. +# Requests are passed through unchanged; the bare root and the two legacy +# /filebrowser_quantum paths are redirected to the app's baseURL, which is what +# its own links already point at. sed -i "s|%%protocol%%|${ADDON_PROTOCOL}|g" /etc/nginx/servers/direct.conf sed -i "s|%%subpath%%|${FB_BASEURL}/|g" /etc/nginx/servers/direct.conf diff --git a/filebrowser_quantum/rootfs/etc/nginx/servers/direct.conf b/filebrowser_quantum/rootfs/etc/nginx/servers/direct.conf index 70fcedbee8..d10b7c9c76 100644 --- a/filebrowser_quantum/rootfs/etc/nginx/servers/direct.conf +++ b/filebrowser_quantum/rootfs/etc/nginx/servers/direct.conf @@ -6,19 +6,35 @@ server { client_max_body_size 0; + # nginx listens on 8072 inside the container but is published to the host + # as 8071. An absolute redirect would be built from $server_port and send + # the browser to :8072, which is not published and therefore unreachable. + absolute_redirect off; + + # FileBrowser serves under its baseURL (the Supervisor ingress entry) and + # emits that prefix as absolute links in its HTML/JS, so the browser must + # use that same path here. The bare root and the two legacy paths below + # redirect to it; every other request is proxied through untouched, which + # keeps asset, API and websocket URLs working without response rewriting. location = / { - return 302 /filebrowser_quantum/; + return 302 %%subpath%%; } + # 1.5.1.1 briefly documented /filebrowser_quantum/ as the direct URL. The + # app never served that path itself, so send those bookmarks on instead of + # letting them fall through to a 404. location = /filebrowser_quantum { - return 301 /filebrowser_quantum/; + return 302 %%subpath%%; } - location /filebrowser_quantum/ { - add_header Access-Control-Allow-Origin *; + location = /filebrowser_quantum/ { + return 302 %%subpath%%; + } + + location / { proxy_connect_timeout 30m; proxy_send_timeout 30m; proxy_read_timeout 30m; - proxy_pass %%protocol%%://backend%%subpath%%; + proxy_pass %%protocol%%://backend; } }