Try ingress

This commit is contained in:
Alexandre
2024-05-20 18:12:42 +02:00
parent 80e005ff6a
commit 9a92fa1007
6 changed files with 34 additions and 13 deletions

View File

@@ -7,9 +7,12 @@ set -e
###############
if bashio::config.true 'ssl'; then
bashio::log "Ssl is enabled using addon options, setting up nginx"
bashio::config.require.ssl
certfile=$(bashio::config 'certfile')
keyfile=$(bashio::config 'keyfile')
sed -i "/root/a tls /ssl/${certfile} /ssl/${keyfile}" /etc/caddy/Caddyfile
sed -i "s|http://|https://|g" /etc/caddy/Caddyfile
fi
echo " "

View File

@@ -44,7 +44,8 @@ sed -i "/User=pi/d" "$HOME/BirdNET-Pi/templates/birdnet_log.service"
sed -i "s|birdnet_log.sh|cat /proc/1/fd/1|g" "$HOME/BirdNET-Pi/templates/birdnet_log.service"
# Make sure config is correctly formatted.
echo "... avoid caddy formatting errors"
echo "... caddyfile modifications"
caddy fmt --overwrite /etc/caddy/Caddyfile
sed -i "s|http://|http://:8081|g" /etc/caddy/Caddyfile
echo " "

View File

@@ -8,22 +8,22 @@
location /log {
# Proxy pass
proxy_pass http://localhost:80;
proxy_pass http://localhost:8081;
}
location /stats {
# Proxy pass
proxy_pass http://localhost:80;
proxy_pass http://localhost:8081;
}
location /terminal {
# Proxy pass
proxy_pass http://localhost:80;
proxy_pass http://localhost:8081;
}
location / {
# Proxy pass
proxy_pass http://localhost:80;
proxy_pass http://localhost:8081;
# Next three lines allow websockets
proxy_http_version 1.1;