mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-02 22:04:06 +02:00
Merge pull request #2480 from alexbelgium/codex/fix-nginx-resolver-host-error
birdnet-pipy: disable nginx service when ingress is unavailable
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
## 0.5.0-4 (2026-02-15)
|
||||||
|
- Disable nginx service when ingress is not active
|
||||||
|
|
||||||
|
## 0.5.0-3 (2026-02-15)
|
||||||
|
- Fix nginx startup without ingress by removing templated resolver dependency
|
||||||
|
|
||||||
## 0.5.0-2 (2026-02-14)
|
## 0.5.0-2 (2026-02-14)
|
||||||
- Skip ingress nginx configuration when ingress is not active (empty/invalid ingress port)
|
- Skip ingress nginx configuration when ingress is not active (empty/invalid ingress port)
|
||||||
|
|||||||
@@ -99,5 +99,5 @@ schema:
|
|||||||
ssl: bool?
|
ssl: bool?
|
||||||
slug: birdnet-pipy
|
slug: birdnet-pipy
|
||||||
url: https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-pipy
|
url: https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-pipy
|
||||||
version: "0.5.0-2"
|
version: "0.5.0-4"
|
||||||
webui: "[PROTO:ssl]://[HOST]:[PORT:80]"
|
webui: "[PROTO:ssl]://[HOST]:[PORT:80]"
|
||||||
|
|||||||
@@ -14,10 +14,13 @@ ingress_interface="$(bashio::addon.ip_address)"
|
|||||||
ingress_entry="$(bashio::addon.ingress_entry)"
|
ingress_entry="$(bashio::addon.ingress_entry)"
|
||||||
|
|
||||||
if ! [[ "${ingress_port}" =~ ^[0-9]+$ ]] || [[ "${ingress_port}" -le 0 ]]; then
|
if ! [[ "${ingress_port}" =~ ^[0-9]+$ ]] || [[ "${ingress_port}" -le 0 ]]; then
|
||||||
bashio::log.info "Ingress not active, skipping ingress nginx configuration"
|
bashio::log.info "Ingress not active, disabling nginx service"
|
||||||
|
touch /run/nginx-disabled
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm -f /run/nginx-disabled
|
||||||
|
|
||||||
sed -i \
|
sed -i \
|
||||||
-e "s|proxy_pass http://api|proxy_pass http://127.0.0.1|g" \
|
-e "s|proxy_pass http://api|proxy_pass http://127.0.0.1|g" \
|
||||||
-e "s|proxy_pass http://icecast|proxy_pass http://127.0.0.1|g" \
|
-e "s|proxy_pass http://icecast|proxy_pass http://127.0.0.1|g" \
|
||||||
@@ -31,6 +34,3 @@ sed -i \
|
|||||||
/etc/nginx/servers/ingress.conf
|
/etc/nginx/servers/ingress.conf
|
||||||
|
|
||||||
sed -i "s#%%ingress_entry%%#${ingress_entry}#g" /etc/nginx/includes/ingress_params.conf
|
sed -i "s#%%ingress_entry%%#${ingress_entry}#g" /etc/nginx/includes/ingress_params.conf
|
||||||
|
|
||||||
# Set DNS resolver for internal requests
|
|
||||||
sed -i "s/%%dns_host%%/127.0.0.11/g" /etc/nginx/includes/resolver.conf
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
resolver %%dns_host%%;
|
resolver 127.0.0.11 ipv6=off;
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
#!/usr/bin/with-contenv bashio
|
#!/usr/bin/with-contenv bashio
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [ -f /run/nginx-disabled ]; then
|
||||||
|
bashio::log.info "Nginx disabled because ingress is not active"
|
||||||
|
exec sleep infinity
|
||||||
|
fi
|
||||||
|
|
||||||
nginx
|
nginx
|
||||||
|
|||||||
Reference in New Issue
Block a user