Admin: remove a site, optionally with its local files #13

Merged
rhelwig merged 2 commits from feat/admin-delete-site into main 2026-10-10 20:46:08 +00:00
Owner

Ron asked (2026-10-10) for a way to remove sites from Admin, e.g. the old "Editor Test Site", optionally deleting their files on disk.

What it does

  • Site page → new Remove site card → /sites/:id/remove confirmation page that lists what goes (pages/posts, assets, asides, local releases, saved publishing setup and publication history) and what stays (anything on Dash Platform / IPFS — removing locally never unpublishes).
  • Checkbox Also delete local files used only by this site: removes local blobs that no remaining site references (shared blobs, e.g. identical default theme CSS, are always kept) plus export/<key>/ and stub-cache/<key>/. Unchecked = records only, files stay.
  • Confirmation: type the site key. If the site has a publishing destination or publication history it needs the phrase delete <key> from this Admin and an acknowledgement checkbox; an extra warning appears when it is the only mainnet-linked site in this Admin.
  • A metadata-only snapshot (no page text, no files) is written to deleted-sites/<key>-<time>.json before anything is removed.
  • Store change: LocalDashMetadataStore.removeSite does it in one locked write and returns the storage ids still used elsewhere. The Admin AI assistant gets no removal tool.

Docs: SPECS "Removing a site from Admin"; IMPLEMENTATION-PLAN entry.

Tests: tests/site-removal.test.ts (shared vs exclusive blobs, wrong confirmation changes nothing, records-only mode, mainnet-linked site needs phrase + acknowledgement). npm test 179/179, typecheck clean. Manually smoke-tested the HTTP flow on a throwaway Admin (wrong phrase → error, correct → removed + notice + snapshot).

No Platform writes, no Dash.

Ron asked (2026-10-10) for a way to remove sites from Admin, e.g. the old "Editor Test Site", optionally deleting their files on disk. **What it does** - Site page → new **Remove site** card → `/sites/:id/remove` confirmation page that lists what goes (pages/posts, assets, asides, local releases, saved publishing setup and publication history) and what stays (anything on Dash Platform / IPFS — removing locally never unpublishes). - Checkbox **Also delete local files used only by this site**: removes local blobs that no remaining site references (shared blobs, e.g. identical default theme CSS, are always kept) plus `export/<key>/` and `stub-cache/<key>/`. Unchecked = records only, files stay. - Confirmation: type the site key. If the site has a publishing destination or publication history it needs the phrase `delete <key> from this Admin` **and** an acknowledgement checkbox; an extra warning appears when it is the only mainnet-linked site in this Admin. - A metadata-only snapshot (no page text, no files) is written to `deleted-sites/<key>-<time>.json` before anything is removed. - Store change: `LocalDashMetadataStore.removeSite` does it in one locked write and returns the storage ids still used elsewhere. The Admin AI assistant gets no removal tool. **Docs:** SPECS "Removing a site from Admin"; IMPLEMENTATION-PLAN entry. **Tests:** `tests/site-removal.test.ts` (shared vs exclusive blobs, wrong confirmation changes nothing, records-only mode, mainnet-linked site needs phrase + acknowledgement). `npm test` 179/179, typecheck clean. Manually smoke-tested the HTTP flow on a throwaway Admin (wrong phrase → error, correct → removed + notice + snapshot). No Platform writes, no Dash.
Site page gets a Remove site card leading to a confirmation page that
lists what goes (pages, assets, asides, local releases, publishing setup
and history) and what stays (anything on Dash Platform or IPFS). Typing the
site key confirms; a site with a publishing destination or publication
history needs 'delete <key> from this Admin' plus an acknowledgement, with
an extra warning when it is the only mainnet-linked site.

Optional 'also delete local files' removes blobs no remaining site uses,
plus export/<key> and stub-cache/<key>; shared blobs are always kept. A
metadata-only snapshot is written to deleted-sites/ first. Removal is a
single locked write in the local store and never touches Platform.
Sign in to join this conversation.
No reviewers
No labels
feature request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rhelwig/DecentSite!13
No description provided.