Skip to content

Commit 966690a

Browse files
committed
docs+ci: final wording fixes (restore TL;DR, crypt-key note, overlay allow-list comment)
- Makefile restore TL;DR: files/ + config/ tarballs (not uploads/storage); drop orphan test-glpi .PHONY entry - lint.yml + bin/compose-file.sh: clarify GLPI .env secrets / shipped overlays - migration runbook: clearer 'crypt key is a file, not an env var' note Signed-off-by: Sebastian Mendel <sebastian.mendel@netresearch.de>
1 parent 9374923 commit 966690a

6 files changed

Lines changed: 22 additions & 29 deletions

File tree

.github/workflows/lint.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ jobs:
6060
run: |
6161
cp .env.example .env
6262
# supply just-good-enough placeholders so validation passes
63-
# (GLPI has no APP_KEY — its crypt key is generated on first boot)
63+
# (GLPI's only .env secrets are the DB passwords; its crypt key is
64+
# minted on first boot inside the glpi-config volume)
6465
sed -i \
6566
-e 's/^GLPI_DB_PASSWORD=$/GLPI_DB_PASSWORD=ci-placeholder/' \
6667
-e 's/^DB_ROOT_PASSWORD=$/DB_ROOT_PASSWORD=ci-placeholder/' \

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ restore: ## Print pointer to the disaster-recovery runbook (not automated)
191191
@printf ' runbook step by step:\n\n'
192192
@printf ' docs/runbook-restore.md\n\n'
193193
@printf ' TL;DR: stop app+scheduler, pick a dump from the backups volume,\n'
194-
@printf ' drop+recreate the database, gunzip | mariadb, restore uploads/\n'
195-
@printf ' and storage/ tarballs, then `make restart`.\n'
194+
@printf ' drop+recreate the database, gunzip | mariadb, restore the\n'
195+
@printf ' files/ and config/ tarballs, then `make restart`.\n'
196196

197197
clean: ## DESTRUCTIVE: down + delete ALL volumes (db + uploads + backups)
198198
@read -r -p "This deletes ALL data — the database, uploads AND the backups volume. Type 'yes' to proceed: " ans; \
@@ -202,7 +202,7 @@ clean: ## DESTRUCTIVE: down + delete ALL volumes (db + uploads + backups)
202202
.PHONY: \
203203
help init up down restart logs logs-app ps \
204204
backup backup-list backup-verify \
205-
health test test-image test-glpi test-bats hardening-check \
205+
health test test-image test-bats hardening-check \
206206
dev build lint pull upgrade \
207207
shell console restore clean \
208208
overlays \

bin/compose-file.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ case "$action" in
6060
for p in "$@"; do
6161
# Allow-list the overlays this stack actually ships — anything else is
6262
# either a typo or someone wiring an untrusted compose file into the
63-
# stack. GLPI has no built-in error tracking, so (unlike the Snipe-IT
64-
# sibling) there is deliberately no bugsink/sentry overlay here.
63+
# stack. The shipped overlays are traefik, caddy and observability.
6564
case "$p" in
6665
examples/compose.traefik.yml|examples/compose.caddy.yml|examples/compose.observability.yml) ;;
6766
*) echo "compose-file: unknown overlay (allowed: traefik, caddy, observability): $p" >&2; exit 1 ;;

docs/migration-from-upstream-single-container.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,9 @@ Edit `.env`. The values that matter for a migration:
139139
DB + config restored, the entrypoint detects the existing install and runs
140140
`database:update` instead.
141141
- `TZ`, `GLPI_HTTP_PORT`, `GLPI_HOST` — set to taste.
142-
- There is **no `APP_KEY`** here — GLPI's encryption key is the
143-
`glpicrypt.key` *file* you're migrating, not an env var.
142+
- GLPI's encryption key is **not** an env var — it is the `glpicrypt.key`
143+
*file* you're migrating (see above). There is nothing crypto-related to set
144+
in `.env`.
144145

145146
Leave the `make init` DB passwords as they are; we adopt the bundled `db`
146147
service and rewrite the restored `config_db.php` to match it during cutover.

tests/bin/compose-file.bats

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
# (sibling under bin/), so the fake repo includes both scripts.
1111
#
1212
# The accepted overlay allow-list is exactly: traefik, caddy,
13-
# observability. GLPI has no built-in error tracking, so (unlike the
14-
# Snipe-IT sibling) there is no bugsink/sentry overlay — those are
15-
# rejected even when the file exists.
13+
# observability. Any other examples/compose.*.yml path is rejected by the
14+
# allow-list — even when the file exists on disk.
1615

1716
load test_helper
1817

@@ -116,15 +115,14 @@ setup() {
116115
! grep -q '^COMPOSE_FILE=' .env
117116
}
118117

119-
@test "compose-file add: rejects a dropped overlay (bugsink) even if the file exists" {
120-
# The bugsink overlay is intentionally NOT in the allow-list (GLPI has no
121-
# built-in error tracking). The allow-list check runs before the file
122-
# stat, so this is rejected even though setup_fake_repo created the file.
123-
[ -f examples/compose.bugsink.yml ]
124-
run ./bin/compose-file.sh add examples/compose.bugsink.yml
125-
[ "$status" -eq 1 ]
126-
[[ "$output" == *"unknown overlay"* ]]
127-
! grep -q '^COMPOSE_FILE=' .env
118+
@test "compose-file add: accepts the observability overlay" {
119+
# observability is one of the three allow-listed overlays — adding it must
120+
# succeed and append it to COMPOSE_FILE. (The "file exists but not
121+
# allow-listed → rejected" path is covered by the examples/random.yml test
122+
# below.)
123+
run ./bin/compose-file.sh add examples/compose.observability.yml
124+
[ "$status" -eq 0 ]
125+
grep -qx 'COMPOSE_FILE=compose.yml:examples/compose.observability.yml' .env
128126
}
129127

130128
@test "compose-file add: rejects an allow-listed overlay whose file is missing" {

tests/bin/test_helper.bash

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
# ├── examples/
1414
# │ ├── compose.caddy.yml (empty placeholder, accepted overlay)
1515
# │ ├── compose.observability.yml (empty placeholder, accepted overlay)
16-
# │ ├── compose.traefik.yml (empty placeholder, accepted overlay)
17-
# │ └── compose.bugsink.yml (empty placeholder, DROPPED overlay —
18-
# │ present only to prove the allow-list
19-
# │ rejects it even when the file exists)
16+
# │ └── compose.traefik.yml (empty placeholder, accepted overlay)
2017
# └── .env ← mode 0600, optional seed content
2118
#
2219
# Both helpers `cd "$(dirname "$0")/.."` to the repo root before
@@ -66,14 +63,11 @@ setup_fake_repo() {
6663
cp "$REAL_BIN/compose-file.sh" "$BATS_TEST_TMPDIR/bin/compose-file.sh"
6764
chmod +x "$BATS_TEST_TMPDIR/bin/"*.sh
6865

69-
# Touch the three overlay files compose-file.sh accepts, plus a bugsink
70-
# file representing the deliberately-dropped overlay (so a test can prove
71-
# it is rejected by the allow-list even though the file exists). Empty
72-
# content is fine — the script only stats these, never reads them.
66+
# Touch the three overlay files compose-file.sh accepts. Empty content is
67+
# fine — the script only stats these, never reads them.
7368
: > "$BATS_TEST_TMPDIR/examples/compose.caddy.yml"
7469
: > "$BATS_TEST_TMPDIR/examples/compose.observability.yml"
7570
: > "$BATS_TEST_TMPDIR/examples/compose.traefik.yml"
76-
: > "$BATS_TEST_TMPDIR/examples/compose.bugsink.yml"
7771

7872
# Seed .env. umask 077 ensures the file is born at 0600 even before
7973
# the explicit chmod below — mirrors init.sh.

0 commit comments

Comments
 (0)