mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-08-26 06:43:31 +02:00
Merge pull request #2912 from alexbelgium/ai-fix/bazarr-base-url-scope
Fix Bazarr base_url sed clobbering Radarr/Sonarr's own base_url
This commit is contained in:
@@ -1,4 +1,8 @@
|
|||||||
|
|
||||||
|
## 1.6.0.2 (2026-07-27)
|
||||||
|
|
||||||
|
- Fix base_url sed patterns rewriting *every* `base_url` key in Bazarr's config.yaml (radarr.base_url, sonarr.base_url, and any other configured integration), instead of only Bazarr's own under `general:`. This silently broke the Radarr/Sonarr connections inside Bazarr on every addon restart when ingress was enabled
|
||||||
|
|
||||||
## 1.6.0.1 (2026-07-27)
|
## 1.6.0.1 (2026-07-27)
|
||||||
|
|
||||||
- Fix ingress: nginx rewrote Bazarr's redirects into an absolute `http://<host>:8099/...` URL, which the browser blocked as mixed content when Home Assistant is served over HTTPS. Redirects now stay relative and point at the ingress path
|
- Fix ingress: nginx rewrote Bazarr's redirects into an absolute `http://<host>:8099/...` URL, which the browser blocked as mixed content when Home Assistant is served over HTTPS. Redirects now stay relative and point at the ingress path
|
||||||
|
|||||||
@@ -112,4 +112,4 @@ schema:
|
|||||||
slug: bazarr_nas
|
slug: bazarr_nas
|
||||||
udev: true
|
udev: true
|
||||||
url: https://github.com/alexbelgium/hassio-addons/tree/master/bazarr
|
url: https://github.com/alexbelgium/hassio-addons/tree/master/bazarr
|
||||||
version: "1.6.0.1"
|
version: "1.6.0.2"
|
||||||
|
|||||||
@@ -35,16 +35,20 @@ if [ -f "$CONFIG_LOCATION" ]; then
|
|||||||
ingress_noauth)
|
ingress_noauth)
|
||||||
bashio::log.green "Ingress is enabled, authentication is disabled"
|
bashio::log.green "Ingress is enabled, authentication is disabled"
|
||||||
bashio::log.yellow "WARNING : Make sure that the port is not exposed externally by your router to avoid a security risk !"
|
bashio::log.yellow "WARNING : Make sure that the port is not exposed externally by your router to avoid a security risk !"
|
||||||
# Set base_url (must start with / for Flask blueprint registration)
|
# Set base_url (must start with / for Flask blueprint registration).
|
||||||
sed -i "s| base_url:.*| base_url: /$slug|" "$CONFIG_LOCATION"
|
# Scoped to the general: block only -- config.yaml also carries a
|
||||||
|
# base_url under each configured *arr integration (radarr.base_url,
|
||||||
|
# sonarr.base_url, ...) and those must not be touched.
|
||||||
|
sed -i "/^general:/,/^[^ ]/{ s| base_url:.*| base_url: /$slug|; }" "$CONFIG_LOCATION"
|
||||||
# Disable auth
|
# Disable auth
|
||||||
sed -i '/^auth:/,/^[^ ]/{ s/ type:.*/ type: null/ }' "$CONFIG_LOCATION"
|
sed -i '/^auth:/,/^[^ ]/{ s/ type:.*/ type: null/ }' "$CONFIG_LOCATION"
|
||||||
;;
|
;;
|
||||||
# Ingress mode, with authentication
|
# Ingress mode, with authentication
|
||||||
ingress_auth)
|
ingress_auth)
|
||||||
bashio::log.green "Ingress is enabled, and external authentication is enabled"
|
bashio::log.green "Ingress is enabled, and external authentication is enabled"
|
||||||
# Set base_url (must start with / for Flask blueprint registration)
|
# Set base_url (must start with / for Flask blueprint registration).
|
||||||
sed -i "s| base_url:.*| base_url: /$slug|" "$CONFIG_LOCATION"
|
# Scoped to the general: block only -- see note above.
|
||||||
|
sed -i "/^general:/,/^[^ ]/{ s| base_url:.*| base_url: /$slug|; }" "$CONFIG_LOCATION"
|
||||||
# Enable Bazarr auth when leaving ingress_noauth
|
# Enable Bazarr auth when leaving ingress_noauth
|
||||||
sed -i '/^auth:/,/^[^ ]/{ s/ type:.*/ type: form/ }' "$CONFIG_LOCATION"
|
sed -i '/^auth:/,/^[^ ]/{ s/ type:.*/ type: form/ }' "$CONFIG_LOCATION"
|
||||||
;;
|
;;
|
||||||
@@ -52,7 +56,8 @@ if [ -f "$CONFIG_LOCATION" ]; then
|
|||||||
noingress_auth)
|
noingress_auth)
|
||||||
bashio::log.green "Disabling ingress and enabling authentication"
|
bashio::log.green "Disabling ingress and enabling authentication"
|
||||||
bashio::log.yellow "WARNING : Ingress is disabled so the app won't be available from HA itself !"
|
bashio::log.yellow "WARNING : Ingress is disabled so the app won't be available from HA itself !"
|
||||||
sed -i "s/ base_url:.*/ base_url: ''/" "$CONFIG_LOCATION"
|
# Scoped to the general: block only -- see note above.
|
||||||
|
sed -i "/^general:/,/^[^ ]/{ s/ base_url:.*/ base_url: ''/; }" "$CONFIG_LOCATION"
|
||||||
# Enable Bazarr auth when leaving ingress_noauth
|
# Enable Bazarr auth when leaving ingress_noauth
|
||||||
sed -i '/^auth:/,/^[^ ]/{ s/ type:.*/ type: form/ }' "$CONFIG_LOCATION"
|
sed -i '/^auth:/,/^[^ ]/{ s/ type:.*/ type: form/ }' "$CONFIG_LOCATION"
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -15,10 +15,13 @@ bashio::net.wait_for "$port" localhost 900
|
|||||||
if [ -f "$CONFIG_LOCATION" ]; then
|
if [ -f "$CONFIG_LOCATION" ]; then
|
||||||
if ! bashio::config.true "ingress_disabled"; then
|
if ! bashio::config.true "ingress_disabled"; then
|
||||||
if ! bashio::config.has_value "connection_mode" || [ "$(bashio::config 'connection_mode')" != "noingress_auth" ]; then
|
if ! bashio::config.has_value "connection_mode" || [ "$(bashio::config 'connection_mode')" != "noingress_auth" ]; then
|
||||||
if ! grep -q "base_url: /$slug" "$CONFIG_LOCATION"; then
|
if ! sed -n "/^general:/,/^[^ ]/ { /^ base_url: \/$slug$/p; }" "$CONFIG_LOCATION" | grep -q .; then
|
||||||
bashio::log.warning "BaseUrl not set properly, restarting"
|
bashio::log.warning "BaseUrl not set properly, restarting"
|
||||||
# Must start with / for Flask blueprint registration
|
# Must start with / for Flask blueprint registration. Scoped to
|
||||||
sed -i "s| base_url:.*| base_url: /$slug|" "$CONFIG_LOCATION"
|
# the general: block only -- config.yaml also carries a base_url
|
||||||
|
# under each configured *arr integration (radarr.base_url,
|
||||||
|
# sonarr.base_url, ...) and those must not be touched.
|
||||||
|
sed -i "/^general:/,/^[^ ]/{ s| base_url:.*| base_url: /$slug|; }" "$CONFIG_LOCATION"
|
||||||
bashio::addon.restart
|
bashio::addon.restart
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user