Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4bd759c
fix(auth): return error for missing users and clean up token responses
peer-cat Apr 18, 2026
001018c
feat: harden container infrastructure (ADR-T-009, Phases 1 & 2)
peer-cat Apr 18, 2026
09addb7
docs: replace ADR-T-009 with structural container refactor
peer-cat Apr 19, 2026
d9887fd
refactor(container): build hygiene — drop port ARGs, tighten context
peer-cat Apr 19, 2026
35fc2a4
feat(container): extract helper binaries into workspace crates (ADR-T…
peer-cat Apr 20, 2026
f697158
feat(config): extract parsing surface into `torrust-index-config` crate
peer-cat Apr 21, 2026
ab52b50
feat(container): split runtime base, harden busybox surface (ADR-T-00…
peer-cat Apr 21, 2026
6f37431
feat(config): require tracker.token and database.connect_url at the s…
peer-cat Apr 21, 2026
0568e22
feat(config): introduce `torrust-index-config-probe` (ADR-T-009 Phase 6)
peer-cat Apr 21, 2026
839450b
feat(container): rework entry script around config probe (ADR-T-009 P…
peer-cat Apr 21, 2026
af823d5
feat(container): compose split + bring-up fixes (ADR-T-009 Phase 8)
peer-cat Apr 21, 2026
51cf24a
docs(container): documentation & CI audit guards (ADR-T-009 Phase 9)
peer-cat Apr 21, 2026
8b1717a
docs(adr): consolidate ADR-T-009 plan into a single self-contained ADR
peer-cat Apr 22, 2026
ed10d4e
fix(container): handle usrmerged base in release runtime stage
peer-cat Apr 22, 2026
291e43e
chore(deps): drop unused root-crate dependencies camino and serde_with
peer-cat Apr 22, 2026
1971942
test(config): isolate `for_tests()` constructor test in figment Jail
peer-cat Apr 22, 2026
66d85b6
test(e2e): inject mandatory config overrides in container e2e runners
peer-cat Apr 22, 2026
edc6ca6
test(config): scrub inherited config env vars in all Jail-wrapped tests
peer-cat Apr 22, 2026
46d0221
test(e2e): normalise container-augmented config fields in settings co…
peer-cat Apr 22, 2026
22051b3
fix: tighten error handling and secret hygiene across helpers
peer-cat Apr 23, 2026
c54d2de
fix(health-check): connect via Happy Eyeballs so localhost falls back…
peer-cat Apr 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .dockerignore → .containerignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@
/README.md
/rustfmt.toml
/storage/
/target/
/target/
/adr/
/docs/
82 changes: 82 additions & 0 deletions .github/workflows/container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,90 @@ env:
CARGO_TERM_COLOR: always

jobs:
lints:
name: Lints (Container infra)
runs-on: ubuntu-latest

steps:
- id: checkout
name: Checkout Repository
uses: actions/checkout@v6

# Phase 9 §9.1.3 — guard against re-introducing the
# `mailcatcher` dev sidecar (or any SMTP/mail config)
# into the production-shaped baseline. The override
# file is *expected* to mention `mailcatcher` and is
# deliberately excluded from the audit. Comments are
# stripped before grepping so the explanatory header
# in `compose.yaml` (which legitimately references
# `mailcatcher` in prose) does not trip the audit;
# we are looking for live YAML config, not docs.
- id: compose-baseline-no-mailcatcher
name: compose.yaml has no mailcatcher / SMTP wiring
run: |
set -eu
# awk strips `# ...` comments while preserving line
# numbering 1:1 with the source file, so any error
# output points the reader at the real line.
if awk '{ sub(/#.*/, ""); print }' compose.yaml \
| grep -nE 'mailcatcher|MAILER|SMTP|smtp_'; then
echo "::error file=compose.yaml::dev mail sidecar / SMTP config present in production-shaped baseline (ADR-T-009 §D1 / §8.1)"
exit 1
fi
echo "compose.yaml clean."

# Phase 9 / ADR-T-009 §D8 — vendored `su-exec.c` must not change
# without a fresh audit entry recording the new SHA-256
# in contrib/dev-tools/su-exec/AUDIT.md.
- id: su-exec-audit
name: su-exec audit log matches vendored source
run: |
set -eu
audit=contrib/dev-tools/su-exec/AUDIT.md
test -s "$audit"
recorded=$(sed -n '/^## Audit Log/,$ { s/^SHA-256: \([0-9a-f]\{64\}\)$/\1/p; }' "$audit" | tail -1)
actual=$(sha256sum contrib/dev-tools/su-exec/su-exec.c | cut -d' ' -f1)
if [ -z "$recorded" ]; then
echo "::error file=$audit::no SHA-256 entry found in '## Audit Log' section (ADR-T-009 §D8)"
exit 1
fi
if [ "$recorded" != "$actual" ]; then
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 §D8."
exit 1
fi
echo "su-exec audit current ($actual)."

# Phase 9 / ADR-T-009 Acceptance Criterion #7 — every env
# var listed in the entry script's manifest block must be
# documented in docs/containers.md.
- id: entry-env-docs
name: entry-script env vars documented
run: |
set -eu
script=share/container/entry_script_sh
vars=$(sed -n '/^# ENTRY_ENV_VARS:/,/^# END_ENTRY_ENV_VARS/p' "$script" \
| grep -oE '[A-Z][A-Z0-9_]+' \
| sort -u)
if [ -z "$vars" ]; then
echo "::error file=$script::ENTRY_ENV_VARS manifest block not found or empty (ADR-T-009 Acceptance Criterion #7)"
exit 1
fi
missing=0
for v in $vars; do
grep -q "$v" docs/containers.md || {
echo "::error file=docs/containers.md::env var '$v' is in the entry-script manifest but not documented"
missing=1
}
done
grep -q 'compose\.override\.yaml' docs/containers.md || {
echo "::error file=docs/containers.md::two-file Compose split (compose.override.yaml) is not documented"
missing=1
}
[ "$missing" -eq 0 ]

test:
name: Test (Docker)
needs: lints
runs-on: ubuntu-latest

strategy:
Expand Down
33 changes: 31 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ When working inside a package, prefer running only the `--package` tests,
as the whole-project tests are slow to run. (Occasionally run the whole
suite, for example when finishing up.)

## Commit Messages

When writing a commit message, be sure to review the last few commit message to compare the style.

## Running Tests

When running tests, tee to a temp file (`/tmp/...`) and then grep that
Expand Down Expand Up @@ -45,6 +49,23 @@ API, perhaps using `#[doc(hidden)]` helpers when appropriate.

Every test file (module) should maintain an index of the tests contained in the module-doc. The primary purpose is to make it easy to scan the test files to detect duplicates or overlapping coverage. Please opportunistically create if missing.

## POSIX Paths

Treat paths as opaque byte sequences. POSIX permits any byte except
`\0` (NUL) and `/` (the path separator) in a file or directory name,
and there is no guarantee that the bytes are valid UTF-8. Concretely:

- Prefer `OsStr` / `OsString` / `Path` / `PathBuf` (or `Utf8Path`
when UTF-8 really is a precondition you intend to enforce) over
ad-hoc `String` handling.
- Do not assume any particular character class — names may contain
spaces, newlines, control bytes, leading dashes, or arbitrary
non-UTF-8 bytes.
- NUL termination is only required when crossing a libc/FFI
boundary (e.g. `CString` for `open(2)`); interior NUL bytes are
invalid for those APIs and must be rejected, not silently
truncated.

## Cross-Reference Conventions

Eagerly corrected when spotted in **any** file!
Expand All @@ -59,6 +80,13 @@ use their own `ADR-<PREFIX>-<NNN>` form without the `§` prefix.
| `T-` | Torrust (root crate) | *(none yet)* |
| `R-` | render-text-as-image | `packages/render-text-as-image/` |

Helper crates (`index-health-check`, `index-auth-keypair`,
`index-config`, `index-config-probe`, `index-cli-common`,
`index-entry-script`) are internal implementation details of
the root crate and do not own separate ADRs or specification
docs. They share the `T-` prefix for any cross-references
that target them.

### General Rules

- Use `§§` for ranges: e.g. `§§IDEA M-12.2–12.5`.
Expand All @@ -76,5 +104,6 @@ use their own `ADR-<PREFIX>-<NNN>` form without the `§` prefix.
To avoid partial or corrupted writes, always replace files atomically:

1. Read the file.
2. Using the CLI, `rm` the file.
3. Recreate the file.
2. Write the new content to a temporary file
3. Rename the temporary file to atomically overwrite the original file:
`mv file.tmp file`
Loading
Loading