fix: add built-in service subdomains to DNS zone on startup
Unit Tests / test (push) Successful in 7m45s

_build_dns_records() only hardcoded 'api' and 'webui', relying on the
optional service registry for the rest. Built-in services (calendar,
files, mail, webdav) were never registered, so they were absent from
the zone file and tests querying webdav.<domain> via CoreDNS got
NXDOMAIN.

Add _BUILTIN_SERVICE_SUBDOMAINS constant and include those names in
every zone build. Also update _stale and apply_cell_name exclusion
sets so DDNS mode correctly removes them from the parent zone.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-07 03:14:34 -04:00
parent e8b8e47aa4
commit 08f46332b0
3 changed files with 18 additions and 20 deletions
+5 -13
View File
@@ -501,23 +501,15 @@ class TestDNSZoneRecords:
)
def test_service_records_absent_without_registry(self):
"""Without a registry, service subdomain records are not generated.
Phase 2: service DNS records only exist when a service is installed
and the registry reports it. The hardcoded fallback is gone.
"""
"""Built-in services always get DNS records; optional services require a registry."""
records = self._records()
names = {r['name'] for r in records}
assert 'calendar' not in names, \
'calendar DNS record must not appear without a registry'
assert 'files' not in names, \
'files DNS record must not appear without a registry'
assert 'mail' not in names, \
'mail DNS record must not appear without a registry'
# Built-in services are always present
for svc in ('calendar', 'files', 'mail', 'webdav'):
assert svc in names, f'{svc} DNS record must always be generated'
# Non-built-in names are only generated when a registry is wired
assert 'webmail' not in names, \
'webmail DNS record must not appear without a registry'
assert 'webdav' not in names, \
'webdav DNS record must not appear without a registry'
def test_service_records_present_with_registry(self):
"""With a registry that provides calendar/mail/files, all resolve to WG IP."""