Repository navigation
Drop cPanel's own sync, and keep the server's hostname out of it - #88
Conversation
Installing on the live cPanel box ran the initial fill twice: #80 added the reconcile-based one, and cPanel already had its own under a different name — "Sync existing cPanel accounts", which my grep for "Queue existing domains" did not match. I reported that cPanel had no initial fill at all. It had one, and a worse one: - it POSTs to the API directly, so an outage during install loses the zones instead of queueing them - no canonicalisation, so an IDN goes as whatever the panel stored - it reads DNS= from /var/cpanel/users, which is the account's main domain only — addon and parked domains are not there Removed; the reconcile path covers all of it. Second, on the same install: whmapi1 listzones includes the server's own hostname zone, which the API refuses (it is under the service's domain). Every cPanel install therefore ended with a failed op in the queue and an alarming line in the log, on a zone that was never the customer's. panel_zones() now drops the zone whose name is the machine's FQDN, for every panel. tests/test_hostname_filter.sh: the hostname zone goes, case and trailing dot included; the parent zone and a subdomain of it stay; a hostname without a dot drops nothing; an empty panel stays empty. Mutations: removing the filter fails 3, comparing without normalising fails 2. Live on the cPanel box: panel_zones() now returns only the customer zone and reconcile reports ok: 1, missing: 0.
|
One item, then ready. Both fixes are right: the old cPanel block bypassed the queue, skipped canonicalisation and saw only the primary domain, so removing it in favour of the shared fill is a strict improvement; the hostname filter compares lowercased, dot-stripped names, refuses to act on a bare short hostname, and is overridable for tests; the rows cover drop / keep order / short name. CI green, no attribution trailers. Blocker, the comment rule: the three-line block above the filter in seconddns_common.py and the three-line test header — two each ('the host's own zone is not a customer zone; add it by hand with seconddns add if wanted' is the invariant). |
|
Verified: both comments are at two lines, CI green, no attribution trailers. Ready to merge into develop. |
Both found by installing on the live cPanel box — the first is a correction to #80.
cPanel had its own initial fill, and I missed it
The install ran the fill twice: the reconcile-based one from #80, and cPanel's own, which existed all along under a different name — "Sync existing cPanel accounts". My grep in #80 looked for "Queue existing domains", did not match, and I reported that cPanel had no initial fill at all.
It had one, and a worse one:
POSTs to the API directly, bypassing the queue — an outage during the install loses those zones instead of retryingDNS=from/var/cpanel/users, which is the account's main domain only; addon and parked domains never appearRemoved. The reconcile path already covers all of it, through the queue, with canonicalisation.
The server's own hostname was being queued
whmapi1 listzonesincludes the zone for the machine's own hostname — hereserver1.seconddns.com. The API refuses it, correctly, because it falls under the service's own domain:So every cPanel install ended with a failed operation in the queue and an alarming line in the log, over a zone that was never the customer's. (The message being readable at all is #78 working — before that it was a bare
HTTP 400.)panel_zones()now drops the zone whose name equals the machine's FQDN, for every panel. Anyone who genuinely wants it canseconddns addit by hand.Tests
tests/test_hostname_filter.sh: the hostname zone goes, including an uppercase form and a trailing dot; the parent zone (seconddns.com) and a subdomain of the hostname stay; a hostname with no dot drops nothing; an empty panel stays empty rather than erroring. Mutations: removing the filter fails 3, comparing without normalising fails 2.Live
On the cPanel box after the change,
panel_zones()returns onlymy123domain.com, andseconddns-reconcilereportsok: 1 missing: 0 stale: 0.