From ea6ad9a31b4e67a35ff3de992991a51c329e6246 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 24 Apr 2026 05:15:33 +0000 Subject: [PATCH] home: add tls.admin_listen_addr for separate https admin listener Add an optional tls.admin_listen_addr (netip.AddrPort) that, when set, runs a dedicated HTTPS server for the admin UI/API on that address, while the HTTPS server on tls.port_https serves DoH only. Both servers share the same TLS certificate. When unset the previous single-server behavior is preserved, so existing installs are unaffected and DNS clients using DoH see no change. Port conflicts involving admin_listen_addr are validated at config parse time (including --check-config), not only as a runtime bind failure. HTTP/3 on tls.port_https mirrors the HTTPS mux split so DoH-over-HTTP/3 clients are not forced through the admin auth middleware and admin routes are not exposed on the DoH port. validateTLSSettings reads AdminListenAddr from the server-side config snapshot, not the frontend payload (the field is json:"-"), so UI port_https changes still trigger the admin-port conflict check. checkPortAvailability validates the admin HTTPS port on its own IP (which may differ from the web API bind host). tlsConfigChanged uses a fresh shutdown context for each HTTPS server so the admin server is not handed an already-cancelled context. registerDoHHandlers reads the admin listen address under config.RLock. Backend + YAML only; no UI changes in this commit. See the CHANGELOG entry for user-facing details. Addresses #7424 and #7598. Co-Authored-By: raviu --- CHANGELOG.md | 6 + .../home/adminlistenaddr_internal_test.go | 237 ++++++++++++++++++ internal/home/config.go | 24 +- internal/home/control.go | 41 ++- internal/home/dns.go | 21 +- internal/home/home.go | 37 +++ internal/home/tls.go | 34 ++- internal/home/web.go | 191 +++++++++++++- 8 files changed, 564 insertions(+), 27 deletions(-) create mode 100644 internal/home/adminlistenaddr_internal_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 395a029676a..16c51ab548b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,10 @@ See also the [v0.107.75 GitHub milestone][ms-v0.107.75]. NOTE: Add new changes BELOW THIS COMMENT. --> +### Added + +- New optional `tls.admin_listen_addr` configuration setting (an `IP:port` listen address, e.g. `127.0.0.1:4443`). When set, AdGuard Home starts a second HTTPS server on this address dedicated to the admin UI and API, while the HTTPS server on `tls.port_https` serves DNS-over-HTTPS only. Both servers share the same TLS certificate. When unset (the default), behavior is unchanged: one HTTPS server on `tls.port_https` serves both admin UI and DoH ([#7424], [#7598]). + ### Changed - `enable_dnssec` in `dns` configuration now defines whether the proxy should set the DO flag in the upstream requests, the default is `true` ([#7046]). @@ -27,6 +31,8 @@ NOTE: Add new changes BELOW THIS COMMENT. - Safe Browsing and Parental Control labels on the General Settings page not updating after changing the UI language. [#7046]: https://github.com/AdguardTeam/AdGuardHome/issues/7046 +[#7424]: https://github.com/AdguardTeam/AdGuardHome/issues/7424 +[#7598]: https://github.com/AdguardTeam/AdGuardHome/issues/7598