Fix FileBrowser Quantum direct web access (#2979)

* Fix FileBrowser Quantum direct web access

* fix(filebrowser_quantum): make direct ip:port access actually work

ports: {8080/tcp: 8071} alone (as originally proposed) publishes the app's
own port, but FileBrowser Quantum's server.baseURL is set at boot to the
Supervisor ingress-entry path (an opaque, per-install hash), so the app only
serves correctly under that exact path -- a bare port publish gives an
unreachable page, per alexbelgium's own analysis on #2978.

Add a second, dedicated nginx vhost (direct.conf) that proxies a fixed public
path (/filebrowser_quantum/) onto the same ingress-entry baseURL the existing
ingress vhost already targets, instead of changing the app's baseURL itself.
This leaves the ingress vhost, and therefore Ingress access, completely
unchanged -- only the new vhost is new surface area. config.yaml now
publishes the new vhost's internal port (8072) to host 8071, not the app's
own 8080 directly.

Co-authored-by: polmonta <polmonta05@gmail.com>

---------

Co-authored-by: polmonta <polmonta05@gmail.com>
Co-authored-by: alexbelgium <alexandre.pary@gmail.com>
This commit is contained in:
Pol Montanera
2026-08-17 18:32:48 +02:00
committed by GitHub
parent 53ad396e5b
commit 232e697301
5 changed files with 53 additions and 3 deletions

View File

@@ -1,4 +1,10 @@
## 1.5.1.1 (2026-08-16)
- Expose the web UI on host port 8071, reachable at `<your-ip>:8071`
(redirects to `/filebrowser_quantum/`). Direct access is served by a new,
separate nginx vhost that proxies to the same backend Ingress already uses;
Ingress itself, and the app's own base URL, are unchanged.
## 1.5.1 (2026-08-08)
- Update to latest version from gtsteffaniak/filebrowser (changelog : https://github.com/gtsteffaniak/filebrowser/releases)

View File

@@ -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 `<your-ip>:8071`.
1. Access the web UI through the sidebar or at `<your-ip>:8071/filebrowser_quantum/`.
## Configuration
The web UI can be found at `<your-ip>:8071` or through the Home Assistant sidebar when using Ingress.
The web UI can be found at `<your-ip>:8071` (redirects to `/filebrowser_quantum/`) or through the Home Assistant sidebar when using Ingress.
**Default credentials:**
- Username: `admin`

View File

@@ -97,6 +97,10 @@ options:
default_user_scope: "/"
panel_admin: false
panel_icon: mdi:file-search
ports:
8072/tcp: 8071
ports_description:
8072/tcp: Web UI port
privileged:
- SYS_ADMIN
- DAC_READ_SEARCH
@@ -114,4 +118,4 @@ schema:
slug: filebrowser_quantum
udev: true
url: https://github.com/alexbelgium/hassio-addons
version: "1.5.1"
version: "1.5.1.1"

View File

@@ -43,6 +43,13 @@ 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.
FB_BASEURL=$(bashio::addon.ingress_entry)
export FB_BASEURL
@@ -59,6 +66,15 @@ sed -i "s|%%protocol%%|${ADDON_PROTOCOL}|g" /etc/nginx/servers/ingress.conf
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.
sed -i "s|%%protocol%%|${ADDON_PROTOCOL}|g" /etc/nginx/servers/direct.conf
sed -i "s|%%subpath%%|${FB_BASEURL}/|g" /etc/nginx/servers/direct.conf
mkdir -p /var/log/nginx && touch /var/log/nginx/error.log
############################

View File

@@ -0,0 +1,24 @@
server {
listen 0.0.0.0:8072 default_server;
include /etc/nginx/includes/server_params.conf;
include /etc/nginx/includes/proxy_params.conf;
client_max_body_size 0;
location = / {
return 302 /filebrowser_quantum/;
}
location = /filebrowser_quantum {
return 301 /filebrowser_quantum/;
}
location /filebrowser_quantum/ {
add_header Access-Control-Allow-Origin *;
proxy_connect_timeout 30m;
proxy_send_timeout 30m;
proxy_read_timeout 30m;
proxy_pass %%protocol%%://backend%%subpath%%;
}
}