Files
computer-playbook/scripts/container/purge/README.md
T
kevinveenbirkenbachandClaude Opus 4.7 5325fe3cf0 refactor(purge): app-keyed orchestrator + wipe stale tokens between rounds
The token store at /var/lib/infinito/secrets/tokens.yml survived
compose+volumes purges, so matrix-deploy variant transitions left a
stale matomo token in place. On the next round the token-empty guard
in sys-front-inj-matomo never fired and the public-URL probe hit an
empty openresty upstream, returning 502.

- utils/cleanup/tokens.py: wipes users.<user>.tokens.<app_id> entries
  via utils.cache.yaml (load_yaml_any / dump_yaml).
- scripts/container/purge/apps.sh: app-keyed orchestrator that maps
  $APPS to compose entities, drives entity/{db,compose,dir}.sh, and
  invokes utils.cleanup.tokens for the same app set.
- scripts/tests/deploy/local/purge/entity.sh becomes a thin
  docker-exec wrapper invoking apps.sh inside the runner.
- Drop scripts/container/purge/entity/all.sh; its trivial loop and
  unused --wipe-data-only / --db-only flags fold into apps.sh.
- tests/unit/utils/cleanup/test_tokens.py covers wipe paths (single
  app, multi-user, multi-app, no-match no-rewrite, missing file,
  user-without-tokens, non-dict user) plus the __main__ shim.
- READMEs updated for the new layout.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 02:25:04 +02:00

919 B

Container Purge 🗑️

Container-local cleanup helpers under scripts/container/purge/.

These scripts run inside the local infinito container and remove container-local state only. For the canonical Make target index that invokes these helpers, see make.md.

Entry Points 🎯

Entry point What it does Notes
apps.sh App-keyed orchestrator that maps $APPS to compose entities, drives entity/{db,compose,dir}.sh, and wipes the matching token-store entries via tokens.py. The host-side wrapper entity.sh docker execs this script.
web.sh Removes nginx and self-signed CA state inside the container. Called by the local purge wrapper.
entity/ Entity-keyed primitives. See entity/README.md for the exact scripts.