You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(container): documentation & CI audit guards (ADR-T-009 Phase 9)
Closes out ADR-T-009 by landing the documentation and CI-audit
work that the earlier phases deferred. No runtime behaviour
changes; the diff is operator-facing docs plus three new
container-infra lint jobs.
Highlights:
- CHANGELOG: consolidate the Phase 1–9 story under a single
ADR-T-009 entry covering the lean release / debug split,
the three extracted helper crates (health-check,
auth-keypair, config-probe), the Compose split, and the
vendored su-exec audit. Also document the three breaking
changes operators need to know about (mandatory
database.connect_url and tracker.token, mutually-exclusive
AUTH__*_PEM / AUTH__*_PATH pairs, and the demotion of
TORRUST_INDEX_DATABASE_DRIVER to a first-boot TOML selector).
- README: replace the bare `docker run` / `podman run`
one-liners with the now-required override pair, and add
a Compose-sandbox section pointing at `make up-dev` /
`make up-prod`. Cross-link ADR-T-009 from the docs index.
- docs/containers.md: document the test-stage build gate
(no --skip-tests escape hatch, by design), the new
IMPORTER_API_PORT and TZ env vars, and the canonical
entry-script env-var manifest contract.
- share/container/entry_script_sh: add the
`ENTRY_ENV_VARS` / `END_ENTRY_ENV_VARS` manifest block
as the single source of truth for every env var the
script consults (including dynamically constructed
AUTH__*_{PEM,PATH} names a naive grep would miss).
- contrib/dev-tools/su-exec/AUDIT.md: new file recording
provenance, choice rationale (vs gosu / setpriv / su),
re-audit triggers (file-change + CVE, deliberately not
calendar-based), and an append-only audit log anchored
by SHA-256.
- .github/workflows/container.yaml: new `lints` job that
the existing `test` job now depends on, with three
guards — (1) compose.yaml stays free of mailcatcher /
SMTP wiring (comments stripped before grepping so the
explanatory header doesn't trip the audit),
(2) su-exec.c SHA-256 matches the most recent AUDIT.md
entry, and (3) every env var in the entry-script
manifest is documented in docs/containers.md.
- ADR + implementation plan: flip status from Proposed /
Phase 9 "Not started" to Implemented.
- AGENTS.md: extend the helper-crates list with
index-cli-common and index-entry-script.
echo "::error file=$audit::no SHA-256 entry found in '## Audit Log' section (ADR-T-009 §9.2)"
63
+
exit 1
64
+
fi
65
+
if [ "$recorded" != "$actual" ]; then
66
+
echo "::error file=$audit::recorded SHA-256 ($recorded) does not match contrib/dev-tools/su-exec/su-exec.c ($actual). Append a new dated audit entry per ADR-T-009 §9.2."
67
+
exit 1
68
+
fi
69
+
echo "su-exec audit current ($actual)."
70
+
71
+
# Phase 9 §9 / Acceptance Criterion #7 — every env var
72
+
# listed in the entry script's manifest block must be
See [Compose Split](./docs/containers.md#compose-split) in the container
82
+
guide for the required env vars and the validation contract.
83
+
52
84
### Development Version
53
85
54
86
- Please assure you have the ___[latest stable (or nightly) version of Rust][Rust]___.
@@ -144,6 +176,7 @@ The following services are provided by the default configuration:
144
176
-[ADR-T-006: Refactor the Error System](adr/006-error-system-refactor.md) — Replace the 41-variant `ServiceError` god enum with domain-scoped error enums (`AuthError`, `UserError`, `TorrentError`, `CategoryTagError`) and a thin `ApiError` wrapper.
145
177
-[ADR-T-007: Refactor the JWT System](adr/007-jwt-system-refactor.md) — Centralise JWT handling into `src/jwt.rs`, redesign claims to RFC 7519, move to RS256 asymmetric signing, and consolidate session validation into a single code path.
146
178
-[ADR-T-008: Refactor the Roles and Permissions System](adr/008-roles-and-permissions-refactor.md) — Replace Casbin with a native Rust permission system (`PermissionMatrix` + `RequirePermission<A>` Axum extractors), migrate from `administrator: bool` to a `role` column, and add a `/me/permissions` discovery endpoint.
179
+
-[ADR-T-009: Container Infrastructure Refactor](adr/009-container-infrastructure-refactor.md) — Split the runtime image into `release` (distroless, root-only toolset) and `debug` bases; extract three helper binaries (`torrust-index-health-check`, `torrust-index-auth-keypair`, `torrust-index-config-probe`) into their own workspace crates with no HTTP/TLS/async-runtime deps; strip credentials from shipped TOMLs and make `database.connect_url` / `tracker.token` mandatory schema fields; split Compose into a production-shaped `compose.yaml` baseline plus an auto-loaded `compose.override.yaml` dev sandbox; and add an internal audit record for vendored `su-exec`.
0 commit comments