LibrePortal/scripts/app/app_update_specifics.sh
librelad e5f6f4c371 feat(dns): split-horizon local DNS for app subdomains
setupLocalDnsRewrites points every configured domain at the server's LAN IP
inside the self-hosted resolver, so app subdomains resolve locally and hit
Traefik directly (valid certs, no router hairpin). AdGuard gets a wildcard
rewrite per domain via its REST API; Pi-hole gets per-host A records in the
supported, mounted custom.list (no wildcard support there). Safe by
construction: idempotent, guarded by installed-checks, cannot corrupt the
resolver. Hooked into the Apply-DNS actions and resolver install. Also drops
the dead HOST_NAME read from the setupDNSIP stub.

NOTE: needs a live smoke-test — the AdGuard API call and Pi-hole reload
can't be exercised without the running containers.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
2026-05-22 01:10:56 +01:00

37 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
appUpdateSpecifics()
{
local app_name="$1"
# Initialize setup.
initializeAppVariables $app_name;
if [[ $app_name == "adguard" ]] || [[ $app_name == "pihole" ]]; then
if [[ $CFG_REQUIREMENT_DNS_UPDATER == "true" ]]; then
updateDNS $app_name install;
fi
# Split-horizon local DNS: app subdomains resolve to the box on the LAN.
declare -F setupLocalDnsRewrites >/dev/null 2>&1 && setupLocalDnsRewrites
fi
if [[ $app_name == "libreportal" ]]; then
webuiLibrePortalUpdate;
fi
if [[ $app_name == "dashy" ]]; then
# Refresh apps-services.json (the source of truth that
# appDashyUpdateConf reads) before generating dashy's conf.yml.
# On a first dashy install the file may not yet reflect dashy
# itself; on a re-install the previous selection survives.
webuiLibrePortalUpdate;
appDashyUpdateConf;
fi
if [[ $shouldrestart == "true" ]]; then
dockerComposeRestart $app_name;
fi
isSuccessful "All application specific updates have been completed."
}