Files
loki/scripts
CatoandClaude Opus 5 f847ba8fb5 feat(retire): a site can be taken off the internet, password-protected, or removed (#657)
Creating a site makes about forty things. Deleting the project undid two of
them, plus the repository if you asked. Everything else survived — and the
part that survived is the part that is public.

After "Delete project" on a kicked-off project you still had: the live site at
<slug>.orangecat.ch, its Caddy vhost and TLS certificate, an enabled systemd
unit, /opt/<slug> with its secrets, the checkout, an apps.conf row holding a
port that could never be reclaimed, a monitoring target that keeps paging about
a site you deleted, the box's SSH deploy key sitting in the repository, and the
project's milestones orphaned onto /goals. The only way off the internet was a
human with SSH.

FOUR LEVELS, because "undo it" means four different things:

  offline   stops serving at once; code, files and port kept. Reversible.
  private   keeps working behind a password; repository made private.
  restore   undoes either of the above.
  delete    unit, vhost, /opt, checkout, apps.conf row (freeing the port),
            monitoring target and the leftover deploy key. The repository is
            ARCHIVED, never deleted, unless explicitly asked — that is the one
            step nobody can undo, so it is never a default.

NOTHING HAPPENS WITHOUT A SECOND ASK. The default prints exactly what it would
touch and performs no action, and that preview is produced by the same script
that does the work — a plan written separately is a description that drifts.
The route runs the plan through the runner and returns it inline, so the
confirmation is the real thing rather than a promise about it.

Refusals are refusals: thirteen infrastructure slugs (fleetcrown, orangecat,
the bridge…) cannot be retired at all, and a LIVE client engagement needs an
explicit second hand — money terms are not a thing a button decides.

Shape follows new-site.sh, deliberately: a closed set of parameters validated
against a fixed grammar, handed to the script as an ARGUMENT VECTOR via
execFile, armed by the same FLEETCROWN_SITE_FACTORY switch that arms creation.
A runner allowed to bring public hosts into being is the one allowed to take
them away, and no other.

Also fixed, found by the same inventory:
- GitHub visibility could only be set at creation. setGithubRepoVisibility
  makes a repository private (or public) afterwards — new-site.sh creates
  public repos, so "make this not public" had no answer for the code.
- Deleting a project now deletes the milestones the kickoff wrote FOR it,
  instead of leaving them unowned on /goals (ON DELETE SET NULL).
- "Danger zone" says what it does NOT do, and points at the site controls.

Verified: pnpm run verify green. 32 assertions on the script (a dry run never
edits the register; every artifact named in a delete plan; infrastructure
refused; no backticks), 41 on the validator (a plan never carries --go; no mode
defaults to deleting a repository).

DEPLOYMENT: set FLEETCROWN_RETIRE_SITE_SCRIPT in /opt/fleetcrown/runner/.env to
the retire-site.sh in the factory checkout, beside the FLEETCROWN_NEW_SITE_SCRIPT
already there, and update that checkout. Until then the command is rejected with
that exact reason rather than silently doing nothing.


Claude-Session: https://claude.ai/code/session_01WSNERoZZqW2TgqbAGHSQZf

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-11 08:46:08 -07:00
..
2026-08-31 09:23:30 +00:00
…
…
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00