Files
computer-playbook/scripts/container/purge/entity
kevinveenbirkenbachandClaude Opus 4.7 a77a570409 refactor(env): consolidate INFINITO_* namespace and centralize path/image SPOTs
Closes a stack of env-pipeline regressions left over from the recent
INFINITO_* namespace refactor by:

* DOMAIN_PRIMARY now reads INFINITO_DOMAIN strictly (was: legacy DOMAIN
  env var → defaulted to infinito.localhost, which never resolved
  because CoreDNS serves the INFINITO_DOMAIN value, infinito.example).
* group_vars/all/08_networks.yml IPs (ip4/ip6/dns) now read
  INFINITO_IP4 / INFINITO_IP6 / INFINITO_DNS_IP.
* PLAYWRIGHT_KEEP_ALL renamed to INFINITO_PLAYWRIGHT_KEEP end-to-end
  (env-builder, role default, run_one.yml docker exec, playwright.config.js,
  lint allowlist, docs anchor, CI workflow vars).
* PKGMGR_IMAGE renamed to INFINITO_PARENT_IMAGE; Dockerfile ARG drops
  the inline default so env/default.env is the only SPOT.
* INFINITO_SRC_DIR centralized: Dockerfile ARG (no default) + ENV;
  compose forwards it as build-arg, volume mount path, and container env;
  every Python CLI + shell helper + CI workflow now reads it strictly
  (os.environ[...] / "${INFINITO_SRC_DIR:?...}") instead of the literal
  /opt/src/infinito.
* New entries in env/default.env: INFINITO_IP6=::1, INFINITO_PARENT_IMAGE,
  INFINITO_PLAYWRIGHT_KEEP=false. All three propagated through
  utils/env/handlers/passthrough.STATIC_KEYS and (where consumed in the
  container) through compose.yml's environment block.

Validated end-to-end with `make test` (2360 tests across lint, lint-*,
test-lint, test-external, test-unit, test-integration).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 02:30:34 +02:00
..
…
…

Entity Purge 🗑️

Entity-keyed purge primitives for stack-level cleanup inside the running container.

For the canonical Make target index that invokes these helpers, see make.md.

Entry Points 🎯

Script What it does Key inputs
compose.sh Stops the compose stack and removes volumes. Stack names
db.sh Drops or truncates the backing database. Stack names, --wipe-data-only
dir.sh Removes the stack directory and its volumes. Stack names
nginx.sh Removes the per-domain nginx vhost files (http + https) belonging to every app under the entity. Thin wrapper around nginx_vhosts.py. Stack names
network.sh Drops the per-entity default Docker network when compose.sh left it behind with the wrong / empty com.docker.compose.network label (typical between matrix-deploy rounds). Skips removal when the network still has active container endpoints, so shared-service networks (svc-db-mariadb, svc-db-postgres, …) stay in place while their provider container is up. The global docker network prune -f sweep that catches orphans whose names do NOT match the entity is run once by the orchestrator apps.sh after the entity loop. Idempotent. Stack name

These primitives are entity-keyed. The app-keyed orchestrator apps.sh maps app ids to entities and drives them in sequence alongside the token-store wipe in tokens.py.