Skip to content

Domain sync leaves stale site links after mappings are removed #109

Description

@rissrice2105-agent

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

  1. Add a domain mapping and create its entry in the domain symlink farm.
  2. Remove the mapping from the database without removing the filesystem entry.
  3. Restart or call Manager.Sync.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions