Establish the self-contained tools convention and prove it on a core app: - discovery now reads containers/<app>/tools/<app>.tools.json (the tools/ subfolder); tool functions live at containers/<app>/tools/*.sh, auto-sourced by the container scan (depth 3) — no scripts/app/ entry, no array regen. - adguard migrated: its 2 Tools-tab actions (reset_password, apply_dns_updater) moved to containers/adguard/tools/ + tools/adguard.tools.json, and dropped from the central webui_tools.sh heredoc. adguard_auth.sh stays in scripts/app/ — it's a logic helper, NOT a tool (the key distinction: only DECLARED tools move). Central + per-app styles coexist (pihole etc. still central), so the remaining apps can migrate one at a time with nothing breaking. Verified: heredoc valid sans adguard, per-app merge re-adds adguard's 2 tools, scripts array dropped the moved fns. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: librelad <librelad@digitalangels.vip>
15 lines
498 B
Bash
15 lines
498 B
Bash
#!/bin/bash
|
|
|
|
appAdguardApplyDnsUpdater()
|
|
{
|
|
isHeader "Apply DNS Updater (AdGuard)"
|
|
if ! declare -F updateDNS >/dev/null 2>&1; then
|
|
isError "updateDNS function not loaded — cannot apply."
|
|
return 1
|
|
fi
|
|
updateDNS "adguard" "manual"
|
|
isSuccessful "/etc/resolv.conf updated to use AdGuard as the host DNS resolver."
|
|
# Split-horizon: make app subdomains resolve to the box on the LAN.
|
|
declare -F setupLocalDnsRewrites >/dev/null 2>&1 && setupLocalDnsRewrites
|
|
}
|