[FIX] installer: serve the AvianVisitors collage at / on a fresh clone
This commit is contained in:
@@ -238,6 +238,13 @@ EOF
|
||||
usermod -aG $USER caddy
|
||||
usermod -aG video caddy
|
||||
chmod g+r+x $HOME
|
||||
|
||||
# Serve the AvianVisitors collage at / rather than the stock BirdNET-Pi UI.
|
||||
# The Caddyfile written above is the stock one (hardcoded php-fpm.sock, no
|
||||
# index.html try_files override); re-apply both through update_caddyfile.sh,
|
||||
# the single source of truth, so / serves index.html not index.php. Run it
|
||||
# last so it wins.
|
||||
"$HOME/BirdNET-Pi/scripts/update_caddyfile.sh"
|
||||
}
|
||||
|
||||
install_avahi_aliases() {
|
||||
|
||||
@@ -84,4 +84,12 @@ EOF
|
||||
fi
|
||||
|
||||
sudo caddy fmt --overwrite /etc/caddy/Caddyfile
|
||||
sudo systemctl reload caddy
|
||||
# Fail loudly on a Caddyfile caddy can't parse rather than reloading a broken
|
||||
# config and reporting success.
|
||||
sudo caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile || {
|
||||
echo "generated Caddyfile failed validation; not reloading caddy" >&2
|
||||
exit 1
|
||||
}
|
||||
# reload-or-restart so this also works at install time, when caddy may not be
|
||||
# running yet (a plain reload would fail there); tolerate a not-yet-ready unit.
|
||||
sudo systemctl reload-or-restart caddy 2>/dev/null || true
|
||||
|
||||
Reference in New Issue
Block a user