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
+4 -5
View File
@@ -349,12 +349,11 @@ class TestApplyIpRange(unittest.TestCase):
self.nm.apply_ip_range('10.1.2.0/24', 'pictest', 'mycell')
zone_file = os.path.join(self.nm.dns_zones_dir, 'mycell.zone')
content = open(zone_file).read()
# Without a registry, only the infrastructure names are generated
for host in ('pictest', 'api', 'webui'):
# Infrastructure and built-in service names are always generated
for host in ('pictest', 'api', 'webui', 'calendar', 'files', 'mail', 'webdav'):
self.assertIn(host, content)
# Service records are only generated when a registry is wired
for host in ('calendar', 'files', 'mail', 'webmail', 'webdav'):
self.assertNotIn(host, content)
# Non-built-in names are only generated when a registry is wired
self.assertNotIn('webmail', content)
@patch('subprocess.run')
def test_same_range_updates_zone_without_error(self, _mock):