diff --git a/seerr/CHANGELOG.md b/seerr/CHANGELOG.md index 1451226fb2..3b780566ea 100644 --- a/seerr/CHANGELOG.md +++ b/seerr/CHANGELOG.md @@ -1,7 +1,4 @@ -## 3.4.1.3 (2026-08-18) - -- Fixed the `404: Not Found` on **Discover** persisting for browsers that had already opened Seerr through ingress, even after 3.4.1.1 and 3.4.1.2 were installed (#2975). Seerr serves its JavaScript bundle with `Cache-Control: public, max-age=31536000, immutable`, and the add-on's nginx rewrites that bundle to carry the ingress prefix - which strips the `ETag` and `Last-Modified` a browser would revalidate with. Since every add-on version served the same upstream build, the chunk URLs never changed either, so a browser kept replaying the broken 3.4.1/3.4.1.1 JavaScript from its own cache for up to a year and no fix could reach it. That is why the report persisted on the origin the reporter uses daily (`https:///`) while a browser that had never cached it (`http://:8123/`) already showed the fixed behaviour. The asset paths now carry the add-on version, so each release has its own URLs and the first page load after an update fetches the current bundle. Only ingress was affected; the directly published port 5055 always worked. - + ## 3.4.1.2 (2026-08-18) - Fixed **Discover** in the sidebar still failing through ingress after 3.4.1.1 (#2975). The trailing slash added in 3.4.1.1 was also applied to the copy of the link inside Seerr's JavaScript bundle, and Next.js' client-side router strips a trailing slash before navigating: it then sent the click to a URL Home Assistant does not route, so it either landed on the same `404: Not Found` or threw `Invariant: attempted to hard navigate to the same URL` and did nothing at all. The bundle is no longer rewritten, so **Discover** routes inside the app exactly like **Requests**, **Issues** and **Settings** already did. The server-rendered link keeps its trailing slash. Only ingress was affected; the directly published port 5055 always worked. diff --git a/seerr/config.yaml b/seerr/config.yaml index b3eaffa55c..f73c177f7a 100644 --- a/seerr/config.yaml +++ b/seerr/config.yaml @@ -96,4 +96,4 @@ schema: slug: seerr udev: true url: https://github.com/alexbelgium/hassio-addons/tree/master/seerr -version: "3.4.1.3" +version: "3.4.1.2" diff --git a/seerr/rootfs/etc/cont-init.d/32-nginx_ingress.sh b/seerr/rootfs/etc/cont-init.d/32-nginx_ingress.sh index b6cae77afc..ab5f163b86 100755 --- a/seerr/rootfs/etc/cont-init.d/32-nginx_ingress.sh +++ b/seerr/rootfs/etc/cont-init.d/32-nginx_ingress.sh @@ -12,27 +12,10 @@ ingress_port=$(bashio::addon.ingress_port) ingress_interface=$(bashio::addon.ip_address) ingress_entry=$(bashio::addon.ingress_entry) -# Cache-busting marker for the rewritten JavaScript bundle. -# -# Seerr serves /_next/static/ as "public, max-age=31536000, immutable", and -# nginx's sub_filter strips ETag and Last-Modified off every response it -# rewrites, while the HTML naming those chunks is served "no-store" and keeps -# naming the same URLs. A browser therefore pins the bundle this add-on rewrote -# on its first visit for a year, with no request left that could deliver a -# later change to the sub_filter rules below - which is how #2975 outlived two -# fixes. Folding the version into the asset path gives every release its own -# URLs. njs/ingress.js strips the marker again before proxying. -# -# BUILD_VERSION is the add-on version baked in at build time (it is also what -# bashio::addon.version returns). Only [A-Za-z0-9-] survives: the marker ends up -# inside a regex literal in Seerr's own bundle, where a dot would be a wildcard. -asset_tag="ha-$(printf '%s' "${BUILD_VERSION:-0}" | tr -c 'A-Za-z0-9' '-')" - # Update ingress.conf with actual values 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|%%ingress_entry%%|${ingress_entry}|g" /etc/nginx/servers/ingress.conf sed -i "s|%%ingress_entry_escaped%%|${ingress_entry//\//\\\\\/}|g" /etc/nginx/servers/ingress.conf -sed -i "s|%%asset_tag%%|${asset_tag}|g" /etc/nginx/servers/ingress.conf -bashio::log.info "Nginx ingress configured on ${ingress_interface}:${ingress_port} (asset tag ${asset_tag})" +bashio::log.info "Nginx ingress configured on ${ingress_interface}:${ingress_port}" diff --git a/seerr/rootfs/etc/nginx/njs/ingress.js b/seerr/rootfs/etc/nginx/njs/ingress.js index b28a4c4db2..70e5aefc51 100644 --- a/seerr/rootfs/etc/nginx/njs/ingress.js +++ b/seerr/rootfs/etc/nginx/njs/ingress.js @@ -47,27 +47,11 @@ function encodePart(part) { } /* - * The cache-busting marker servers/ingress.conf inserts in front of every - * rewritten "/_next" path, e.g. "/ha-3-4-1-3/_next/static/chunks/x.js". It - * gives each add-on release its own asset URLs - Seerr serves /_next/static/ as - * immutable for a year and sub_filter strips the validators, so identical URLs - * would pin the rewritten bundle in the browser forever. Seerr knows nothing - * about the marker, so it is removed again here, on the way in. - * - * Any marker is accepted, not just the one this container serves: a tab opened - * before an add-on update keeps requesting its dynamic chunks under the marker - * it was handed, and those have to keep working until it is reloaded. The - * lookahead keeps a real Seerr path that merely starts with "ha-" untouched. - */ -var ASSET_TAG = /^\/ha-[0-9A-Za-z-]+(?=\/_next(\/|$))/; - -/* - * Returns the request URI with the path untouched byte-for-byte apart from the - * cache-busting marker, and only the query string repaired. Used as the - * proxy_pass target. + * Returns the request URI with the path untouched byte-for-byte and only the + * query string repaired. Used as the proxy_pass target. */ function uri(r) { - var raw = r.variables.request_uri.replace(ASSET_TAG, ""); + var raw = r.variables.request_uri; var split = raw.indexOf("?"); if (split < 0) { diff --git a/seerr/rootfs/etc/nginx/servers/ingress.conf b/seerr/rootfs/etc/nginx/servers/ingress.conf index e14048fb5b..8ac559904a 100644 --- a/seerr/rootfs/etc/nginx/servers/ingress.conf +++ b/seerr/rootfs/etc/nginx/servers/ingress.conf @@ -77,14 +77,8 @@ server { # because the compiled output spells the prop 'href:"/"' and not # 'href="/"'. These are textual substitutions over someone else's minified # output: recheck them whenever Seerr or Next.js is upgraded. - # "%%asset_tag%%" is a cache-busting marker carrying the add-on version, - # substituted by 32-nginx_ingress.sh - which explains why it is needed. - # In short: without it a browser replays the bundle this file produced at - # the version it first loaded, for a year, and no later change to any - # rule here can reach it. njs/ingress.js strips the marker back off - # before proxying; the two belong together, do not change one alone. - sub_filter '\/_next' '%%ingress_entry_escaped%%\/%%asset_tag%%\/_next'; - sub_filter '/_next' '$app/%%asset_tag%%/_next'; + sub_filter '\/_next' '%%ingress_entry_escaped%%\/_next'; + sub_filter '/_next' '$app/_next'; sub_filter '/api/v1' '$app/api/v1'; sub_filter '/login/plex/loading' '$app/login/plex/loading'; sub_filter '/images/' '$app/images/';