Summary
The custom-domain manager documents the database as the source of truth for the Caddy symlink farm, but Manager.Sync only creates or replaces links for mappings that currently exist.
Entries already present under <data>/domains are never removed when their database mapping disappears. After an out-of-band database repair, failed unlink, or other drift, the old host path can therefore continue pointing at and serving the previous member's public_html.
Reproduction
- Add a domain mapping and create its entry in the domain symlink farm.
- Remove the mapping from the database without removing the filesystem entry.
- Restart or call
Manager.Sync.
- The stale domain entry remains even though it no longer exists in
AllDomains().
Expected behavior
Before rebuilding current mappings, sync should remove domain-directory entries that are absent from the database so the documented source of truth is actually enforced.
Summary
The custom-domain manager documents the database as the source of truth for the Caddy symlink farm, but
Manager.Synconly creates or replaces links for mappings that currently exist.Entries already present under
<data>/domainsare never removed when their database mapping disappears. After an out-of-band database repair, failed unlink, or other drift, the old host path can therefore continue pointing at and serving the previous member'spublic_html.Reproduction
Manager.Sync.AllDomains().Expected behavior
Before rebuilding current mappings, sync should remove domain-directory entries that are absent from the database so the documented source of truth is actually enforced.