Files
hassio-addons/bazarr/rootfs/etc/cont-init.d
Claude 3b67bef373 Fix Bazarr base_url sed clobbering Radarr/Sonarr's own base_url
Bazarr's config.yaml carries a base_url key under general: (Bazarr's own
ingress path) AND a separate base_url under each configured *arr integration
-- radarr.base_url, sonarr.base_url, etc. -- which is how Bazarr reaches
those services at their own ingress-prefixed URL.

Every base_url sed in this addon was unscoped:

    sed -i "s|  base_url:.*|  base_url: /$slug|" "$CONFIG_LOCATION"

sed applies s/// to every matching line in the file, not just the first, and
"  base_url:.*" matches any 2-space-indented base_url line regardless of
which top-level section it's under. Since general.base_url, radarr.base_url,
sonarr.base_url etc. all sit at that same indent, this rewrote all of them to
Bazarr's own value on every container start (32-nginx_ingress.sh) and again
in the run script's fallback -- silently breaking Bazarr's configured
connections to Radarr and Sonarr.

Scope each sed to the general: block only, reusing the range idiom this file
already uses to scope the auth: block's type: substitution:

    sed -i "/^general:/,/^[^ ]/{ s|  base_url:.*|  base_url: /$slug|; }" ...

Verified against a representative config.yaml (general/radarr/sonarr/subsarr
sections, including general:'s list-style provider entries) for all three
connection_mode branches plus the run script's fallback: general.base_url is
the only line touched in every case; radarr.base_url and sonarr.base_url
survive with their original values.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 17:46:30 +02:00
..