mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-03 16:00:29 +01:00
Update 33-nginx_ingress.sh
This commit is contained in:
@@ -18,14 +18,18 @@ ingress_entry=$(bashio::addon.ingress_entry)
|
||||
# Quits if ingress not active
|
||||
if [ -z "$ingress_entry" ]; then exit 0; fi
|
||||
|
||||
# Create .htpasswd
|
||||
export "$(grep "^CADDY_PWD" /config/birdnet.conf)"
|
||||
htpasswd -b -c /home/pi/.htpasswd birdnet "$CADDY_PWD" &>/dev/null
|
||||
|
||||
echo " "
|
||||
bashio::log.info "Adapting for ingress"
|
||||
echo "... setting up nginx"
|
||||
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
|
||||
|
||||
# Create .htpasswd
|
||||
echo "... setting up automatic identification"
|
||||
export "$(grep "^CADDY_PWD" /config/birdnet.conf)"
|
||||
htpasswd -b -c /home/pi/.htpasswd birdnet "$CADDY_PWD" &>/dev/null
|
||||
chown 1000:1000 /home/pi/.htpasswd
|
||||
#sed -i '/caddy_pwd,\$config/a exec("htpasswd -b -c /home/pi/.htpasswd birdnet \"$caddy_pwd\" &>/dev/null");' "$HOME"/BirdNET-Pi/scripts/advanced.php
|
||||
|
||||
echo " "
|
||||
|
||||
Reference in New Issue
Block a user