From e6f3ec208749c64a59c594f7d2872d75dc32149d Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 12:53:35 +0200 Subject: [PATCH 01/46] Fixtures: sparkyfitness, rallly and outline seed through their own front door (R-462, R-624) - Sparkyfitness: better-auth sign-up/sign-in, a check-in weight stored and read back; a wrong password and an empty date must read as absent. Waits out the app's own 429 (one client address behind traefik). - Rallly: sign-up, the six-digit e-mail code READ (select only) from the app's own verifications row in place of a mailbox, verify-email, sign-in, polls.make, readback by the public polls.get; an unknown id must be not found. - Outline: the self-hosted first-run route installation.create (workspace + admin, refused once a team exists), an API key with Outline's own CSRF pair, a document, readback by documents.info; an unknown id must 404 and a wrong key 401. - outline and rallly leave the NoRoute list: both had a front-door route after all. Measured on the bench (LXC 9401) and on 9202 2026-09-30: felhom.eu/documentation/audits/pg-last-six-2026-09-30/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- scripts/upgrade_fixtures_box.py | 254 ++++++++++++++++++++++++++++++ scripts/upgrade_fixtures_box28.py | 6 +- 2 files changed, 256 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade_fixtures_box.py b/scripts/upgrade_fixtures_box.py index d253f66..ca2e904 100644 --- a/scripts/upgrade_fixtures_box.py +++ b/scripts/upgrade_fixtures_box.py @@ -1163,7 +1163,261 @@ class Wishlist: say(f" wishlist: sign-in as the seeded user type={good.get('type')} ok={ok} (wrong password refused)") return ok +# ============================================================================================= +def _set_cookies(out): + """The `name=value` pairs of every Set-Cookie in a `curl -D -` answer (headers + body), joined for + a Cookie header. Kept in the fixture's own memory only; never printed.""" + pairs = re.findall(r"(?im)^set-cookie:\s*([^=;\s]+=[^;\r\n]*)", out or "") + return "; ".join(pairs) + + +class Sparkyfitness: + """SparkyFitness's OWN better-auth API: `POST /api/auth/sign-up/email` makes the first account (the + household's own first-run route — the box's sign-up block goes up only AFTER the setup, decision 47), + `POST /api/auth/sign-in/email` gives the session cookie, `POST /api/measurements/check-in` stores a + weight for one date, `GET /api/measurements/check-in/` reads it back. Measured on the bench + 2026-09-30 (v0.17.3, PostgreSQL 15): sign-up 200, check-in 200, readback equal, an empty date → `{}`, + a wrong password → 401. + + THE FIXTURE PROVES ITSELF ON EVERY CALL: verify() also requires a wrong password to be refused and a + date with no check-in to read back without the weight. + """ + sub = "sparky" + + def _signin(self, w, sub, email, pw): + # better-auth rate-limits sign-in per client address (a box's traefik is ONE address): a 429 is waited + # out, never read as a verdict (measured on 9202 2026-09-30: seed sign-in + wrong + right within 1 s → 429). + for _ in range(4): + rc, code, out = w.app_curl(sub, "/api/auth/sign-in/email", "-D", "-", "-H", "Content-Type: application/json", + "-H", f"Origin: https://{sub}.{w.DOMAIN}", + data=json.dumps({"email": email, "password": pw}), method="POST") + if code != "429": + break + time.sleep(15) + return code, _set_cookies(out) + + def seed(self, w, sub, say): + if not w.wait_app(sub, "/api/health", want=("200",), tries=120): + if not w.wait_app(sub, "/", want=("200",), tries=30): + return None + email = "drill" + secrets.token_hex(3) + "@gate.invalid" + pw = "Drill-" + secrets.token_hex(10) + weight = round(50 + secrets.randbelow(4000) / 100, 2) + rc, code, out = w.app_curl(sub, "/api/auth/sign-up/email", "-H", "Content-Type: application/json", + "-H", f"Origin: https://{sub}.{w.DOMAIN}", + data=json.dumps({"email": email, "password": pw, "name": "Drill"}), method="POST") + say(f" sparkyfitness: sign-up http={code}") + if code not in ("200", "201"): + self.tried = f"POST /api/auth/sign-up/email -> {code} {out[:120]}" + return None + code, ck = self._signin(w, sub, email, pw) + if code != "200" or not ck: + self.tried = f"POST /api/auth/sign-in/email -> {code}" + return None + rc, code, out = w.app_curl(sub, "/api/measurements/check-in", "-H", f"Cookie: {ck}", + "-H", "Content-Type: application/json", "-H", f"Origin: https://{sub}.{w.DOMAIN}", + data=json.dumps({"entry_date": "2026-09-01", "weight": weight}), method="POST") + say(f" sparkyfitness: check-in http={code}") + if code != "200": + self.tried = f"POST /api/measurements/check-in -> {code} {out[:120]}" + return None + say(f" sparkyfitness: seeded user {email.split('@')[0]} with a weight of {weight} on 2026-09-01") + return {"email": email, "pw": pw, "weight": weight} + + def verify(self, w, sub, t, say): + if not w.wait_app(sub, "/", want=("200",), tries=120): + say(" sparkyfitness: the app never served /") + return False + code, _ = self._signin(w, sub, t["email"], "wrong-" + secrets.token_hex(6)) + if code == "200": + say(" sparkyfitness: READBACK UNUSABLE — a wrong password signed in") + return False + code, ck = self._signin(w, sub, t["email"], t["pw"]) + if code != "200" or not ck: + say(f" sparkyfitness: the seeded user could not sign in (http {code})") + return False + rc, code, out = w.app_curl(sub, "/api/measurements/check-in/1999-01-01", "-H", f"Cookie: {ck}") + if code != "200" or '"weight"' in (out or ""): + say(f" sparkyfitness: READBACK UNUSABLE — an empty date answered {code} {out[:80]}") + return False + rc, code, out = w.app_curl(sub, "/api/measurements/check-in/2026-09-01", "-H", f"Cookie: {ck}") + try: + got = json.loads(out).get("weight") + except Exception: + got = None + say(f" sparkyfitness: readback of the seeded weight http={code} equal={got == t['weight']}") + return got == t["weight"] + + +class Rallly: + """Rallly's OWN better-auth API and its own tRPC, the household's route: `POST /api/better-auth/sign-up/email` + makes the account, which then needs the six-digit code Rallly e-mails. **The one step that is not the front + door:** the code is READ (a SELECT, never a write) from the app's own `verifications` row, standing in for the + household's mailbox — this venue has none. The code is then given back through the front door + (`POST /api/better-auth/email-otp/verify-email`), the session comes from `sign-in/email`, and a poll is made + with `polls.make` (tRPC). The readback is the public `polls.get` by the poll's id. Nothing is written by hand + (R-156). Measured on the bench 2026-09-30 (v4.11.1, PostgreSQL 16): sign-up 200 (the mail send fails — + ESOCKET — and the code is stored anyway), verify 200, `polls.make` 200, `polls.get` 200 with the title, an + unknown id → 404 "Poll not found". + + THE FIXTURE PROVES ITSELF ON EVERY CALL: verify() also requires an id that cannot exist to be not found. + """ + sub = "poll" + + def _auth(self, w, sub, path, body): + return w.app_curl(sub, "/api/better-auth/" + path, "-D", "-", "-H", "Content-Type: application/json", + "-H", f"Origin: https://{sub}.{w.DOMAIN}", data=json.dumps(body), method="POST") + + def _get(self, w, sub, poll_id): + q = json.dumps({"json": {"urlId": poll_id}}, separators=(",", ":")) + import urllib.parse + return w.app_curl(sub, "/api/trpc/polls.get?input=" + urllib.parse.quote(q)) + + def seed(self, w, sub, say): + if not w.wait_app(sub, "/login", want=("200",), tries=90): + return None + email = "drill" + secrets.token_hex(3) + "@gate.invalid" + pw = "Drill-" + secrets.token_hex(10) + rc, code, out = self._auth(w, sub, "sign-up/email", {"email": email, "password": pw, "name": "Drill"}) + say(f" rallly: sign-up http={code}") + if code != "200": + self.tried = f"POST /api/better-auth/sign-up/email -> {code}" + return None + otp = "" + for _ in range(10): + otp = w.guest("docker exec rallly-postgres psql -U rallly -d rallly -Atc " + f"\"select split_part(value,':',1) from verifications where identifier=" + f"'email-verification-otp-{email}' order by created_at desc limit 1\" 2>&1").strip() + if re.fullmatch(r"\d{6}", otp): + break + time.sleep(2) + if not re.fullmatch(r"\d{6}", otp): + self.tried = "the e-mail code was not in the app's own verifications table" + say(" rallly: no e-mail code found in the app's own table") + return None + rc, code, out = self._auth(w, sub, "email-otp/verify-email", {"email": email, "otp": otp}) + say(f" rallly: verify-email with the code http={code}") + if code != "200": + self.tried = f"POST /api/better-auth/email-otp/verify-email -> {code}" + return None + rc, code, out = self._auth(w, sub, "sign-in/email", {"email": email, "password": pw}) + ck = _set_cookies(out) + if code != "200" or "session_token" not in ck: + self.tried = f"POST /api/better-auth/sign-in/email -> {code}" + return None + title = "drillpoll-" + secrets.token_hex(4) + rc, code, out = w.app_curl(sub, "/api/trpc/polls.make", "-H", f"Cookie: {ck}", "-H", "Content-Type: application/json", + "-H", f"Origin: https://{sub}.{w.DOMAIN}", + data=json.dumps({"json": {"title": title, "timeZone": "Europe/Budapest", + "options": [{"startDate": "2026-12-01"}]}}), method="POST") + try: + pid = json.loads(out)["result"]["data"]["json"]["data"]["id"] + except Exception: + self.tried = f"POST /api/trpc/polls.make -> {code} {out[:120]}" + say(f" rallly: polls.make -> {code} {out[:120]}") + return None + say(f" rallly: seeded poll {title} ({pid})") + return {"id": pid, "title": title} + + def verify(self, w, sub, t, say): + if not w.wait_app(sub, "/login", want=("200",), tries=90): + say(" rallly: the app never served /login") + return False + rc, code, out = self._get(w, sub, "Nope" + secrets.token_hex(4)) + if code != "404": + say(f" rallly: READBACK UNUSABLE — an id that cannot exist answered {code}") + return False + rc, code, out = self._get(w, sub, t["id"]) + found = code == "200" and t["title"] in (out or "") + say(f" rallly: readback of the seeded poll http={code} found={found}") + return found + + +class Outline: + """Outline's OWN first-run API, the household's route while the app holds no workspace: + `POST /api/installation.create` makes the workspace and its admin and signs them in (Outline mounts it + only on self-hosted installs, and refuses it once a team exists). The session makes an API key + (`apiKeys.create`, with Outline's own CSRF cookie + header), the key makes a collection and a published + document, and the readback is `documents.info` with the key. Measured on the bench 2026-09-30 (v1.9.1, + PostgreSQL 16): every call 200, the title and body read back, an unknown id → 404, a wrong key → 401. + + THE FIXTURE PROVES ITSELF ON EVERY CALL: verify() also requires an unknown document id to be not found + and a wrong key to be refused. + """ + sub = "kb" + ZERO = "00000000-0000-4000-8000-000000000000" + + def _api(self, w, sub, call, body, key): + return w.app_curl(sub, "/api/" + call, "-H", f"Authorization: Bearer {key}", "-H", + "Content-Type: application/json", data=json.dumps(body), method="POST") + + def seed(self, w, sub, say): + if not w.wait_app(sub, "/_health", want=("200",), tries=90): + return None + o = f"https://{sub}.{w.DOMAIN}" + rc, code, out = w.app_curl(sub, "/api/installation.create", "-D", "-", "-H", "Content-Type: application/json", + "-H", f"Origin: {o}", + data=json.dumps({"teamName": "Drill", "userName": "Drill", + "userEmail": "drill" + secrets.token_hex(3) + "@gate.invalid"}), + method="POST") + ck = _set_cookies(out) + say(f" outline: installation.create http={code}") + if code not in ("200", "302") or "accessToken=" not in ck: + self.tried = f"POST /api/installation.create -> {code}" + return None + rc, code, out = w.app_curl(sub, "/home", "-D", "-", "-o", "/dev/null", "-H", f"Cookie: {ck}") + csrf = re.search(r"(?im)^set-cookie:\s*csrfToken=([^;\r\n]+)", out or "") + if not csrf: + self.tried = "no csrfToken cookie from GET /home" + return None + cs = csrf.group(1) + rc, code, out = w.app_curl(sub, "/api/apiKeys.create", "-H", f"Cookie: {ck}; csrfToken={cs}", "-H", f"x-csrf-token: {cs}", + "-H", "Content-Type: application/json", "-H", f"Origin: {o}", + data=json.dumps({"name": "drill"}), method="POST") + try: + key = json.loads(out)["data"]["value"] + except Exception: + self.tried = f"POST /api/apiKeys.create -> {code} {out[:120]}" + return None + rc, code, out = self._api(w, sub, "collections.create", {"name": "Drill"}, key) + try: + col = json.loads(out)["data"]["id"] + except Exception: + self.tried = f"POST /api/collections.create -> {code} {out[:120]}" + return None + title, body = "drilldoc-" + secrets.token_hex(4), "drill body " + secrets.token_hex(6) + rc, code, out = self._api(w, sub, "documents.create", + {"title": title, "text": body, "collectionId": col, "publish": True}, key) + try: + did = json.loads(out)["data"]["id"] + except Exception: + self.tried = f"POST /api/documents.create -> {code} {out[:120]}" + return None + say(f" outline: seeded document {title}") + return {"key": key, "id": did, "title": title, "body": body} + + def verify(self, w, sub, t, say): + if not w.wait_app(sub, "/_health", want=("200",), tries=90): + say(" outline: the app never served /_health") + return False + rc, code, _ = self._api(w, sub, "documents.info", {"id": self.ZERO}, t["key"]) + if code != "404": + say(f" outline: READBACK UNUSABLE — an unknown document answered {code}") + return False + rc, code, _ = self._api(w, sub, "documents.info", {"id": t["id"]}, "ol_api_" + secrets.token_hex(19)) + if code != "401": + say(f" outline: READBACK UNUSABLE — a wrong key answered {code}") + return False + rc, code, out = self._api(w, sub, "documents.info", {"id": t["id"]}, t["key"]) + found = code == "200" and t["title"] in (out or "") and t["body"] in (out or "") + say(f" outline: readback of the seeded document http={code} found={found}") + return found + + FIXTURES = { + "sparkyfitness": Sparkyfitness(), + "rallly": Rallly(), + "outline": Outline(), "home-assistant": HomeAssistant(), "romm": Romm(), "vikunja": Vikunja(), diff --git a/scripts/upgrade_fixtures_box28.py b/scripts/upgrade_fixtures_box28.py index 6b28e1b..8e8d80c 100644 --- a/scripts/upgrade_fixtures_box28.py +++ b/scripts/upgrade_fixtures_box28.py @@ -407,8 +407,6 @@ FIXTURES28.update({ "template; it stores no household data"), "plex": NoRoute("plex", "plex", "the first-run claim needs a token minted at plex.tv by a " "real Plex account; no account exists for this venue"), - "outline": NoRoute("outline", "outline", "sign-in requires an external identity provider " - "(OIDC/Slack/Google); no local sign-up route exists"), - "rallly": NoRoute("rallly", "rallly", "sign-in is an e-mail magic link; this venue has no " - "mailbox the harness can read"), + # outline and rallly WERE NoRoute here until 2026-09-30: both have a front-door first-run route after all + # (outline `installation.create`, rallly sign-up + its own e-mail code) — the fixtures are in upgrade_fixtures_box.py. }) From 25ffd89ea6668e0dce6540523215298745e4fd30 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 12:54:11 +0200 Subject: [PATCH 02/46] rallly: PostgreSQL 16 -> 18, converted by the box (R-463) The ONLY image move in this commit. Written by upgrade-test.py --write-ladder from both venues: - bench LXC 9401 (harness v4): converted 16 -> 18 in 21.4 s, check equal over 31 tables, the seeded poll read back, 10-minute memory watch peak 61.6 % (anon), 0 kills, 0 restarts; - box 9202 (controller 0.283.1, the product's guarded Update, drill catalog): converted, done in 32.8 s, PG_VERSION 18, the poll read back through the front door. Undo case on 9202 first: the load failing (adminpack, which 18 lacks) -> undone in 57.5 s, back on 16, the poll read back. Target 18: rallly's own upstream compose runs postgres:18-alpine at /var/lib/postgresql at v4.11.1 (09 decision 42's rule). The data mount moves with the image (pg_mounts_for). Evidence: felhom.eu/documentation/audits/pg-last-six-2026-09-30/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/rallly/.felhom.yml | 8 +++++++- templates/rallly/docker-compose.yml | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/templates/rallly/.felhom.yml b/templates/rallly/.felhom.yml index b4e4018..a1f8c00 100644 --- a/templates/rallly/.felhom.yml +++ b/templates/rallly/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "poll" slug: "rallly" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-07-18" +catalog_since: "2026-09-30" # --- Resource hints (displayed on deploy screen) --- resources: @@ -121,3 +121,9 @@ i18n: label: 'Database password' - env_var: SECRET_PASSWORD label: 'Encryption key' + +# update_ladder — the test record: one tested step per line, oldest first (JSON flow mappings, +# `09-update-architecture.md` §6.4 part 4). WRITTEN BY scripts/upgrade-test.py, never by hand; +# gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. +update_ladder: + - {"from": {"rallly": "lukevella/rallly:4.11.1", "rallly-postgres": "postgres:16-alpine"}, "to": {"rallly": "lukevella/rallly:4.11.1", "rallly-postgres": "postgres:18-alpine"}, "digest": {"rallly": "sha256:b2acb78afb1e2e88445e78cec4393cd8b8cc63f9268cf1defe19f96d0db945b0", "rallly-postgres": "sha256:77f585114c32fbca283dc835b0596f4e52b51b4c6662d7810b2f4084f60a1873"}, "verdict": "proven", "tested_at": "2026-09-30T10:40:06Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/bench/apps/rallly/bench/evidence/MV-rallly/verdict.json", "box_evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/box/rallly/box-verdict-rallly.json", "memory_peak_pct": 61.6, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 68.5, "engine_conversion": {"service": "rallly-postgres", "engine": "postgres", "from": 16, "to": 18}} diff --git a/templates/rallly/docker-compose.yml b/templates/rallly/docker-compose.yml index 67550bb..0072635 100644 --- a/templates/rallly/docker-compose.yml +++ b/templates/rallly/docker-compose.yml @@ -60,7 +60,7 @@ services: - "traefik.http.services.rallly.loadbalancer.server.port=3000" rallly-postgres: - image: postgres:16-alpine + image: postgres:18-alpine container_name: rallly-postgres restart: unless-stopped environment: @@ -69,7 +69,7 @@ services: - POSTGRES_DB=rallly - TZ=Europe/Budapest volumes: - - rallly_postgres_data:/var/lib/postgresql/data + - rallly_postgres_data:/var/lib/postgresql networks: - rallly-internal deploy: From aeb0cd6989c800bbae6272bc34f1aaf675b3a34c Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 12:54:31 +0200 Subject: [PATCH 03/46] outline: PostgreSQL 16 -> 18, converted by the box (R-463) The ONLY image move in this commit. Written by upgrade-test.py --write-ladder from both venues: - bench LXC 9401 (harness v4): converted 16 -> 18 in 26.7 s, check equal over 42 tables, the seeded document read back, 10-minute memory watch peak 48.9 % (anon), 0 kills, 0 restarts; - box 9202 (controller 0.283.1, the product's guarded Update, drill catalog): converted, done in 41.1 s, PG_VERSION 18, the document read back through the front door. Undo case on 9202 first: the load failing (adminpack) -> undone in 57.5 s, back on 16, the document read back. Target 18: Outline's official self-host compose (docs.getoutline.com, Docker) runs postgres:18 at /var/lib/postgresql (09 decision 42's rule); Outline documents PostgreSQL 14+. Evidence: felhom.eu/documentation/audits/pg-last-six-2026-09-30/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/outline/.felhom.yml | 8 +++++++- templates/outline/docker-compose.yml | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/templates/outline/.felhom.yml b/templates/outline/.felhom.yml index 2e1033a..935956e 100644 --- a/templates/outline/.felhom.yml +++ b/templates/outline/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "kb" slug: "outline" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-07-18" +catalog_since: "2026-09-30" # --- Resource hints (displayed on deploy screen) --- resources: @@ -125,3 +125,9 @@ i18n: label: 'Encryption key' - env_var: UTILS_SECRET label: 'Utility key' + +# update_ladder — the test record: one tested step per line, oldest first (JSON flow mappings, +# `09-update-architecture.md` §6.4 part 4). WRITTEN BY scripts/upgrade-test.py, never by hand; +# gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. +update_ladder: + - {"from": {"outline": "outlinewiki/outline:1.9.1", "outline-postgres": "postgres:16-alpine", "outline-redis": "redis:7-alpine"}, "to": {"outline": "outlinewiki/outline:1.9.1", "outline-postgres": "postgres:18-alpine", "outline-redis": "redis:7-alpine"}, "digest": {"outline": "sha256:9fe2cbdceccea0ffb82cbc8dc6f4c0d4ba1d377454e502d5d2bddececb34d4f1", "outline-postgres": "sha256:77f585114c32fbca283dc835b0596f4e52b51b4c6662d7810b2f4084f60a1873", "outline-redis": "sha256:858f009f9709ce576febc734aa78b8f6d624b82571f9ddb6bda4377c833b3499"}, "verdict": "proven", "tested_at": "2026-09-30T10:40:04Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/bench/apps/outline/bench/evidence/MV-outline/verdict.json", "box_evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/box/outline/box-verdict-outline.json", "memory_peak_pct": 48.9, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 65.5, "engine_conversion": {"service": "outline-postgres", "engine": "postgres", "from": 16, "to": 18}} diff --git a/templates/outline/docker-compose.yml b/templates/outline/docker-compose.yml index 15415e4..6dab5a2 100644 --- a/templates/outline/docker-compose.yml +++ b/templates/outline/docker-compose.yml @@ -57,7 +57,7 @@ services: - "traefik.http.services.outline.loadbalancer.server.port=3000" outline-postgres: - image: postgres:16-alpine + image: postgres:18-alpine container_name: outline-postgres restart: unless-stopped environment: @@ -66,7 +66,7 @@ services: - POSTGRES_DB=outline - TZ=Europe/Budapest volumes: - - outline_postgres_data:/var/lib/postgresql/data + - outline_postgres_data:/var/lib/postgresql networks: - outline-internal deploy: From 1666572fd03d42e443a8983b6cec455407388db0 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 12:58:34 +0200 Subject: [PATCH 04/46] sparkyfitness: PostgreSQL 15 -> 18, converted by the box (R-463) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ONLY image move in this commit. Written by upgrade-test.py --write-ladder from both venues: - bench LXC 9401 (harness v4): converted 15 -> 18 in 13.3 s, check equal over 94 tables, the seeded check-in weight read back, 10-minute memory watch peak 31.3 % (anon), 0 kills, 0 restarts; - box 9202 (controller 0.283.1, the product's guarded Update, drill catalog): CONVERTED 15 -> 18 in 9.8 s (2 databases, 94 tables, 261 rows equal), done in 58.5 s, PG_VERSION 18, the weight read back through the front door. Undo case on 9202 (after a reinstall at 15): the load failing (adminpack) -> undone in 74.9 s, back on 15, the weight read back. Target 18: SparkyFitness's own upstream compose pairs v0.17.3 with postgres:18.3-alpine at /var/lib/postgresql (09 decision 42's rule). PGDATA is left as it was (/var/lib/postgresql/data/pgdata), now a folder inside the moved volume — the definition both venues tested. Only the header comment changes beside the image and its mount. Evidence: felhom.eu/documentation/audits/pg-last-six-2026-09-30/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/sparkyfitness/.felhom.yml | 8 +++++++- templates/sparkyfitness/docker-compose.yml | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/templates/sparkyfitness/.felhom.yml b/templates/sparkyfitness/.felhom.yml index 3454edb..42dd900 100644 --- a/templates/sparkyfitness/.felhom.yml +++ b/templates/sparkyfitness/.felhom.yml @@ -9,7 +9,7 @@ subdomain: "sparky" slug: "sparkyfitness" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-07-18" +catalog_since: "2026-09-30" resources: mem_request: "400M" @@ -140,3 +140,9 @@ i18n: label: 'Application database password' - env_var: BETTER_AUTH_SECRET label: 'Session signing key' + +# update_ladder — the test record: one tested step per line, oldest first (JSON flow mappings, +# `09-update-architecture.md` §6.4 part 4). WRITTEN BY scripts/upgrade-test.py, never by hand; +# gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. +update_ladder: + - {"from": {"sparkyfitness-db": "postgres:15-alpine", "sparkyfitness-server": "codewithcj/sparkyfitness_server:v0.17.3", "sparkyfitness-frontend": "codewithcj/sparkyfitness:v0.17.3"}, "to": {"sparkyfitness-db": "postgres:18-alpine", "sparkyfitness-server": "codewithcj/sparkyfitness_server:v0.17.3", "sparkyfitness-frontend": "codewithcj/sparkyfitness:v0.17.3"}, "digest": {"sparkyfitness-db": "sha256:77f585114c32fbca283dc835b0596f4e52b51b4c6662d7810b2f4084f60a1873", "sparkyfitness-frontend": "sha256:46d90e46bd87312fcbbbb05036d99e4cb1c821e928b0516ee727de4c3c90752b", "sparkyfitness-server": "sha256:6aa7d9832324ea403be144a26398a82afbf04abbb4da89f9d04ba61838516b3f"}, "verdict": "proven", "tested_at": "2026-09-30T10:38:51Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/bench/apps/sparkyfitness/bench/evidence/MV-sparkyfitness/verdict.json", "box_evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/box/sparkyfitness/box-verdict-sparkyfitness.json", "memory_peak_pct": 31.3, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 35.1, "engine_conversion": {"service": "sparkyfitness-db", "engine": "postgres", "from": 15, "to": 18}} diff --git a/templates/sparkyfitness/docker-compose.yml b/templates/sparkyfitness/docker-compose.yml index efc5f2f..3c42792 100644 --- a/templates/sparkyfitness/docker-compose.yml +++ b/templates/sparkyfitness/docker-compose.yml @@ -1,6 +1,6 @@ # SparkyFitness - Táplálkozás- és edzéskövető # Domain: ${SUBDOMAIN}.${DOMAIN} -# Database: PostgreSQL 15 (dedicated) +# Database: PostgreSQL 18 (dedicated; its datadir stays at PGDATA=/var/lib/postgresql/data/pgdata inside the volume) # RAM: ~400M (mem_limit: 1792M) | Pi-compatible: No # # Topology: frontend (nginx SPA, :80) proxies /api,/uploads internally to @@ -17,7 +17,7 @@ services: sparkyfitness-db: - image: postgres:15-alpine + image: postgres:18-alpine container_name: sparkyfitness-db restart: unless-stopped environment: @@ -27,7 +27,7 @@ services: - PGDATA=/var/lib/postgresql/data/pgdata - TZ=Europe/Budapest volumes: - - sparkyfitness_db_data:/var/lib/postgresql/data + - sparkyfitness_db_data:/var/lib/postgresql networks: - sparkyfitness-internal deploy: From 54ca055efd59a3d2b7d8b61a7e5a4ae42eef8640 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 13:14:12 +0200 Subject: [PATCH 05/46] bookstack: 26.05.5 -> 26.09.1 (within the line), both venues proven (R-462, Part F) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ONLY image move in this commit. Written by upgrade-test.py --write-ladder: - bench LXC 9401 (harness v4, the bench's own BookStack fixture): FROM settled, the seeded admin read back, migrations ran, read back after, 10-minute memory watch peak 43.7 % (anon), 0 kills, 0 restarts; the abort (old image back) starts and serves the data; - box 9202 (controller 0.283.1, the product's guarded Update, drill catalog): done in 64.6 s, the seeded admin read back through the app's own CLI. The superseded step keeps its definition at steps/fdb7afbec5ea4dbc.{yml,felhom.yml} (09 §6.4 part 5). The database half only, as before (R-460). MariaDB 12.3 does not move. Evidence: felhom.eu/documentation/audits/pg-last-six-2026-09-30/F/ and .../box/bookstack/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/bookstack/.felhom.yml | 3 +- templates/bookstack/docker-compose.yml | 2 +- .../steps/fdb7afbec5ea4dbc.felhom.yml | 129 ++++++++++++++++++ .../bookstack/steps/fdb7afbec5ea4dbc.yml | 90 ++++++++++++ 4 files changed, 222 insertions(+), 2 deletions(-) create mode 100644 templates/bookstack/steps/fdb7afbec5ea4dbc.felhom.yml create mode 100644 templates/bookstack/steps/fdb7afbec5ea4dbc.yml diff --git a/templates/bookstack/.felhom.yml b/templates/bookstack/.felhom.yml index e351dc9..c6ab3a5 100644 --- a/templates/bookstack/.felhom.yml +++ b/templates/bookstack/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "wiki" slug: "bookstack" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-09-22" +catalog_since: "2026-09-30" # --- Resource hints (displayed on deploy screen) --- resources: @@ -133,3 +133,4 @@ i18n: # gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. update_ladder: - {"from": {"bookstack": "lscr.io/linuxserver/bookstack:26.05.2", "bookstack-db": "mariadb:12.3"}, "to": {"bookstack": "lscr.io/linuxserver/bookstack:26.05.5", "bookstack-db": "mariadb:12.3"}, "digest": {"bookstack": "sha256:189c796273469115cf810e53f450e15b93184018e4728cd65fcaef8aa93584bc", "bookstack-db": "sha256:805c8e104bd563d5bfa24fadd3f31cd419ea859cb5277f32b5dbf2db714f9ed1"}, "verdict": "proven", "tested_at": "2026-09-21T18:25:39.453490+00:00", "harness_version": 1, "evidence": "felhom.eu/documentation/audits/update-night-2026-09-21/apps/bookstack/verdict.json", "memory_peak_pct": null, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "backfilled": "2026-09-23", "note": "backfilled from catalog commit ac4828f; box walk only (harness v1, no memory watch); digest = what the registry served on 2026-09-23, not a measurement of the tested image"} + - {"from": {"bookstack": "lscr.io/linuxserver/bookstack:26.05.5", "bookstack-db": "mariadb:12.3"}, "to": {"bookstack": "lscr.io/linuxserver/bookstack:26.09.1", "bookstack-db": "mariadb:12.3"}, "digest": {"bookstack": "sha256:99cd1f5707c1911afad213adec5c9739763b76f843d1477142231834ecdcb6f7", "bookstack-db": "sha256:805c8e104bd563d5bfa24fadd3f31cd419ea859cb5277f32b5dbf2db714f9ed1"}, "verdict": "proven", "tested_at": "2026-09-30T11:09:02Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/F/apps/bookstack/bench/evidence/MV-bookstack/verdict.json", "box_evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/box/bookstack/box-verdict-bookstack.json", "memory_peak_pct": 43.7, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 58.3} diff --git a/templates/bookstack/docker-compose.yml b/templates/bookstack/docker-compose.yml index 35e3e21..c9f60b4 100644 --- a/templates/bookstack/docker-compose.yml +++ b/templates/bookstack/docker-compose.yml @@ -10,7 +10,7 @@ services: bookstack: - image: lscr.io/linuxserver/bookstack:26.05.5 + image: lscr.io/linuxserver/bookstack:26.09.1 container_name: bookstack restart: unless-stopped depends_on: diff --git a/templates/bookstack/steps/fdb7afbec5ea4dbc.felhom.yml b/templates/bookstack/steps/fdb7afbec5ea4dbc.felhom.yml new file mode 100644 index 0000000..e192d18 --- /dev/null +++ b/templates/bookstack/steps/fdb7afbec5ea4dbc.felhom.yml @@ -0,0 +1,129 @@ +# ============================================================================= +# .felhom.yml - App metadata for felhom-controller +# ============================================================================= + +# --- Display info (shown on dashboard) --- +display_name: "BookStack" +description: "Egyszerű, könyv-szerű wiki és dokumentáció platform" +category: "productivity" +subdomain: "wiki" +slug: "bookstack" +# catalog_since: the date THIS repo last changed this app's pinned images. Any commit that +# changes an image: line must set this to the same day (see CLAUDE.md). +catalog_since: "2026-09-22" + +# --- Resource hints (displayed on deploy screen) --- +resources: + mem_request: "150M" + mem_limit: "512M" + pi_compatible: true + needs_hdd: false + +# --- Deploy fields (first deployment only) --- +deploy_fields: + - env_var: DOMAIN + label: "Domain" + type: domain + description: "A szerver domain neve" + locked_after_deploy: true + + - env_var: SUBDOMAIN + label: "Aldomain" + type: subdomain + default: "wiki" + required: true + locked_after_deploy: true + description: "Az alkalmazás aldomainje" + + - env_var: APP_KEY + label: "Alkalmazás kulcs" + type: secret + generate: "base64key:32" + locked_after_deploy: true + + - env_var: DB_PASSWORD + label: "Adatbázis jelszó" + type: secret + generate: "password:24" + locked_after_deploy: true + + # `09` §3 decision 45: BookStack starts with admin@admin.com / password. The box replaces that password with + # this generated one right after the install (after_install below); the app page shows it as the first password. + - env_var: ADMIN_PASSWORD + label: "Admin jelszó (admin@admin.com)" + type: password + generate: "password:24" + description: "Az első bejelentkezéshez: admin@admin.com és ez a jelszó. Utána a profilodban módosítható." + locked_after_deploy: true + +# --- App info (info page content) --- +app_info: + tagline: "Egyszerű wiki platform - polcok, könyvek, fejezetek és oldalak" + default_creds: "admin@admin.com / password" + docs_url: "https://www.bookstackapp.com/docs/" + + use_cases: + - 'Családi tudásbázis - receptek, kézikönyvek, szabályok' + - 'Projekt dokumentáció strukturált formában' + - 'Könyv > Fejezet > Oldal hierarchia az áttekinthetőségért' + - 'Teljes szöveges keresés és címkék' + - 'WYSIWYG és Markdown szerkesztő' + + first_steps: + - 'Nyisd meg a wiki.DOMAIN címet a böngészőben' + - 'Jelentkezz be: admin@admin.com és a Beállítások oldalon látható első jelszó' + - 'Változtasd meg az admin email címét a sajátodra' + - 'Hozd létre az első polcot és könyvet' + - 'Kezdj el írni!' + + +# --- After a fresh install (controller >= 0.279.0, decision 45) --- +# BookStack's OWN artisan command updates the initial admin in place. Measured on 9202 2026-09-28: afterwards +# admin@admin.com / password no longer logs in, the generated password does. +after_install: + service: bookstack + env: [ADMIN_PASSWORD] + command: ["php", "/app/www/artisan", "bookstack:create-admin", "--email=admin@admin.com", "--name=Admin", "--password=${ADMIN_PASSWORD}", "--initial"] + success: "The default admin user has been updated" + +# --- Controller-side health probe --- +healthcheck: + checks: + - type: http + port: 80 + +# --- English copy (localisation slice 5, R-560) -------------------------------------------- +# The Hungarian above is UNCHANGED. A box on English reads this block field by field; a missing +# field shows the Hungarian one; a controller older than 0.257.0 ignores the block entirely. +i18n: + en: + description: 'A simple, book-shaped wiki and documentation platform' + app_info: + tagline: 'A simple wiki platform - shelves, books, chapters and pages' + default_creds: 'admin@admin.com / password' + use_cases: + - 'A family knowledge base - recipes, manuals, house rules' + - 'Project documentation with a structure you can follow' + - 'Book > Chapter > Page, so a large set stays readable' + - 'Full text search and tags' + - 'A visual editor and a Markdown editor' + first_steps: + - 'Open wiki.DOMAIN in your browser' + - 'Sign in: admin@admin.com and the first password shown on the settings page' + - 'Change the admin e-mail address to your own' + - 'Create your first shelf and book' + - 'Start writing' + deploy_fields: + - env_var: DOMAIN + label: 'Domain' + description: 'The server domain name' + - env_var: SUBDOMAIN + label: 'Subdomain' + description: 'The subdomain this app answers on' + - env_var: DB_PASSWORD + label: 'Database password' + - env_var: APP_KEY + label: 'Application key' + - env_var: ADMIN_PASSWORD + label: 'Admin password (admin@admin.com)' + description: 'For the first sign-in: admin@admin.com and this password. Change it in your profile afterwards.' diff --git a/templates/bookstack/steps/fdb7afbec5ea4dbc.yml b/templates/bookstack/steps/fdb7afbec5ea4dbc.yml new file mode 100644 index 0000000..35e3e21 --- /dev/null +++ b/templates/bookstack/steps/fdb7afbec5ea4dbc.yml @@ -0,0 +1,90 @@ +# BookStack - Egyszerű, könyv-szerű wiki és dokumentáció platform +# Domain: ${SUBDOMAIN}.${DOMAIN} +# Database: mariadb +# RAM: ~150M (mem_limit: 512M) | Pi-compatible: Yes +# +# Environment variables: +# DOMAIN - Your domain (e.g., demo-felhom.eu) +# DB_PASSWORD - Adatbázis jelszó (auto-generated) +# APP_KEY - Laravel application key (auto-generated) + +services: + bookstack: + image: lscr.io/linuxserver/bookstack:26.05.5 + container_name: bookstack + restart: unless-stopped + depends_on: + bookstack-db: + condition: service_healthy + environment: + - TZ=Europe/Budapest + - PUID=1000 + - PGID=1000 + - DB_HOST=bookstack-db + - DB_PORT=3306 + - DB_USERNAME=bookstack + - DB_PASSWORD=${DB_PASSWORD} + - DB_DATABASE=bookstack + - APP_KEY=${APP_KEY} + - APP_URL=https://${SUBDOMAIN}.${DOMAIN} + volumes: + - bookstack_config:/config + networks: + - traefik-public + - bookstack-internal + deploy: + resources: + limits: + memory: 512M + healthcheck: + test: ["CMD", "curl", "-f", "http://127.0.0.1:80"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 30s + labels: + - "traefik.enable=true" + - "traefik.http.routers.bookstack.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)" + - "traefik.http.routers.bookstack.entrypoints=websecure" + - "traefik.http.routers.bookstack.tls=true" + - "traefik.http.routers.bookstack.tls.certresolver=letsencrypt" + - "traefik.http.services.bookstack.loadbalancer.server.port=80" + + bookstack-db: + image: mariadb:12.3 + container_name: bookstack-db + restart: unless-stopped + environment: + - MYSQL_ROOT_PASSWORD=${DB_PASSWORD} + - MYSQL_DATABASE=bookstack + - MYSQL_USER=bookstack + - MYSQL_PASSWORD=${DB_PASSWORD} + - TZ=Europe/Budapest + # MARIADB_AUTO_UPGRADE: on a MAJOR engine move the engine converts its own datadir (~7 s on a + # small DB, backs its system tables up first). Operator ruling 2026-09-13 on + # felhom.eu/documentation/audits/SPIKE-r459-mariadb-upgrade-2026-09-06.md. Inert until a + # major moves — and none may, until Slice 4 (R-448) ships: see CLAUDE.md, engine-major rule. + - MARIADB_AUTO_UPGRADE=1 + volumes: + - bookstack_db_data:/var/lib/mysql + networks: + - bookstack-internal + deploy: + resources: + limits: + memory: 256M + healthcheck: + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 20s + +volumes: + bookstack_config: + bookstack_db_data: + +networks: + traefik-public: + external: true + bookstack-internal: From d75d1fd52480bcdb67d2789c1b72ae23fcb1b9e4 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 13:27:45 +0200 Subject: [PATCH 06/46] kimai: apache-2.57.0 -> 2.67.0 (within major 2), both venues proven (R-462, Part F) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ONLY image move in this commit. Upstream stopped the `apache-` tag prefix after 2.57.0; MEASURED 2026-09-30 on Docker Hub: `2.67.0`, `2`, `stable` and `apache` all resolve to ONE digest (sha256:3084f1e5…), while `fpm`/`latest` are another — so the plain tag IS the Apache variant. Written by upgrade-test.py --write-ladder: - bench LXC 9401 (harness v4, box fixture Kimai via boxport): the seeded user read back before and after, Doctrine migrations ran (to Version20260804090000), 10-minute memory watch: kimai anon 6.0 % (cgroup 91.7 % = file cache, decision 22), kimai-db anon 45.0 %, 0 kills, 0 restarts; the abort starts and serves the data; - box 9202 (controller 0.283.1, the product's guarded Update, drill catalog): done in 82.1 s, the seeded user read back through the app's own CLI. The superseded step keeps its definition at steps/def18c0c25cf49f7.{yml,felhom.yml}. Evidence: felhom.eu/documentation/audits/pg-last-six-2026-09-30/F/ and .../box/kimai/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/kimai/.felhom.yml | 3 +- templates/kimai/docker-compose.yml | 2 +- .../kimai/steps/def18c0c25cf49f7.felhom.yml | 115 ++++++++++++++++++ templates/kimai/steps/def18c0c25cf49f7.yml | 85 +++++++++++++ 4 files changed, 203 insertions(+), 2 deletions(-) create mode 100644 templates/kimai/steps/def18c0c25cf49f7.felhom.yml create mode 100644 templates/kimai/steps/def18c0c25cf49f7.yml diff --git a/templates/kimai/.felhom.yml b/templates/kimai/.felhom.yml index 70e3919..07c6c0a 100644 --- a/templates/kimai/.felhom.yml +++ b/templates/kimai/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "time" slug: "kimai" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-09-23" +catalog_since: "2026-09-30" # --- Resource hints (displayed on deploy screen) --- resources: @@ -119,3 +119,4 @@ i18n: # gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. update_ladder: - {"from": {"kimai": "kimai/kimai2:apache-2.57.0", "kimai-db": "mariadb:11.6"}, "to": {"kimai": "kimai/kimai2:apache-2.57.0", "kimai-db": "mariadb:11.8"}, "digest": {"kimai": "sha256:efa66c5eadf948b94d8031e9436feae491d90b2ceaa3d5e45e4d7c1a59dd8c38", "kimai-db": "sha256:79d59758afc91b89b120b0a8904d637f5a3b3e1c4900f29b740d6d46c72fef68"}, "verdict": "proven", "tested_at": "2026-09-23T19:58:59Z", "harness_version": 3, "evidence": "felhom.eu/documentation/audits/night-2026-09-23/apps/kimai/bench/evidence/MV-kimai/verdict.json", "box_evidence": "felhom.eu/documentation/audits/night-2026-09-23/apps/kimai/verdict.json", "memory_peak_pct": 37.9, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 100.0} + - {"from": {"kimai": "kimai/kimai2:apache-2.57.0", "kimai-db": "mariadb:11.8"}, "to": {"kimai": "kimai/kimai2:2.67.0", "kimai-db": "mariadb:11.8"}, "digest": {"kimai": "sha256:3084f1e5ecdc10afafc193911039a06cdabda4473f3a48d62edbe460e3c154ee", "kimai-db": "sha256:79d59758afc91b89b120b0a8904d637f5a3b3e1c4900f29b740d6d46c72fef68"}, "verdict": "proven", "tested_at": "2026-09-30T11:25:04Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/F/apps/kimai/bench/evidence/MV-kimai/verdict.json", "box_evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/box/kimai/box-verdict-kimai.json", "memory_peak_pct": 45.0, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 91.7} diff --git a/templates/kimai/docker-compose.yml b/templates/kimai/docker-compose.yml index 8c27459..8ddafb4 100644 --- a/templates/kimai/docker-compose.yml +++ b/templates/kimai/docker-compose.yml @@ -11,7 +11,7 @@ services: kimai: - image: kimai/kimai2:apache-2.57.0 + image: kimai/kimai2:2.67.0 container_name: kimai restart: unless-stopped depends_on: diff --git a/templates/kimai/steps/def18c0c25cf49f7.felhom.yml b/templates/kimai/steps/def18c0c25cf49f7.felhom.yml new file mode 100644 index 0000000..a48deec --- /dev/null +++ b/templates/kimai/steps/def18c0c25cf49f7.felhom.yml @@ -0,0 +1,115 @@ +# ============================================================================= +# .felhom.yml - App metadata for felhom-controller +# ============================================================================= + +# --- Display info (shown on dashboard) --- +display_name: "Kimai" +description: "Időkövetés és projektmenedzsment" +category: "productivity" +subdomain: "time" +slug: "kimai" +# catalog_since: the date THIS repo last changed this app's pinned images. Any commit that +# changes an image: line must set this to the same day (see CLAUDE.md). +catalog_since: "2026-09-23" + +# --- Resource hints (displayed on deploy screen) --- +resources: + mem_request: "100M" + mem_limit: "384M" + pi_compatible: true + needs_hdd: false + +# --- Deploy fields (first deployment only) --- +deploy_fields: + - env_var: DOMAIN + label: "Domain" + type: domain + description: "A szerver domain neve" + locked_after_deploy: true + + - env_var: SUBDOMAIN + label: "Aldomain" + type: subdomain + default: "time" + required: true + locked_after_deploy: true + description: "Az alkalmazás aldomainje" + + - env_var: DB_PASSWORD + label: "Adatbázis jelszó" + type: secret + generate: "password:24" + locked_after_deploy: true + + - env_var: ADMIN_EMAIL + label: "Admin email" + type: text + default: "admin@example.com" + + - env_var: ADMIN_PASSWORD + label: "Admin jelszó" + type: password + generate: "password:16" + description: "Első bejelentkezéshez. Utána a webes felületen módosítható." + locked_after_deploy: false + +# --- App info (info page content) --- +app_info: + tagline: "Időkövetés - projektek, ügyfelek és munkaidő nyilvántartás" + default_creds: "(telepítéskor megadott admin email és jelszó)" + docs_url: "https://www.kimai.org/documentation/" + + use_cases: + - 'Munkaidő nyilvántartás projektekre és ügyfelekre bontva' + - 'Stopper-szerű időmérés egy kattintással' + - 'Riportok és exportálás (PDF, CSV, Excel)' + - 'Költségek és számlázás nyilvántartás' + - 'Több felhasználó csapat szintű jogosultságokkal' + + first_steps: + - 'Nyisd meg a time.DOMAIN címet a böngészőben' + - 'Jelentkezz be a telepítéskor megadott admin adatokkal' + - 'Hozd létre az első ügyfelet és projektet' + - 'Indítsd el az időmérést' + + +# --- Controller-side health probe --- +healthcheck: + checks: + - type: http + port: 8001 + +# --- English copy (localisation slice 5, R-560) -------------------------------------------- +# The Hungarian above is UNCHANGED. A box on English reads this block field by field; a missing +# field shows the Hungarian one; a controller older than 0.257.0 ignores the block entirely. +i18n: + en: + description: 'Time tracking and project management' + app_info: + tagline: 'Time tracking - projects, clients and hours worked' + default_creds: '(the admin e-mail and password you set at install time)' + use_cases: + - 'Record hours worked, split by project and client' + - 'A stopwatch you start with one click' + - 'Reports and export (PDF, CSV, Excel)' + - 'Keep track of costs and invoicing' + - 'Several people, with team-level permissions' + first_steps: + - 'Open time.DOMAIN in your browser' + - 'Sign in with the admin details you set at install time' + - 'Create your first client and project' + - 'Start the timer' + deploy_fields: + - env_var: DOMAIN + label: 'Domain' + description: 'The server domain name' + - env_var: SUBDOMAIN + label: 'Subdomain' + description: 'The subdomain this app answers on' + - env_var: DB_PASSWORD + label: 'Database password' + - env_var: ADMIN_EMAIL + label: 'Admin e-mail' + - env_var: ADMIN_PASSWORD + label: 'Admin password' + description: 'For the first sign-in. You can change it in the app afterwards.' diff --git a/templates/kimai/steps/def18c0c25cf49f7.yml b/templates/kimai/steps/def18c0c25cf49f7.yml new file mode 100644 index 0000000..8c27459 --- /dev/null +++ b/templates/kimai/steps/def18c0c25cf49f7.yml @@ -0,0 +1,85 @@ +# Kimai - Időkövetés és projektmenedzsment +# Domain: ${SUBDOMAIN}.${DOMAIN} +# Database: mariadb +# RAM: ~100M (mem_limit: 384M) | Pi-compatible: Yes +# +# Environment variables: +# DOMAIN - Your domain (e.g., demo-felhom.eu) +# DB_PASSWORD - Adatbázis jelszó (auto-generated) +# ADMIN_EMAIL - Admin email +# ADMIN_PASSWORD - Admin jelszó (auto-generated) + +services: + kimai: + image: kimai/kimai2:apache-2.57.0 + container_name: kimai + restart: unless-stopped + depends_on: + kimai-db: + condition: service_healthy + environment: + - TZ=Europe/Budapest + - DATABASE_URL=mysql://kimai:${DB_PASSWORD}@kimai-db:3306/kimai?charset=utf8mb4&serverVersion=11.6.2-MariaDB + - ADMINMAIL=${ADMIN_EMAIL:-admin@example.com} + - ADMINPASS=${ADMIN_PASSWORD} + volumes: + - kimai_var:/opt/kimai/var + networks: + - traefik-public + - kimai-internal + deploy: + resources: + limits: + memory: 384M + healthcheck: + test: ["CMD", "curl", "-f", "http://127.0.0.1:8001"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 30s + labels: + - "traefik.enable=true" + - "traefik.http.routers.kimai.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)" + - "traefik.http.routers.kimai.entrypoints=websecure" + - "traefik.http.routers.kimai.tls=true" + - "traefik.http.routers.kimai.tls.certresolver=letsencrypt" + - "traefik.http.services.kimai.loadbalancer.server.port=8001" + + kimai-db: + image: mariadb:11.8 + container_name: kimai-db + restart: unless-stopped + environment: + - MYSQL_ROOT_PASSWORD=${DB_PASSWORD} + - MYSQL_DATABASE=kimai + - MYSQL_USER=kimai + - MYSQL_PASSWORD=${DB_PASSWORD} + - TZ=Europe/Budapest + # MARIADB_AUTO_UPGRADE: on a MAJOR engine move the engine converts its own datadir (~7 s on a + # small DB, backs its system tables up first). Operator ruling 2026-09-13 on + # felhom.eu/documentation/audits/SPIKE-r459-mariadb-upgrade-2026-09-06.md. Inert until a + # major moves — and none may, until Slice 4 (R-448) ships: see CLAUDE.md, engine-major rule. + - MARIADB_AUTO_UPGRADE=1 + volumes: + - kimai_db_data:/var/lib/mysql + networks: + - kimai-internal + deploy: + resources: + limits: + memory: 256M + healthcheck: + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 20s + +volumes: + kimai_db_data: + kimai_var: + +networks: + traefik-public: + external: true + kimai-internal: From 7425ebd6b2df76969210c02c96bd1b6c5b067b11 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 14:11:57 +0200 Subject: [PATCH 07/46] audiobookshelf: within-major step, both venues proven (R-462, Part F) {'audiobookshelf': 'ghcr.io/advplyr/audiobookshelf:2.36.1'} -> {'audiobookshelf': 'ghcr.io/advplyr/audiobookshelf:2.37.1'} The ONLY image move in this commit. Written by upgrade-test.py --write-ladder (gates rc=0): - bench LXC 9401 (harness v4): the seed read back before and after; 10-minute memory watch: audiobookshelf anon 10.5 % | migration: [2Kaudiobookshelf | [2026-09-30 13:52:16.057] INFO: [MigrationManager] No migr; 0 kills, 0 restarts; the abort starts and serves the data; - box 9202 (controller 0.283.1, the product's guarded Update, drill catalog): done in 24.6 s, the seed read back through the app's own front door. Evidence: felhom.eu/documentation/audits/pg-last-six-2026-09-30/F/ and .../box/audiobookshelf/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/audiobookshelf/.felhom.yml | 3 +- templates/audiobookshelf/docker-compose.yml | 2 +- .../steps/8db6e47fe3ce3a65.felhom.yml | 133 ++++++++++++++++++ .../audiobookshelf/steps/8db6e47fe3ce3a65.yml | 61 ++++++++ 4 files changed, 197 insertions(+), 2 deletions(-) create mode 100644 templates/audiobookshelf/steps/8db6e47fe3ce3a65.felhom.yml create mode 100644 templates/audiobookshelf/steps/8db6e47fe3ce3a65.yml diff --git a/templates/audiobookshelf/.felhom.yml b/templates/audiobookshelf/.felhom.yml index 4fa4ea4..67b8fc8 100644 --- a/templates/audiobookshelf/.felhom.yml +++ b/templates/audiobookshelf/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "audiobooks" slug: "audiobookshelf" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-09-22" +catalog_since: "2026-09-30" # --- Resource hints (displayed on deploy screen) --- resources: @@ -137,3 +137,4 @@ i18n: # gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. update_ladder: - {"from": {"audiobookshelf": "ghcr.io/advplyr/audiobookshelf:2.35.1"}, "to": {"audiobookshelf": "ghcr.io/advplyr/audiobookshelf:2.36.1"}, "digest": {"audiobookshelf": "sha256:3528a93b6442ffe54bd46771bbbab7c97084e1101071586d9dc2254f30bb4358"}, "verdict": "proven", "tested_at": "2026-09-21T18:44:43.824636+00:00", "harness_version": 1, "evidence": "felhom.eu/documentation/audits/update-night-2026-09-21/apps/audiobookshelf/verdict.json", "memory_peak_pct": null, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "backfilled": "2026-09-23", "note": "backfilled from catalog commit 6525b8e; box walk only (harness v1, no memory watch); digest = what the registry served on 2026-09-23, not a measurement of the tested image"} + - {"from": {"audiobookshelf": "ghcr.io/advplyr/audiobookshelf:2.36.1"}, "to": {"audiobookshelf": "ghcr.io/advplyr/audiobookshelf:2.37.1"}, "digest": {"audiobookshelf": "sha256:581d68b2a6fc7ebf58d81c878a9f387cbbc0d88ac9d37b298b9cee10168af85b"}, "verdict": "proven", "tested_at": "2026-09-30T12:03:23Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/F/apps/audiobookshelf/bench/evidence/MV-audiobookshelf/verdict.json", "box_evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/box/audiobookshelf/box-verdict-audiobookshelf.json", "memory_peak_pct": 10.5, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 14.0} diff --git a/templates/audiobookshelf/docker-compose.yml b/templates/audiobookshelf/docker-compose.yml index a41a7b1..e817654 100644 --- a/templates/audiobookshelf/docker-compose.yml +++ b/templates/audiobookshelf/docker-compose.yml @@ -17,7 +17,7 @@ services: audiobookshelf: - image: ghcr.io/advplyr/audiobookshelf:2.36.1 + image: ghcr.io/advplyr/audiobookshelf:2.37.1 container_name: audiobookshelf restart: unless-stopped # Runs as root (see note above). Restore an escalation boundary: block SUID-based privilege diff --git a/templates/audiobookshelf/steps/8db6e47fe3ce3a65.felhom.yml b/templates/audiobookshelf/steps/8db6e47fe3ce3a65.felhom.yml new file mode 100644 index 0000000..e884a06 --- /dev/null +++ b/templates/audiobookshelf/steps/8db6e47fe3ce3a65.felhom.yml @@ -0,0 +1,133 @@ +# ============================================================================= +# .felhom.yml - App metadata for felhom-controller +# ============================================================================= + +# --- Display info (shown on dashboard) --- +display_name: "Audiobookshelf" +description: "Hangoskönyv és podcast kezelő szerver" +category: "media" +subdomain: "audiobooks" +slug: "audiobookshelf" +# catalog_since: the date THIS repo last changed this app's pinned images. Any commit that +# changes an image: line must set this to the same day (see CLAUDE.md). +catalog_since: "2026-09-22" + +# --- Resource hints (displayed on deploy screen) --- +resources: + mem_request: "100M" + mem_limit: "512M" + pi_compatible: true + needs_hdd: true + +# --- Backup classification (referential coupling; see felhom.eu documentation/audits/SPIKE-backup-classification-2026-07-14.md) --- +backup: + userdata: + - path: media/audiobooks + class: optional # PENDING-VETO: spike chose excluded; ruled optional for consistency + # with komga/romm (curated, often personally ripped — precious). + # If Viktor rules excluded, flip THIS LINE ONLY before committing. + - path: media/podcasts + class: excluded # re-downloadable by definition + +# --- Deploy fields (first deployment only) --- +deploy_fields: + - env_var: DOMAIN + label: "Domain" + type: domain + description: "A szerver domain neve" + locked_after_deploy: true + + - env_var: SUBDOMAIN + label: "Aldomain" + type: subdomain + default: "audiobooks" + required: true + locked_after_deploy: true + description: "Az alkalmazás aldomainje" + + - env_var: HDD_PATH + label: "Hangoskönyv tár útvonal" + type: path + required: true + placeholder: "/mnt/felhom-drives/hdd_1" + description: "A külső merevlemez elérési útja" + locked_after_deploy: true + + +# --- The setup gate (controller >= 0.280.0, `09` §3 decision 46) --- +# The first visitor would create the admin. So a fresh install is closed to everyone but the household (a browser +# signed in to the dashboard) until the first setup is done; audiobookshelf's own status says so (`/status` isInit — upstream, measured on 9202 by the +# 2026-09-29 live proof). +setup_gate: true +# measured on 9202 2026-09-29: isInit false -> true after POST /init; the gate opened ~20 s later (audits/login-gate-2026-09-29/C). +setup_done_probe: + url: http://audiobookshelf:80/status + field: isInit + done: "true" + +# --- App info (info page content) --- +app_info: + tagline: "Hangoskönyv és podcast kezelő, lejátszó és szinkronizáló" + docs_url: "https://www.audiobookshelf.org/docs" + + use_cases: + - 'Hangoskönyvek és podcastok rendszerezése és lejátszása' + - 'Automatikus metaadat letöltés - borítók, leírások, fejezetek' + - 'Folytatás ott, ahol abbahagytad (szinkron eszközök között)' + - 'Podcast feliratkozás és automatikus letöltés' + - 'Dedikált mobil alkalmazások (Android, iOS)' + + first_steps: + - 'Nyisd meg az audiobooks.DOMAIN címet a böngészőben' + - 'Hozd létre az admin fiókot az első megnyitáskor' + - 'Add hozzá a könyvtárakat (/audiobooks és/vagy /podcasts)' + - 'Várd meg az automatikus szkennelést' + - 'Telepítsd az Audiobookshelf alkalmazást a telefonodra' + + prerequisites: + - 'Külső HDD szükséges a hangoskönyvek tárolásához' + - 'Hangoskönyvek mappákba rendezve (pl. Szerző/Könyv/)' + +# --- Controller-side health probe --- +healthcheck: + checks: + - type: api + port: 80 + path: "/healthcheck" + expect: + status: 200 + +# --- English copy (localisation slice 5, R-560) -------------------------------------------- +# The Hungarian above is UNCHANGED. A box on English reads this block field by field; a missing +# field shows the Hungarian one; a controller older than 0.257.0 ignores the block entirely. +i18n: + en: + description: 'An audiobook and podcast server' + app_info: + tagline: 'An audiobook and podcast library, player and sync' + use_cases: + - 'Sort and play your audiobooks and podcasts' + - 'Details arrive on their own - covers, descriptions, chapters' + - 'Carry on where you stopped (it syncs between devices)' + - 'Subscribe to a podcast and let it download itself' + - 'Apps of its own for phones (Android, iOS)' + first_steps: + - 'Open audiobooks.DOMAIN in your browser' + - 'Create the admin account the first time you open it' + - 'Add your libraries (/audiobooks and/or /podcasts)' + - 'Wait for the first scan to finish' + - 'Install the Audiobookshelf app on your phone' + prerequisites: + - 'An external hard drive is needed to keep the audiobooks on' + - 'Audiobooks sorted into folders (Author/Book/, for example)' + deploy_fields: + - env_var: DOMAIN + label: 'Domain' + description: 'The server domain name' + - env_var: SUBDOMAIN + label: 'Subdomain' + description: 'The subdomain this app answers on' + - env_var: HDD_PATH + label: 'Audiobook library path' + description: 'The path to the external hard drive' + placeholder: '/mnt/felhom-drives/hdd_1' diff --git a/templates/audiobookshelf/steps/8db6e47fe3ce3a65.yml b/templates/audiobookshelf/steps/8db6e47fe3ce3a65.yml new file mode 100644 index 0000000..a41a7b1 --- /dev/null +++ b/templates/audiobookshelf/steps/8db6e47fe3ce3a65.yml @@ -0,0 +1,61 @@ +# Audiobookshelf - Hangoskönyv és podcast kezelő szerver +# Domain: ${SUBDOMAIN}.${DOMAIN} +# Database: None (file-based) +# RAM: ~100M (mem_limit: 512M) | Pi-compatible: Yes +# +# Environment variables: +# DOMAIN - Your domain (e.g., demo-felhom.eu) +# USERDATA_PATH - Ügyfél-tartalom gyökér (/userdata) +# +# Storage layout (felhom userdata convention): +# Hangoskönyvek → ${USERDATA_PATH}/media/audiobooks (írható) +# Podcastok → ${USERDATA_PATH}/media/podcasts (írható) +# Run-identity: ROOT (fallback). user "1000:1000" was tried but the image creates its /metadata named +# volume as root at init and fails (`EACCES mkdir /metadata/logs`) when pinned to 1000. So it runs as +# root and relies on the setgid 2775 userdata dirs (files land group 1000 → FileBrowser can browse/read). +# (Verified live; see REPORT.) + +services: + audiobookshelf: + image: ghcr.io/advplyr/audiobookshelf:2.36.1 + container_name: audiobookshelf + restart: unless-stopped + # Runs as root (see note above). Restore an escalation boundary: block SUID-based privilege + # escalation. Full cap_drop is NOT applied — the image's root-init needs file-ownership caps to + # set up /metadata, and dropping them reproduces the EACCES failure we hit pinning user:1000. + security_opt: + - no-new-privileges:true + environment: + - TZ=Europe/Budapest + volumes: + - audiobookshelf_config:/config + - audiobookshelf_metadata:/metadata + - ${USERDATA_PATH}/media/audiobooks:/audiobooks + - ${USERDATA_PATH}/media/podcasts:/podcasts + networks: + - traefik-public + deploy: + resources: + limits: + memory: 512M + healthcheck: + test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:80/healthcheck"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 30s + labels: + - "traefik.enable=true" + - "traefik.http.routers.audiobookshelf.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)" + - "traefik.http.routers.audiobookshelf.entrypoints=websecure" + - "traefik.http.routers.audiobookshelf.tls=true" + - "traefik.http.routers.audiobookshelf.tls.certresolver=letsencrypt" + - "traefik.http.services.audiobookshelf.loadbalancer.server.port=80" + +volumes: + audiobookshelf_config: + audiobookshelf_metadata: + +networks: + traefik-public: + external: true From 9f075a47ce08c5b7d9602d79df31ab8f1475db89 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 14:12:00 +0200 Subject: [PATCH 08/46] n8n: within-major step, both venues proven (R-462, Part F) {'n8n': 'n8nio/n8n:2.41.2'} -> {'n8n': 'n8nio/n8n:2.42.1'} The ONLY image move in this commit. Written by upgrade-test.py --write-ladder (gates rc=0): - bench LXC 9401 (harness v4): the seed read back before and after; 10-minute memory watch: n8n anon 23.0 % | migration: [2Kn8n | Migrations in progress, please do NOT stop the process.; 0 kills, 0 restarts; the abort starts and serves the data; - box 9202 (controller 0.283.1, the product's guarded Update, drill catalog): done in 122.1 s, the seed read back through the app's own front door. Evidence: felhom.eu/documentation/audits/pg-last-six-2026-09-30/F/ and .../box/n8n/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/n8n/.felhom.yml | 3 +- templates/n8n/docker-compose.yml | 2 +- .../n8n/steps/b11b8c2e9771ba0f.felhom.yml | 115 ++++++++++++++++++ templates/n8n/steps/b11b8c2e9771ba0f.yml | 48 ++++++++ 4 files changed, 166 insertions(+), 2 deletions(-) create mode 100644 templates/n8n/steps/b11b8c2e9771ba0f.felhom.yml create mode 100644 templates/n8n/steps/b11b8c2e9771ba0f.yml diff --git a/templates/n8n/.felhom.yml b/templates/n8n/.felhom.yml index c842c9a..8e58269 100644 --- a/templates/n8n/.felhom.yml +++ b/templates/n8n/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "auto" slug: "n8n" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-09-25" +catalog_since: "2026-09-30" # --- Resource hints (displayed on deploy screen) --- resources: @@ -121,3 +121,4 @@ update_ladder: - {"from": {"n8n": "n8nio/n8n:2.31.3"}, "to": {"n8n": "n8nio/n8n:2.40.5"}, "digest": {"n8n": "sha256:9f693fd5565539efd5e75ad168526c8041a6af516d9e50bc4d9cb1c9c5031523"}, "verdict": "proven", "tested_at": "2026-09-21T18:55:28.852396+00:00", "harness_version": 1, "evidence": "felhom.eu/documentation/audits/update-night-2026-09-21/apps/n8n/verdict.json", "memory_peak_pct": null, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "backfilled": "2026-09-23", "note": "backfilled from catalog commit 4132e35; box walk only (harness v1, no memory watch); digest = what the registry served on 2026-09-23, not a measurement of the tested image"} - {"from": {"n8n": "n8nio/n8n:2.40.5"}, "to": {"n8n": "n8nio/n8n:2.41.1"}, "digest": {"n8n": "sha256:52f147bba97908fe58e616738f2f0485696ac7b5670a1baf169ccf1ff3173de7"}, "verdict": "proven", "tested_at": "2026-09-23T19:49:44Z", "harness_version": 3, "evidence": "felhom.eu/documentation/audits/night-2026-09-23/apps/n8n/bench/evidence/MV-n8n/verdict.json", "box_evidence": "felhom.eu/documentation/audits/night-2026-09-23/apps/n8n/verdict.json", "memory_peak_pct": 22.7, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 46.8} - {"from": {"n8n": "n8nio/n8n:2.41.1"}, "to": {"n8n": "n8nio/n8n:2.41.2"}, "digest": {"n8n": "sha256:1419c3c665b02531dd43d815ef62f573aa9b1307962162a08a349dc8a452e8bf"}, "verdict": "proven", "tested_at": "2026-09-24T21:45:14Z", "harness_version": 3, "evidence": "felhom.eu/documentation/audits/night-2026-09-25/E/apps/n8n/bench", "box_evidence": "felhom.eu/documentation/audits/night-2026-09-25/E/apps/n8n/box", "memory_peak_pct": 22.4, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 55.9} + - {"from": {"n8n": "n8nio/n8n:2.41.2"}, "to": {"n8n": "n8nio/n8n:2.42.1"}, "digest": {"n8n": "sha256:e7634e62f766044dc770460db8defdcd84034eb6d767dd6a1101d49fe98f814f"}, "verdict": "proven", "tested_at": "2026-09-30T12:05:01Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/F/apps/n8n/bench/evidence/MV-n8n/verdict.json", "box_evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/box/n8n/box-verdict-n8n.json", "memory_peak_pct": 23.0, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 45.3} diff --git a/templates/n8n/docker-compose.yml b/templates/n8n/docker-compose.yml index 2c45c5a..11fd431 100644 --- a/templates/n8n/docker-compose.yml +++ b/templates/n8n/docker-compose.yml @@ -9,7 +9,7 @@ services: n8n: - image: n8nio/n8n:2.41.2 + image: n8nio/n8n:2.42.1 container_name: n8n restart: unless-stopped environment: diff --git a/templates/n8n/steps/b11b8c2e9771ba0f.felhom.yml b/templates/n8n/steps/b11b8c2e9771ba0f.felhom.yml new file mode 100644 index 0000000..558f21e --- /dev/null +++ b/templates/n8n/steps/b11b8c2e9771ba0f.felhom.yml @@ -0,0 +1,115 @@ +# ============================================================================= +# .felhom.yml - App metadata for felhom-controller +# ============================================================================= + +# --- Display info (shown on dashboard) --- +display_name: "n8n" +description: "Workflow automatizálás vizuális szerkesztővel" +category: "productivity" +subdomain: "auto" +slug: "n8n" +# catalog_since: the date THIS repo last changed this app's pinned images. Any commit that +# changes an image: line must set this to the same day (see CLAUDE.md). +catalog_since: "2026-09-25" + +# --- Resource hints (displayed on deploy screen) --- +resources: + mem_request: "512M" + mem_limit: "1536M" + pi_compatible: false + needs_hdd: false + +# --- Deploy fields (first deployment only) --- +deploy_fields: + - env_var: DOMAIN + label: "Domain" + type: domain + description: "A szerver domain neve" + locked_after_deploy: true + + - env_var: SUBDOMAIN + label: "Aldomain" + type: subdomain + default: "auto" + required: true + locked_after_deploy: true + description: "Az alkalmazás aldomainje" + + - env_var: N8N_ENCRYPTION_KEY + label: "Titkosítási kulcs" + type: secret + generate: "hex:16" + locked_after_deploy: true + + +# --- The setup gate (controller >= 0.280.0, `09` §3 decision 46) --- +# The first visitor would create the admin. So a fresh install is closed to everyone but the household (a browser +# signed in to the dashboard) until the first setup is done; n8n's own settings say so (measured on 9202 2026-09-29: +# showSetupOnFirstLoad true -> false once the owner exists). +setup_gate: true +# measured on 9202 2026-09-29: showSetupOnFirstLoad true -> false after the owner setup (audits/login-gate-2026-09-29/C). +setup_done_probe: + url: http://n8n:5678/rest/settings + field: data.userManagement.showSetupOnFirstLoad + done: "false" + +# --- App info (info page content) --- +app_info: + tagline: "Vizuális workflow automatizálás - Zapier/IFTTT alternatíva" + docs_url: "https://docs.n8n.io/" + + use_cases: + - 'Alkalmazások összekapcsolása vizuális workflow szerkesztővel' + - 'Automatizálás: email, Telegram, webhook, fájl feldolgozás' + - '400+ integráció (Google, Slack, Notion, GitHub, stb.)' + - 'Időzített feladatok (cron) és webhook triggerek' + - 'AI munkafolyamatok LLM integrációval' + + first_steps: + - 'Nyisd meg az auto.DOMAIN címet a böngészőben' + - 'Hozd létre az admin fiókot' + - 'Próbálj ki egy sablon workflow-t a Template galériából' + - 'Hozd létre az első saját munkafolyamatot' + + prerequisites: + - 'x86 processzor szükséges' + +# --- Controller-side health probe --- +healthcheck: + checks: + - type: api + port: 5678 + path: "/healthz" + expect: + status: 200 + +# --- English copy (localisation slice 5, R-560) -------------------------------------------- +# The Hungarian above is UNCHANGED. A box on English reads this block field by field; a missing +# field shows the Hungarian one; a controller older than 0.257.0 ignores the block entirely. +i18n: + en: + description: 'Workflow automation with a visual editor' + app_info: + tagline: 'Visual workflow automation - a Zapier/IFTTT alternative' + use_cases: + - 'Wire apps together in a visual workflow editor' + - 'Automate e-mail, Telegram, webhooks and file handling' + - '400+ integrations (Google, Slack, Notion, GitHub and more)' + - 'Scheduled jobs (cron) and webhook triggers' + - 'AI workflows with an LLM in them' + first_steps: + - 'Open auto.DOMAIN in your browser' + - 'Create the admin account' + - 'Try a ready-made workflow from the Template gallery' + - 'Build your first workflow of your own' + prerequisites: + - 'An x86 processor is needed' + deploy_fields: + - env_var: DOMAIN + label: 'Domain' + description: 'The server domain name' + - env_var: SUBDOMAIN + label: 'Subdomain' + description: 'The subdomain this app answers on' + - env_var: N8N_ENCRYPTION_KEY + label: 'Encryption key' diff --git a/templates/n8n/steps/b11b8c2e9771ba0f.yml b/templates/n8n/steps/b11b8c2e9771ba0f.yml new file mode 100644 index 0000000..2c45c5a --- /dev/null +++ b/templates/n8n/steps/b11b8c2e9771ba0f.yml @@ -0,0 +1,48 @@ +# n8n - Workflow automatizálás vizuális szerkesztővel +# Domain: ${SUBDOMAIN}.${DOMAIN} +# Database: None (file-based) +# RAM: ~150M (mem_limit: 512M) | Pi-compatible: No +# +# Environment variables: +# DOMAIN - Your domain (e.g., demo-felhom.eu) +# N8N_ENCRYPTION_KEY- Titkosítási kulcs (auto-generated) + +services: + n8n: + image: n8nio/n8n:2.41.2 + container_name: n8n + restart: unless-stopped + environment: + - TZ=Europe/Budapest + - N8N_HOST=${SUBDOMAIN}.${DOMAIN} + - N8N_PROTOCOL=https + - WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN}/ + - N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY} + volumes: + - n8n_data:/home/node/.n8n + networks: + - traefik-public + deploy: + resources: + limits: + memory: 1536M + healthcheck: + test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:5678/healthz"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 30s + labels: + - "traefik.enable=true" + - "traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)" + - "traefik.http.routers.n8n.entrypoints=websecure" + - "traefik.http.routers.n8n.tls=true" + - "traefik.http.routers.n8n.tls.certresolver=letsencrypt" + - "traefik.http.services.n8n.loadbalancer.server.port=5678" + +volumes: + n8n_data: + +networks: + traefik-public: + external: true From 6d91495756c7ea4ea907cfbf1949d56ac88d0de8 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 14:26:43 +0200 Subject: [PATCH 09/46] navidrome: within-major step, both venues proven (R-462, Part F) {'navidrome': 'deluan/navidrome:0.64.1'} -> {'navidrome': 'deluan/navidrome:0.64.2'} The ONLY image move in this commit. Written by upgrade-test.py --write-ladder (catalog gates rc=0): - bench LXC 9401 (harness v4): the seed read back before and after; 10-minute memory watch: navidrome anon 6.9 % (cgroup 9.4 %); 0 kills, 0 restarts; the abort starts and serves the data; - box 9202 (controller 0.283.1, the product's guarded Update, drill catalog): done in 14.4 s, the seed read back through the app's own front door. Evidence: felhom.eu/documentation/audits/pg-last-six-2026-09-30/F/ and .../box/navidrome/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/navidrome/.felhom.yml | 3 +- templates/navidrome/docker-compose.yml | 2 +- .../steps/78af7f781064ba79.felhom.yml | 121 ++++++++++++++++++ .../navidrome/steps/78af7f781064ba79.yml | 51 ++++++++ 4 files changed, 175 insertions(+), 2 deletions(-) create mode 100644 templates/navidrome/steps/78af7f781064ba79.felhom.yml create mode 100644 templates/navidrome/steps/78af7f781064ba79.yml diff --git a/templates/navidrome/.felhom.yml b/templates/navidrome/.felhom.yml index 225e847..54733e8 100644 --- a/templates/navidrome/.felhom.yml +++ b/templates/navidrome/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "music" slug: "navidrome" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-09-23" +catalog_since: "2026-09-30" # --- Resource hints (displayed on deploy screen) --- resources: @@ -126,3 +126,4 @@ i18n: update_ladder: - {"from": {"navidrome": "deluan/navidrome:0.63.2"}, "to": {"navidrome": "deluan/navidrome:0.64.0"}, "digest": {"navidrome": "sha256:a384948b81bd1529986c5960169e7fc4fa00f46bde6bd517971a4c36671db2af"}, "verdict": "proven", "tested_at": "2026-09-21T18:42:51.148860+00:00", "harness_version": 1, "evidence": "felhom.eu/documentation/audits/update-night-2026-09-21/apps/navidrome/verdict.json", "memory_peak_pct": null, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "backfilled": "2026-09-23", "note": "backfilled from catalog commit 7708a04; box walk only (harness v1, no memory watch); digest = what the registry served on 2026-09-23, not a measurement of the tested image"} - {"from": {"navidrome": "deluan/navidrome:0.64.0"}, "to": {"navidrome": "deluan/navidrome:0.64.1"}, "digest": {"navidrome": "sha256:df22d661b8d0322c33754d999b567150df9e131a47ae53be71fed0154bf8cef5"}, "verdict": "proven", "tested_at": "2026-09-23T19:42:12Z", "harness_version": 3, "evidence": "felhom.eu/documentation/audits/night-2026-09-23/apps/navidrome/bench/evidence/MV-navidrome/verdict.json", "box_evidence": "felhom.eu/documentation/audits/night-2026-09-23/apps/navidrome/verdict.json", "memory_peak_pct": 6.3, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 9.2} + - {"from": {"navidrome": "deluan/navidrome:0.64.1"}, "to": {"navidrome": "deluan/navidrome:0.64.2"}, "digest": {"navidrome": "sha256:38dc2727bfcfd5ede290f8ada114fc90368146f265ae4701ddddbcbe2a44ee52"}, "verdict": "proven", "tested_at": "2026-09-30T12:15:38Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/F/apps/navidrome/bench/evidence/MV-navidrome/verdict.json", "box_evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/box/navidrome/box-verdict-navidrome.json", "memory_peak_pct": 6.9, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 9.4} diff --git a/templates/navidrome/docker-compose.yml b/templates/navidrome/docker-compose.yml index 8cbe61d..99bbe63 100644 --- a/templates/navidrome/docker-compose.yml +++ b/templates/navidrome/docker-compose.yml @@ -12,7 +12,7 @@ services: navidrome: - image: deluan/navidrome:0.64.1 + image: deluan/navidrome:0.64.2 container_name: navidrome restart: unless-stopped environment: diff --git a/templates/navidrome/steps/78af7f781064ba79.felhom.yml b/templates/navidrome/steps/78af7f781064ba79.felhom.yml new file mode 100644 index 0000000..8063ea9 --- /dev/null +++ b/templates/navidrome/steps/78af7f781064ba79.felhom.yml @@ -0,0 +1,121 @@ +# ============================================================================= +# .felhom.yml - App metadata for felhom-controller +# ============================================================================= + +# --- Display info (shown on dashboard) --- +display_name: "Navidrome" +description: "Könnyű zene szerver Subsonic API támogatással" +category: "media" +subdomain: "music" +slug: "navidrome" +# catalog_since: the date THIS repo last changed this app's pinned images. Any commit that +# changes an image: line must set this to the same day (see CLAUDE.md). +catalog_since: "2026-09-23" + +# --- Resource hints (displayed on deploy screen) --- +resources: + mem_request: "50M" + mem_limit: "256M" + pi_compatible: true + needs_hdd: true + +# --- Backup classification (referential coupling; see felhom.eu documentation/audits/SPIKE-backup-classification-2026-07-14.md) --- +backup: + userdata: + - path: media/music + class: excluded # re-rippable bulk, :ro, shared tree + +# --- Deploy fields (first deployment only) --- +deploy_fields: + - env_var: DOMAIN + label: "Domain" + type: domain + description: "A szerver domain neve" + locked_after_deploy: true + + - env_var: SUBDOMAIN + label: "Aldomain" + type: subdomain + default: "music" + required: true + locked_after_deploy: true + description: "Az alkalmazás aldomainje" + + - env_var: HDD_PATH + label: "Zenegyűjtemény útvonal" + type: path + required: true + placeholder: "/mnt/felhom-drives/hdd_1" + description: "A külső merevlemez elérési útja, ahol a zenefájlok tárolódnak" + locked_after_deploy: true + +# --- The setup gate (controller >= 0.281.0, `09` §3 decisions 46-47) --- +# The first visitor would create the admin; a fresh install is closed to everyone but the household until the first setup is done. +setup_gate: true + +# --- App info (info page content) --- +app_info: + tagline: "Könnyű zene szerver - streameld a saját zenegyűjteményedet" + docs_url: "https://www.navidrome.org/docs/" + + use_cases: + - 'Saját zenegyűjtemény streamelése bármilyen eszközről' + - 'Subsonic API kompatibilis mobil alkalmazások használata' + - 'Lejátszási listák, kedvencek és értékelések kezelése' + - 'Automatikus metaadat és borítókép letöltés' + - 'Több felhasználó külön könyvtárral és beállításokkal' + + first_steps: + - 'Nyisd meg a music.DOMAIN címet a böngészőben' + - 'Az első felhasználó automatikusan admin lesz' + - 'Hozd létre a fiókodat és várd meg az első szkennelést' + - 'Telepíts Subsonic-kompatibilis alkalmazást (pl. Subtracks, play:Sub)' + - 'Add meg a szerver címet: https://music.DOMAIN' + + prerequisites: + - 'Külső HDD szükséges a zenefájlok tárolásához' + - 'Zenefájlok mappákba rendezve (pl. Előadó/Album/szám.flac)' + +# --- Controller-side health probe --- +healthcheck: + checks: + - type: api + port: 4533 + path: "/ping" + expect: + status: 200 + +# --- English copy (localisation slice 5, R-560) -------------------------------------------- +# The Hungarian above is UNCHANGED. A box on English reads this block field by field; a missing +# field shows the Hungarian one; a controller older than 0.257.0 ignores the block entirely. +i18n: + en: + description: 'A light music server with Subsonic API support' + app_info: + tagline: 'A light music server - stream your own music collection' + use_cases: + - 'Stream your own music collection to any device' + - 'Use any Subsonic-compatible phone app' + - 'Playlists, favourites and ratings' + - 'Details and cover art arrive on their own' + - 'Several people, each with their own library and settings' + first_steps: + - 'Open music.DOMAIN in your browser' + - 'The first user becomes the admin automatically' + - 'Create your account and wait for the first scan' + - 'Install a Subsonic-compatible app (Subtracks or play:Sub, for example)' + - 'Give it the server address: https://music.DOMAIN' + prerequisites: + - 'An external hard drive is needed to keep the music files on' + - 'Music files sorted into folders (Artist/Album/track.flac, for example)' + deploy_fields: + - env_var: DOMAIN + label: 'Domain' + description: 'The server domain name' + - env_var: SUBDOMAIN + label: 'Subdomain' + description: 'The subdomain this app answers on' + - env_var: HDD_PATH + label: 'Music collection path' + description: 'The path to the external hard drive where the music files are kept' + placeholder: '/mnt/felhom-drives/hdd_1' diff --git a/templates/navidrome/steps/78af7f781064ba79.yml b/templates/navidrome/steps/78af7f781064ba79.yml new file mode 100644 index 0000000..8cbe61d --- /dev/null +++ b/templates/navidrome/steps/78af7f781064ba79.yml @@ -0,0 +1,51 @@ +# Navidrome - Könnyű zene szerver Subsonic API támogatással +# Domain: ${SUBDOMAIN}.${DOMAIN} +# Database: None (file-based) +# RAM: ~50M (mem_limit: 256M) | Pi-compatible: Yes +# +# Environment variables: +# DOMAIN - Your domain (e.g., demo-felhom.eu) +# USERDATA_PATH - Ügyfél-tartalom gyökér (/userdata) +# +# Storage layout (felhom userdata convention): +# Zenegyűjtemény → ${USERDATA_PATH}/media/music (csak olvasható) + +services: + navidrome: + image: deluan/navidrome:0.64.1 + container_name: navidrome + restart: unless-stopped + environment: + - TZ=Europe/Budapest + - ND_SCANSCHEDULE=1h + - ND_LOGLEVEL=info + - ND_BASEURL= + volumes: + - navidrome_data:/data + - ${USERDATA_PATH}/media/music:/music:ro + networks: + - traefik-public + deploy: + resources: + limits: + memory: 256M + healthcheck: + test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:4533/ping"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 30s + labels: + - "traefik.enable=true" + - "traefik.http.routers.navidrome.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)" + - "traefik.http.routers.navidrome.entrypoints=websecure" + - "traefik.http.routers.navidrome.tls=true" + - "traefik.http.routers.navidrome.tls.certresolver=letsencrypt" + - "traefik.http.services.navidrome.loadbalancer.server.port=4533" + +volumes: + navidrome_data: + +networks: + traefik-public: + external: true From 2acfbf1e95fe3faf30ee9721c07e7ade0d24ec28 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 14:26:47 +0200 Subject: [PATCH 10/46] grafana: within-major step, both venues proven (R-462, Part F) {'grafana': 'grafana/grafana:13.2.2'} -> {'grafana': 'grafana/grafana:13.2.3'} The ONLY image move in this commit. Written by upgrade-test.py --write-ladder (catalog gates rc=0): - bench LXC 9401 (harness v4): the seed read back before and after; 10-minute memory watch: grafana anon 47.1 % (cgroup 100.0 %); 0 kills, 0 restarts; the abort starts and serves the data; - box 9202 (controller 0.283.1, the product's guarded Update, drill catalog): done in 23.6 s, the seed read back through the app's own front door. The box walk was run TWICE: the first read back 401 because the instrument lost the deploy's admin password between two processes (box/grafana/step-attempt1-instrument-401.txt); fixed in the walk tools, grafana reinstalled at 13.2.2 from the drill catalog, seeded, stepped: read back. Evidence: felhom.eu/documentation/audits/pg-last-six-2026-09-30/F/ and .../box/grafana/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/grafana/.felhom.yml | 3 +- templates/grafana/docker-compose.yml | 2 +- .../grafana/steps/f3b0cc9b3e239437.felhom.yml | 107 ++++++++++++++++++ templates/grafana/steps/f3b0cc9b3e239437.yml | 46 ++++++++ 4 files changed, 156 insertions(+), 2 deletions(-) create mode 100644 templates/grafana/steps/f3b0cc9b3e239437.felhom.yml create mode 100644 templates/grafana/steps/f3b0cc9b3e239437.yml diff --git a/templates/grafana/.felhom.yml b/templates/grafana/.felhom.yml index 2211788..1460722 100644 --- a/templates/grafana/.felhom.yml +++ b/templates/grafana/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "grafana" slug: "grafana" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-09-22" +catalog_since: "2026-09-30" # --- Resource hints (displayed on deploy screen) --- resources: @@ -111,3 +111,4 @@ i18n: # gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. update_ladder: - {"from": {"grafana": "grafana/grafana:13.1.0"}, "to": {"grafana": "grafana/grafana:13.2.2"}, "digest": {"grafana": "sha256:ac461fb352abc50da10a51c7d02462e9c05488f11f53f14b3ad79a8145f638a0"}, "verdict": "proven", "tested_at": "2026-09-21T19:02:25.646053+00:00", "harness_version": 1, "evidence": "felhom.eu/documentation/audits/update-night-2026-09-21/apps/grafana/verdict.json", "memory_peak_pct": null, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "backfilled": "2026-09-23", "note": "backfilled from catalog commit 068f445; box walk only (harness v1, no memory watch); digest = what the registry served on 2026-09-23, not a measurement of the tested image"} + - {"from": {"grafana": "grafana/grafana:13.2.2"}, "to": {"grafana": "grafana/grafana:13.2.3"}, "digest": {"grafana": "sha256:b28bae15e219c998fb0e0424ed724930cc61b1f61fb404d47c862f9a23f9e572"}, "verdict": "proven", "tested_at": "2026-09-30T12:17:45Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/F/apps/grafana/bench/evidence/MV-grafana/verdict.json", "box_evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/box/grafana/box-verdict-grafana.json", "memory_peak_pct": 47.1, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 100.0} diff --git a/templates/grafana/docker-compose.yml b/templates/grafana/docker-compose.yml index da43dd6..05d4876 100644 --- a/templates/grafana/docker-compose.yml +++ b/templates/grafana/docker-compose.yml @@ -9,7 +9,7 @@ services: grafana: - image: grafana/grafana:13.2.2 + image: grafana/grafana:13.2.3 container_name: grafana restart: unless-stopped environment: diff --git a/templates/grafana/steps/f3b0cc9b3e239437.felhom.yml b/templates/grafana/steps/f3b0cc9b3e239437.felhom.yml new file mode 100644 index 0000000..fcbda23 --- /dev/null +++ b/templates/grafana/steps/f3b0cc9b3e239437.felhom.yml @@ -0,0 +1,107 @@ +# ============================================================================= +# .felhom.yml - App metadata for felhom-controller +# ============================================================================= + +# --- Display info (shown on dashboard) --- +display_name: "Grafana" +description: "Professzionális monitoring és vizualizációs platform" +category: "dashboard" +subdomain: "grafana" +slug: "grafana" +# catalog_since: the date THIS repo last changed this app's pinned images. Any commit that +# changes an image: line must set this to the same day (see CLAUDE.md). +catalog_since: "2026-09-22" + +# --- Resource hints (displayed on deploy screen) --- +resources: + mem_request: "100M" + mem_limit: "512M" + pi_compatible: true + needs_hdd: false + +# --- Deploy fields (first deployment only) --- +deploy_fields: + - env_var: DOMAIN + label: "Domain" + type: domain + description: "A szerver domain neve" + locked_after_deploy: true + + - env_var: SUBDOMAIN + label: "Aldomain" + type: subdomain + default: "grafana" + required: true + locked_after_deploy: true + description: "Az alkalmazás aldomainje" + + - env_var: GF_SECURITY_ADMIN_PASSWORD + label: "Admin jelszó" + type: password + generate: "password:16" + description: "Első bejelentkezéshez. Utána a webes felületen módosítható." + locked_after_deploy: false + +# --- App info (info page content) --- +app_info: + tagline: "Vizualizációs platform - dashboardok, grafikonok, alertek" + default_creds: "admin / (telepítéskor megadott jelszó)" + docs_url: "https://grafana.com/docs/grafana/latest/" + + use_cases: + - 'Rendszer metrikák vizualizálása (CPU, RAM, hálózat, lemez)' + - 'Egyedi dashboardok létrehozása különböző adatforrásokból' + - 'Alertek és értesítések küszöbértékek alapján' + - 'Prometheus, InfluxDB és sok más adatforrás támogatás' + - 'Szép, megosztható dashboardok' + + first_steps: + - 'Nyisd meg a grafana.DOMAIN címet a böngészőben' + - 'Jelentkezz be az admin fiókkal' + - 'Add hozzá az adatforrásokat (Connections > Data Sources)' + - 'Importálj egy dashboard sablont vagy hozz létre sajátot' + + prerequisites: + - 'Adatforrás szükséges (pl. Prometheus - külön telepítendő)' + +# --- Controller-side health probe --- +healthcheck: + checks: + - type: api + port: 3000 + path: "/api/health" + expect: + status: 200 + +# --- English copy (localisation slice 5, R-560) -------------------------------------------- +# The Hungarian above is UNCHANGED. A box on English reads this block field by field; a missing +# field shows the Hungarian one; a controller older than 0.257.0 ignores the block entirely. +i18n: + en: + description: 'A professional monitoring and visualisation platform' + app_info: + tagline: 'A visualisation platform - dashboards, graphs and alerts' + default_creds: 'admin / (the password you set at install time)' + use_cases: + - 'See system numbers as graphs (CPU, RAM, network, disk)' + - 'Build your own dashboards from several data sources' + - 'Alerts and notifications when a number crosses a line you set' + - 'Prometheus, InfluxDB and many more data sources' + - 'Dashboards that look good and can be shared' + first_steps: + - 'Open grafana.DOMAIN in your browser' + - 'Sign in with the admin account' + - 'Add your data sources (Connections > Data Sources)' + - 'Import a dashboard template, or build your own' + prerequisites: + - 'A data source is needed (Prometheus, for example - installed separately)' + deploy_fields: + - env_var: DOMAIN + label: 'Domain' + description: 'The server domain name' + - env_var: SUBDOMAIN + label: 'Subdomain' + description: 'The subdomain this app answers on' + - env_var: GF_SECURITY_ADMIN_PASSWORD + label: 'Admin password' + description: 'For the first sign-in. You can change it in the app afterwards.' diff --git a/templates/grafana/steps/f3b0cc9b3e239437.yml b/templates/grafana/steps/f3b0cc9b3e239437.yml new file mode 100644 index 0000000..da43dd6 --- /dev/null +++ b/templates/grafana/steps/f3b0cc9b3e239437.yml @@ -0,0 +1,46 @@ +# Grafana - Professzionális monitoring és vizualizációs platform +# Domain: ${SUBDOMAIN}.${DOMAIN} +# Database: None (file-based) +# RAM: ~100M (mem_limit: 512M) | Pi-compatible: Yes +# +# Environment variables: +# DOMAIN - Your domain (e.g., demo-felhom.eu) +# GF_SECURITY_ADMIN_PASSWORD- Admin jelszó (auto-generated) + +services: + grafana: + image: grafana/grafana:13.2.2 + container_name: grafana + restart: unless-stopped + environment: + - TZ=Europe/Budapest + - GF_SERVER_ROOT_URL=https://${SUBDOMAIN}.${DOMAIN} + - GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD:?the admin password is required (R-708)} + volumes: + - grafana_data:/var/lib/grafana + networks: + - traefik-public + deploy: + resources: + limits: + memory: 512M + healthcheck: + test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:3000/api/health"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 30s + labels: + - "traefik.enable=true" + - "traefik.http.routers.grafana.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)" + - "traefik.http.routers.grafana.entrypoints=websecure" + - "traefik.http.routers.grafana.tls=true" + - "traefik.http.routers.grafana.tls.certresolver=letsencrypt" + - "traefik.http.services.grafana.loadbalancer.server.port=3000" + +volumes: + grafana_data: + +networks: + traefik-public: + external: true From 403a8f537a02808c7ed759f70718bc1f591b4814 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 14:30:27 +0200 Subject: [PATCH 11/46] komga: within-major step, both venues proven (R-462, Part F) {'komga': 'gotson/komga:1.27.1'} -> {'komga': 'gotson/komga:1.28.0'} The ONLY image move in this commit. Written by upgrade-test.py --write-ladder (catalog gates rc=0): - bench LXC 9401 (harness v4): the seed read back before and after; 10-minute memory watch: komga anon 64.5 % (cgroup 67.5 %); 0 kills, 0 restarts; the abort starts and serves the data; - box 9202 (controller 0.283.1, the product's guarded Update, drill catalog): done in 44.2 s, the seed read back through the app's own front door. Evidence: felhom.eu/documentation/audits/pg-last-six-2026-09-30/F/ and .../box/komga/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/komga/.felhom.yml | 3 +- templates/komga/docker-compose.yml | 2 +- .../komga/steps/f7c491acf8f39ff8.felhom.yml | 127 ++++++++++++++++++ templates/komga/steps/f7c491acf8f39ff8.yml | 63 +++++++++ 4 files changed, 193 insertions(+), 2 deletions(-) create mode 100644 templates/komga/steps/f7c491acf8f39ff8.felhom.yml create mode 100644 templates/komga/steps/f7c491acf8f39ff8.yml diff --git a/templates/komga/.felhom.yml b/templates/komga/.felhom.yml index 4c9d91f..134f6c9 100644 --- a/templates/komga/.felhom.yml +++ b/templates/komga/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "comics" slug: "komga" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-09-23" +catalog_since: "2026-09-30" # --- Resource hints (displayed on deploy screen) --- resources: @@ -131,3 +131,4 @@ i18n: # gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. update_ladder: - {"from": {"komga": "gotson/komga:1.25.0"}, "to": {"komga": "gotson/komga:1.27.1"}, "digest": {"komga": "sha256:9cf102f5fb78e2e020700c53eca757e4f4d4e347121b0a16380822760337cca9"}, "verdict": "proven", "tested_at": "2026-09-23T19:46:46Z", "harness_version": 3, "evidence": "felhom.eu/documentation/audits/night-2026-09-23/apps/komga/bench/evidence/MV-komga/verdict.json", "box_evidence": "felhom.eu/documentation/audits/night-2026-09-23/apps/komga/verdict.json", "memory_peak_pct": 60.0, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 76.8} + - {"from": {"komga": "gotson/komga:1.27.1"}, "to": {"komga": "gotson/komga:1.28.0"}, "digest": {"komga": "sha256:19764751d501495b021530c9426f25d8f9f8748dc38ab3ba48eb62d7df2cd92e"}, "verdict": "proven", "tested_at": "2026-09-30T12:30:04Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/F/apps/komga/bench/evidence/MV-komga/verdict.json", "box_evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/box/komga/box-verdict-komga.json", "memory_peak_pct": 64.5, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 67.5} diff --git a/templates/komga/docker-compose.yml b/templates/komga/docker-compose.yml index ce86bb6..6798694 100644 --- a/templates/komga/docker-compose.yml +++ b/templates/komga/docker-compose.yml @@ -16,7 +16,7 @@ services: komga: - image: gotson/komga:1.27.1 + image: gotson/komga:1.28.0 container_name: komga restart: unless-stopped # Runs as root (see note above). Restore an escalation boundary: block SUID-based privilege diff --git a/templates/komga/steps/f7c491acf8f39ff8.felhom.yml b/templates/komga/steps/f7c491acf8f39ff8.felhom.yml new file mode 100644 index 0000000..5ecc9cc --- /dev/null +++ b/templates/komga/steps/f7c491acf8f39ff8.felhom.yml @@ -0,0 +1,127 @@ +# ============================================================================= +# .felhom.yml - App metadata for felhom-controller +# ============================================================================= + +# --- Display info (shown on dashboard) --- +display_name: "Komga" +description: "Képregény és manga szerver OPDS támogatással" +category: "media" +subdomain: "comics" +slug: "komga" +# catalog_since: the date THIS repo last changed this app's pinned images. Any commit that +# changes an image: line must set this to the same day (see CLAUDE.md). +catalog_since: "2026-09-23" + +# --- Resource hints (displayed on deploy screen) --- +resources: + mem_request: "200M" + mem_limit: "768M" + pi_compatible: true + needs_hdd: true + +# --- Backup classification (referential coupling; see felhom.eu documentation/audits/SPIKE-backup-classification-2026-07-14.md) --- +backup: + userdata: + - path: media/comics + class: optional # ruled: precious-decoupled (re-scanned, hand-curated) + +# --- Deploy fields (first deployment only) --- +deploy_fields: + - env_var: DOMAIN + label: "Domain" + type: domain + description: "A szerver domain neve" + locked_after_deploy: true + + - env_var: SUBDOMAIN + label: "Aldomain" + type: subdomain + default: "comics" + required: true + locked_after_deploy: true + description: "Az alkalmazás aldomainje" + + - env_var: HDD_PATH + label: "Képregénytár útvonal" + type: path + required: true + placeholder: "/mnt/felhom-drives/hdd_1" + description: "A külső merevlemez elérési útja" + locked_after_deploy: true + +# --- The setup gate (controller >= 0.281.0, `09` §3 decisions 46-47) --- +# The first visitor would create the admin; a fresh install is closed to everyone but the household until the first setup is done. +setup_gate: true +# measured on 9202 2026-09-29: isClaimed false -> true once the admin claimed it. +setup_done_probe: + url: http://komga:25600/api/v1/claim + field: isClaimed + done: "true" + +# --- App info (info page content) --- +app_info: + tagline: "Képregény, manga és könyv szerver webes olvasóval" + docs_url: "https://komga.org/docs/" + + use_cases: + - 'Képregények és mangák rendszerezése és olvasása böngészőben' + - 'Automatikus metaadat szkennelés és borítókép generálás' + - 'OPDS feed kompatibilis olvasó alkalmazásokhoz' + - 'Olvasási haladás szinkronizálás eszközök között' + - 'Több felhasználó külön könyvtárral' + + first_steps: + - 'Nyisd meg a comics.DOMAIN címet a böngészőben' + - 'Hozd létre az admin fiókot az első megnyitáskor' + - 'Add hozzá a könyvtárat (/data)' + - 'Várd meg az automatikus szkennelést' + - 'Használj OPDS-kompatibilis alkalmazást mobilon (pl. Tachiyomi)' + + prerequisites: + - 'Külső HDD szükséges a képregények tárolásához' + - 'Támogatott formátumok: CBZ, CBR, PDF, EPUB' + +# --- Controller-side health probe --- +healthcheck: + checks: + - type: api + port: 25600 + # /actuator/health is unauthenticated (200); the /api/v1 prefix is auth-gated (401). + path: "/actuator/health" + expect: + status: 200 + +# --- English copy (localisation slice 5, R-560) -------------------------------------------- +# The Hungarian above is UNCHANGED. A box on English reads this block field by field; a missing +# field shows the Hungarian one; a controller older than 0.257.0 ignores the block entirely. +i18n: + en: + description: 'A comic and manga server with OPDS support' + app_info: + tagline: 'A comic, manga and book server with a web reader' + use_cases: + - 'Sort and read comics and manga in your browser' + - 'Details are scanned in and covers made on their own' + - 'An OPDS feed for reader apps' + - 'Your reading position follows you between devices' + - 'Several people, each with their own library' + first_steps: + - 'Open comics.DOMAIN in your browser' + - 'Create the admin account the first time you open it' + - 'Add the library (/data)' + - 'Wait for the first scan to finish' + - 'Use an OPDS-compatible app on your phone (Tachiyomi, for example)' + prerequisites: + - 'An external hard drive is needed to keep the comics on' + - 'Formats it reads: CBZ, CBR, PDF, EPUB' + deploy_fields: + - env_var: DOMAIN + label: 'Domain' + description: 'The server domain name' + - env_var: SUBDOMAIN + label: 'Subdomain' + description: 'The subdomain this app answers on' + - env_var: HDD_PATH + label: 'Comic library path' + description: 'The path to the external hard drive' + placeholder: '/mnt/felhom-drives/hdd_1' diff --git a/templates/komga/steps/f7c491acf8f39ff8.yml b/templates/komga/steps/f7c491acf8f39ff8.yml new file mode 100644 index 0000000..ce86bb6 --- /dev/null +++ b/templates/komga/steps/f7c491acf8f39ff8.yml @@ -0,0 +1,63 @@ +# Komga - Képregény és manga szerver OPDS támogatással +# Domain: ${SUBDOMAIN}.${DOMAIN} +# Database: None (file-based) +# RAM: ~460M under load on 1.27 (mem_limit: 768M) | Pi-compatible: Yes +# +# Environment variables: +# DOMAIN - Your domain (e.g., demo-felhom.eu) +# USERDATA_PATH - Ügyfél-tartalom gyökér (/userdata) +# +# Storage layout (felhom userdata convention): +# Képregénytár → ${USERDATA_PATH}/media/comics (írható) +# Run-identity: ROOT (fallback). user "1000:1000" was tried but the gotson/komga image creates its +# SQLite /config DB as root at init and cannot open it when pinned to 1000 (no PUID-style chown) — +# the container crash-loops. So it runs as root and relies on the setgid 2775 userdata dirs: files it +# writes land group 1000 so FileBrowser + group members can READ/browse them. (Verified live; see REPORT.) + +services: + komga: + image: gotson/komga:1.27.1 + container_name: komga + restart: unless-stopped + # Runs as root (see note above). Restore an escalation boundary: block SUID-based privilege + # escalation. Full cap_drop is NOT applied — the image's root-init needs CHOWN/SETUID/SETGID to + # set up /config, and dropping them crash-loops it (the same failure we hit pinning user:1000). + security_opt: + - no-new-privileges:true + environment: + - TZ=Europe/Budapest + volumes: + - komga_config:/config + - ${USERDATA_PATH}/media/comics:/data + networks: + - traefik-public + deploy: + resources: + limits: + # 768M, MEASURED 2026-09-23 night: 1.27.1 used 94.6 % of 512M (its own memory, anon) under ten + # minutes of light load — memory_tight; at 768M 60 %, 0 kills. The JVM grows into what it is given. + memory: 768M + # HC override: komga's actuator lives at /actuator/health (unauthenticated, 200), NOT under the + # auth-gated /api/v1 API prefix — the old /api/v1/actuator/health returns 401 so `curl -f` failed + # (exit 22) and the container reported "unhealthy" despite serving fine. The gotson/komga image + # ships curl (verified), so curl -f on the unauthenticated endpoint is the correct probe. + healthcheck: + test: ["CMD", "curl", "-f", "http://127.0.0.1:25600/actuator/health"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 30s + labels: + - "traefik.enable=true" + - "traefik.http.routers.komga.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)" + - "traefik.http.routers.komga.entrypoints=websecure" + - "traefik.http.routers.komga.tls=true" + - "traefik.http.routers.komga.tls.certresolver=letsencrypt" + - "traefik.http.services.komga.loadbalancer.server.port=25600" + +volumes: + komga_config: + +networks: + traefik-public: + external: true From 06e804b82453d689d8292d8a9b48343d3ef00b2e Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 14:45:02 +0200 Subject: [PATCH 12/46] CHANGELOG + REPORT: the last six PostgreSQL apps, Part F; zipline's fixture tries /api/setup first (R-624) zipline 4's first-run route is POST /api/setup (measured on the bench 2026-09-30, v4.6.1: GET -> {"firstSetup":true}, POST {username,password} -> 200 SUPERADMIN, the login works). The two paths the fixture tried stay as fallbacks. No image moves in this commit. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- CHANGELOG.md | 18 ++++++++++++++++++ REPORT.md | 18 ++++++++++-------- scripts/upgrade_fixtures_box.py | 5 ++++- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27ec86b..b4031e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +## The last six PostgreSQL apps decided; seven more apps update themselves at night (2026-09-30, day brief) + +- **PostgreSQL → 18, converted by the box** (the ONLY image move in each commit, written by `upgrade-test.py + --write-ladder` from both venues, one undo case each on 9202): rallly `25ffd89`, outline `aeb0cd6`, sparkyfitness + `1666572` (from 15; `PGDATA` left as it was, now a folder inside the moved volume). Each app's own upstream runs 18 + (`09` decision 42's rule). **Stay on 16, same rule:** zipline (upstream 16), adventurelog (upstream postgis 16-3.5), + immich (upstream 14; its only 18 images drop pgvecto.rs). All eleven PostgreSQL apps are now decided. +- **Fixtures (`e6f3ec2`)** — three front-door seeds that were thought impossible: sparkyfitness (better-auth sign-up + + a check-in), rallly (sign-up, its own e-mail code read from its own table in place of a mailbox, a poll), outline + (`installation.create`, an API key, a document). outline and rallly leave the NoRoute list. **zipline's fixture now + tries `POST /api/setup` first** — its real first-run route (measured on the bench: a SUPERADMIN, the login works). +- **Within-major steps, both venues** (Part F): bookstack 26.09.1 `54ca055`, kimai 2.67.0 `d75d1fd` (the plain tag's + digest equals `apache`'s — upstream dropped the prefix), audiobookshelf 2.37.1 `7425ebd`, n8n 2.42.1 `9f075a4`, + navidrome 0.64.2 `6d91495`, grafana 13.2.3 `2acfbf1`, komga 1.28.0 `403a8f5`. None `memory_tight`; no limit moved. +- **Not moved:** immich v3.2.4 (box proven; bench inconclusive twice — its FIRST start at today's pin could not finish, + the database OOM-killed at 512 MiB: `felhom.eu` R-732). +- Evidence: `felhom.eu/documentation/audits/pg-last-six-2026-09-30/`. CI green for every push (jobs 1106–1109 and on). + ## Sign-up locked twice (the app's own switch + a case-insensitive block); wanderer closable; three more probes; a probe must carry its measurement (2026-09-29 evening, decisions 47–49) - **The app's own sign-up switch** on adventurelog, calcom, gitea, gramps-web, homebox, papra, sparkyfitness, termix, diff --git a/REPORT.md b/REPORT.md index 4b4ee7e..669c17c 100644 --- a/REPORT.md +++ b/REPORT.md @@ -1,10 +1,12 @@ -# REPORT — 2026-09-29 evening: sign-up locked twice; wanderer closable; three probes; the probe-measured gate (decisions 47–49) +# REPORT — 2026-09-30 (day): the last six PostgreSQL apps decided; seven more within-major steps -Architecture: `09-update-architecture.md` §3 decisions 47–49, `01-topology-and-trust.md` §5. Controller 0.282.0. -Evidence: `felhom.eu/documentation/audits/signup-lock-2026-09-29/`. Per-app table: `FIRST-ADMIN.md` (sign-up locks). +Architecture: `09-update-architecture.md` §3 decisions 35, 37–39, 42–43; §6.4 part 10; §6.5 (the drill catalog, 9202 only). +Evidence: `felhom.eu/documentation/audits/pg-last-six-2026-09-30/`. Operator report: `felhom.eu/REPORT-pg-last-six-2026-09-30.md`. -- 9 apps: the app's own switch closed by `after_setup` when the gate opens (measured: refuses a stranger straight at the app). -- All 11 blocks case-insensitive; final trick run 113 tries, 0 got in. -- wanderer: sign-up closed by "Close sign-up now"; two holes found and closed (collection id, letter case). -- ghost, home-assistant, gramps-web: probes measured; gates opened by themselves. -- Gates: new `probe-measured` (5 decoys); decoy suite fixed (docmost fixture) — 97 cases pass. +- rallly, outline, sparkyfitness → PostgreSQL 18: bench converted (31/42/94 tables equal), box 9202 CONVERTED in 7.1/7.9/9.8 s + through the guarded Update, one undo case each (undone, back on the old major, seed read back). Engine gate ALLOWED on push. +- zipline, adventurelog, immich stay on 16 (their upstreams run 16, 16, 14). +- Three new front-door fixtures; zipline's fixture fixed to its real first-run route. +- Part F: bookstack, kimai, audiobookshelf, n8n, navidrome, grafana, komga — each proven on both venues, one commit each. +- immich v3.2.4 NOT moved: first start at today's pin OOM-killed its database on the bench (R-732). +- Night-updatable apps: 28 (+ nextcloud) in the morning → 31 (+ nextcloud) after. diff --git a/scripts/upgrade_fixtures_box.py b/scripts/upgrade_fixtures_box.py index ca2e904..a7e0601 100644 --- a/scripts/upgrade_fixtures_box.py +++ b/scripts/upgrade_fixtures_box.py @@ -769,7 +769,10 @@ class Zipline: return None user = "drill" + secrets.token_hex(3) pw = "Drill-" + secrets.token_hex(10) - for path in ("/api/auth/register", "/api/auth/setup"): + # /api/setup is Zipline 4's first-run route (measured on the bench 2026-09-30, v4.6.1: GET -> {"firstSetup":true}, + # POST {username,password} -> 200 with a SUPERADMIN, the seeded user logs in). The two others were guesses + # (R-624 read this app as "no route" because of them); they stay as fallbacks. + for path in ("/api/setup", "/api/auth/register", "/api/auth/setup"): rc, code, body = w.app_curl(sub, path, "-H", "Content-Type: application/json", data=json.dumps({"username": user, "password": pw}), method="POST") From 56c4888f5ee50f5c02c8c3724737885c83ce1b93 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 16:13:36 +0200 Subject: [PATCH 13/46] immich: v3.2.2 -> v3.2.4 with immich-postgres 512M -> 768M (R-732) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ONLY image move in this commit; the limit rides it (09 decision 39's precedent), because the step itself re-runs immich's geodata import (228 294 -> 228 571 places) — the load that killed the database. Cause, measured on the bench (audits/immich-first-start-2026-09-30/A-cause.md): the first-start import runs up to 9 concurrent 5000-row INSERTs; the database then needs ~400 MB anon + ~170 MB touched shared_buffers (the image's own postgresql.conf fixes 512MB). At 512M with no swap: 61 kills; with 512 MB swap: 0 (swapped ~70 MB) — why 9202 passed; shared_buffers 128MB alone: still killed; 1024M: 0; 768M: 0. Proof at the new definition, fresh install from birth, no swap: bench x2 (anon 409/412 MB = 53 %, 0 kills, import 8.1 s) and box 9202 (anon 368 MB = 48 %, 0 kills, swap.peak 0). Step, written by upgrade-test.py --write-ladder: bench (harness v4) proven, 10-min watch 0 kills 0 restarts, anon peak 51.1 %; box 9202 through the guarded Update: done 58.5 s, album read back, the running database limit 805306368 after. The step carries `files_may_change` (the harness saw only immich's six 13-byte `.immich` folder markers rewritten at start) — the night leg takes it only with a whole copy. Per-box cost: +256 MB on immich-postgres; `mem_limit` 4096M -> 4480M (the old figure was already 128 MB under the sum of the four limits). Header comment corrected (it said postgres 256M). Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/immich/.felhom.yml | 5 +- templates/immich/docker-compose.yml | 13 +- .../immich/steps/a1bfe9d95485f8d0.felhom.yml | 156 ++++++++++++++++++ templates/immich/steps/a1bfe9d95485f8d0.yml | 151 +++++++++++++++++ 4 files changed, 319 insertions(+), 6 deletions(-) create mode 100644 templates/immich/steps/a1bfe9d95485f8d0.felhom.yml create mode 100644 templates/immich/steps/a1bfe9d95485f8d0.yml diff --git a/templates/immich/.felhom.yml b/templates/immich/.felhom.yml index 6203d7e..bf9c59e 100644 --- a/templates/immich/.felhom.yml +++ b/templates/immich/.felhom.yml @@ -15,12 +15,12 @@ subdomain: "photos" slug: "immich" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-09-23" +catalog_since: "2026-09-30" # --- Resource hints (displayed on deploy screen) --- resources: mem_request: "2048M" - mem_limit: "4096M" + mem_limit: "4480M" pi_compatible: false needs_hdd: true @@ -161,3 +161,4 @@ i18n: update_ladder: - {"from": {"immich-server": "ghcr.io/immich-app/immich-server:v3.0.3", "immich-machine-learning": "ghcr.io/immich-app/immich-machine-learning:v3.0.3", "immich-postgres": "ghcr.io/immich-app/postgres:16-vectorchord0.4.3-pgvectors0.2.0", "immich-redis": "redis:7-alpine"}, "to": {"immich-server": "ghcr.io/immich-app/immich-server:v3.2.2", "immich-machine-learning": "ghcr.io/immich-app/immich-machine-learning:v3.0.3", "immich-postgres": "ghcr.io/immich-app/postgres:16-vectorchord0.4.3-pgvectors0.2.0", "immich-redis": "redis:7-alpine"}, "digest": {"immich-machine-learning": "sha256:d76fe88b69282c09a97eac4f82dafa82cfd77bce274bc742591cde974f87dacb", "immich-postgres": "sha256:1a078b237c1d9b420b0ee59147386b4aa60d3a07a8e6a402fc84a57e41b043a4", "immich-redis": "sha256:858f009f9709ce576febc734aa78b8f6d624b82571f9ddb6bda4377c833b3499", "immich-server": "sha256:79cc1623323d5894922686d8743b4780181428f98eecbfb58ce12c41ef02d1ea"}, "verdict": "proven", "tested_at": "2026-09-22T12:12:19.159912+00:00", "harness_version": 1, "evidence": "felhom.eu/documentation/audits/the-28-2026-09-22/apps/immich/verdict.json", "memory_peak_pct": null, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "backfilled": "2026-09-23", "note": "backfilled from catalog commit 12c1270; box walk only (harness v1, no memory watch); digest = what the registry served on 2026-09-23, not a measurement of the tested image"} - {"from": {"immich-server": "ghcr.io/immich-app/immich-server:v3.2.2", "immich-machine-learning": "ghcr.io/immich-app/immich-machine-learning:v3.0.3", "immich-postgres": "ghcr.io/immich-app/postgres:16-vectorchord0.4.3-pgvectors0.2.0", "immich-redis": "redis:7-alpine"}, "to": {"immich-server": "ghcr.io/immich-app/immich-server:v3.2.2", "immich-machine-learning": "ghcr.io/immich-app/immich-machine-learning:v3.2.2", "immich-postgres": "ghcr.io/immich-app/postgres:16-vectorchord0.4.3-pgvectors0.2.0", "immich-redis": "redis:7-alpine"}, "digest": {"immich-machine-learning": "sha256:60dfcf266a9ef3b7376f5678e8c980d4fb61db5fc48c078fe8a326ab1535d60d", "immich-postgres": "sha256:1a078b237c1d9b420b0ee59147386b4aa60d3a07a8e6a402fc84a57e41b043a4", "immich-redis": "sha256:858f009f9709ce576febc734aa78b8f6d624b82571f9ddb6bda4377c833b3499", "immich-server": "sha256:79cc1623323d5894922686d8743b4780181428f98eecbfb58ce12c41ef02d1ea"}, "verdict": "proven", "tested_at": "2026-09-23T19:58:59Z", "harness_version": 3, "evidence": "felhom.eu/documentation/audits/night-2026-09-23/apps/immich/bench/evidence/MV-immich/verdict.json", "box_evidence": "felhom.eu/documentation/audits/night-2026-09-23/apps/immich/verdict.json", "memory_peak_pct": 51.4, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 100.1} + - {"from": {"immich-server": "ghcr.io/immich-app/immich-server:v3.2.2", "immich-machine-learning": "ghcr.io/immich-app/immich-machine-learning:v3.2.2", "immich-postgres": "ghcr.io/immich-app/postgres:16-vectorchord0.4.3-pgvectors0.2.0", "immich-redis": "redis:7-alpine"}, "to": {"immich-server": "ghcr.io/immich-app/immich-server:v3.2.4", "immich-machine-learning": "ghcr.io/immich-app/immich-machine-learning:v3.2.4", "immich-postgres": "ghcr.io/immich-app/postgres:16-vectorchord0.4.3-pgvectors0.2.0", "immich-redis": "redis:7-alpine"}, "digest": {"immich-machine-learning": "sha256:e16c2f166a8174901959fdf85e2e4c7bd1ebc4b37e0b6655de97c41408a260c4", "immich-postgres": "sha256:1a078b237c1d9b420b0ee59147386b4aa60d3a07a8e6a402fc84a57e41b043a4", "immich-redis": "sha256:858f009f9709ce576febc734aa78b8f6d624b82571f9ddb6bda4377c833b3499", "immich-server": "sha256:d317916b28090c33eb36b308464ea391f8b7df1d850fcfea227a39ec879718c2"}, "verdict": "proven", "tested_at": "2026-09-30T14:09:09Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/immich-first-start-2026-09-30/bench/apps/immich/bench/evidence/MV-immich/verdict.json", "box_evidence": "felhom.eu/documentation/audits/immich-first-start-2026-09-30/box/immich/box-verdict-immich.json", "memory_peak_pct": 51.1, "marks": {"files_may_change": true, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 100.0} diff --git a/templates/immich/docker-compose.yml b/templates/immich/docker-compose.yml index f1c1c4f..daf22da 100644 --- a/templates/immich/docker-compose.yml +++ b/templates/immich/docker-compose.yml @@ -1,7 +1,7 @@ # Immich - Self-hosted Photo & Video Management # Domain: ${SUBDOMAIN}.${DOMAIN} # Database: PostgreSQL (with VectorChord) + Redis -# RAM: ~4GB minimum (mem_limit: 4096M total — server 2048M + ML 1536M + postgres 256M + redis 128M) | Pi-compatible: No (ML too heavy) +# RAM: ~4GB minimum (mem_limit: 4480M total — server 2048M + ML 1536M + postgres 768M + redis 128M) | Pi-compatible: No (ML too heavy) # # Environment variables: # DOMAIN - Your domain (e.g., demo-felhom.eu) @@ -27,7 +27,7 @@ services: immich-server: - image: ghcr.io/immich-app/immich-server:v3.2.2 + image: ghcr.io/immich-app/immich-server:v3.2.4 container_name: immich-server restart: unless-stopped depends_on: @@ -68,7 +68,7 @@ services: - "traefik.http.services.immich.loadbalancer.server.port=2283" immich-machine-learning: - image: ghcr.io/immich-app/immich-machine-learning:v3.2.2 + image: ghcr.io/immich-app/immich-machine-learning:v3.2.4 container_name: immich-machine-learning restart: unless-stopped environment: @@ -103,10 +103,15 @@ services: - immich_postgres_data:/var/lib/postgresql/data networks: - immich-internal + # 768M, not 512M (R-732, measured 2026-09-30): immich's FIRST start imports ~228 000 geodata places in up to + # 9 concurrent 5000-row INSERTs, and the database then needs ~400 MB of its own memory + ~170 MB of touched + # shared_buffers (the image's own postgresql.conf sets 512MB). At 512M it was OOM-killed 61 times on a box with + # no swap and survived on a box with swap only by swapping ~70-110 MB out. At 768M, no swap: 0 kills, peak + # anon 412 MB (54 %). Lowering shared_buffers to 128MB alone did NOT stop the kills (measured). deploy: resources: limits: - memory: 512M + memory: 768M healthcheck: test: ["CMD-SHELL", "pg_isready -U immich -d immich"] interval: 10s diff --git a/templates/immich/steps/a1bfe9d95485f8d0.felhom.yml b/templates/immich/steps/a1bfe9d95485f8d0.felhom.yml new file mode 100644 index 0000000..dea993b --- /dev/null +++ b/templates/immich/steps/a1bfe9d95485f8d0.felhom.yml @@ -0,0 +1,156 @@ +# ============================================================================= +# .felhom.yml — App metadata for felhom-controller +# ============================================================================= +# Place alongside docker-compose.yml in each stack directory: +# /opt/docker/stacks/immich/.felhom.yml +# ============================================================================= + +# --- Display info (shown on dashboard) --- +display_name: "Immich" +description: "Fotók és videók kezelése (Google Photos alternatíva)" +category: "media" +subdomain: "photos" + +# --- Asset slug --- +slug: "immich" +# catalog_since: the date THIS repo last changed this app's pinned images. Any commit that +# changes an image: line must set this to the same day (see CLAUDE.md). +catalog_since: "2026-09-23" + +# --- Resource hints (displayed on deploy screen) --- +resources: + mem_request: "2048M" + mem_limit: "4480M" + pi_compatible: false + needs_hdd: true + +# --- Backup classification (referential coupling; see felhom.eu documentation/audits/SPIKE-backup-classification-2026-07-14.md) --- +backup: + hdd: + - path: appdata/immich + class: mandatory # managed upload library — DB-referenced (SQ3: restore-without = broken) + userdata: + - path: media/photos + class: optional # external library, :ro — precious but re-scanned (explicit overrides ro-default) + +# --- Deploy fields --- +deploy_fields: + - env_var: DOMAIN + label: "Domain" + type: domain + description: "A szerver domain neve" + locked_after_deploy: true + + - env_var: SUBDOMAIN + label: "Aldomain" + type: subdomain + default: "photos" + required: true + locked_after_deploy: true + description: "Az alkalmazás aldomainje" + + - env_var: DB_PASSWORD + label: "Adatbázis jelszó" + type: secret + generate: "password:24" + locked_after_deploy: true + + - env_var: HDD_PATH + label: "Adattárolási útvonal" + type: path + required: true + placeholder: "/mnt/felhom-drives/hdd_1" + description: "A külső merevlemez elérési útja, ahol a fotók és videók tárolódnak" + locked_after_deploy: true + + +# --- The setup gate (controller >= 0.280.0, `09` §3 decision 46) --- +# The first visitor would create the admin. So a fresh install is closed to everyone but the household (a browser +# signed in to the dashboard) until the first setup is done; immich's own status says so (measured on 9202 2026-09-29: +# isInitialized false -> true once the admin exists). +setup_gate: true +# measured on 9202 2026-09-29: isInitialized false -> true after the admin sign-up (audits/login-gate-2026-09-29/C). +setup_done_probe: + url: http://immich-server:2283/api/server/config + field: isInitialized + done: "true" + +# --- App info (info page content) --- +app_info: + tagline: 'Google Photos alternatíva - automatikus fotó mentés és rendszerezés' + docs_url: 'https://immich.app/docs/overview/introduction' + + use_cases: + - 'Fotók és videók automatikus mentése telefonról' + - 'Arc- és tárgyfelismerés gépi tanulással' + - 'Térképes megjelenítés helyszín alapján' + - 'Emlékek és visszatekintések automatikus generálása' + - 'Albumok létrehozása és megosztása családtagokkal' + + first_steps: + - 'Nyisd meg a photos.DOMAIN címet a böngészőben' + - 'Hozd létre az admin fiókot' + - 'Telepítsd az Immich alkalmazást a telefonodra (Android/iOS)' + - 'Állítsd be az automatikus feltöltést az alkalmazásban' + - 'Hívd meg a családtagokat külön fiókokkal' + # MOUNT-READY, REGISTRATION PENDING: a megosztott média/photos mappa be van csatolva + # /external/photos néven (csak olvasható), de az Immich CSAK akkor látja, ha az + # adminfelületen (Administration → External Libraries) regisztrálod a /external/photos + # útvonalat. Compose ezt NEM teszi meg automatikusan — ez egy telepítés utáni lépés. + - 'Külső könyvtár (opcionális): Administration → External Libraries → add /external/photos' + + prerequisites: + - 'Külső HDD szükséges a fotók és videók tárolásához' + - 'Legalább 4 GB szabad RAM ajánlott (gépi tanulás funkciókhoz)' + - 'x86 processzor szükséges (nem fut Raspberry Pi-n)' + +# --- Controller-side health probe --- +healthcheck: + # container: no exact match and FOUR `immich-*` containers, so the old prefix rule picked whichever the + # container list happened to yield first — it could have been `immich-postgres` (R-630) + container: immich-server + checks: + - type: api + port: 2283 + path: "/api/server/ping" + expect: + status: 200 + +# --- English copy (localisation slice 5, R-560) -------------------------------------------- +# The Hungarian above is UNCHANGED. A box on English reads this block field by field; a missing +# field shows the Hungarian one; a controller older than 0.257.0 ignores the block entirely. +i18n: + en: + description: 'Photos and videos in one place (a Google Photos alternative)' + app_info: + tagline: 'A Google Photos alternative - your photos back themselves up and sort themselves' + use_cases: + - 'Photos and videos back themselves up from your phone' + - 'It recognises faces and objects on its own' + - 'See where a photo was taken, on a map' + - 'Memories and look-backs, put together for you' + - 'Build albums and share them with the household' + first_steps: + - 'Open photos.DOMAIN in your browser' + - 'Create the admin account' + - 'Install the Immich app on your phone (Android/iOS)' + - 'Turn on automatic upload in the app' + - 'Invite the household, each with their own account' + - 'An external library (optional): Administration -> External Libraries -> add /external/photos' + prerequisites: + - 'An external hard drive is needed to keep the photos and videos on' + - 'At least 4 GB of free RAM is recommended (for the machine learning features)' + - 'An x86 processor is needed (it does not run on a Raspberry Pi)' + deploy_fields: + - env_var: DOMAIN + label: 'Domain' + description: 'The server domain name' + - env_var: SUBDOMAIN + label: 'Subdomain' + description: 'The subdomain this app answers on' + - env_var: DB_PASSWORD + label: 'Database password' + - env_var: HDD_PATH + label: 'Data storage path' + description: 'The path to the external hard drive where the photos and videos are kept' + placeholder: '/mnt/felhom-drives/hdd_1' diff --git a/templates/immich/steps/a1bfe9d95485f8d0.yml b/templates/immich/steps/a1bfe9d95485f8d0.yml new file mode 100644 index 0000000..5fbdc3e --- /dev/null +++ b/templates/immich/steps/a1bfe9d95485f8d0.yml @@ -0,0 +1,151 @@ +# Immich - Self-hosted Photo & Video Management +# Domain: ${SUBDOMAIN}.${DOMAIN} +# Database: PostgreSQL (with VectorChord) + Redis +# RAM: ~4GB minimum (mem_limit: 4480M total — server 2048M + ML 1536M + postgres 768M + redis 128M) | Pi-compatible: No (ML too heavy) +# +# Environment variables: +# DOMAIN - Your domain (e.g., demo-felhom.eu) +# HDD_PATH - Drive namespace root (managed upload lives under appdata) +# USERDATA_PATH - Ügyfél-tartalom gyökér (/userdata) +# DB_PASSWORD - PostgreSQL password (auto-generated) +# +# Storage layout (felhom userdata convention): +# Managed upload (Immich-owned) → ${HDD_PATH}/appdata/immich (HDD, host path — app-managed) +# External photo library (RO) → ${USERDATA_PATH}/media/photos → /external/photos +# PostgreSQL data → immich_postgres_data (named volume, NVMe) +# ML model cache → immich_ml_cache (named volume, NVMe) +# Redis data → immich_redis_data (named volume, NVMe) +# +# ⚠ EXTERNAL LIBRARY IS NOT WIRED BY COMPOSE: mounting /external/photos only makes the files +# visible to the container. To actually surface them in Immich you MUST register an External +# Library pointing at /external/photos in the Immich admin UI (Administration → External +# Libraries) or via the API — a POST-DEPLOY step. Until then photos sharing is "mount ready, +# registration pending". See .felhom.yml first_steps + REPORT. +# +# First-time setup: +# Create admin account on first visit, then register the External Library (see above). + +services: + immich-server: + image: ghcr.io/immich-app/immich-server:v3.2.2 + container_name: immich-server + restart: unless-stopped + depends_on: + immich-postgres: + condition: service_healthy + immich-redis: + condition: service_healthy + environment: + - DB_PASSWORD=${DB_PASSWORD} + - DB_HOSTNAME=immich-postgres + - DB_USERNAME=immich + - DB_DATABASE_NAME=immich + - REDIS_HOSTNAME=immich-redis + - IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003 + - TZ=Europe/Budapest + volumes: + - ${HDD_PATH}/appdata/immich:/usr/src/app/upload + - ${USERDATA_PATH}/media/photos:/external/photos:ro + networks: + - traefik-public + - immich-internal + deploy: + resources: + limits: + memory: 2048M + healthcheck: + test: ["CMD", "curl", "-sf", "http://127.0.0.1:2283/api/server/ping"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 60s + labels: + - "traefik.enable=true" + - "traefik.http.routers.immich.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)" + - "traefik.http.routers.immich.entrypoints=websecure" + - "traefik.http.routers.immich.tls=true" + - "traefik.http.routers.immich.tls.certresolver=letsencrypt" + - "traefik.http.services.immich.loadbalancer.server.port=2283" + + immich-machine-learning: + image: ghcr.io/immich-app/immich-machine-learning:v3.2.2 + container_name: immich-machine-learning + restart: unless-stopped + environment: + - TZ=Europe/Budapest + - TRANSFORMERS_CACHE=/cache + volumes: + - immich_ml_cache:/cache + networks: + - immich-internal + deploy: + resources: + limits: + memory: 1536M + healthcheck: + test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:3003/ping')"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 120s + + immich-postgres: + image: ghcr.io/immich-app/postgres:16-vectorchord0.4.3-pgvectors0.2.0 + container_name: immich-postgres + restart: unless-stopped + environment: + - POSTGRES_USER=immich + - POSTGRES_PASSWORD=${DB_PASSWORD} + - POSTGRES_DB=immich + - POSTGRES_INITDB_ARGS=--data-checksums + - TZ=Europe/Budapest + volumes: + - immich_postgres_data:/var/lib/postgresql/data + networks: + - immich-internal + # 768M, not 512M (R-732, measured 2026-09-30): immich's FIRST start imports ~228 000 geodata places in up to + # 9 concurrent 5000-row INSERTs, and the database then needs ~400 MB of its own memory + ~170 MB of touched + # shared_buffers (the image's own postgresql.conf sets 512MB). At 512M it was OOM-killed 61 times on a box with + # no swap and survived on a box with swap only by swapping ~70-110 MB out. At 768M, no swap: 0 kills, peak + # anon 412 MB (54 %). Lowering shared_buffers to 128MB alone did NOT stop the kills (measured). + deploy: + resources: + limits: + memory: 768M + healthcheck: + test: ["CMD-SHELL", "pg_isready -U immich -d immich"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 30s + + immich-redis: + image: redis:7-alpine + container_name: immich-redis + restart: unless-stopped + command: redis-server --appendonly yes + environment: + - TZ=Europe/Budapest + volumes: + - immich_redis_data:/data + networks: + - immich-internal + deploy: + resources: + limits: + memory: 128M + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 10s + timeout: 5s + retries: 3 + +volumes: + immich_ml_cache: + immich_postgres_data: + immich_redis_data: + +networks: + traefik-public: + external: true + immich-internal: From 4c552cf56bdc4ffcff2503239baa7f3b35cd4674 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 16:17:17 +0200 Subject: [PATCH 14/46] CHANGELOG + REPORT: immich 768M + v3.2.4 (R-732) Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- CHANGELOG.md | 10 ++++++++++ REPORT.md | 17 +++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4031e0..818a23e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## immich: the database gets 768M, and v3.2.4 is published with it (2026-09-30, afternoon, R-732) + +- **Cause, measured** (`felhom.eu/documentation/audits/immich-first-start-2026-09-30/A-cause.md`): the first-start geodata + import runs up to 9 concurrent 5000-row INSERTs; the database needs ~400 MB anon + ~170 MB touched shared_buffers (the + image's fixed 512MB). At 512M without swap: 61–104 OOM kills; with swap it survives by swapping. `shared_buffers` 128MB + alone does not help (measured). An update that ships a new geodata file re-runs the import. +- `56c4888`: immich v3.2.2 → v3.2.4 (server + ML), `immich-postgres` 512M → 768M, `mem_limit` 4096M → 4480M, header comment + corrected. Proven with swap off: fresh installs (bench ×2, 9202) 0 kills, anon ≤ 54 %; the step on both venues. + The step carries `files_may_change` (immich's `.immich` markers; R-734). +256 MB per immich box. + ## The last six PostgreSQL apps decided; seven more apps update themselves at night (2026-09-30, day brief) - **PostgreSQL → 18, converted by the box** (the ONLY image move in each commit, written by `upgrade-test.py diff --git a/REPORT.md b/REPORT.md index 669c17c..a368fd4 100644 --- a/REPORT.md +++ b/REPORT.md @@ -1,12 +1,9 @@ -# REPORT — 2026-09-30 (day): the last six PostgreSQL apps decided; seven more within-major steps +# REPORT — 2026-09-30 (late afternoon): immich's first start fixed; v3.2.4 published with it -Architecture: `09-update-architecture.md` §3 decisions 35, 37–39, 42–43; §6.4 part 10; §6.5 (the drill catalog, 9202 only). -Evidence: `felhom.eu/documentation/audits/pg-last-six-2026-09-30/`. Operator report: `felhom.eu/REPORT-pg-last-six-2026-09-30.md`. +Evidence: `felhom.eu/documentation/audits/immich-first-start-2026-09-30/`. Operator report: `felhom.eu/REPORT-immich-first-start-2026-09-30.md`. -- rallly, outline, sparkyfitness → PostgreSQL 18: bench converted (31/42/94 tables equal), box 9202 CONVERTED in 7.1/7.9/9.8 s - through the guarded Update, one undo case each (undone, back on the old major, seed read back). Engine gate ALLOWED on push. -- zipline, adventurelog, immich stay on 16 (their upstreams run 16, 16, 14). -- Three new front-door fixtures; zipline's fixture fixed to its real first-run route. -- Part F: bookstack, kimai, audiobookshelf, n8n, navidrome, grafana, komga — each proven on both venues, one commit each. -- immich v3.2.4 NOT moved: first start at today's pin OOM-killed its database on the bench (R-732). -- Night-updatable apps: 28 (+ nextcloud) in the morning → 31 (+ nextcloud) after. +- Cause: 9 concurrent geodata INSERTs need ~575 MB in the database; 512M only fits with swap. Controls: swap alone, limit alone + flip it; shared_buffers alone does not. +- `56c4888`: v3.2.4 + `immich-postgres` 768M (`mem_limit` 4480M). Fresh installs with swap off: 0 kills on both venues. +- The step: bench proven (10-min watch 0 kills), box 9202 done in 58.5 s, album read back, limit 768M after. +- An installed immich on 3.2.2 gets 768M with its next guarded Update (by hand, or the night leg when a whole copy exists). From d7ba60c4098ae5daac6d4b5d742fbe637f0e4b6e Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 17:16:56 +0200 Subject: [PATCH 15/46] gitea: 1.27.0 -> 1.27.3, its first ladder step, both venues proven (R-462, R-624) Bench 9401 (harness v4, swap 0): the first-run installer form posted, a repo seeded and read back before and after, 10-min memory watch 0 kills (anon peak 26.6 %, cgroup 52.9 %). Box 9202: the guarded Update done in 21.6 s through the setup gate, the repo read back. Written by upgrade-test.py --write-ladder. 28.0.0 is a major (2026-09-02 ruling) and is not touched. Evidence: felhom.eu/documentation/audits/more-night-apps-2026-09-30/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/gitea/.felhom.yml | 8 +++++++- templates/gitea/docker-compose.yml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/gitea/.felhom.yml b/templates/gitea/.felhom.yml index 3dafe1a..1457671 100644 --- a/templates/gitea/.felhom.yml +++ b/templates/gitea/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "git" slug: "gitea" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-07-18" +catalog_since: "2026-09-30" # --- Resource hints (displayed on deploy screen) --- resources: @@ -121,3 +121,9 @@ i18n: - env_var: SUBDOMAIN label: 'Subdomain' description: 'The subdomain this app answers on' + +# update_ladder — the test record: one tested step per line, oldest first (JSON flow mappings, +# `09-update-architecture.md` §6.4 part 4). WRITTEN BY scripts/upgrade-test.py, never by hand; +# gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. +update_ladder: + - {"from": {"gitea": "gitea/gitea:1.27.0"}, "to": {"gitea": "gitea/gitea:1.27.3"}, "digest": {"gitea": "sha256:87a67ee09d3ae0d1df5fda5dcda3e2a1f9236a45b0a59025d6e00e46adc43bef"}, "verdict": "proven", "tested_at": "2026-09-30T15:14:09Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/bench/apps/gitea/bench/evidence/MV-gitea/verdict.json", "box_evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/box/gitea/step.txt", "memory_peak_pct": 26.6, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 52.9} diff --git a/templates/gitea/docker-compose.yml b/templates/gitea/docker-compose.yml index 890087c..4b42dfd 100644 --- a/templates/gitea/docker-compose.yml +++ b/templates/gitea/docker-compose.yml @@ -8,7 +8,7 @@ services: gitea: - image: gitea/gitea:1.27.0 + image: gitea/gitea:1.27.3 container_name: gitea restart: unless-stopped environment: From 3e4aa7707e8ef58bf48742490e5ddc11178caefd Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 17:45:40 +0200 Subject: [PATCH 16/46] emby: 4.11.0.3 -> 4.11.0.4, within-major step, both venues proven (R-462) Bench 9401 (harness v4, swap 0): the startup-wizard user seeded and read back before and after, 10-min memory watch 0 kills (anon peak 4.7 %); the abort starts and serves. Box 9202: the guarded Update done in 23.6 s through the setup gate, read back. Written by upgrade-test.py --write-ladder; the superseded step keeps its definition in steps/. Evidence: felhom.eu/documentation/audits/more-night-apps-2026-09-30/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/emby/.felhom.yml | 3 +- templates/emby/docker-compose.yml | 2 +- .../emby/steps/c9865ae7db76a683.felhom.yml | 123 ++++++++++++++++++ templates/emby/steps/c9865ae7db76a683.yml | 53 ++++++++ 4 files changed, 179 insertions(+), 2 deletions(-) create mode 100644 templates/emby/steps/c9865ae7db76a683.felhom.yml create mode 100644 templates/emby/steps/c9865ae7db76a683.yml diff --git a/templates/emby/.felhom.yml b/templates/emby/.felhom.yml index 12b51f4..451304a 100644 --- a/templates/emby/.felhom.yml +++ b/templates/emby/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "emby" slug: "emby" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-09-23" +catalog_since: "2026-09-30" # --- Resource hints (displayed on deploy screen) --- resources: @@ -128,3 +128,4 @@ i18n: update_ladder: - {"from": {"emby": "emby/embyserver:4.10.0.20"}, "to": {"emby": "emby/embyserver:4.11.0.1"}, "digest": {"emby": "sha256:bcc54978db53e333c5b693948447df0ed9dfa7c798a751a9402ff4da4909a6e2"}, "verdict": "proven", "tested_at": "2026-09-22T12:07:44.952377+00:00", "harness_version": 1, "evidence": "felhom.eu/documentation/audits/the-28-2026-09-22/apps/emby/verdict.json", "memory_peak_pct": null, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "backfilled": "2026-09-23", "note": "backfilled from catalog commit 7a6797b; box walk only (harness v1, no memory watch); digest = what the registry served on 2026-09-23, not a measurement of the tested image"} - {"from": {"emby": "emby/embyserver:4.11.0.1"}, "to": {"emby": "emby/embyserver:4.11.0.3"}, "digest": {"emby": "sha256:2ff130d624a97782474e7de791875d2871d613b2afaddc73b3e11eb0c9caa770"}, "verdict": "proven", "tested_at": "2026-09-23T19:54:42Z", "harness_version": 3, "evidence": "felhom.eu/documentation/audits/night-2026-09-23/apps/emby/bench/evidence/MV-emby/verdict.json", "box_evidence": "felhom.eu/documentation/audits/night-2026-09-23/apps/emby/verdict.json", "memory_peak_pct": 4.5, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 7.9} + - {"from": {"emby": "emby/embyserver:4.11.0.3"}, "to": {"emby": "emby/embyserver:4.11.0.4"}, "digest": {"emby": "sha256:1feaaf724694d08a1fb19370b6ff37e6669edb16cae69e02660177253f903dc1"}, "verdict": "proven", "tested_at": "2026-09-30T15:28:57Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/bench/apps/emby/bench/evidence/MV-emby/verdict.json", "box_evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/box/emby/step.txt", "memory_peak_pct": 4.7, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 7.3} diff --git a/templates/emby/docker-compose.yml b/templates/emby/docker-compose.yml index 93dcf58..b56957a 100644 --- a/templates/emby/docker-compose.yml +++ b/templates/emby/docker-compose.yml @@ -12,7 +12,7 @@ services: emby: - image: emby/embyserver:4.11.0.3 + image: emby/embyserver:4.11.0.4 container_name: emby restart: unless-stopped environment: diff --git a/templates/emby/steps/c9865ae7db76a683.felhom.yml b/templates/emby/steps/c9865ae7db76a683.felhom.yml new file mode 100644 index 0000000..5964509 --- /dev/null +++ b/templates/emby/steps/c9865ae7db76a683.felhom.yml @@ -0,0 +1,123 @@ +# ============================================================================= +# .felhom.yml - App metadata for felhom-controller +# ============================================================================= + +# --- Display info (shown on dashboard) --- +display_name: "Emby" +description: "Személyes média szerver élő TV és DVR támogatással" +category: "media" +subdomain: "emby" +slug: "emby" +# catalog_since: the date THIS repo last changed this app's pinned images. Any commit that +# changes an image: line must set this to the same day (see CLAUDE.md). +catalog_since: "2026-09-23" + +# --- Resource hints (displayed on deploy screen) --- +resources: + mem_request: "512M" + mem_limit: "2048M" + pi_compatible: false + needs_hdd: true + +# --- Backup classification (referential coupling; see felhom.eu documentation/audits/SPIKE-backup-classification-2026-07-14.md) --- +backup: + userdata: + - path: media + class: excluded # pure reader of the shared tree (:ro); state lives in volumes + +# --- Deploy fields (first deployment only) --- +deploy_fields: + - env_var: DOMAIN + label: "Domain" + type: domain + description: "A szerver domain neve" + locked_after_deploy: true + + - env_var: SUBDOMAIN + label: "Aldomain" + type: subdomain + default: "emby" + required: true + locked_after_deploy: true + description: "Az alkalmazás aldomainje" + + - env_var: HDD_PATH + label: "Médiatár útvonal" + type: path + required: true + placeholder: "/mnt/felhom-drives/hdd_1" + description: "A külső merevlemez elérési útja" + locked_after_deploy: true + +# --- The setup gate (controller >= 0.281.0, `09` §3 decisions 46-47) --- +# The first visitor would create the admin; a fresh install is closed to everyone but the household until the first setup is done. +setup_gate: true + +# --- App info (info page content) --- +app_info: + tagline: "Személyes média szerver élő TV és DVR támogatással" + docs_url: "https://emby.media/support/articles/Home.html" + + use_cases: + - 'Filmek, sorozatok, zene és fotók kezelése egy helyen' + - 'Élő TV nézés és felvétel (DVR) TV tunerrel' + - 'Automatikus transzkódolás bármilyen eszközhöz' + - 'Szülői felügyelet és felhasználói profilok' + - 'Szinkronizálás offline megtekintéshez mobilon' + + first_steps: + - 'Nyisd meg az emby.DOMAIN címet a böngészőben' + - 'Kövesd a beállítás varázslót' + - 'Hozd létre az admin fiókot' + - 'Add hozzá a médiatárat a /media mappából' + - 'Telepítsd az Emby alkalmazást eszközeidre' + + prerequisites: + - 'Külső HDD szükséges a médiafájlok tárolásához' + - 'Legalább 2 GB szabad RAM ajánlott' + - 'Emby Premiere előfizetés a prémium funkciókhoz (opcionális)' + +# --- Controller-side health probe --- +healthcheck: + checks: + - type: api + port: 8096 + path: "/emby/system/ping" + expect: + status: 200 + +# --- English copy (localisation slice 5, R-560) -------------------------------------------- +# The Hungarian above is UNCHANGED. A box on English reads this block field by field; a missing +# field shows the Hungarian one; a controller older than 0.257.0 ignores the block entirely. +i18n: + en: + description: 'A personal media server with live TV and recording' + app_info: + tagline: 'A personal media server with live TV and recording' + use_cases: + - 'Films, series, music and photos in one place' + - 'Watch and record live TV, with a TV tuner' + - 'It re-encodes on the fly for whatever device you are on' + - 'Parental controls and a profile for each person' + - 'Sync to a phone to watch offline' + first_steps: + - 'Open emby.DOMAIN in your browser' + - 'Follow the setup wizard' + - 'Create the admin account' + - 'Add your library from the /media folder' + - 'Install the Emby app on your devices' + prerequisites: + - 'An external hard drive is needed to keep the media files on' + - 'At least 2 GB of free RAM is recommended' + - 'An Emby Premiere subscription for the premium features (optional)' + deploy_fields: + - env_var: DOMAIN + label: 'Domain' + description: 'The server domain name' + - env_var: SUBDOMAIN + label: 'Subdomain' + description: 'The subdomain this app answers on' + - env_var: HDD_PATH + label: 'Media library path' + description: 'The path to the external hard drive' + placeholder: '/mnt/felhom-drives/hdd_1' diff --git a/templates/emby/steps/c9865ae7db76a683.yml b/templates/emby/steps/c9865ae7db76a683.yml new file mode 100644 index 0000000..93dcf58 --- /dev/null +++ b/templates/emby/steps/c9865ae7db76a683.yml @@ -0,0 +1,53 @@ +# Emby - Személyes média szerver élő TV és DVR támogatással +# Domain: ${SUBDOMAIN}.${DOMAIN} +# Database: None (file-based) +# RAM: ~512M (mem_limit: 2048M) | Pi-compatible: No +# +# Environment variables: +# DOMAIN - Your domain (e.g., demo-felhom.eu) +# USERDATA_PATH - Ügyfél-tartalom gyökér (/userdata) +# +# Storage layout (felhom userdata convention): +# Médiatár → ${USERDATA_PATH}/media (csak olvasható) + +services: + emby: + image: emby/embyserver:4.11.0.3 + container_name: emby + restart: unless-stopped + environment: + - TZ=Europe/Budapest + - UID=1000 + - GID=1000 + volumes: + - emby_config:/config + - ${USERDATA_PATH}/media:/media:ro + networks: + - traefik-public + deploy: + resources: + limits: + memory: 2048M + healthcheck: + # Az Emby képfájlban NINCS curl és nincs önálló wget — csak BusyBox van. + # A korábbi curl-próba ezért soha nem futott le, a konténer véglegesen + # unhealthy maradt, és a Traefik nem irányított rá forgalmat (404). + test: ["CMD", "/bin/busybox", "wget", "--spider", "-q", "http://127.0.0.1:8096/emby/system/ping"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 30s + labels: + - "traefik.enable=true" + - "traefik.http.routers.emby.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)" + - "traefik.http.routers.emby.entrypoints=websecure" + - "traefik.http.routers.emby.tls=true" + - "traefik.http.routers.emby.tls.certresolver=letsencrypt" + - "traefik.http.services.emby.loadbalancer.server.port=8096" + +volumes: + emby_config: + +networks: + traefik-public: + external: true From 9a78e3b757e2c7bcbdda7b9dede3e4dba283935c Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 17:46:01 +0200 Subject: [PATCH 17/46] ghost: 6.65.0-alpine -> 6.67.0-alpine, within-major step, both venues proven (R-462) Bench 9401 (harness v4, swap 0): the site set up through /ghost/api/admin/authentication/setup/, its title read back before and after, 10-min memory watch 0 kills (anon peak 26.7 %); the abort starts and serves. Box 9202: the guarded Update done in 107.7 s through the setup gate, read back. Written by upgrade-test.py --write-ladder. Evidence: felhom.eu/documentation/audits/more-night-apps-2026-09-30/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/ghost/.felhom.yml | 3 +- templates/ghost/docker-compose.yml | 2 +- .../ghost/steps/b937fe12810ef293.felhom.yml | 103 ++++++++++++++++++ templates/ghost/steps/b937fe12810ef293.yml | 47 ++++++++ 4 files changed, 153 insertions(+), 2 deletions(-) create mode 100644 templates/ghost/steps/b937fe12810ef293.felhom.yml create mode 100644 templates/ghost/steps/b937fe12810ef293.yml diff --git a/templates/ghost/.felhom.yml b/templates/ghost/.felhom.yml index fbd12ec..901ff69 100644 --- a/templates/ghost/.felhom.yml +++ b/templates/ghost/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "blog" slug: "ghost" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-09-23" +catalog_since: "2026-09-30" # Bare "/" is the public blog; the admin panel / setup wizard lives at /ghost/. open_path: "/ghost/" @@ -108,3 +108,4 @@ i18n: update_ladder: - {"from": {"ghost": "ghost:6.53.0-alpine"}, "to": {"ghost": "ghost:6.64.0-alpine"}, "digest": {"ghost": "sha256:47ecbe856dd06dcd20cb9410e1c4d532fc085eba776cfabc203609c7d15d8320"}, "verdict": "proven", "tested_at": "2026-09-22T13:11:12.069214+00:00", "harness_version": 1, "evidence": "felhom.eu/documentation/audits/the-28-2026-09-22/apps/ghost/verdict.json", "memory_peak_pct": null, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "backfilled": "2026-09-23", "note": "backfilled from catalog commit acbfafa; box walk only (harness v1, no memory watch); digest = what the registry served on 2026-09-23, not a measurement of the tested image"} - {"from": {"ghost": "ghost:6.64.0-alpine"}, "to": {"ghost": "ghost:6.65.0-alpine"}, "digest": {"ghost": "sha256:65788e5e2c5478319f8fc65ac12816dbc941d1a9c834c87190cf1d2d1b79d4e2"}, "verdict": "proven", "tested_at": "2026-09-23T19:32:30Z", "harness_version": 3, "evidence": "felhom.eu/documentation/audits/night-2026-09-23/apps/ghost/bench/evidence/MV-ghost/verdict.json", "box_evidence": "felhom.eu/documentation/audits/night-2026-09-23/apps/ghost/verdict.json", "memory_peak_pct": 24.9, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 43.3} + - {"from": {"ghost": "ghost:6.65.0-alpine"}, "to": {"ghost": "ghost:6.67.0-alpine"}, "digest": {"ghost": "sha256:1f7ecf094d54363014636c3540dbe9c368394504abaa283914e4fcf8d699f331"}, "verdict": "proven", "tested_at": "2026-09-30T15:42:18Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/bench/apps/ghost/bench/evidence/MV-ghost/verdict.json", "box_evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/box/ghost/step.txt", "memory_peak_pct": 26.7, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 33.9} diff --git a/templates/ghost/docker-compose.yml b/templates/ghost/docker-compose.yml index dba5380..a92f943 100644 --- a/templates/ghost/docker-compose.yml +++ b/templates/ghost/docker-compose.yml @@ -8,7 +8,7 @@ services: ghost: - image: ghost:6.65.0-alpine + image: ghost:6.67.0-alpine container_name: ghost restart: unless-stopped environment: diff --git a/templates/ghost/steps/b937fe12810ef293.felhom.yml b/templates/ghost/steps/b937fe12810ef293.felhom.yml new file mode 100644 index 0000000..03b3977 --- /dev/null +++ b/templates/ghost/steps/b937fe12810ef293.felhom.yml @@ -0,0 +1,103 @@ +# ============================================================================= +# .felhom.yml - App metadata for felhom-controller +# ============================================================================= + +# --- Display info (shown on dashboard) --- +display_name: "Ghost" +description: "Professzionális blog és hírlevél platform" +category: "productivity" +subdomain: "blog" +slug: "ghost" +# catalog_since: the date THIS repo last changed this app's pinned images. Any commit that +# changes an image: line must set this to the same day (see CLAUDE.md). +catalog_since: "2026-09-23" +# Bare "/" is the public blog; the admin panel / setup wizard lives at /ghost/. +open_path: "/ghost/" + +# --- Resource hints (displayed on deploy screen) --- +resources: + mem_request: "150M" + mem_limit: "512M" + pi_compatible: false + needs_hdd: false + +# --- Deploy fields (first deployment only) --- +deploy_fields: + - env_var: DOMAIN + label: "Domain" + type: domain + description: "A szerver domain neve" + locked_after_deploy: true + + - env_var: SUBDOMAIN + label: "Aldomain" + type: subdomain + default: "blog" + required: true + locked_after_deploy: true + description: "Az alkalmazás aldomainje" + +# --- The setup gate (controller >= 0.281.0, `09` §3 decisions 46-47) --- +# The first visitor would create the admin; a fresh install is closed to everyone but the household until the first setup is done. +setup_gate: true +# measured on 9202 2026-09-29: before the setup {"setup":[{"status":false}]}, after {"setup":[{"status":true}]}. +setup_done_probe: + url: http://ghost:2368/ghost/api/admin/authentication/setup/ + field: setup.0.status + done: "true" + +# --- App info (info page content) --- +app_info: + tagline: "Professzionális blog és hírlevél platform" + docs_url: "https://ghost.org/docs/" + + use_cases: + - 'Professzionális blog indítása és üzemeltetése' + - 'Hírlevél küldés beépített email funkcióval' + - 'SEO-optimalizált tartalom publikálás' + - 'Tagság és fizetős tartalom kezelés' + - 'Markdown és vizuális szerkesztő' + + first_steps: + - 'Nyisd meg a blog.DOMAIN/ghost/ címet a böngészőben' + - 'Hozd létre az admin fiókot a beállítás varázslóban' + - 'Írd meg és publikáld az első posztodat' + - 'Személyre szabd a témát és beállításokat' + + prerequisites: + - 'x86 processzor szükséges' + +# --- Controller-side health probe --- +healthcheck: + checks: + - type: http + port: 2368 + +# --- English copy (localisation slice 5, R-560) -------------------------------------------- +# The Hungarian above is UNCHANGED. A box on English reads this block field by field; a missing +# field shows the Hungarian one; a controller older than 0.257.0 ignores the block entirely. +i18n: + en: + description: 'A professional blog and newsletter platform' + app_info: + tagline: 'A professional blog and newsletter platform' + use_cases: + - 'Start and run a professional blog' + - 'Send a newsletter with the built-in e-mail feature' + - 'Publish content that search engines can read' + - 'Memberships and paid content' + - 'A Markdown editor and a visual one' + first_steps: + - 'Open blog.DOMAIN/ghost/ in your browser' + - 'Create the admin account in the setup wizard' + - 'Write and publish your first post' + - 'Make the theme and the settings your own' + prerequisites: + - 'An x86 processor is needed' + deploy_fields: + - env_var: DOMAIN + label: 'Domain' + description: 'The server domain name' + - env_var: SUBDOMAIN + label: 'Subdomain' + description: 'The subdomain this app answers on' diff --git a/templates/ghost/steps/b937fe12810ef293.yml b/templates/ghost/steps/b937fe12810ef293.yml new file mode 100644 index 0000000..dba5380 --- /dev/null +++ b/templates/ghost/steps/b937fe12810ef293.yml @@ -0,0 +1,47 @@ +# Ghost - Professzionális blog és hírlevél platform +# Domain: ${SUBDOMAIN}.${DOMAIN} +# Database: None (file-based) +# RAM: ~150M (mem_limit: 512M) | Pi-compatible: No +# +# Environment variables: +# DOMAIN - Your domain (e.g., demo-felhom.eu) + +services: + ghost: + image: ghost:6.65.0-alpine + container_name: ghost + restart: unless-stopped + environment: + - TZ=Europe/Budapest + - NODE_ENV=production + - url=https://${SUBDOMAIN}.${DOMAIN} + - database__client=sqlite3 + - database__connection__filename=content/data/ghost.db + volumes: + - ghost_content:/var/lib/ghost/content + networks: + - traefik-public + deploy: + resources: + limits: + memory: 512M + healthcheck: + test: ["CMD", "node", "-e", "require('http').get('http://127.0.0.1:2368/',r=>{process.exit(r.statusCode<400?0:1)}).on('error',()=>process.exit(1))"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 30s + labels: + - "traefik.enable=true" + - "traefik.http.routers.ghost.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)" + - "traefik.http.routers.ghost.entrypoints=websecure" + - "traefik.http.routers.ghost.tls=true" + - "traefik.http.routers.ghost.tls.certresolver=letsencrypt" + - "traefik.http.services.ghost.loadbalancer.server.port=2368" + +volumes: + ghost_content: + +networks: + traefik-public: + external: true From 15f4d5969a80560f33c0fbc66b37b941b4f6c2f1 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 18:05:31 +0200 Subject: [PATCH 18/46] home-assistant: 2026.9.3 -> 2026.9.4, within-major step, both venues proven (R-462) Bench 9401 (harness v4, swap 0): the onboarding owner seeded and logged in before and after, 10-min memory watch 0 kills (anon peak 32.0 %); the abort starts and serves. Box 9202: the guarded Update done in 113.8 s through the setup gate, the owner logs in. The old head was a backfilled harness-v1 entry; this step carries the memory watch. Written by upgrade-test.py --write-ladder. Evidence: felhom.eu/documentation/audits/more-night-apps-2026-09-30/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/home-assistant/.felhom.yml | 3 +- templates/home-assistant/docker-compose.yml | 2 +- .../steps/52034472eaf393c5.felhom.yml | 106 ++++++++++++++++++ .../home-assistant/steps/52034472eaf393c5.yml | 61 ++++++++++ 4 files changed, 170 insertions(+), 2 deletions(-) create mode 100644 templates/home-assistant/steps/52034472eaf393c5.felhom.yml create mode 100644 templates/home-assistant/steps/52034472eaf393c5.yml diff --git a/templates/home-assistant/.felhom.yml b/templates/home-assistant/.felhom.yml index fb5a189..6c2251c 100644 --- a/templates/home-assistant/.felhom.yml +++ b/templates/home-assistant/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "ha" slug: "home-assistant" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-09-22" +catalog_since: "2026-09-30" # --- Resource hints (displayed on deploy screen) --- resources: @@ -110,3 +110,4 @@ i18n: # gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. update_ladder: - {"from": {"home-assistant": "ghcr.io/home-assistant/home-assistant:2026.7.2"}, "to": {"home-assistant": "ghcr.io/home-assistant/home-assistant:2026.9.3"}, "digest": {"home-assistant": "sha256:d8922685169707fd91e8b9729902d975f06157d005e422874d201e0261dda196"}, "verdict": "proven", "tested_at": "2026-09-21T19:10:14.843396+00:00", "harness_version": 1, "evidence": "felhom.eu/documentation/audits/update-night-2026-09-21/apps/home-assistant/verdict.json", "memory_peak_pct": null, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "backfilled": "2026-09-23", "note": "backfilled from catalog commit 4405f12; box walk only (harness v1, no memory watch); digest = what the registry served on 2026-09-23, not a measurement of the tested image"} + - {"from": {"home-assistant": "ghcr.io/home-assistant/home-assistant:2026.9.3"}, "to": {"home-assistant": "ghcr.io/home-assistant/home-assistant:2026.9.4"}, "digest": {"home-assistant": "sha256:3e6710a7ab2a61311d9d899b719f6c3657791c63e8f4942cec4ebc42401d6b76"}, "verdict": "proven", "tested_at": "2026-09-30T15:56:29Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/bench/apps/home-assistant/bench/evidence/MV-home-assistant/verdict.json", "box_evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/box/home-assistant/step.txt", "memory_peak_pct": 32.0, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 47.4} diff --git a/templates/home-assistant/docker-compose.yml b/templates/home-assistant/docker-compose.yml index 00dba82..a791459 100644 --- a/templates/home-assistant/docker-compose.yml +++ b/templates/home-assistant/docker-compose.yml @@ -8,7 +8,7 @@ services: home-assistant: - image: ghcr.io/home-assistant/home-assistant:2026.9.3 + image: ghcr.io/home-assistant/home-assistant:2026.9.4 container_name: home-assistant restart: unless-stopped entrypoint: ["/bin/sh", "-c"] diff --git a/templates/home-assistant/steps/52034472eaf393c5.felhom.yml b/templates/home-assistant/steps/52034472eaf393c5.felhom.yml new file mode 100644 index 0000000..586c3c5 --- /dev/null +++ b/templates/home-assistant/steps/52034472eaf393c5.felhom.yml @@ -0,0 +1,106 @@ +# ============================================================================= +# .felhom.yml - App metadata for felhom-controller +# ============================================================================= + +# --- Display info (shown on dashboard) --- +display_name: "Home Assistant" +description: "Nyílt forráskódú okos otthon központ" +category: "home" +subdomain: "ha" +slug: "home-assistant" +# catalog_since: the date THIS repo last changed this app's pinned images. Any commit that +# changes an image: line must set this to the same day (see CLAUDE.md). +catalog_since: "2026-09-22" + +# --- Resource hints (displayed on deploy screen) --- +resources: + mem_request: "256M" + mem_limit: "1024M" + pi_compatible: true + needs_hdd: false + +# --- Deploy fields (first deployment only) --- +deploy_fields: + - env_var: DOMAIN + label: "Domain" + type: domain + description: "A szerver domain neve" + locked_after_deploy: true + + - env_var: SUBDOMAIN + label: "Aldomain" + type: subdomain + default: "ha" + required: true + locked_after_deploy: true + description: "Az alkalmazás aldomainje" + +# --- The setup gate (controller >= 0.281.0, `09` §3 decisions 46-47) --- +# The first visitor would create the admin; a fresh install is closed to everyone but the household until the first setup is done. +setup_gate: true +# measured on 9202 2026-09-29: before [{"step":"user","done":false},…], after the user step [{"step":"user","done":true},…]. +setup_done_probe: + url: http://home-assistant:8123/api/onboarding + field: 0.done + done: "true" + +# --- App info (info page content) --- +app_info: + tagline: "Okos otthon központ - automatizálás és vezérlés egy helyről" + docs_url: "https://www.home-assistant.io/docs/" + + use_cases: + - 'Okos otthon eszközök központi kezelése (lámpa, termosztát, kamera)' + - 'Automatizálások létrehozása (pl. mozgásérzékelőre lámpa be)' + - '2000+ integráció (Zigbee, Z-Wave, Tuya, Shelly, stb.)' + - 'Dashboard a család számára mobilon és tableten' + - 'Energiafogyasztás monitorozás' + + first_steps: + - 'Nyisd meg a ha.DOMAIN címet a böngészőben' + - 'Hozd létre a tulajdonos fiókot az onboarding során' + - 'Fedezd fel az automatikusan felfedezett eszközöket' + - 'Telepíts integrációkat az okos otthon eszközeidhez' + - 'Hozd létre az első automatizálást' + + prerequisites: + - 'Okos otthon eszközök (nem kötelező, de ajánlott a telepítés előtt)' + - 'Zigbee/Z-Wave koordinátor USB eszközök átpasszolása nem támogatott Docker módban' + +# --- Controller-side health probe --- +healthcheck: + checks: + - type: api + port: 8123 + path: "/api/" + +# --- English copy (localisation slice 5, R-560) -------------------------------------------- +# The Hungarian above is UNCHANGED. A box on English reads this block field by field; a missing +# field shows the Hungarian one; a controller older than 0.257.0 ignores the block entirely. +i18n: + en: + description: 'An open source smart home hub' + app_info: + tagline: 'A smart home hub - automation and control from one place' + use_cases: + - 'Run your smart home devices from one place (lights, thermostat, cameras)' + - 'Build automations (a light that comes on with a motion sensor, for example)' + - '2000+ integrations (Zigbee, Z-Wave, Tuya, Shelly and more)' + - 'A dashboard for the household, on phones and tablets' + - 'Watch what your home uses in energy' + first_steps: + - 'Open ha.DOMAIN in your browser' + - 'Create the owner account during onboarding' + - 'Look at the devices it has already found on its own' + - 'Install integrations for your smart home devices' + - 'Build your first automation' + prerequisites: + - 'Smart home devices (not required, but worth having before you install)' + - 'Passing a Zigbee/Z-Wave USB coordinator through is not supported in Docker mode' + deploy_fields: + - env_var: DOMAIN + label: 'Domain' + description: 'The server domain name' + - env_var: SUBDOMAIN + label: 'Subdomain' + description: 'The subdomain this app answers on' diff --git a/templates/home-assistant/steps/52034472eaf393c5.yml b/templates/home-assistant/steps/52034472eaf393c5.yml new file mode 100644 index 0000000..00dba82 --- /dev/null +++ b/templates/home-assistant/steps/52034472eaf393c5.yml @@ -0,0 +1,61 @@ +# Home Assistant - Nyílt forráskódú okos otthon központ +# Domain: ${SUBDOMAIN}.${DOMAIN} +# Database: None (file-based) +# RAM: ~256M (mem_limit: 1024M) | Pi-compatible: Yes +# +# Environment variables: +# DOMAIN - Your domain (e.g., demo-felhom.eu) + +services: + home-assistant: + image: ghcr.io/home-assistant/home-assistant:2026.9.3 + container_name: home-assistant + restart: unless-stopped + entrypoint: ["/bin/sh", "-c"] + command: + - | + # Ensure reverse-proxy (Traefik) trusted_proxies config exists. + # 172.16.0.0/12 covers all Docker bridge networks. + CFG=/config/configuration.yaml + if [ -f "$$CFG" ] && ! grep -q 'trusted_proxies' "$$CFG"; then + printf '\nhttp:\n use_x_forwarded_for: true\n trusted_proxies:\n - 172.16.0.0/12\n' >> "$$CFG" + elif [ ! -f "$$CFG" ]; then + cat > "$$CFG" << 'HACFG' + default_config: + http: + use_x_forwarded_for: true + trusted_proxies: + - 172.16.0.0/12 + HACFG + fi + exec /init + environment: + - TZ=Europe/Budapest + volumes: + - homeassistant_config:/config + networks: + - traefik-public + deploy: + resources: + limits: + memory: 1024M + healthcheck: + test: ["CMD", "curl", "-sf", "http://127.0.0.1:8123/manifest.json"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 30s + labels: + - "traefik.enable=true" + - "traefik.http.routers.home-assistant.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)" + - "traefik.http.routers.home-assistant.entrypoints=websecure" + - "traefik.http.routers.home-assistant.tls=true" + - "traefik.http.routers.home-assistant.tls.certresolver=letsencrypt" + - "traefik.http.services.home-assistant.loadbalancer.server.port=8123" + +volumes: + homeassistant_config: + +networks: + traefik-public: + external: true From 7a4ff48590608df7d271c98e1b67d5d85076e88f Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 18:05:48 +0200 Subject: [PATCH 19/46] wger: run the database migrations at start (R-738) wger's image runs `manage.py migrate` only when DJANGO_PERFORM_MIGRATIONS=True (entrypoint.sh). Without it, 2.6 -> 2.7 through the guarded Update on 9202 ended `done` and left 12 migrations unapplied: the web login answered 500 (no such column: core_userprofile.time_zone). With the switch, the same step on 9202 ran the migrations and the seeded weight entry read back. No image moves here; no box reporting to the hub runs wger. Evidence: felhom.eu/documentation/audits/more-night-apps-2026-09-30/box/wger/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/wger/docker-compose.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/wger/docker-compose.yml b/templates/wger/docker-compose.yml index f02c78f..3933676 100644 --- a/templates/wger/docker-compose.yml +++ b/templates/wger/docker-compose.yml @@ -26,6 +26,9 @@ services: # https Origin with "CSRF verification failed" — nobody could sign in from a browser. - CSRF_TRUSTED_ORIGINS=https://${SUBDOMAIN}.${DOMAIN} - X_FORWARDED_PROTO_HEADER_SET=True + # R-738: the image runs `manage.py migrate` at start ONLY with this switch (entrypoint.sh). Without it an update + # that brings migrations leaves wger serving its front page over an unmigrated database (login 500). + - DJANGO_PERFORM_MIGRATIONS=True - DJANGO_DB_ENGINE=django.db.backends.sqlite3 - DJANGO_DB_DATABASE=/home/wger/db/database.sqlite - DJANGO_DB_USER=wger From 53a4a1ddf770e319cb8c361afa479430914803bc Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 18:15:49 +0200 Subject: [PATCH 20/46] calibre-web: v4.0.6 -> v4.0.8, its first ladder step, both venues proven (R-462) A new front-door fixture: a book uploaded through the app's own Upload form and read back through its OPDS feed (listed, and the served EPUB carries the marker), with a wrong-password and an absent-title control. Bench 9401 (harness v4, swap 0): proven, 10-min watch 0 kills (anon peak 19.3 %); the harness saw the household books folder's tree hash change, so the step carries files_may_change (a night press needs a fresh whole copy). Box 9202: done in 64.6 s, the book read back, and not one file in the books folder changed (per-file hashes before/after). Written by upgrade-test.py --write-ladder. Evidence: felhom.eu/documentation/audits/more-night-apps-2026-09-30/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/calibre-web/.felhom.yml | 8 +++++++- templates/calibre-web/docker-compose.yml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/calibre-web/.felhom.yml b/templates/calibre-web/.felhom.yml index e0ef2ea..e4a5e7d 100644 --- a/templates/calibre-web/.felhom.yml +++ b/templates/calibre-web/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "books" slug: "calibre-web" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-07-12" +catalog_since: "2026-09-30" # --- Resource hints (displayed on deploy screen) --- resources: @@ -154,3 +154,9 @@ i18n: label: 'E-books to read in' - path: 'media/books' label: 'E-book library' + +# update_ladder — the test record: one tested step per line, oldest first (JSON flow mappings, +# `09-update-architecture.md` §6.4 part 4). WRITTEN BY scripts/upgrade-test.py, never by hand; +# gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. +update_ladder: + - {"from": {"calibre-web": "crocodilestick/calibre-web-automated:v4.0.6"}, "to": {"calibre-web": "crocodilestick/calibre-web-automated:v4.0.8"}, "digest": {"calibre-web": "sha256:5e00373854247750cc3e4479b492ae09293ff5e06ed10177f226634d97888679"}, "verdict": "proven", "tested_at": "2026-09-30T16:11:42Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/bench/apps/calibre-web/bench/evidence/MV-calibre-web/verdict.json", "box_evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/box/calibre-web/step.txt", "memory_peak_pct": 19.3, "marks": {"files_may_change": true, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 38.9} diff --git a/templates/calibre-web/docker-compose.yml b/templates/calibre-web/docker-compose.yml index 61c118b..058e8f3 100644 --- a/templates/calibre-web/docker-compose.yml +++ b/templates/calibre-web/docker-compose.yml @@ -20,7 +20,7 @@ services: calibre-web: - image: crocodilestick/calibre-web-automated:v4.0.6 + image: crocodilestick/calibre-web-automated:v4.0.8 container_name: calibre-web restart: unless-stopped environment: From 5b1972b7f964e04d7e79f0ee666736b46d764c92 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 18:16:45 +0200 Subject: [PATCH 21/46] harness: five new front-door fixtures, gitea's installer, HTTPS backends, per-file change names (R-462, R-624, R-735) - fixtures (upgrade_fixtures_box.py): calibre-web (Upload form -> OPDS readback + the served EPUB), wger (web login -> weight entry API), crafty-controller (API v2 roles), uptime-kuma (socket.io polling: setup, login, addStatusPage -> public /api/status-page/); gitea posts its own first-run installer form (R-624's fixable case) and keeps the admin CLI for an installed one. calibre-web and wger run the template's own after_install on the bench, which has none. - R-735: the bench's `password:N:special` now has the controller's shape (randomWithSpecial); test seen failing first (length 32, no special), then 45/45. - upgrade_boxport / the memory watch: a backend traefik reaches over https (loadbalancer.server.scheme) is reached over https on the bench too (crafty-controller). - upgrade-test: files-before/after-detail.json and `files_changed_detail` NAME the files behind a files_may_change mark (R-734's method, now in the harness); test ChangedFiles. - test_catalog_gates: the gate count was stale (9, the runner has 10) and red on main; now 10. Evidence: felhom.eu/documentation/audits/more-night-apps-2026-09-30/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- scripts/check-volume-persistence.py | 11 + scripts/test_catalog_gates.py | 5 +- scripts/test_check_volume_persistence.py | 16 + scripts/test_upgrade_bench.py | 11 + scripts/upgrade-test.py | 58 ++- scripts/upgrade_boxport.py | 19 +- scripts/upgrade_fixtures_box.py | 466 ++++++++++++++++++++++- 7 files changed, 565 insertions(+), 21 deletions(-) diff --git a/scripts/check-volume-persistence.py b/scripts/check-volume-persistence.py index d6a1b91..2d62598 100644 --- a/scripts/check-volume-persistence.py +++ b/scripts/check-volume-persistence.py @@ -421,9 +421,20 @@ def _gen(spec, ftype): """ if spec: kind, _, n = spec.partition(":") + n, _, form = n.partition(":") n = int(n) if n.isdigit() else 32 if kind == "hex": return secrets.token_hex(n) + if kind == "password" and form == "special": + # R-735: `password:N:special` — deploy.go randomWithSpecial: N long, a letter or digit first, at least + # one lower, upper, digit and one of passwordSpecials. Pinned by + # test_check_volume_persistence.TestEnvBuilding.test_password_special_carries_the_controllers_shape. + alph, specials = "abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789", "-_.!@#%+=" + while True: + p = "".join(secrets.choice(alph + specials) for _ in range(n)) + if (p[0] not in specials and any(c in specials for c in p) and any(c.islower() for c in p) + and any(c.isupper() for c in p) and any(c.isdigit() for c in p)): + return p if kind in ("password", "secret"): alph = "abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789" return "".join(secrets.choice(alph) for _ in range(n)) diff --git a/scripts/test_catalog_gates.py b/scripts/test_catalog_gates.py index 9ccaff8..ed5567e 100644 --- a/scripts/test_catalog_gates.py +++ b/scripts/test_catalog_gates.py @@ -60,8 +60,9 @@ class CatalogGatesFastTest(unittest.TestCase): spec.loader.exec_module(mod) # STALE UNTIL 2026-09-23: this read 5 gates and 3 fast ones while the table had grown to 7 # (copy-i18n, probe-matches-compose) — the test was red and nobody ran it. Now 9 with the test - # record's two halves; the slow pair stays out of --fast. - self.assertEqual(len(mod.GATES), 9) + # record's two halves; the slow pair stays out of --fast. STALE AGAIN until 2026-09-30: 10 since + # probe-measured joined; the test had been red on main (found by the more-night-apps session). + self.assertEqual(len(mod.GATES), 10) self.assertEqual([g[0] for g in mod.GATES if not g[3]], ["image-resolvable", "volume-persistence"]) self.assertIn("test-record", [g[0] for g in mod.GATES if g[3] and not g[4]]) # runs in CI too # the gates that need git history are the ones the CI half cannot run (R-452's shallow gap) diff --git a/scripts/test_check_volume_persistence.py b/scripts/test_check_volume_persistence.py index 4c9465b..f05d6a7 100644 --- a/scripts/test_check_volume_persistence.py +++ b/scripts/test_check_volume_persistence.py @@ -442,6 +442,22 @@ class TestEnvBuilding(unittest.TestCase): import base64 self.assertEqual(len(base64.b64decode(v[len("base64:"):])), 32) + def test_password_special_carries_the_controllers_shape(self): + """R-735: `password:N:special` must be what the controller's randomWithSpecial mints (deploy.go L1335): + N long, a letter or digit first, at least one lower, upper, digit and one of `-_.!@#%+=`. Without the + special character calibre-web's own rule refuses the password and the bench cannot seed the app. + COMPANION RED-PROOF: before the fix `_gen` returned letters and digits only; this test failed.""" + felhom = "deploy_fields:\n - env_var: ADMIN_PASSWORD\n type: password\n generate: \"password:24:special\"\n" + for _ in range(50): + v = cvp.build_env("calibre-web", felhom, "${ADMIN_PASSWORD}")["ADMIN_PASSWORD"] + self.assertEqual(len(v), 24, v) + self.assertTrue(any(c in "-_.!@#%+=" for c in v), f"no special character: {v}") + self.assertNotIn(v[0], "-_.!@#%+=") + for cls in ("abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "0123456789"): + self.assertTrue(any(c in cls for c in v), f"missing one of {cls[:3]}…: {v}") + plain = "deploy_fields:\n - env_var: P\n type: password\n generate: \"password:16\"\n" + self.assertTrue(cvp.build_env("x", plain, "${P}")["P"].isalnum()) # the plain form is unchanged + def test_deploy_fields_block_ends_at_the_next_top_level_key(self): felhom = "deploy_fields:\n - env_var: A\n type: text\napp_info:\n tagline: x\n" self.assertEqual([f["env_var"] for f in cvp.parse_deploy_fields(felhom)], ["A"]) diff --git a/scripts/test_upgrade_bench.py b/scripts/test_upgrade_bench.py index 9702a73..1088e2e 100644 --- a/scripts/test_upgrade_bench.py +++ b/scripts/test_upgrade_bench.py @@ -70,5 +70,16 @@ class ClearScratch(unittest.TestCase): self.assertTrue(os.path.exists(keep)) +class ChangedFiles(unittest.TestCase): + """2026-09-30: a `files_may_change` mark names its files (R-734's method, now in the harness).""" + + def test_names_changed_added_removed_and_nothing_else(self): + before = {"/d": {"a.txt": "1:aa", "b.txt": "1:bb", "gone": "1:cc"}} + after = {"/d": {"a.txt": "1:aa", "b.txt": "2:bd", "new": "1:dd"}} + self.assertEqual(ut.changed_files(before, after), + ["/d/b.txt (changed)", "/d/gone (removed)", "/d/new (added)"]) + self.assertEqual(ut.changed_files(before, before), []) + + if __name__ == "__main__": unittest.main(verbosity=2) diff --git a/scripts/upgrade-test.py b/scripts/upgrade-test.py index 8800ef2..d06c30f 100755 --- a/scripts/upgrade-test.py +++ b/scripts/upgrade-test.py @@ -370,12 +370,14 @@ def memory_watch(app: str, project: str, workdir: Path, seconds: int, say, ev: P paths = LOAD_PATHS.get(app, ["/"]) native = fx.FIXTURES.get(app) cname, port = getattr(native, "container", app), getattr(native, "port", 80) + scheme = "http" if native is None and boxport is not None: # a box-fixture app: load the container traefik routes `/` to, at its own port rts = boxport.routes((workdir / "docker-compose.yml").read_text()) root = [r for r in rts if not r[0]] or rts if root: cname, port = root[0][1], root[0][2] + scheme = root[0][3] if len(root[0]) > 3 else "http" # an HTTPS backend (crafty-controller) target = container_ip(cname) stop = threading.Event() hits = {"n": 0, "codes": {}} @@ -383,7 +385,8 @@ def memory_watch(app: str, project: str, workdir: Path, seconds: int, say, ev: P class _NoRedirect(urllib.request.HTTPRedirectHandler): def redirect_request(self, *a, **k): return None # a 30x is the app ANSWERING; following it to the unreachable domain is not load - opener = urllib.request.build_opener(_NoRedirect) + import ssl + opener = urllib.request.build_opener(_NoRedirect, urllib.request.HTTPSHandler(context=ssl._create_unverified_context())) host = None try: envtxt = (workdir / ".env").read_text() @@ -398,7 +401,7 @@ def memory_watch(app: str, project: str, workdir: Path, seconds: int, say, ev: P def worker(i): k = 0 while not stop.is_set(): - url = f"http://{target}:{port}{paths[(i + k) % len(paths)]}" + url = f"{scheme}://{target}:{port}{paths[(i + k) % len(paths)]}" k += 1 try: req = urllib.request.Request(url, headers={"Host": host, "X-Forwarded-Proto": "https"} if host else {}) @@ -565,6 +568,51 @@ def bind_tree_hash(project: str, workdir: Path) -> dict: return out +def bind_tree_files(project: str, workdir: Path) -> dict: + """{bind source dir: {relpath: "size:sha256[:16]"}} — the same walk as bind_tree_hash, per FILE, so a + `files_may_change` mark can NAME the files it saw change (R-734's method, 2026-09-30: the tree hash alone + could not say which file moved). Files above 64 MiB carry size and mtime only, as in bind_tree_hash.""" + import hashlib + r = compose(workdir, project, "ps", "-aq", timeout=120) + srcs = set() + for cid in (r.stdout or "").split(): + info = cvp._inspect(cid) or {} + for m in info.get("Mounts") or []: + if m.get("Type") == "bind" and os.path.isdir(m.get("Source") or "") \ + and not (m.get("Source") or "").startswith(("/var/run", "/run", "/etc", "/proc", "/sys")): + srcs.add(m["Source"]) + out = {} + for src in sorted(srcs): + files = {} + for dp, _, fn in os.walk(src): + for f in fn: + fp = os.path.join(dp, f) + try: + st = os.lstat(fp) + if st.st_size <= 64 * 1024 * 1024 and os.path.isfile(fp) and not os.path.islink(fp): + with open(fp, "rb") as fh: + d = hashlib.sha256(fh.read()).hexdigest()[:16] + else: + d = "mtime-%d" % int(st.st_mtime) + files[os.path.relpath(fp, src)] = "%d:%s" % (st.st_size, d) + except OSError: + files[os.path.relpath(fp, src)] = "unreadable" + out[src] = files + return out + + +def changed_files(before: dict, after: dict) -> list: + """["/ (added|removed|changed)"] between two bind_tree_files results.""" + out = [] + for src in sorted(set(before) | set(after)): + b, a = before.get(src) or {}, after.get(src) or {} + for rel in sorted(set(b) | set(a)): + if b.get(rel) != a.get(rel): + kind = "added" if rel not in b else "removed" if rel not in a else "changed" + out.append(f"{src}/{rel} ({kind})") + return out + + # --- the PostgreSQL major conversion on the bench (`09` §6.4 part 10, harness v4) --------------------- # # The postgres image converts nothing and refuses an older major's datadir (R-463); 18 refuses even an @@ -793,6 +841,8 @@ def run_edge(edge_id: str) -> dict: files_before = bind_tree_hash(project, workdir) (ev / "files-before.json").write_text(json.dumps(files_before, indent=2)) + detail_before = bind_tree_files(project, workdir) + (ev / "files-before-detail.json").write_text(json.dumps(detail_before, indent=2)) # --- 4. TO --- swap_at = datetime.now(timezone.utc).replace(microsecond=0).isoformat().replace("+00:00", "Z") @@ -846,8 +896,12 @@ def run_edge(edge_id: str) -> dict: (ev / "files-after.json").write_text(json.dumps(files_after, indent=2)) rec["files_changed"] = sorted(k for k in set(files_before) | set(files_after) if files_before.get(k) != files_after.get(k)) + detail_after = bind_tree_files(project, workdir) + (ev / "files-after-detail.json").write_text(json.dumps(detail_after, indent=2)) + rec["files_changed_detail"] = changed_files(detail_before, detail_after)[:200] if rec["files_changed"]: rec["marks"] = sorted(set(rec["marks"]) | {"files_may_change"}) + say(f"files_may_change — the files: {rec['files_changed_detail'][:20]}") say(f"files_may_change: the bind-mounted tree changed under {rec['files_changed']}") # --- 5b. the MEMORY WATCH — only for an edge that just read back; a failed one is decided --- diff --git a/scripts/upgrade_boxport.py b/scripts/upgrade_boxport.py index 8abc57f..93c9f58 100644 --- a/scripts/upgrade_boxport.py +++ b/scripts/upgrade_boxport.py @@ -29,13 +29,16 @@ import upgrade_fixtures_box28 as _box28 ROUTE_RULE_RE = re.compile(r"traefik\.http\.routers\.([A-Za-z0-9_-]+)\.rule[=:]\s*[\"']?(.+?)[\"']?\s*$") ROUTE_SVC_RE = re.compile(r"traefik\.http\.routers\.([A-Za-z0-9_-]+)\.service[=:]\s*[\"']?([A-Za-z0-9_-]+)") LB_PORT_RE = re.compile(r"traefik\.http\.services\.([A-Za-z0-9_-]+)\.loadbalancer\.server\.port[=:]\s*[\"']?(\d+)") +# 2026-09-30 (crafty-controller): a backend that speaks HTTPS says so to traefik; the bench must too. +LB_SCHEME_RE = re.compile(r"traefik\.http\.services\.([A-Za-z0-9_-]+)\.loadbalancer\.server\.scheme[=:]\s*[\"']?(https?)") PATH_RE = re.compile(r"PathPrefix\(`([^`]+)`\)") SERVICE_RE = re.compile(r"^ ([A-Za-z0-9_-]+):\s*$") CNAME_RE = re.compile(r"^\s+container_name:\s*[\"']?([^\s\"']+)") def routes(compose_text): - """[(path_prefixes, container, port)] for every compose service traefik routes to.""" + """[(path_prefixes, container, port, scheme)] for every compose service traefik routes to. The scheme is + the 4th element so every reader of [0]..[2] is unchanged.""" out, cur, cname, labels = [], None, {}, {} for line in compose_text.splitlines(): m = SERVICE_RE.match(line) @@ -50,9 +53,9 @@ def routes(compose_text): if "traefik." in line: labels.setdefault(cur, []).append(line.strip().lstrip("- ").strip()) for svc, ls in labels.items(): - rules, rsvc, ports = {}, {}, {} + rules, rsvc, ports, schemes = {}, {}, {}, {} for l in ls: - for rx, d in ((ROUTE_RULE_RE, rules), (ROUTE_SVC_RE, rsvc), (LB_PORT_RE, ports)): + for rx, d in ((ROUTE_RULE_RE, rules), (ROUTE_SVC_RE, rsvc), (LB_PORT_RE, ports), (LB_SCHEME_RE, schemes)): mm = rx.search(l) if mm: d[mm.group(1)] = mm.group(2) @@ -62,7 +65,7 @@ def routes(compose_text): prefixes = [] for r, rule in rules.items(): prefixes += PATH_RE.findall(rule) - out.append((prefixes, cname.get(svc, svc), port)) + out.append((prefixes, cname.get(svc, svc), port, next(iter(schemes.values()), "http"))) return out @@ -83,12 +86,12 @@ class Venue: def _target(self, path): best, blen = None, -1 - for prefixes, container, port in self.routes: + for prefixes, container, port, scheme in self.routes: if not prefixes and blen < 0: - best, blen = (container, port), 0 + best, blen = (container, port, scheme), 0 for p in prefixes: if path.startswith(p) and len(p) > blen: - best, blen = (container, port), len(p) + best, blen = (container, port, scheme), len(p) return best def sh(self, args, timeout=300, inp=None): @@ -115,7 +118,7 @@ class Venue: args += ["-X", method] if data is not None: args += ["--data-binary", "@-"] - args += list(extra) + ["http://%s:%d%s" % (ip, t[1], path)] + args += list(extra) + ["%s://%s:%d%s" % (t[2], ip, t[1], path)] r = self.sh(args, timeout=timeout + 30, inp=data) body, _, code = (r.stdout or "").rpartition("\n") return r.returncode, code.strip(), body diff --git a/scripts/upgrade_fixtures_box.py b/scripts/upgrade_fixtures_box.py index a7e0601..b59803a 100644 --- a/scripts/upgrade_fixtures_box.py +++ b/scripts/upgrade_fixtures_box.py @@ -19,7 +19,7 @@ verify() must ask the APP, never the filesystem: a migration is supposed to rewr Where a fixture can prove itself (a negative control that must read as absent) it does so on EVERY call, so a readback that has broken into always saying "found" fails instead of passing everything. """ -import base64, json, re, secrets, time +import base64, json, os, re, secrets, time def _gx(w, container, *cmd, timeout=240): @@ -172,21 +172,55 @@ class BookStack: # ============================================================================================= class Gitea: - """Gitea's own admin CLI creates the first user; its own REST API (basic auth) then creates a - repository and reads it back. Both are the app's own interfaces.""" + """The first user comes from gitea's own FIRST-RUN INSTALLER (R-624, 2026-09-30): the template sets no + INSTALL_LOCK, so a fresh instance serves the installer form at `/`, and `gitea admin user create` + refuses (`MustInstalled()`). The household fills that form in; so does this fixture — `POST /` with the + form's OWN default values (read from the page, never typed) plus an admin account. Measured on the bench + 2026-09-30 (1.27.0): no CSRF field on the install form; 200, gitea restarts its web server in-process, and + the admin's Basic auth answers `/api/v1/user` 200 within seconds. On a box the setup gate (decision 46) is + in front; walk.app_curl passes it as the household does. An instance that is ALREADY installed falls back + to the admin CLI (the old route). Its own REST API (basic auth) then creates a repository and reads it + back. All of these are the app's own interfaces.""" sub = "git" + FORM_DEFAULTS = ("db_path", "app_name", "repo_root_path", "lfs_root_path", "run_user", "domain", + "ssh_port", "http_port", "app_url", "log_root_path") def seed(self, w, sub, say): if not w.wait_app(sub, "/", want=("200", "302")): return None user = "drill" + secrets.token_hex(3) pw = "Drill-" + secrets.token_hex(10) - out = _gx(w, "gitea", "su", "git", "-c", - f"gitea admin user create --username {user} --password {pw} " - f"--email {user}@gate.invalid --admin --must-change-password=false") - say(f" gitea: admin user create :: {' '.join(out.split())[:140]}") - if "has been successfully created" not in out and "successfully created" not in out: - return None + rc, code, page = w.app_curl(sub, "/") + if 'name="db_type"' in (page or "") and 'name="admin_name"' in (page or ""): + args = ["--data-urlencode", "db_type=sqlite3", "--data-urlencode", "password_algorithm=pbkdf2"] + for n in self.FORM_DEFAULTS: + m = re.search(r'name="%s" value="([^"]*)"' % n, page) + if m: + args += ["--data-urlencode", f"{n}={m.group(1)}"] + args += ["--data-urlencode", f"admin_name={user}", "--data-urlencode", f"admin_passwd={pw}", + "--data-urlencode", f"admin_confirm_passwd={pw}", + "--data-urlencode", f"admin_email={user}@gate.invalid"] + rc, code, body = w.app_curl(sub, "/", *args, method="POST", timeout=120) + say(f" gitea: first-run installer POST / http={code}") + ok = False + for _ in range(40): # the installer restarts gitea's web server in-process + rc, c2, _ = w.app_curl(sub, "/api/v1/user", "-u", f"{user}:{pw}", timeout=15) + if c2 == "200": + ok = True + break + time.sleep(3) + if not ok: + self.tried = f"installer POST / -> {code}; the admin never authenticated (last {c2})" + say(f" gitea: {self.tried} :: {' '.join((body or '').split())[:160]}") + return None + say(" gitea: installed through its own first-run form; the admin authenticates") + else: + out = _gx(w, "gitea", "su", "git", "-c", + f"gitea admin user create --username {user} --password {pw} " + f"--email {user}@gate.invalid --admin --must-change-password=false") + say(f" gitea: already installed — admin user create :: {' '.join(out.split())[:140]}") + if "successfully created" not in out: + return None repo = "drillrepo" + secrets.token_hex(3) rc, code, body = w.app_curl(sub, "/api/v1/user/repos", "-u", f"{user}:{pw}", "-H", "Content-Type: application/json", @@ -1417,7 +1451,421 @@ class Outline: return found +# ============================================================================================= +class CalibreWeb: + """Calibre-Web Automated (2026-09-30, R-462). THE FRONT DOOR is the household's own „Upload" button: log in + through the login form (Flask-WTF CSRF token read from the page), then `POST /upload` with the book, exactly + the form the page posts. The other door — dropping a file into the ingest folder (`${IMPORT_PATH}/calibre`, + reached through FileBrowser) — is NOT used: from here it would be a file planted in a mount (R-156). + Measured on the bench 2026-09-30: uploads are ON in a fresh v4.0.6; the book lands in the household's + library folder (`${USERDATA_PATH}/media/books// (<id>)/`, backup class `mandatory`). + + THE ADMIN PASSWORD. On a box the product's `after_install` (the app's own CLI, `cps.py -s admin:<pw>`) sets + it from the deploy field, and the walk holds the value it generated. The bench runs no `after_install`, so + when the generated password does not log in, the fixture runs THE SAME command the product runs — the + app's own CLI inside its own container — and says so. + + READBACK: the app's OPDS feed (HTTP Basic, the route e-readers use): the search must list the title, and the + book's own download must be the uploaded book (the marker read out of the EPUB the app serves). Negative + controls on every call: a wrong password must answer 401, and a title that cannot exist must not be found.""" + sub = "books" + + @staticmethod + def _epub(marker): + import io, zipfile + buf = io.BytesIO() + z = zipfile.ZipFile(buf, "w") + z.writestr(zipfile.ZipInfo("mimetype"), "application/epub+zip") + z.writestr("META-INF/container.xml", + '<?xml version="1.0"?><container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">' + '<rootfiles><rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml"/>' + '</rootfiles></container>') + z.writestr("OEBPS/content.opf", + '<?xml version="1.0" encoding="UTF-8"?><package xmlns="http://www.idpf.org/2007/opf" ' + 'unique-identifier="bid" version="2.0"><metadata xmlns:dc="http://purl.org/dc/elements/1.1/" ' + f'xmlns:opf="http://www.idpf.org/2007/opf"><dc:title>{marker}</dc:title>' + '<dc:creator opf:role="aut">Drill Author</dc:creator><dc:language>en</dc:language>' + f'<dc:identifier id="bid">urn:uuid:{marker}</dc:identifier></metadata><manifest>' + '<item id="c1" href="c1.xhtml" media-type="application/xhtml+xml"/>' + '<item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/></manifest>' + '<spine toc="ncx"><itemref idref="c1"/></spine></package>') + z.writestr("OEBPS/toc.ncx", + '<?xml version="1.0"?><ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">' + f'<head><meta name="dtb:uid" content="urn:uuid:{marker}"/></head><docTitle><text>{marker}</text>' + '</docTitle><navMap><navPoint id="n1" playOrder="1"><navLabel><text>One</text></navLabel>' + '<content src="c1.xhtml"/></navPoint></navMap></ncx>') + z.writestr("OEBPS/c1.xhtml", + '<?xml version="1.0" encoding="UTF-8"?><html xmlns="http://www.w3.org/1999/xhtml"><head>' + f'<title>{marker}

{marker}-body the household keeps this.

') + z.close() + return buf.getvalue() + + def _opds(self, w, sub, pw, path): + return w.app_curl(sub, path, "-u", f"admin:{pw}") + + def seed(self, w, sub, say): + import os, tempfile + if not w.wait_app(sub, "/login", want=("200",), tries=72): + return None + pw = (w.GENERATED.get("calibre-web") or {}).get("ADMIN_PASSWORD") or "" + rc, code, _ = self._opds(w, sub, pw, "/opds") + if code != "200": + say(f" calibre-web: the generated admin password does not log in (opds http={code}) — running the " + "template's own after_install command (the app's CLI, as the product does after an install)") + import shlex # as the template's after_install: `user: abc` (docker exec -u keeps the image's PATH; `su` does not) + out = w.guest("docker exec -u abc calibre-web python3 /app/calibre-web-automated/cps.py -p /config/app.db -s " + + shlex.quote(f"admin:{pw}") + " 2>&1") + say(f" calibre-web: after_install :: {' '.join(out.split())[-80:]}") + rc, code, _ = self._opds(w, sub, pw, "/opds") + if code != "200": + self.tried = f"admin login after after_install -> {code}" + return None + jar = tempfile.mktemp(prefix="cw-jar-") + try: + rc, code, page = w.app_curl(sub, "/login", "-c", jar, "-b", jar) + m = re.search(r'name="csrf_token" value="([^"]+)"', page or "") + if not m: + self.tried = f"GET /login -> {code}, no csrf_token" + return None + rc, code, _ = w.app_curl(sub, "/login", "-c", jar, "-b", jar, "--data-urlencode", f"csrf_token={m.group(1)}", + "--data-urlencode", "username=admin", "--data-urlencode", f"password={pw}", + "--data-urlencode", "remember_me=on", method="POST") + rc, code, home = w.app_curl(sub, "/", "-c", jar, "-b", jar) + m = re.search(r'name="csrf_token" value="([^"]+)"', home or "") + has_form = 'action="/upload"' in (home or "") + if code != "200" or not has_form or not m: + self.tried = f"login -> home {code}, upload form present={has_form}" + say(f" calibre-web: {self.tried}") + return None + marker = "upg" + secrets.token_hex(6) + book = tempfile.mktemp(prefix="cw-", suffix=".epub") + open(book, "wb").write(self._epub(marker)) + rc, code, out = w.app_curl(sub, "/upload", "-c", jar, "-b", jar, "-H", f"X-CSRFToken: {m.group(1)}", + "-F", f"csrf_token={m.group(1)}", + "-F", f"btn-upload=@{book};type=application/epub+zip", method="POST") + os.unlink(book) + say(f" calibre-web: POST /upload http={code} {out[:80]}") + if code != "200": + self.tried = f"POST /upload -> {code} {out[:120]}" + return None + finally: + if os.path.exists(jar): + os.unlink(jar) + t = {"pw": pw, "marker": marker} + for _ in range(24): # the upload is a task; the library entry follows within seconds + rc, code, feed = self._opds(w, sub, pw, f"/opds/search/{marker}") + if marker in (feed or ""): + say(f" calibre-web: seeded book {marker} is in the library") + return t + time.sleep(5) + self.tried = "uploaded, but the book never appeared in the OPDS search" + return None + + def verify(self, w, sub, t, say): + import io, os, tempfile, zipfile + if not w.wait_app(sub, "/login", want=("200",), tries=72): + say(" calibre-web: the app never served /login") + return False + rc, code, _ = self._opds(w, sub, "wrong-" + secrets.token_hex(6), "/opds") + if code != "401": + say(f" calibre-web: READBACK UNUSABLE — a wrong password answered {code}") + return False + ghost = "upg" + secrets.token_hex(6) + rc, code, feed = self._opds(w, sub, t["pw"], f"/opds/search/{ghost}") + if code != "200" or "" in (feed or ""): + say(f" calibre-web: READBACK UNUSABLE — a title that cannot exist: http={code}, entries={(feed or '').count('')}") + return False + feed = "" + for _ in range(12): + rc, code, feed = self._opds(w, sub, t["pw"], f"/opds/search/{t['marker']}") + if code == "200" and f"{t['marker']}" in (feed or ""): + break + time.sleep(5) + listed = f"{t['marker']}" in (feed or "") + m = re.search(r'href="(/opds/download/\d+/epub/?)"', feed or "") + served = False + if listed and m: + f = tempfile.mktemp(prefix="cw-dl-") + rc, code, _ = w.app_curl(sub, m.group(1), "-u", f"admin:{t['pw']}", "-o", f) + try: + z = zipfile.ZipFile(io.BytesIO(open(f, "rb").read())) + served = any(f"{t['marker']}-body" in z.read(n).decode("utf-8", "replace") for n in z.namelist()) + except Exception as e: + say(f" calibre-web: the download is not a readable EPUB (http={code}): {e}") + finally: + if os.path.exists(f): + os.unlink(f) + say(f" calibre-web: readback — listed={listed} download_link={bool(m)} book_content_served={served}") + return listed and served + + +# ============================================================================================= +class Wger: + """wger (2026-09-30, R-462). THE FRONT DOOR is the web login form (`/en/user/login`, Django CSRF), then the + app's own REST API with that session: `POST /api/v2/weightentry/` (a weight on a date — household data in its + SQLite), read back with `GET /api/v2/weightentry/?weight=`. Measured on the bench 2026-09-30 (2.6). + NOT the app-API login (`/allauth/app/v1/auth/login`): it answers 500 on a CORRECT password on this template + (no JWT_PRIVATE_KEY — filed, R-737). THE ADMIN PASSWORD: as calibre-web — the box's `after_install` sets it; + the bench runs the template's own command (password as the last argument) when the generated one does not + log in. Negative controls on every readback: no session answers 403, a weight never entered counts 0.""" + sub = "fitness" + SET_PW = ("import os, sys; sys.path.insert(0, '/home/wger/src'); os.chdir('/home/wger/src'); " + "os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings.main'); import django; django.setup(); " + "from django.contrib.auth.models import User; u = User.objects.get(username='admin'); " + "u.set_password(sys.argv[1]); u.save(); print('FELHOM_AFTER_INSTALL_OK')") + + @staticmethod + def _host(w, sub): + return w.host(sub) if hasattr(w, "host") else f"{sub}.{w.DOMAIN}" + + def _login(self, w, sub, pw, jar): + o = f"https://{self._host(w, sub)}" + hdr = ["-H", f"Origin: {o}", "-H", f"Referer: {o}/en/user/login", "-c", jar, "-b", jar] + rc, code, page = w.app_curl(sub, "/en/user/login", *hdr) + m = re.search(r'name="csrfmiddlewaretoken" value="([^"]+)"', page or "") + if not m: + return None, f"GET /en/user/login -> {code}, no csrf" + rc, code, _ = w.app_curl(sub, "/en/user/login", *hdr, "--data-urlencode", f"csrfmiddlewaretoken={m.group(1)}", + "--data-urlencode", "login=admin", "--data-urlencode", f"password={pw}", method="POST") + jt = open(jar).read() if os.path.exists(jar) else "" + if code != "302" or "sessionid" not in jt: + return None, f"POST /en/user/login -> {code}" + csrf = re.search(r"csrftoken\s+(\S+)", jt) + return hdr + ["-H", f"X-CSRFToken: {csrf.group(1) if csrf else ''}"], "ok" + + def seed(self, w, sub, say): + import shlex, tempfile + if not w.wait_app(sub, "/en/user/login", want=("200",), tries=72): + return None + pw = (w.GENERATED.get("wger") or {}).get("ADMIN_PASSWORD") or "" + jar = tempfile.mktemp(prefix="wger-jar-") + try: + hdr, why = self._login(w, sub, pw, jar) + if hdr is None: + say(f" wger: the generated admin password does not log in ({why}) — running the template's own " + "after_install command (the app's CLI, as the product does after an install)") + out = w.guest("docker exec wger python3 -c " + shlex.quote(self.SET_PW) + " " + shlex.quote(pw) + " 2>&1") + say(f" wger: after_install :: {' '.join(out.split())[-60:]}") + hdr, why = self._login(w, sub, pw, jar) + if hdr is None: + self.tried = f"web login after after_install: {why}" + return None + weight = "%d.%02d" % (60 + secrets.randbelow(60), secrets.randbelow(100)) + rc, code, out = w.app_curl(sub, "/api/v2/weightentry/", *hdr, "-H", "Content-Type: application/json", + data=json.dumps({"date": "2026-09-30T10:00:00Z", "weight": weight}), method="POST") + say(f" wger: POST /api/v2/weightentry/ http={code}") + if code != "201": + self.tried = f"POST /api/v2/weightentry/ -> {code} {out[:120]}" + return None + return {"pw": pw, "weight": weight} + finally: + if os.path.exists(jar): + os.unlink(jar) + + def verify(self, w, sub, t, say): + import tempfile + if not w.wait_app(sub, "/en/user/login", want=("200",), tries=72): + say(" wger: the app never served /en/user/login") + return False + rc, code, _ = w.app_curl(sub, f"/api/v2/weightentry/?weight={t['weight']}") + if code not in ("401", "403"): + say(f" wger: READBACK UNUSABLE — no session answered {code}") + return False + jar = tempfile.mktemp(prefix="wger-jar-") + try: + hdr, why = self._login(w, sub, t["pw"], jar) + if hdr is None: + say(f" wger: login failed: {why}") + return False + rc, code, out = w.app_curl(sub, "/api/v2/weightentry/?weight=199.99", *hdr) + if code != "200" or '"count":0' not in (out or "").replace(" ", ""): + say(f" wger: READBACK UNUSABLE — a weight never entered: http={code} {out[:80]}") + return False + rc, code, out = w.app_curl(sub, f"/api/v2/weightentry/?weight={t['weight']}", *hdr) + ok = code == "200" and f'"weight":"{t["weight"]}"' in (out or "").replace(" ", "") + say(f" wger: readback of the seeded weight entry http={code} found={ok}") + return ok + finally: + if os.path.exists(jar): + os.unlink(jar) + + +# ============================================================================================= +class Crafty: + """Crafty Controller 4 (2026-09-30, R-462). Its own REST API v2, behind its own HTTPS port (the template tells + traefik `scheme=https`; the bench adapter reads that label): `POST /api/v2/auth/login` as `admin` with the + deploy's CRAFTY_PASSWORD (the compose entrypoint writes it into default.json), then `POST /api/v2/roles` — a + role is a record in crafty's own database, created the way its panel creates one — read back with + `GET /api/v2/roles`. Measured on the bench 2026-09-30 (4.10.7): the POST needs `mfa_required` (500 without). + Negative control on every readback: a wrong token must answer 401/403.""" + sub = "minecraft" + + def _token(self, w, sub, pw): + rc, code, out = w.app_curl(sub, "/api/v2/auth/login", "-H", "Content-Type: application/json", + data=json.dumps({"username": "admin", "password": pw}), method="POST") + try: + return json.loads(out)["data"]["token"], code + except Exception: + return None, f"{code} {(out or '')[:120]}" + + def seed(self, w, sub, say): + if not w.wait_app(sub, "/", want=("200", "302"), tries=90): + return None + pw = (w.GENERATED.get("crafty-controller") or {}).get("CRAFTY_PASSWORD") or "" + tok, why = None, None + for _ in range(12): # crafty answers `/` before its API accepts the seeded admin + tok, why = self._token(w, sub, pw) + if tok: + break + time.sleep(5) + if not tok: + self.tried = f"POST /api/v2/auth/login -> {why}" + return None + role = "upg" + secrets.token_hex(5) + rc, code, out = w.app_curl(sub, "/api/v2/roles", "-H", f"Authorization: Bearer {tok}", + "-H", "Content-Type: application/json", + data=json.dumps({"name": role, "servers": [], "mfa_required": False}), method="POST") + say(f" crafty: POST /api/v2/roles http={code} {out[:60]}") + if code != "200" or '"ok"' not in (out or ""): + self.tried = f"POST /api/v2/roles -> {code} {out[:120]}" + return None + return {"pw": pw, "role": role} + + def verify(self, w, sub, t, say): + if not w.wait_app(sub, "/", want=("200", "302"), tries=90): + say(" crafty: the app never answered /") + return False + tok = None + for _ in range(12): + tok, why = self._token(w, sub, t["pw"]) + if tok: + break + time.sleep(5) + if not tok: + say(f" crafty: login failed: {why}") + return False + rc, code, _ = w.app_curl(sub, "/api/v2/roles", "-H", f"Authorization: Bearer x{tok}") + if code not in ("401", "403"): + say(f" crafty: READBACK UNUSABLE — a wrong token answered {code}") + return False + rc, code, out = w.app_curl(sub, "/api/v2/roles", "-H", f"Authorization: Bearer {tok}") + names = [r.get("role_name") for r in (json.loads(out).get("data") or [])] if code == "200" else [] + ok = t["role"] in names + say(f" crafty: readback of the seeded role http={code} found={ok} (roles listed: {len(names)})") + return ok + + +# ============================================================================================= +class UptimeKuma: + """Uptime Kuma 2 (2026-09-30, R-462). Its web page talks to the server over socket.io, and its first-run setup, + login and every edit exist ONLY there — so the fixture speaks socket.io's plain HTTP long-polling transport + (Engine.IO v4: `GET/POST /socket.io/?EIO=4&transport=polling`) through the app's own front door, exactly the + messages the page sends: `setup` (the first admin), `login`, `addStatusPage` (a status page is a record in its + own SQLite). READBACK through its public REST route `GET /api/status-page/` (the page households share), + which must carry the seeded title; negative control: a slug never made must not answer 200 with a title.""" + sub = "status" + RS = "\x1e" + + class _IO: + def __init__(self, w, sub): + self.w, self.sub, self.sid, self.buf, self.ack = w, sub, None, [], 0 + + def _get(self): + rc, code, out = self.w.app_curl(self.sub, f"/socket.io/?EIO=4&transport=polling&sid={self.sid}", timeout=30) + if code != "200": + raise RuntimeError(f"poll http={code} {out[:80]}") + for p in (out or "").split(UptimeKuma.RS): + if p == "2": # ping → pong + self._post("3") + elif p: + self.buf.append(p) + + def _post(self, body): + rc, code, out = self.w.app_curl(self.sub, f"/socket.io/?EIO=4&transport=polling&sid={self.sid}", + "-H", "Content-Type: text/plain;charset=UTF-8", data=body, method="POST") + if code != "200": + raise RuntimeError(f"post http={code} {out[:80]}") + + def open(self): + rc, code, out = self.w.app_curl(self.sub, "/socket.io/?EIO=4&transport=polling") + m = re.search(r'"sid":"([^"]+)"', out or "") + if code != "200" or not m: + raise RuntimeError(f"handshake http={code} {out[:80]}") + self.sid = m.group(1) + self._post("40") + for _ in range(10): + self._get() + if any(p.startswith("40") for p in self.buf): + return self + raise RuntimeError("no socket.io connect") + + def call(self, event, *args): + n = self.ack + self.ack += 1 + self._post(f"42{n}" + json.dumps([event, *args])) + for _ in range(30): + for p in list(self.buf): + if p.startswith(f"43{n}["): + self.buf.remove(p) + return json.loads(p[len(f"43{n}"):])[0] + self._get() + raise RuntimeError(f"no answer to {event}") + + def seed(self, w, sub, say): + if not w.wait_app(sub, "/", want=("200", "302"), tries=90): + return None + user, pw = "drill" + secrets.token_hex(3), "Drill-" + secrets.token_hex(10) + "A1" + try: + io = self._IO(w, sub).open() + r = io.call("setup", user, pw) + say(f" uptime-kuma: setup ok={r.get('ok')} {str(r.get('msg'))[:60]}") + if not r.get("ok"): + self.tried = f"socket.io setup -> {r}" + return None + io = self._IO(w, sub).open() + r = io.call("login", {"username": user, "password": pw, "token": ""}) + if not r.get("ok"): + self.tried = f"socket.io login -> {str(r)[:120]}" + return None + title, slug = "Drill " + secrets.token_hex(4), "upg" + secrets.token_hex(4) + r = io.call("addStatusPage", title, slug) + say(f" uptime-kuma: addStatusPage ok={r.get('ok')} {str(r.get('msg'))[:60]}") + if not r.get("ok"): + self.tried = f"socket.io addStatusPage -> {str(r)[:120]}" + return None + except Exception as e: + self.tried = f"socket.io: {e}" + say(f" uptime-kuma: {self.tried}") + return None + return {"user": user, "pw": pw, "title": title, "slug": slug} + + def verify(self, w, sub, t, say): + if not w.wait_app(sub, "/", want=("200", "302"), tries=90): + say(" uptime-kuma: the app never answered /") + return False + rc, code, out = w.app_curl(sub, f"/api/status-page/upgnever{secrets.token_hex(4)}") + if code == "200" and '"title"' in (out or ""): + say(f" uptime-kuma: READBACK UNUSABLE — a slug never made answered {code} with a title") + return False + found = False + for _ in range(12): + rc, code, out = w.app_curl(sub, f"/api/status-page/{t['slug']}") + try: + found = code == "200" and json.loads(out)["config"]["title"] == t["title"] + except Exception: + found = False + if found: + break + time.sleep(5) + say(f" uptime-kuma: readback of the seeded status page http={code} found={found}") + return found + + FIXTURES = { + "uptime-kuma": UptimeKuma(), + "crafty-controller": Crafty(), + "wger": Wger(), + "calibre-web": CalibreWeb(), "sparkyfitness": Sparkyfitness(), "rallly": Rallly(), "outline": Outline(), From 4ad32aa768c5470df28aa12fe4d9e58320f2a7cb Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 18:25:51 +0200 Subject: [PATCH 22/46] wger: 2.6 -> 2.7, its first ladder step, both venues proven (R-462, R-738) A new front-door fixture: the web login, then a weight entry through the app's own API, read back with a no-session and a never-entered-weight control. Both venues ran on the R-738 template (7a4ff48, migrations at start): bench 9401 proven, its migrations ran, 10-min watch 0 kills (anon peak 49.8 %); box 9202 done in 46.2 s, the migrations ran, the entry read back. The first box walk WITHOUT the fix failed (login 500, 12 migrations unapplied) and wrote nothing. Putting 2.6 back after the migration loses the entries (recorded, as always; the box's undo restores the pre-update copy instead). Written by upgrade-test.py --write-ladder. Evidence: felhom.eu/documentation/audits/more-night-apps-2026-09-30/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/wger/.felhom.yml | 8 +++++++- templates/wger/docker-compose.yml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/wger/.felhom.yml b/templates/wger/.felhom.yml index a06a7ba..8fec2f7 100644 --- a/templates/wger/.felhom.yml +++ b/templates/wger/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "fitness" slug: "wger" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-07-19" +catalog_since: "2026-09-30" # --- Resource hints (displayed on deploy screen) --- resources: @@ -123,3 +123,9 @@ i18n: - env_var: ADMIN_PASSWORD label: 'Admin password (admin)' description: 'For the first sign-in: admin and this password. Change it in the settings afterwards.' + +# update_ladder — the test record: one tested step per line, oldest first (JSON flow mappings, +# `09-update-architecture.md` §6.4 part 4). WRITTEN BY scripts/upgrade-test.py, never by hand; +# gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. +update_ladder: + - {"from": {"wger": "wger/server:2.6"}, "to": {"wger": "wger/server:2.7"}, "digest": {"wger": "sha256:1c5789b93bfe5eed0b7287255782d9177027b255de2b22b59f511a693a48db04"}, "verdict": "proven", "tested_at": "2026-09-30T16:25:03Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/bench/apps/wger/bench/evidence/MV-wger/verdict.json", "box_evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/box/wger/step.txt", "memory_peak_pct": 49.8, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 78.6} diff --git a/templates/wger/docker-compose.yml b/templates/wger/docker-compose.yml index 3933676..05fd2f6 100644 --- a/templates/wger/docker-compose.yml +++ b/templates/wger/docker-compose.yml @@ -9,7 +9,7 @@ services: wger: - image: wger/server:2.6 + image: wger/server:2.7 container_name: wger restart: unless-stopped environment: From e1f0179d7a7cd8f69baddb98637018c1023506b4 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 18:41:02 +0200 Subject: [PATCH 23/46] crafty-controller: 4.10.7 -> 4.11.0, its first ladder step, both venues proven (R-462) A new front-door fixture: crafty's own API v2 (login as admin, a role created and read back, a wrong-token control), reached over its own HTTPS port on the bench as traefik reaches it on a box. Bench 9401 (harness v4, swap 0): proven, 10-min watch 0 kills (anon peak 2.7 % of 2048M); the abort starts and serves. Box 9202: done in 51.3 s, the role read back. Written by upgrade-test.py --write-ladder. Evidence: felhom.eu/documentation/audits/more-night-apps-2026-09-30/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/crafty-controller/.felhom.yml | 8 +++++++- templates/crafty-controller/docker-compose.yml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/crafty-controller/.felhom.yml b/templates/crafty-controller/.felhom.yml index 13a4564..2a19786 100644 --- a/templates/crafty-controller/.felhom.yml +++ b/templates/crafty-controller/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "minecraft" slug: "crafty-controller" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-06-26" +catalog_since: "2026-09-30" # --- Resource hints (displayed on deploy screen) --- resources: @@ -123,3 +123,9 @@ i18n: description: 'The first password of Crafty''s admin user (admin) - this is what signs you in' initial_credentials: note: 'The first admin password (the one set at install time). Change it in Crafty after your first sign-in - this card keeps showing the first password.' + +# update_ladder — the test record: one tested step per line, oldest first (JSON flow mappings, +# `09-update-architecture.md` §6.4 part 4). WRITTEN BY scripts/upgrade-test.py, never by hand; +# gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. +update_ladder: + - {"from": {"crafty-controller": "registry.gitlab.com/crafty-controller/crafty-4:4.10.7"}, "to": {"crafty-controller": "registry.gitlab.com/crafty-controller/crafty-4:4.11.0"}, "digest": {"crafty-controller": "sha256:7b6e87514259549647e15ceeaf73d238792e6d77e2c79fc744d5badc8d6e997c"}, "verdict": "proven", "tested_at": "2026-09-30T16:37:55Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/bench/apps/crafty-controller/bench/evidence/MV-crafty-controller/verdict.json", "box_evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/box/crafty-controller/step.txt", "memory_peak_pct": 2.7, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 8.0} diff --git a/templates/crafty-controller/docker-compose.yml b/templates/crafty-controller/docker-compose.yml index 6dd6596..de80b37 100644 --- a/templates/crafty-controller/docker-compose.yml +++ b/templates/crafty-controller/docker-compose.yml @@ -17,7 +17,7 @@ services: crafty-controller: - image: registry.gitlab.com/crafty-controller/crafty-4:4.10.7 + image: registry.gitlab.com/crafty-controller/crafty-4:4.11.0 container_name: crafty-controller restart: unless-stopped environment: From 35dd5cf03c673261215fc083e5283dfa1de7d5d5 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 18:51:17 +0200 Subject: [PATCH 24/46] uptime-kuma: 2.4.0 -> 2.5.5, its first ladder step, both venues proven (R-462) A new front-door fixture: the app's own socket.io messages over plain HTTP polling (setup, login, addStatusPage), read back through its public /api/status-page/, with an absent-slug control. Bench 9401 (harness v4, swap 0): proven, 10-min watch 0 kills (anon peak 43.3 %); the abort starts and serves. Box 9202: done in 33.9 s through the setup gate, the status page read back. Written by upgrade-test.py --write-ladder. Evidence: felhom.eu/documentation/audits/more-night-apps-2026-09-30/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/uptime-kuma/.felhom.yml | 8 +++++++- templates/uptime-kuma/docker-compose.yml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/uptime-kuma/.felhom.yml b/templates/uptime-kuma/.felhom.yml index 96b6ae3..0da2b8f 100644 --- a/templates/uptime-kuma/.felhom.yml +++ b/templates/uptime-kuma/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "status" slug: "uptime-kuma" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-09-21" +catalog_since: "2026-09-30" # --- Resource hints (displayed on deploy screen) --- resources: @@ -95,3 +95,9 @@ i18n: - env_var: SUBDOMAIN label: 'Subdomain' description: 'The subdomain this app answers on' + +# update_ladder — the test record: one tested step per line, oldest first (JSON flow mappings, +# `09-update-architecture.md` §6.4 part 4). WRITTEN BY scripts/upgrade-test.py, never by hand; +# gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. +update_ladder: + - {"from": {"uptime-kuma": "louislam/uptime-kuma:2.4.0"}, "to": {"uptime-kuma": "louislam/uptime-kuma:2.5.5"}, "digest": {"uptime-kuma": "sha256:c74379ac4509ce2d2c2633f509e67003ee2e45b6e995c5e43fc101f45a0e1fbe"}, "verdict": "proven", "tested_at": "2026-09-30T16:50:40Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/bench/apps/uptime-kuma/bench/evidence/MV-uptime-kuma/verdict.json", "box_evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/box/uptime-kuma/step.txt", "memory_peak_pct": 43.3, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 49.7} diff --git a/templates/uptime-kuma/docker-compose.yml b/templates/uptime-kuma/docker-compose.yml index 032777d..f4f171c 100644 --- a/templates/uptime-kuma/docker-compose.yml +++ b/templates/uptime-kuma/docker-compose.yml @@ -8,7 +8,7 @@ services: uptime-kuma: - image: louislam/uptime-kuma:2.4.0 + image: louislam/uptime-kuma:2.5.5 container_name: uptime-kuma restart: unless-stopped environment: From 63a96b0ef44ee9df307484ed50b38a991f5263ae Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 18:53:17 +0200 Subject: [PATCH 25/46] harness: --restep rewrites one superseded step's definition from a re-proof; zipline's readback waits on its health route MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - upgrade-test.py --restep --definition --catalog --evidence : the only way a superseded step's own files (steps/.yml + .felhom.yml) change after the fact (Part D: immich's step 0b8272068aab36bf still pins 512M). Refuses a non-proven or OOM-killing re-proof, the head entry, and a definition whose images are not the step's; leaves the ladder entry untouched (digests, box evidence, the box's failed-step fingerprint). Two tests; the gate accepts the result. - zipline's verify waited on `/` for 200/302/307; on 9202 it answers 301 and the readback returned False with no line — it now waits on /api/healthcheck like its seed. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- scripts/test_ladder_writer.py | 53 +++++++++++++++++++++++++++++++ scripts/upgrade-test.py | 56 +++++++++++++++++++++++++++++++++ scripts/upgrade_fixtures_box.py | 5 ++- 3 files changed, 113 insertions(+), 1 deletion(-) diff --git a/scripts/test_ladder_writer.py b/scripts/test_ladder_writer.py index ac9f037..2e89fbf 100644 --- a/scripts/test_ladder_writer.py +++ b/scripts/test_ladder_writer.py @@ -131,5 +131,58 @@ class WriterTest(unittest.TestCase): self.assertEqual(r.returncode, 0, r.stdout) + # --- --restep (2026-09-30, Part D): rewrite ONE superseded step's own definition from a re-proof --------------- + def _two_steps(self): + rc, out = self.run_writer(bench()); self.assertEqual(rc, 0, out) + rc, out = self.run_writer(bench(frm=NEXT, to=AFTER)); self.assertEqual(rc, 0, out) + return ladder.step_file({"navidrome": "deluan/navidrome:" + NEXT}) + + def run_restep(self, b, definition_images=None, extra=""): + d = os.path.join(self.tmp, "def"); os.makedirs(d, exist_ok=True) + imgs = definition_images or b["to"] + open(os.path.join(d, "docker-compose.yml"), "w").write( + "services:\n navidrome:\n image: %s\n deploy:\n resources:\n limits:\n memory: 999M\n%s" + % (imgs["navidrome"], extra)) + meta = open(os.path.join(self.tmp, "templates", "navidrome", ladder.step_meta_file(b["to"]))).read() \ + if os.path.exists(os.path.join(self.tmp, "templates", "navidrome", ladder.step_meta_file(b["to"]))) \ + else open(self.fy).read() + open(os.path.join(d, ".felhom.yml"), "w").write(meta + "\n# RESTEP-META-MARKER\n") + bp = os.path.join(self.tmp, "rb.json"); json.dump(b, open(bp, "w")) + buf = io.StringIO() + with redirect_stdout(buf): + rc = ut.write_restep([bp, "--definition", d, "--catalog", self.tmp, "--evidence", "ev/restep/"]) + return rc, buf.getvalue() + + def test_restep_rewrites_the_superseded_steps_files_and_nothing_else(self): + key = self._two_steps() + fy_before = open(self.fy).read() + rc, out = self.run_restep(bench()) + self.assertEqual(rc, 0, out) + sp = os.path.join(self.tmp, "templates", "navidrome", key) + self.assertIn("memory: 999M", open(sp).read()) + self.assertIn("RE-PROVEN", open(sp).read()) + self.assertIn("RESTEP-META-MARKER", open(sp[:-4] + ".felhom.yml").read()) + self.assertEqual(open(self.fy).read(), fy_before, "the ladder entry must not be touched") + import subprocess + r = subprocess.run([sys.executable, os.path.join(HERE, "check-test-record.py"), "--root", self.tmp, + "navidrome"], capture_output=True, text=True) + self.assertEqual(r.returncode, 0, r.stdout) + + def test_restep_refuses_the_head_a_failed_bench_and_a_wrong_definition(self): + key = self._two_steps() + sp = os.path.join(self.tmp, "templates", "navidrome", key) + before = open(sp).read() + rc, out = self.run_restep(bench(frm=NEXT, to=AFTER)) + self.assertEqual(rc, 1); self.assertIn("HEAD", out) + rc, out = self.run_restep(bench(verdict="failed")) + self.assertEqual(rc, 1) + rc, out = self.run_restep(bench(), definition_images={"navidrome": "deluan/navidrome:" + AFTER}) + self.assertEqual(rc, 1); self.assertIn("the definition names", out) + b = bench(); b["memory"]["containers"]["navidrome"]["oom_kill"] = 3 + rc, out = self.run_restep(b) + self.assertEqual(rc, 1); self.assertIn("OOM", out) + self.assertEqual(open(sp).read(), before, "a refused restep must not write") + + if __name__ == "__main__": unittest.main(verbosity=2) diff --git a/scripts/upgrade-test.py b/scripts/upgrade-test.py index d06c30f..5e83eba 100755 --- a/scripts/upgrade-test.py +++ b/scripts/upgrade-test.py @@ -39,6 +39,8 @@ Usage: python3 upgrade-test.py [--soak SECONDS] [ …] (se python3 upgrade-test.py [--soak SECONDS] --move = [...] (FROM = the template) python3 upgrade-test.py --write-ladder --box \ --catalog --evidence [--box-evidence ] (the ONLY ladder writer) + python3 upgrade-test.py --restep --definition --catalog --evidence + (rewrites ONE superseded step's own definition from a bench re-proof of it) python3 upgrade-test.py --list --soak: how long the memory watch runs after a successful readback (default 600; 0 = off) Layout: templates under /opt/upg/templates, evidence under /opt/upg/evidence @@ -1093,10 +1095,64 @@ def write_ladder(argv) -> int: return 0 +def write_restep(argv) -> int: + """`--restep --definition --catalog --evidence ` — rewrite ONE + superseded step's own definition (`steps/.yml` + `steps/.felhom.yml`) from a bench re-proof of THAT + step on a corrected definition (2026-09-30, R-732 → immich's step 0b8272068aab36bf at 768M). Never by hand. + + It refuses unless the bench says `proven` with a memory watch and no kill; the verdict's from/to are exactly + one ladder entry that is NOT the head (the head's definition is the compose, moved by --write-ladder); and the + definition's own images are that entry's `to`. The ladder entry itself is NOT touched: its digests, its box + evidence and the box's failed-step fingerprint stay what they were. The new files say where their re-proof is.""" + import datetime as _dt, hashlib + sys.path.insert(0, str(Path(__file__).resolve().parent)) + import ladder + + def arg(name, default=None): + return argv[argv.index(name) + 1] if name in argv else default + bench = json.loads(Path(argv[0]).read_text()) + dfn, cat, evid = Path(arg("--definition")), Path(arg("--catalog")), arg("--evidence") + app = bench["app"] + if bench.get("verdict") != "proven" or not bench.get("memory") or (bench.get("harness_version") or 0) < 2: + print(f"REFUSED {app}: the bench verdict is {bench.get('verdict')!r} / no memory watch — only a proven re-proof rewrites a step") + return 1 + kills = [n for n, c in (bench["memory"].get("containers") or {}).items() if (c.get("oom_kill") or 0) > 0] + if kills: + print(f"REFUSED {app}: the memory watch saw OOM kills in {kills}") + return 1 + tdir = cat / "templates" / app + entries, _, errs = ladder.parse((tdir / ".felhom.yml").read_text()) + idx = [i for i, e in enumerate(entries or []) if e.get("from") == bench["from"] and e.get("to") == bench["to"]] + if not idx: + print(f"REFUSED {app}: no ladder entry is {bench['from']} -> {bench['to']}") + return 1 + if idx[-1] == len(entries) - 1: + print(f"REFUSED {app}: that entry is the HEAD — its definition is the compose (use --write-ladder)") + return 1 + e = entries[idx[-1]] + comp = (dfn / "docker-compose.yml").read_text() + if ladder.images_in(comp) != e["to"]: + print(f"REFUSED {app}: the definition names {ladder.images_in(comp)}, the step is {e['to']}") + return 1 + sp, smp = tdir / ladder.step_file(e["to"]), tdir / ladder.step_meta_file(e["to"]) + if not sp.exists(): + print(f"REFUSED {app}: {ladder.step_file(e['to'])} does not exist — nothing to rewrite") + return 1 + head = (f"# RE-PROVEN {_dt.date.today().isoformat()} on the bench on THIS definition (upgrade-test.py --restep): " + f"{evid} — definition sha256 {hashlib.sha256(comp.encode()).hexdigest()[:16]}\n") + sp.write_text(head + comp) + smp.write_text(head + ladder.strip_ladder_block((dfn / ".felhom.yml").read_text())) + peaks = {n: c.get("anon_peak_pct") for n, c in (bench["memory"].get("containers") or {}).items()} + print(f"RESTEP {app}: {ladder.step_file(e['to'])} and its .felhom.yml rewritten from {dfn} (anon peaks {peaks})") + return 0 + + def main(argv): global SOAK_SECONDS if argv and argv[0] == "--write-ladder": return write_ladder(argv[1:]) + if argv and argv[0] == "--restep": + return write_restep(argv[1:]) if argv and argv[0] == "--soak": SOAK_SECONDS = int(argv[1]) argv = argv[2:] diff --git a/scripts/upgrade_fixtures_box.py b/scripts/upgrade_fixtures_box.py index b59803a..7f48142 100644 --- a/scripts/upgrade_fixtures_box.py +++ b/scripts/upgrade_fixtures_box.py @@ -817,7 +817,10 @@ class Zipline: return None def verify(self, w, sub, t, say): - if not w.wait_app(sub, "/", want=("200", "302", "307"), tries=60): + # 2026-09-30: `/` answers 301 on 9202 once set up — the old wait (200/302/307) never saw the app and the + # readback returned False with no line in the log. The seed's own health route is the wait now. + if not w.wait_app(sub, "/api/healthcheck", want=("200",), tries=60): + say(" zipline: /api/healthcheck never answered 200") return False def login(p): return w.app_curl(sub, "/api/auth/login", "-H", "Content-Type: application/json", From b0b25148a46e26a926ef47b192ab8514c30c2a34 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 19:14:09 +0200 Subject: [PATCH 26/46] outline: 1.9.1 -> 1.10.1, within-major step, both venues proven (R-462) The app half only; PostgreSQL 18 and redis 7 do not move. Bench 9401 (harness v4, swap 0): the self-hosted workspace + a document seeded and read back before and after, 10-min watch 0 kills (anon peak 33.5 %); the abort starts and serves. Box 9202: done in 89.2 s through the setup gate, the document read back. Written by upgrade-test.py --write-ladder; the PG 18 step keeps its definition. Evidence: felhom.eu/documentation/audits/more-night-apps-2026-09-30/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/outline/.felhom.yml | 1 + templates/outline/docker-compose.yml | 2 +- .../outline/steps/c6e5d58da2a400de.felhom.yml | 127 ++++++++++++++++++ templates/outline/steps/c6e5d58da2a400de.yml | 112 +++++++++++++++ 4 files changed, 241 insertions(+), 1 deletion(-) create mode 100644 templates/outline/steps/c6e5d58da2a400de.felhom.yml create mode 100644 templates/outline/steps/c6e5d58da2a400de.yml diff --git a/templates/outline/.felhom.yml b/templates/outline/.felhom.yml index 935956e..6c61b87 100644 --- a/templates/outline/.felhom.yml +++ b/templates/outline/.felhom.yml @@ -131,3 +131,4 @@ i18n: # gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. update_ladder: - {"from": {"outline": "outlinewiki/outline:1.9.1", "outline-postgres": "postgres:16-alpine", "outline-redis": "redis:7-alpine"}, "to": {"outline": "outlinewiki/outline:1.9.1", "outline-postgres": "postgres:18-alpine", "outline-redis": "redis:7-alpine"}, "digest": {"outline": "sha256:9fe2cbdceccea0ffb82cbc8dc6f4c0d4ba1d377454e502d5d2bddececb34d4f1", "outline-postgres": "sha256:77f585114c32fbca283dc835b0596f4e52b51b4c6662d7810b2f4084f60a1873", "outline-redis": "sha256:858f009f9709ce576febc734aa78b8f6d624b82571f9ddb6bda4377c833b3499"}, "verdict": "proven", "tested_at": "2026-09-30T10:40:04Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/bench/apps/outline/bench/evidence/MV-outline/verdict.json", "box_evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/box/outline/box-verdict-outline.json", "memory_peak_pct": 48.9, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 65.5, "engine_conversion": {"service": "outline-postgres", "engine": "postgres", "from": 16, "to": 18}} + - {"from": {"outline": "outlinewiki/outline:1.9.1", "outline-postgres": "postgres:18-alpine", "outline-redis": "redis:7-alpine"}, "to": {"outline": "outlinewiki/outline:1.10.1", "outline-postgres": "postgres:18-alpine", "outline-redis": "redis:7-alpine"}, "digest": {"outline": "sha256:832051f039b446c87aa23929cf92c00980c66aaa2d744d118c48c016ec816ad8", "outline-postgres": "sha256:77f585114c32fbca283dc835b0596f4e52b51b4c6662d7810b2f4084f60a1873", "outline-redis": "sha256:858f009f9709ce576febc734aa78b8f6d624b82571f9ddb6bda4377c833b3499"}, "verdict": "proven", "tested_at": "2026-09-30T17:04:15Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/bench/apps/outline/bench/evidence/MV-outline/verdict.json", "box_evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/box/outline/step.txt", "memory_peak_pct": 33.5, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 62.1} diff --git a/templates/outline/docker-compose.yml b/templates/outline/docker-compose.yml index 6dab5a2..95072c8 100644 --- a/templates/outline/docker-compose.yml +++ b/templates/outline/docker-compose.yml @@ -11,7 +11,7 @@ services: outline: - image: outlinewiki/outline:1.9.1 + image: outlinewiki/outline:1.10.1 container_name: outline restart: unless-stopped depends_on: diff --git a/templates/outline/steps/c6e5d58da2a400de.felhom.yml b/templates/outline/steps/c6e5d58da2a400de.felhom.yml new file mode 100644 index 0000000..5c245ae --- /dev/null +++ b/templates/outline/steps/c6e5d58da2a400de.felhom.yml @@ -0,0 +1,127 @@ +# ============================================================================= +# .felhom.yml - App metadata for felhom-controller +# ============================================================================= + +# --- Display info (shown on dashboard) --- +display_name: "Outline" +description: "Modern csapat tudásbázis Markdown támogatással" +category: "productivity" +subdomain: "kb" +slug: "outline" +# catalog_since: the date THIS repo last changed this app's pinned images. Any commit that +# changes an image: line must set this to the same day (see CLAUDE.md). +catalog_since: "2026-09-30" + +# --- Resource hints (displayed on deploy screen) --- +resources: + mem_request: "200M" + mem_limit: "768M" + pi_compatible: false + needs_hdd: false + +# --- Deploy fields (first deployment only) --- +deploy_fields: + - env_var: DOMAIN + label: "Domain" + type: domain + description: "A szerver domain neve" + locked_after_deploy: true + + - env_var: SUBDOMAIN + label: "Aldomain" + type: subdomain + default: "kb" + required: true + locked_after_deploy: true + description: "Az alkalmazás aldomainje" + + - env_var: SECRET_KEY + label: "Titkosítási kulcs" + type: secret + generate: "hex:32" + locked_after_deploy: true + + - env_var: UTILS_SECRET + label: "Segédprogram kulcs" + type: secret + generate: "hex:32" + locked_after_deploy: true + + - env_var: DB_PASSWORD + label: "Adatbázis jelszó" + type: secret + generate: "password:24" + locked_after_deploy: true + +# --- The setup gate (controller >= 0.281.0, `09` §3 decisions 46-47) --- +# The first visitor would create the admin; a fresh install is closed to everyone but the household until the first setup is done. +setup_gate: true + +# --- App info (info page content) --- +app_info: + tagline: "Modern tudásbázis - Markdown, valós idejű együttműködés, keresés" + docs_url: "https://docs.getoutline.com/" + + use_cases: + - 'Csapat tudásbázis és dokumentáció' + - 'Markdown szerkesztő valós idejű együttműködéssel' + - 'Strukturált dokumentumok fa-szerkezetben' + - 'Teljes szöveges keresés és hivatkozások' + - 'API és integrációk (Slack, webhookok)' + + first_steps: + - 'Nyisd meg a kb.DOMAIN címet a böngészőben' + - 'Hozd létre az első felhasználót' + - 'Hozz létre egy gyűjteményt (Collection) a dokumentumoknak' + - 'Kezdj el írni Markdown-ban' + - 'Hívd meg a csapattagokat' + + prerequisites: + - 'x86 processzor szükséges' + - 'Legalább 1 GB szabad RAM (Outline + PostgreSQL + Redis)' + +# --- Controller-side health probe --- +healthcheck: + checks: + - type: api + port: 3000 + path: "/_health" + expect: + status: 200 + +# --- English copy (localisation slice 5, R-560) -------------------------------------------- +# The Hungarian above is UNCHANGED. A box on English reads this block field by field; a missing +# field shows the Hungarian one; a controller older than 0.257.0 ignores the block entirely. +i18n: + en: + description: 'A modern team knowledge base with Markdown' + app_info: + tagline: 'A modern knowledge base - Markdown, live collaboration and search' + use_cases: + - 'A knowledge base and documentation for a team' + - 'A Markdown editor several people can use at once' + - 'Documents in a tree you can follow' + - 'Full text search and links between documents' + - 'An API and integrations (Slack, webhooks)' + first_steps: + - 'Open kb.DOMAIN in your browser' + - 'Create the first user' + - 'Create a Collection for your documents' + - 'Start writing in Markdown' + - 'Invite the rest of the team' + prerequisites: + - 'An x86 processor is needed' + - 'At least 1 GB of free RAM (Outline + PostgreSQL + Redis)' + deploy_fields: + - env_var: DOMAIN + label: 'Domain' + description: 'The server domain name' + - env_var: SUBDOMAIN + label: 'Subdomain' + description: 'The subdomain this app answers on' + - env_var: DB_PASSWORD + label: 'Database password' + - env_var: SECRET_KEY + label: 'Encryption key' + - env_var: UTILS_SECRET + label: 'Utility key' diff --git a/templates/outline/steps/c6e5d58da2a400de.yml b/templates/outline/steps/c6e5d58da2a400de.yml new file mode 100644 index 0000000..6dab5a2 --- /dev/null +++ b/templates/outline/steps/c6e5d58da2a400de.yml @@ -0,0 +1,112 @@ +# Outline - Modern csapat tudásbázis Markdown támogatással +# Domain: ${SUBDOMAIN}.${DOMAIN} +# Database: postgres +# RAM: ~200M (mem_limit: 768M) | Pi-compatible: No +# +# Environment variables: +# DOMAIN - Your domain (e.g., demo-felhom.eu) +# SECRET_KEY - Titkosítási kulcs (auto-generated) +# UTILS_SECRET - Segédprogram kulcs (auto-generated) +# DB_PASSWORD - Adatbázis jelszó (auto-generated) + +services: + outline: + image: outlinewiki/outline:1.9.1 + container_name: outline + restart: unless-stopped + depends_on: + outline-postgres: + condition: service_healthy + outline-redis: + condition: service_healthy + environment: + - NODE_ENV=production + - SECRET_KEY=${SECRET_KEY} + - UTILS_SECRET=${UTILS_SECRET} + - DATABASE_URL=postgres://outline:${DB_PASSWORD}@outline-postgres:5432/outline + # Az Outline 1.x alapértelmezésben SSL-t vár a Postgrestől. A stackben futó + # sidecar Postgres nem beszél SSL-t (belső hálózat), ezért enélkül az app + # indulási hurokba kerül: "The server does not support SSL connections". + - PGSSLMODE=disable + - REDIS_URL=redis://outline-redis:6379 + - URL=https://${SUBDOMAIN}.${DOMAIN} + - PORT=3000 + - FILE_STORAGE=local + - FILE_STORAGE_LOCAL_ROOT_DIR=/var/lib/outline/data + volumes: + - outline_data:/var/lib/outline/data + networks: + - traefik-public + - outline-internal + deploy: + resources: + limits: + memory: 768M + healthcheck: + test: ["CMD", "node", "-e", "const http = require('http'); http.get('http://127.0.0.1:3000/_health', (r) => { process.exit(r.statusCode === 200 ? 0 : 1) }).on('error', () => process.exit(1))"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 30s + labels: + - "traefik.enable=true" + - "traefik.http.routers.outline.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)" + - "traefik.http.routers.outline.entrypoints=websecure" + - "traefik.http.routers.outline.tls=true" + - "traefik.http.routers.outline.tls.certresolver=letsencrypt" + - "traefik.http.services.outline.loadbalancer.server.port=3000" + + outline-postgres: + image: postgres:18-alpine + container_name: outline-postgres + restart: unless-stopped + environment: + - POSTGRES_USER=outline + - POSTGRES_PASSWORD=${DB_PASSWORD} + - POSTGRES_DB=outline + - TZ=Europe/Budapest + volumes: + - outline_postgres_data:/var/lib/postgresql + networks: + - outline-internal + deploy: + resources: + limits: + memory: 256M + healthcheck: + test: ["CMD-SHELL", "pg_isready -U outline -d outline"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 20s + + outline-redis: + image: redis:7-alpine + container_name: outline-redis + restart: unless-stopped + environment: + - TZ=Europe/Budapest + volumes: + - outline_redis_data:/data + networks: + - outline-internal + deploy: + resources: + limits: + memory: 128M + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 20s + +volumes: + outline_data: + outline_postgres_data: + outline_redis_data: + +networks: + traefik-public: + external: true + outline-internal: From 8d3a35a720016f0599143fa4715cc4ea44593c4f Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 19:18:24 +0200 Subject: [PATCH 27/46] rallly: 4.11.1 -> 4.15.3, within-major step, both venues proven (R-462) The app half only; PostgreSQL 18 does not move. Bench 9401 (harness v4, swap 0): sign-up with the e-mail code from its own table, a poll seeded and read back before and after, 10-min watch 0 kills (anon peak 60.6 %); putting 4.11.1 back after the migration loses the poll (recorded; the box's undo restores the pre-update copy). Box 9202: done in 64.7 s through the setup gate, the poll read back. Written by upgrade-test.py --write-ladder. Evidence: felhom.eu/documentation/audits/more-night-apps-2026-09-30/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/rallly/.felhom.yml | 1 + templates/rallly/docker-compose.yml | 2 +- .../rallly/steps/076e355244f444f9.felhom.yml | 123 ++++++++++++++++++ templates/rallly/steps/076e355244f444f9.yml | 92 +++++++++++++ 4 files changed, 217 insertions(+), 1 deletion(-) create mode 100644 templates/rallly/steps/076e355244f444f9.felhom.yml create mode 100644 templates/rallly/steps/076e355244f444f9.yml diff --git a/templates/rallly/.felhom.yml b/templates/rallly/.felhom.yml index a1f8c00..38b9a4f 100644 --- a/templates/rallly/.felhom.yml +++ b/templates/rallly/.felhom.yml @@ -127,3 +127,4 @@ i18n: # gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. update_ladder: - {"from": {"rallly": "lukevella/rallly:4.11.1", "rallly-postgres": "postgres:16-alpine"}, "to": {"rallly": "lukevella/rallly:4.11.1", "rallly-postgres": "postgres:18-alpine"}, "digest": {"rallly": "sha256:b2acb78afb1e2e88445e78cec4393cd8b8cc63f9268cf1defe19f96d0db945b0", "rallly-postgres": "sha256:77f585114c32fbca283dc835b0596f4e52b51b4c6662d7810b2f4084f60a1873"}, "verdict": "proven", "tested_at": "2026-09-30T10:40:06Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/bench/apps/rallly/bench/evidence/MV-rallly/verdict.json", "box_evidence": "felhom.eu/documentation/audits/pg-last-six-2026-09-30/box/rallly/box-verdict-rallly.json", "memory_peak_pct": 61.6, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 68.5, "engine_conversion": {"service": "rallly-postgres", "engine": "postgres", "from": 16, "to": 18}} + - {"from": {"rallly": "lukevella/rallly:4.11.1", "rallly-postgres": "postgres:18-alpine"}, "to": {"rallly": "lukevella/rallly:4.15.3", "rallly-postgres": "postgres:18-alpine"}, "digest": {"rallly": "sha256:8cd979aefe8d06e1822bc67054eb2d31088cdb831aa3f7b5615b3768f35431d9", "rallly-postgres": "sha256:77f585114c32fbca283dc835b0596f4e52b51b4c6662d7810b2f4084f60a1873"}, "verdict": "proven", "tested_at": "2026-09-30T17:17:40Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/bench/apps/rallly/bench/evidence/MV-rallly/verdict.json", "box_evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/box/rallly/step.txt", "memory_peak_pct": 60.6, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 65.8} diff --git a/templates/rallly/docker-compose.yml b/templates/rallly/docker-compose.yml index 0072635..9ff77b7 100644 --- a/templates/rallly/docker-compose.yml +++ b/templates/rallly/docker-compose.yml @@ -10,7 +10,7 @@ services: rallly: - image: lukevella/rallly:4.11.1 + image: lukevella/rallly:4.15.3 container_name: rallly restart: unless-stopped depends_on: diff --git a/templates/rallly/steps/076e355244f444f9.felhom.yml b/templates/rallly/steps/076e355244f444f9.felhom.yml new file mode 100644 index 0000000..ac16d00 --- /dev/null +++ b/templates/rallly/steps/076e355244f444f9.felhom.yml @@ -0,0 +1,123 @@ +# ============================================================================= +# .felhom.yml - App metadata for felhom-controller +# ============================================================================= + +# --- Display info (shown on dashboard) --- +display_name: "Rallly" +description: "Időpont szavazás (Doodle alternatíva)" +category: "productivity" +subdomain: "poll" +slug: "rallly" +# catalog_since: the date THIS repo last changed this app's pinned images. Any commit that +# changes an image: line must set this to the same day (see CLAUDE.md). +catalog_since: "2026-09-30" + +# --- Resource hints (displayed on deploy screen) --- +resources: + mem_request: "384M" + mem_limit: "1024M" + pi_compatible: true + needs_hdd: false + +# --- Deploy fields (first deployment only) --- +deploy_fields: + - env_var: DOMAIN + label: "Domain" + type: domain + description: "A szerver domain neve" + locked_after_deploy: true + + - env_var: SUBDOMAIN + label: "Aldomain" + type: subdomain + default: "poll" + required: true + locked_after_deploy: true + description: "Az alkalmazás aldomainje" + + - env_var: SECRET_PASSWORD + label: "Titkosítási kulcs" + type: secret + generate: "hex:32" + locked_after_deploy: true + + - env_var: DB_PASSWORD + label: "Adatbázis jelszó" + type: secret + generate: "password:24" + locked_after_deploy: true + +# --- The setup gate (controller >= 0.281.0, `09` §3 decisions 46-47) --- +# The first visitor would create the admin; a fresh install is closed to everyone but the household until the first setup is done. +setup_gate: true + +# --- App info (info page content) --- +app_info: + tagline: "Időpont szavazás - Doodle alternatíva a saját szerveren" + docs_url: "https://support.rallly.co/" + + use_cases: + - 'Közös időpont egyeztetés szavazással' + - 'Találkozók, események szervezése' + - 'Résztvevők regisztráció nélkül szavazhatnak' + - 'Email értesítések és emlékeztetők' + - 'Egyszerű, tiszta felület' + + first_steps: + - 'Nyisd meg a poll.DOMAIN címet a böngészőben' + - 'Hozz létre egy új szavazást' + - 'Add meg a lehetséges időpontokat' + - 'Oszd meg a linket a résztvevőkkel' + + +# --- Controller-side health probe --- +healthcheck: + checks: + - type: http + port: 3000 + +# --- App-email mapping (apps → in-controller shim → hub → Resend) --- +# Rallly (Nodemailer) uses STARTTLS to the shim (SMTP_SECURE=false) and accepts the shim's self-signed +# cert (SMTP_REJECT_UNAUTHORIZED=false on v4; v3.x accepts by default). From = Rallly's single +# NOREPLY_EMAIL; SMTP_USER/SMTP_PWD stay unset (the shim accepts no-auth). +smtp_mapping: + host_var: SMTP_HOST + port_var: SMTP_PORT + security_var: SMTP_SECURE + security_value: "false" + from_var: NOREPLY_EMAIL + from_name_var: NOREPLY_EMAIL_NAME + from_local: rallly + extra: + SMTP_REJECT_UNAUTHORIZED: "false" + +# --- English copy (localisation slice 5, R-560) -------------------------------------------- +# The Hungarian above is UNCHANGED. A box on English reads this block field by field; a missing +# field shows the Hungarian one; a controller older than 0.257.0 ignores the block entirely. +i18n: + en: + description: 'Vote on a date (a Doodle alternative)' + app_info: + tagline: 'Vote on a date - a Doodle alternative on your own server' + use_cases: + - 'Agree on a time together, by voting' + - 'Organise meetings and events' + - 'People can vote without signing up' + - 'E-mail notices and reminders' + - 'A simple, clean interface' + first_steps: + - 'Open poll.DOMAIN in your browser' + - 'Create a new poll' + - 'Enter the possible dates' + - 'Share the link with everybody' + deploy_fields: + - env_var: DOMAIN + label: 'Domain' + description: 'The server domain name' + - env_var: SUBDOMAIN + label: 'Subdomain' + description: 'The subdomain this app answers on' + - env_var: DB_PASSWORD + label: 'Database password' + - env_var: SECRET_PASSWORD + label: 'Encryption key' diff --git a/templates/rallly/steps/076e355244f444f9.yml b/templates/rallly/steps/076e355244f444f9.yml new file mode 100644 index 0000000..0072635 --- /dev/null +++ b/templates/rallly/steps/076e355244f444f9.yml @@ -0,0 +1,92 @@ +# Rallly - Időpont szavazás (Doodle alternatíva) +# Domain: ${SUBDOMAIN}.${DOMAIN} +# Database: postgres +# RAM: ~50M (mem_limit: 256M) | Pi-compatible: Yes +# +# Environment variables: +# DOMAIN - Your domain (e.g., demo-felhom.eu) +# SECRET_PASSWORD - Titkosítási kulcs (auto-generated) +# DB_PASSWORD - Adatbázis jelszó (auto-generated) + +services: + rallly: + image: lukevella/rallly:4.11.1 + container_name: rallly + restart: unless-stopped + depends_on: + rallly-postgres: + condition: service_healthy + environment: + - TZ=Europe/Budapest + - DATABASE_URL=postgresql://rallly:${DB_PASSWORD}@rallly-postgres:5432/rallly + - SECRET_PASSWORD=${SECRET_PASSWORD} + - NEXT_PUBLIC_BASE_URL=https://${SUBDOMAIN}.${DOMAIN} + # App-email (managed relay). Injected by the controller only when app-email is on (global + + # per-app); empty SMTP_HOST keeps Rallly mail disabled. Rallly (Nodemailer) reads these at send + # time. SMTP_SECURE=false → STARTTLS to the shim; SMTP_REJECT_UNAUTHORIZED=false accepts the + # shim's self-signed cert (v4 flag; v3.x accepts self-signed by default). See .felhom.yml smtp_mapping. + - SMTP_HOST=${SMTP_HOST:-} + - SMTP_PORT=${SMTP_PORT:-587} + - SMTP_SECURE=${SMTP_SECURE:-false} + - SMTP_REJECT_UNAUTHORIZED=${SMTP_REJECT_UNAUTHORIZED:-true} + # NOREPLY_EMAIL + SUPPORT_EMAIL are REQUIRED by Rallly at boot (it refuses to start without valid + # emails), independent of whether mail can actually send. Default them to valid addresses so Rallly + # boots with app-email OFF; the relay overrides NOREPLY_EMAIL to rallly@felhom.eu when ON. + - NOREPLY_EMAIL=${NOREPLY_EMAIL:-noreply@${DOMAIN}} + - NOREPLY_EMAIL_NAME=${NOREPLY_EMAIL_NAME:-Felhom} + - SUPPORT_EMAIL=${SUPPORT_EMAIL:-noreply@${DOMAIN}} + networks: + - traefik-public + - rallly-internal + deploy: + resources: + limits: + memory: 768M + # The rallly image has NO wget/curl — the old wget healthcheck always failed (exit 127), marking the + # container unhealthy, which made Traefik refuse to publish a route to it. Use Node (always present). + # rallly's "/" returns 307 → /login, so accept any status < 500. + healthcheck: + test: ["CMD", "node", "-e", "require('http').get('http://127.0.0.1:3000',r=>process.exit(r.statusCode<500?0:1)).on('error',()=>process.exit(1))"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 30s + labels: + - "traefik.enable=true" + - "traefik.http.routers.rallly.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)" + - "traefik.http.routers.rallly.entrypoints=websecure" + - "traefik.http.routers.rallly.tls=true" + - "traefik.http.routers.rallly.tls.certresolver=letsencrypt" + - "traefik.http.services.rallly.loadbalancer.server.port=3000" + + rallly-postgres: + image: postgres:18-alpine + container_name: rallly-postgres + restart: unless-stopped + environment: + - POSTGRES_USER=rallly + - POSTGRES_PASSWORD=${DB_PASSWORD} + - POSTGRES_DB=rallly + - TZ=Europe/Budapest + volumes: + - rallly_postgres_data:/var/lib/postgresql + networks: + - rallly-internal + deploy: + resources: + limits: + memory: 256M + healthcheck: + test: ["CMD-SHELL", "pg_isready -U rallly -d rallly"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 20s + +volumes: + rallly_postgres_data: + +networks: + traefik-public: + external: true + rallly-internal: From 48440ce01ca93809986b558fb3c30ed24eaa57f8 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 19:34:08 +0200 Subject: [PATCH 28/46] immich: step v3.0.3 -> v3.2.2 (0b8272068aab36bf) re-proven at 768M; its definition rewritten by the writer (R-732) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That step still pinned immich-postgres at 512M. It re-runs the geodata import (v3.0.3 ships geodata dated 2026-07-13, v3.2.2 2026-08-30 — read inside both images), the load R-732 measured at ~575 MB. Re-proof on bench 9401, swap 0, on the step's OWN definition with only the limit changed (768M; mem_limit 4096M -> 4480M): `Starting geodata import` ... `Geodata import completed` in 17 s, the database's kill counter 0 from its birth, the album read back, 10-min watch 0 kills (anon peak 29.6 %). Written by upgrade-test.py --restep; the ladder entry is untouched. No box reporting to the hub runs immich (hub /apps, same day). Evidence: felhom.eu/documentation/audits/more-night-apps-2026-09-30/D/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/immich/steps/0b8272068aab36bf.felhom.yml | 3 ++- templates/immich/steps/0b8272068aab36bf.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/immich/steps/0b8272068aab36bf.felhom.yml b/templates/immich/steps/0b8272068aab36bf.felhom.yml index c42dfc0..5cec593 100644 --- a/templates/immich/steps/0b8272068aab36bf.felhom.yml +++ b/templates/immich/steps/0b8272068aab36bf.felhom.yml @@ -1,3 +1,4 @@ +# RE-PROVEN 2026-09-30 on the bench on THIS definition (upgrade-test.py --restep): felhom.eu/documentation/audits/more-night-apps-2026-09-30/D/evidence/D-immich-0b82-768/verdict.json — definition sha256 a28eb9f4aff09b0a # ============================================================================= # .felhom.yml — App metadata for felhom-controller # ============================================================================= @@ -20,7 +21,7 @@ catalog_since: "2026-09-22" # --- Resource hints (displayed on deploy screen) --- resources: mem_request: "2048M" - mem_limit: "4096M" + mem_limit: "4480M" pi_compatible: false needs_hdd: true diff --git a/templates/immich/steps/0b8272068aab36bf.yml b/templates/immich/steps/0b8272068aab36bf.yml index f07d270..f071596 100644 --- a/templates/immich/steps/0b8272068aab36bf.yml +++ b/templates/immich/steps/0b8272068aab36bf.yml @@ -1,3 +1,4 @@ +# RE-PROVEN 2026-09-30 on the bench on THIS definition (upgrade-test.py --restep): felhom.eu/documentation/audits/more-night-apps-2026-09-30/D/evidence/D-immich-0b82-768/verdict.json — definition sha256 a28eb9f4aff09b0a # Immich - Self-hosted Photo & Video Management # Domain: ${SUBDOMAIN}.${DOMAIN} # Database: PostgreSQL (with VectorChord) + Redis @@ -106,7 +107,7 @@ services: deploy: resources: limits: - memory: 512M + memory: 768M healthcheck: test: ["CMD-SHELL", "pg_isready -U immich -d immich"] interval: 10s From 84de9a9254cf8c1949fa2c7ccb2c1484e6e8762d Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 20:05:31 +0200 Subject: [PATCH 29/46] harness: zipline's readback logs in with the right password first (its login limit answered 429 after the wrong-password control; R-742) Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- scripts/upgrade_fixtures_box.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade_fixtures_box.py b/scripts/upgrade_fixtures_box.py index 7f48142..1d13e78 100644 --- a/scripts/upgrade_fixtures_box.py +++ b/scripts/upgrade_fixtures_box.py @@ -826,13 +826,20 @@ class Zipline: return w.app_curl(sub, "/api/auth/login", "-H", "Content-Type: application/json", data=json.dumps({"username": t["user"], "password": p}), method="POST") - rc, code, _ = login("wrong-" + secrets.token_hex(6)) - if code == "200": - say(" zipline: READBACK UNUSABLE — a wrong password authenticated") - return False - rc, code, body = login(t["pw"]) + # The RIGHT password first (2026-09-30): zipline rate-limits logins, and a wrong attempt first made the + # right one answer 429 on the bench and on 9202. The wrong one after — any non-200 (401/429) is a refusal. + code = None + for _ in range(6): + rc, code, body = login(t["pw"]) + if code != "429": + break + time.sleep(20) ok = code == "200" say(f" zipline: login as the seeded user http={code} ok={ok}") + rc, bad, _ = login("wrong-" + secrets.token_hex(6)) + if bad == "200": + say(" zipline: READBACK UNUSABLE — a wrong password authenticated") + return False return ok From a9700e2b4c051cfd6b970fe2acb4bff04dd43a0e Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 20:05:42 +0200 Subject: [PATCH 30/46] zipline: 4.6.1 -> 4.7.0, its first ladder step, both venues proven (R-462, R-742) 4.8.0 cannot be reached in one step: it refuses to start until the database has run the release before it (prisma -> drizzle; measured on both venues; the box undid it by itself in 20 s). So the first step is 4.7.0. Bench 9401 (harness v4, swap 0): the first user made through /api/setup and logging in before and after, 10-min watch 0 kills (anon peak 41.7 %); the abort starts and serves. Box 9202: done in 103.6 s through the setup gate, the user logs in. PostgreSQL 16 does not move. Written by upgrade-test.py --write-ladder. Evidence: felhom.eu/documentation/audits/more-night-apps-2026-09-30/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/zipline/.felhom.yml | 8 +++++++- templates/zipline/docker-compose.yml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/zipline/.felhom.yml b/templates/zipline/.felhom.yml index 219d524..afac54e 100644 --- a/templates/zipline/.felhom.yml +++ b/templates/zipline/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "img" slug: "zipline" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-07-18" +catalog_since: "2026-09-30" # --- Resource hints (displayed on deploy screen) --- resources: @@ -121,3 +121,9 @@ i18n: label: 'Database password' - env_var: CORE_SECRET label: 'Encryption key' + +# update_ladder — the test record: one tested step per line, oldest first (JSON flow mappings, +# `09-update-architecture.md` §6.4 part 4). WRITTEN BY scripts/upgrade-test.py, never by hand; +# gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. +update_ladder: + - {"from": {"zipline": "ghcr.io/diced/zipline:4.6.1", "zipline-postgres": "postgres:16-alpine"}, "to": {"zipline": "ghcr.io/diced/zipline:4.7.0", "zipline-postgres": "postgres:16-alpine"}, "digest": {"zipline": "sha256:526fa08d2d3cf46bd959b2008987ca8d2a38b1ba840991b68cd9ff4b8c6a3fab", "zipline-postgres": "sha256:721873c34ceb9f8d8fc265984940dc982404c105f19ad51be9fdc5970a6080ea"}, "verdict": "proven", "tested_at": "2026-09-30T18:04:58Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/bench/apps/zipline/bench/evidence/MV-zipline/verdict.json", "box_evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/box/zipline/step.txt", "memory_peak_pct": 41.7, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 56.8} diff --git a/templates/zipline/docker-compose.yml b/templates/zipline/docker-compose.yml index 8b56c25..fafd08a 100644 --- a/templates/zipline/docker-compose.yml +++ b/templates/zipline/docker-compose.yml @@ -10,7 +10,7 @@ services: zipline: - image: ghcr.io/diced/zipline:4.6.1 + image: ghcr.io/diced/zipline:4.7.0 container_name: zipline restart: unless-stopped depends_on: From fb8703020e06e2a46ac9c0222828a46f19fa1114 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 20:22:53 +0200 Subject: [PATCH 31/46] zipline: 4.7.0 -> 4.8.0, its second ladder step, both venues proven (R-462, R-742) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The route 4.8.0 itself asks for (its prisma -> drizzle migration needs 4.7.x first). Bench 9401 (harness v4, swap 0; two earlier attempts stopped at the FROM pull because the bench's own disk was full — images removed by name, no prune): the user logs in before and after, 10-min watch 0 kills (anon peak 34.3 %); the abort starts and serves. Box 9202: done in 32.8 s, the user logs in. 4.7.0 keeps its definition in steps/. Written by upgrade-test.py --write-ladder. Evidence: felhom.eu/documentation/audits/more-night-apps-2026-09-30/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/zipline/.felhom.yml | 1 + templates/zipline/docker-compose.yml | 2 +- .../zipline/steps/da0fed39d57db1bf.felhom.yml | 123 ++++++++++++++++++ templates/zipline/steps/da0fed39d57db1bf.yml | 83 ++++++++++++ 4 files changed, 208 insertions(+), 1 deletion(-) create mode 100644 templates/zipline/steps/da0fed39d57db1bf.felhom.yml create mode 100644 templates/zipline/steps/da0fed39d57db1bf.yml diff --git a/templates/zipline/.felhom.yml b/templates/zipline/.felhom.yml index afac54e..0bca3b4 100644 --- a/templates/zipline/.felhom.yml +++ b/templates/zipline/.felhom.yml @@ -127,3 +127,4 @@ i18n: # gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. update_ladder: - {"from": {"zipline": "ghcr.io/diced/zipline:4.6.1", "zipline-postgres": "postgres:16-alpine"}, "to": {"zipline": "ghcr.io/diced/zipline:4.7.0", "zipline-postgres": "postgres:16-alpine"}, "digest": {"zipline": "sha256:526fa08d2d3cf46bd959b2008987ca8d2a38b1ba840991b68cd9ff4b8c6a3fab", "zipline-postgres": "sha256:721873c34ceb9f8d8fc265984940dc982404c105f19ad51be9fdc5970a6080ea"}, "verdict": "proven", "tested_at": "2026-09-30T18:04:58Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/bench/apps/zipline/bench/evidence/MV-zipline/verdict.json", "box_evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/box/zipline/step.txt", "memory_peak_pct": 41.7, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 56.8} + - {"from": {"zipline": "ghcr.io/diced/zipline:4.7.0", "zipline-postgres": "postgres:16-alpine"}, "to": {"zipline": "ghcr.io/diced/zipline:4.8.0", "zipline-postgres": "postgres:16-alpine"}, "digest": {"zipline": "sha256:8ae3cdf8cdbba2ac98754e9fc4ccec67bbaa86b6e6ab1ccf9683ddcff85eee72", "zipline-postgres": "sha256:721873c34ceb9f8d8fc265984940dc982404c105f19ad51be9fdc5970a6080ea"}, "verdict": "proven", "tested_at": "2026-09-30T18:22:10Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/bench/apps/zipline/bench/evidence/MV-zipline/verdict.json", "box_evidence": "felhom.eu/documentation/audits/more-night-apps-2026-09-30/box/zipline/step.txt", "memory_peak_pct": 34.3, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 54.0} diff --git a/templates/zipline/docker-compose.yml b/templates/zipline/docker-compose.yml index fafd08a..2a48bcc 100644 --- a/templates/zipline/docker-compose.yml +++ b/templates/zipline/docker-compose.yml @@ -10,7 +10,7 @@ services: zipline: - image: ghcr.io/diced/zipline:4.7.0 + image: ghcr.io/diced/zipline:4.8.0 container_name: zipline restart: unless-stopped depends_on: diff --git a/templates/zipline/steps/da0fed39d57db1bf.felhom.yml b/templates/zipline/steps/da0fed39d57db1bf.felhom.yml new file mode 100644 index 0000000..0356337 --- /dev/null +++ b/templates/zipline/steps/da0fed39d57db1bf.felhom.yml @@ -0,0 +1,123 @@ +# ============================================================================= +# .felhom.yml - App metadata for felhom-controller +# ============================================================================= + +# --- Display info (shown on dashboard) --- +display_name: "Zipline" +description: "ShareX/Flameshot szerver - screenshot és fájlmegosztás" +category: "files" +subdomain: "img" +slug: "zipline" +# catalog_since: the date THIS repo last changed this app's pinned images. Any commit that +# changes an image: line must set this to the same day (see CLAUDE.md). +catalog_since: "2026-09-30" + +# --- Resource hints (displayed on deploy screen) --- +resources: + mem_request: "100M" + mem_limit: "512M" + pi_compatible: false + needs_hdd: false + +# --- Deploy fields (first deployment only) --- +deploy_fields: + - env_var: DOMAIN + label: "Domain" + type: domain + description: "A szerver domain neve" + locked_after_deploy: true + + - env_var: SUBDOMAIN + label: "Aldomain" + type: subdomain + default: "img" + required: true + locked_after_deploy: true + description: "Az alkalmazás aldomainje" + + - env_var: CORE_SECRET + label: "Titkosítási kulcs" + type: secret + generate: "hex:32" + locked_after_deploy: true + + - env_var: DB_PASSWORD + label: "Adatbázis jelszó" + type: secret + generate: "password:24" + locked_after_deploy: true + +# --- The setup gate (controller >= 0.281.0, `09` §3 decisions 46-47) --- +# The first visitor would create the admin; a fresh install is closed to everyone but the household until the first setup is done. +setup_gate: true +# measured on 9202 2026-09-29: firstSetup true -> false once the first user exists (/api/setup itself answers 403 after the setup, so it cannot be the check). +setup_done_probe: + url: http://zipline:3000/api/server/public + field: firstSetup + done: "false" + +# --- App info (info page content) --- +app_info: + tagline: "Screenshot és fájlmegosztó szerver ShareX/Flameshot integrációval" + docs_url: "https://zipline.diced.sh/docs/" + + use_cases: + - 'Screenshotok automatikus feltöltése ShareX/Flameshot-ból' + - 'URL rövidítés és szöveg megosztás (paste)' + - 'Galéria nézet és album kezelés' + - 'API támogatás egyedi integrációkhoz' + - 'Felhasználói fiókok és meghívó rendszer' + + first_steps: + - 'Nyisd meg az img.DOMAIN címet a böngészőben' + - 'Az első megnyitáskor hozd létre az admin fiókodat' + - 'Konfiguráld a ShareX-et vagy Flameshot-ot az API URL-lel' + - 'Tölts fel egy screenshot-ot a teszteléshez' + + prerequisites: + - 'ShareX (Windows) vagy Flameshot (Linux) ajánlott a screenshot feltöltéshez' + +# --- Controller-side health probe --- +healthcheck: + checks: + - type: api + port: 3000 + # /api/healthcheck, not /api/health: this probe is `api` WITH an expect + # block, so a 404 on the wrong path reads as unhealthy. zipline's own compose healthcheck + # dials /api/healthcheck (R-618). + path: "/api/healthcheck" + expect: + status: 200 + +# --- English copy (localisation slice 5, R-560) -------------------------------------------- +# The Hungarian above is UNCHANGED. A box on English reads this block field by field; a missing +# field shows the Hungarian one; a controller older than 0.257.0 ignores the block entirely. +i18n: + en: + description: 'A ShareX/Flameshot server - screenshots and file sharing' + app_info: + tagline: 'A screenshot and file sharing server that works with ShareX/Flameshot' + use_cases: + - 'Screenshots upload themselves from ShareX/Flameshot' + - 'Shorten a URL and share text (paste)' + - 'A gallery view and albums' + - 'An API, for integrations of your own' + - 'User accounts and invitations' + first_steps: + - 'Open img.DOMAIN in your browser' + - 'On the first visit, create your admin account' + - 'Point ShareX or Flameshot at the API address' + - 'Upload a screenshot to check it works' + prerequisites: + - 'ShareX (Windows) or Flameshot (Linux) is recommended for uploading screenshots' + deploy_fields: + - env_var: DOMAIN + label: 'Domain' + description: 'The server domain name' + - env_var: SUBDOMAIN + label: 'Subdomain' + description: 'The subdomain this app answers on' + - env_var: DB_PASSWORD + label: 'Database password' + - env_var: CORE_SECRET + label: 'Encryption key' diff --git a/templates/zipline/steps/da0fed39d57db1bf.yml b/templates/zipline/steps/da0fed39d57db1bf.yml new file mode 100644 index 0000000..fafd08a --- /dev/null +++ b/templates/zipline/steps/da0fed39d57db1bf.yml @@ -0,0 +1,83 @@ +# Zipline - ShareX/Flameshot szerver - screenshot és fájlmegosztás +# Domain: ${SUBDOMAIN}.${DOMAIN} +# Database: postgres +# RAM: ~100M (mem_limit: 512M) | Pi-compatible: No +# +# Environment variables: +# DOMAIN - Your domain (e.g., demo-felhom.eu) +# CORE_SECRET - Titkosítási kulcs (auto-generated) +# DB_PASSWORD - Adatbázis jelszó (auto-generated) + +services: + zipline: + image: ghcr.io/diced/zipline:4.7.0 + container_name: zipline + restart: unless-stopped + depends_on: + zipline-postgres: + condition: service_healthy + environment: + - TZ=Europe/Budapest + - CORE_SECRET=${CORE_SECRET} + # FIGYELEM: a v4 óta a DB változó neve DATABASE_URL (prefix NÉLKÜL), míg a + # CORE_SECRET megtartotta a prefixet. A régi CORE_DATABASE_URL nevet a v4 + # már nem ismeri fel, és indulás nélkül kilép: + # "No database environment variables found (DATABASE_URL or all of [...])" + - DATABASE_URL=postgresql://zipline:${DB_PASSWORD}@zipline-postgres:5432/zipline + volumes: + - zipline_uploads:/zipline/uploads + - zipline_public:/zipline/public + networks: + - traefik-public + - zipline-internal + deploy: + resources: + limits: + memory: 512M + healthcheck: + test: ["CMD", "node", "-e", "const http = require('http'); http.get('http://127.0.0.1:3000/api/healthcheck', (r) => { process.exit(r.statusCode === 200 ? 0 : 1) }).on('error', () => process.exit(1))"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 30s + labels: + - "traefik.enable=true" + - "traefik.http.routers.zipline.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)" + - "traefik.http.routers.zipline.entrypoints=websecure" + - "traefik.http.routers.zipline.tls=true" + - "traefik.http.routers.zipline.tls.certresolver=letsencrypt" + - "traefik.http.services.zipline.loadbalancer.server.port=3000" + + zipline-postgres: + image: postgres:16-alpine + container_name: zipline-postgres + restart: unless-stopped + environment: + - POSTGRES_USER=zipline + - POSTGRES_PASSWORD=${DB_PASSWORD} + - POSTGRES_DB=zipline + - TZ=Europe/Budapest + volumes: + - zipline_postgres_data:/var/lib/postgresql/data + networks: + - zipline-internal + deploy: + resources: + limits: + memory: 256M + healthcheck: + test: ["CMD-SHELL", "pg_isready -U zipline -d zipline"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 20s + +volumes: + zipline_postgres_data: + zipline_public: + zipline_uploads: + +networks: + traefik-public: + external: true + zipline-internal: From d18116539aca7c559990a072d08fa845f7896381 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 20:26:54 +0200 Subject: [PATCH 32/46] CHANGELOG + REPORT: twelve more steps, six first ladders (R-462, R-738, R-742, R-732) Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- CHANGELOG.md | 23 +++++++++++++++++++++++ REPORT.md | 18 +++++++++++------- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 818a23e..cad6a7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,26 @@ +## Twelve more steps, six first ladders, and the fixtures behind them (2026-09-30, evening, R-462) + +Each step: bench 9401 (harness v4, swap 0, 10-min memory watch) + box 9202 (drill catalog, the product's guarded +Update), written by `upgrade-test.py --write-ladder`, the only image move in its commit. Evidence: +`felhom.eu/documentation/audits/more-night-apps-2026-09-30/`. +- **First ladders:** gitea 1.27.0 → 1.27.3 `d7ba60c`, calibre-web v4.0.6 → v4.0.8 `53a4a1d` (`files_may_change` — its + library database `metadata.db` in the books folder changed on the bench), wger 2.6 → 2.7 `4ad32aa`, crafty-controller + 4.10.7 → 4.11.0 `e1f0179`, uptime-kuma 2.4.0 → 2.5.5 `35dd5cf`, zipline 4.6.1 → 4.7.0 `a9700e2` → 4.8.0 `fb87030` (4.8.0 needs 4.7.x first — R-742). +- **Within-major steps:** emby 4.11.0.4 `3e4aa77`, ghost 6.67.0-alpine `9a78e3b`, home-assistant 2026.9.4 `15f4d59`, + outline 1.10.1 `b0b2514`, rallly 4.15.3 `8d3a35a`. None `memory_tight`; no limit moved. +- **wger runs its migrations at start** `7a4ff48` (R-738): without `DJANGO_PERFORM_MIGRATIONS=True` the 2.6 → 2.7 step + ended `done` on 9202 with 12 migrations unapplied and the login answering 500. +- **immich's step v3.0.3 → v3.2.2 re-proven at 768M** `48440ce` (R-732): it re-runs the geodata import; the step's own + definition rewritten by the new `upgrade-test.py --restep` `63a96b0`. +- **Harness** `5b1972b`, `63a96b0`: fixtures for calibre-web (Upload form → OPDS), wger (web login → weight API), + crafty-controller (API v2), uptime-kuma (socket.io polling → public status page); gitea posts its own first-run + installer (R-624); zipline's readback waits on `/api/healthcheck` and logs in right-password-first (its login limit); + the bench reaches an HTTPS backend over HTTPS; `password:N:special` has the controller's shape (R-735, red then green); + a `files_may_change` mark now NAMES its files; `--restep`; `test_catalog_gates.py`'s stale gate count (red on main) fixed. +- **Not moved:** wanderer (the bench cannot run it — R-739). **Measured on the way:** zipline 4.6.1 → 4.8.0 directly + fails on both venues, and the box's own guarded Update undid it in 20 s. +- **Night-updatable (audit method (a)): 30 + 2 conditional → 35 + 3 conditional**; 15 apps have no ladder. + ## immich: the database gets 768M, and v3.2.4 is published with it (2026-09-30, afternoon, R-732) - **Cause, measured** (`felhom.eu/documentation/audits/immich-first-start-2026-09-30/A-cause.md`): the first-start geodata diff --git a/REPORT.md b/REPORT.md index a368fd4..28ecc69 100644 --- a/REPORT.md +++ b/REPORT.md @@ -1,9 +1,13 @@ -# REPORT — 2026-09-30 (late afternoon): immich's first start fixed; v3.2.4 published with it +# REPORT — 2026-09-30 (evening): twelve more steps, six first ladders -Evidence: `felhom.eu/documentation/audits/immich-first-start-2026-09-30/`. Operator report: `felhom.eu/REPORT-immich-first-start-2026-09-30.md`. +Evidence: `felhom.eu/documentation/audits/more-night-apps-2026-09-30/`. Operator report: `felhom.eu/REPORT-more-night-apps-2026-09-30.md`. -- Cause: 9 concurrent geodata INSERTs need ~575 MB in the database; 512M only fits with swap. Controls: swap alone, limit alone - flip it; shared_buffers alone does not. -- `56c4888`: v3.2.4 + `immich-postgres` 768M (`mem_limit` 4480M). Fresh installs with swap off: 0 kills on both venues. -- The step: bench proven (10-min watch 0 kills), box 9202 done in 58.5 s, album read back, limit 768M after. -- An installed immich on 3.2.2 gets 768M with its next guarded Update (by hand, or the night leg when a whole copy exists). +- **First ladders:** calibre-web `53a4a1d` (`files_may_change`: its library DB), gitea `d7ba60c`, wger `4ad32aa`, + crafty-controller `e1f0179`, uptime-kuma `35dd5cf`, zipline `a9700e2` + `fb87030` (4.6.1 → 4.7.0 → 4.8.0; the direct + jump fails and the box undid it). **Within-major:** emby `3e4aa77`, ghost `9a78e3b`, home-assistant `15f4d59`, outline + `b0b2514`, rallly `8d3a35a`. Each: bench 9401 (swap 0, 10-min watch, 0 kills) + box 9202 through the guarded Update. +- **Fixes:** wger runs its migrations at start `7a4ff48` (R-738 — its update left the login 500 behind a `done`); + immich's step `0b82…` re-proven at 768M and rewritten by the new `--restep` `48440ce`/`63a96b0` (R-732). +- **Harness** `5b1972b`, `63a96b0`, `84de9a9`: five fixtures, gitea's installer, HTTPS backends, named files behind + `files_may_change`, the bench's `password:N:special` (R-735), zipline's readback, the stale gate-count test. +- **Night-updatable:** 30 + 2 conditional → **35 + 3 conditional**; 15 apps have no ladder. Not done: wanderer (R-739). From 45d84827add21b5ee9edaee52bba3fc3f6c4df77 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 22:27:13 +0200 Subject: [PATCH 33/46] wger: its app login API gets its JWT key pair (R-737) The template set no JWT_PRIVATE_KEY/JWT_PUBLIC_KEY, so the app login (the mobile app's route) answered 500 on a CORRECT password. The deploy's generators cannot make an RSA pair, so the start command makes it ONCE with wger's own `manage.py generate-jwt-keys`, keeps it 0600 on wger's data volume (a restore brings it back), and loads it before the image's own entrypoint. Measured on the bench (2.7): right password 200 with an access token that reads the API (200); wrong password 400 (allauth's answer); the key survives a restart. No image moves. Evidence: felhom.eu/documentation/audits/night-rulings-2026-09-30/D/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/wger/docker-compose.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/templates/wger/docker-compose.yml b/templates/wger/docker-compose.yml index 05fd2f6..2bc88c0 100644 --- a/templates/wger/docker-compose.yml +++ b/templates/wger/docker-compose.yml @@ -11,6 +11,21 @@ services: wger: image: wger/server:2.7 container_name: wger + # R-737 (2026-09-30): wger's app login API (the mobile app's) signs JWTs with JWT_PRIVATE_KEY / JWT_PUBLIC_KEY — an + # RSA pair the deploy's generators cannot make, and without it a CORRECT password answered 500. So the pair is made + # ONCE by wger's own `manage.py generate-jwt-keys`, kept 0600 on wger's own data volume (a restore brings the same + # key back), and loaded before the image's own entrypoint. Never printed. + entrypoint: + - /bin/sh + - -c + - | + K=/home/wger/db/.felhom-jwt.env + if [ ! -s "$$K" ]; then + (cd /home/wger/src && python3 manage.py generate-jwt-keys 2>/dev/null) | grep -E '^JWT_(PRIVATE|PUBLIC)_KEY=' > "$$K.tmp" + if [ "$$(grep -c . "$$K.tmp")" = 2 ]; then mv "$$K.tmp" "$$K" && chmod 600 "$$K"; else rm -f "$$K.tmp"; echo "felhom: JWT keys could not be made" >&2; fi + fi + if [ -s "$$K" ]; then set -a; . "$$K"; set +a; fi + exec /home/wger/entrypoint.sh restart: unless-stopped environment: - TZ=Europe/Budapest From 6a3ead9ebe102989d93e6a779008b8cbd6507d40 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 23:06:09 +0200 Subject: [PATCH 34/46] Same-tag security fixes as tested steps (09 decision 52, R-740): re-test entries, their gates, the monthly command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - A RE-TEST entry: from == to, digest = the registry's new digest, digest_from = the tested one, box_evidence. ladder.check_entry refuses one with no new digest, no digest_from or no box proof; check-test-record rule 2b ties digest_from to the previous entry's digest; check-test-record-move now judges re-tests too (they change .felhom.yml only — the gate looked at compose moves alone) and refuses a digest the registry no longer serves. Decoys: 8 cases in test_gate_decoys.py, seen red with the rules switched off. - upgrade-test.py --retest [svc]: FROM the ladder head's tested digest TO the registry's current one, the full method; --write-ladder writes a re-test entry (plain refs + digest_from), refusing without the box venue or when the registry moved again. Writer tests, red-proofed. - scripts/retest-floating.py — ONE command: --dry-run lists, --engines-only is the ruled start; bench, box (retest_box.py on 9202 via the drill catalog), writer, gates, one commit per app. box_walk.py moves the box client into the catalog. Run today: nothing to re-test on the database/redis lines. - End to end on 9202 (drill): docmost at the OLD redis digest, the re-test, "run tonight's chain now" -> the leg pressed it, the new digest runs, read back, badge current. - Also: upgrade-test.py BENCH_ENV_OVERRIDES (R-739, wanderer's DB address on the bench, recorded per verdict); test_gate_decoys.py read kimai's tag and date from the clone (red on main since kimai moved). Evidence: felhom.eu/documentation/audits/night-rulings-2026-09-30/A/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- REUSE.md | 2 + scripts/box_walk.py | 563 ++++++++++++++++++++++++++++++ scripts/check-test-record-move.py | 47 +++ scripts/check-test-record.py | 16 + scripts/ladder.py | 17 + scripts/retest-floating.py | 230 ++++++++++++ scripts/retest_box.py | 158 +++++++++ scripts/test_gate_decoys.py | 56 ++- scripts/test_ladder_writer.py | 43 +++ scripts/upgrade-test.py | 115 +++++- 10 files changed, 1226 insertions(+), 21 deletions(-) create mode 100644 scripts/box_walk.py create mode 100644 scripts/retest-floating.py create mode 100644 scripts/retest_box.py diff --git a/REUSE.md b/REUSE.md index 60c32b1..25cce94 100644 --- a/REUSE.md +++ b/REUSE.md @@ -25,6 +25,8 @@ Templates are config; the few script helpers other scripts must REUSE, never re- | **Open first-run screen → `setup_gate:`** (decision 46, controller ≥ 0.280.0) | `templates/n8n/.felhom.yml` (probe), `templates/uptime-kuma/.felhom.yml` (no probe → the household's button); `FIRST-ADMIN.md` | `setup_gate: true` + optional `setup_done_probe: {url: http://:/, field: , done: ""}` | TRAPS: the probe must FLIP on the setup — measure it before and after on 9202; an app with open sign-up after setup (R-711) is not closed by the gate; `url` is read on the docker network, so it names the container, not the subdomain. | | **Open sign-up after the setup → `signup_block:`** (decision 47, controller ≥ 0.281.0) | `templates/opengist/.felhom.yml`, `templates/calcom/.felhom.yml` | `signup_block: ""` + `app_info.add_people` (hu) / `i18n.en.app_info.add_people` | TRAPS: block the app's API sign-up call, not only the page; an app's own invite link often uses the same address (the household's 15-minute window covers it); `add_people` is copy — `--capture-freeze`. | | **The app's own sign-up switch → `after_setup:`** (decisions 47/49, controller ≥ 0.282.0) | `templates/homebox/` (compose `HBOX_OPTIONS_ALLOW_REGISTRATION=${SIGNUP_OPEN:-true}` + `.felhom.yml` `after_setup.env`) | compose default OPEN; `after_setup: {env: {SIGNUP_CLOSED: "true"}}` | TRAPS: the default must be OPEN (an installed app is unchanged by the catalog); several apps' switch also refuses the household's FIRST account, so never set it at install; an app with no env switch (opengist, wishlist) keeps the block alone — make that block case-insensitive. | +| **A same-tag security fix → a RE-TEST step** (`09` decision 52, 2026-09-30) | `scripts/retest-floating.py` (the ONE monthly command), `scripts/retest_box.py` (the box venue), `scripts/box_walk.py` (the 9202 client), `upgrade-test.py --retest` + `--write-ladder` | An entry whose `from` == `to`, with `digest_from` (the tested digest it started from) and `box_evidence`. `--dry-run` lists; `--engines-only` is the ruled start. Runbook `felhom.eu/documentation/runbooks/monthly-floating-retest.md`. TRAPS: never write one by hand (the gates refuse no new digest, a digest the registry stopped serving, a missing box proof, a `digest_from` that is not the previous entry's digest); `image_digest.resolve` IGNORES a `@digest` in its argument — ask the registry by manifest for a digest. | +| **A bench-only environment override** (R-739) | `upgrade-test.py` `BENCH_ENV_OVERRIDES` | Only for an app that cannot run on the bench at all (wanderer: its web server calls the DB at the public https name). Every verdict carries `bench_overrides`. Never a template change. | | Controller-side health probe | `templates/vaultwarden/.felhom.yml` (`healthcheck:` block) | `healthcheck.checks[]` with `type: http` (port only), `type: api` (port + `path` + `expect.status: 200`), or `type: tcp` (port only — mealie, crafty-controller). Prefer `api` with a real health path when the app has one. | | App lifecycle (`available`/`hidden`/`abandoned`) | `templates/plant-it/.felhom.yml` (`lifecycle:` block) | Optional top-level `lifecycle:` in `.felhom.yml`. Absent/empty ≡ `available`. `hidden` = not offered for new installs; `abandoned` = same, PLUS a permanent "Nem karbantartott" badge + notice on every box already running it. **Deployed instances keep full function in both states** — lifecycle governs what is OFFERED, never what runs; the controller refuses a deploy of a non-available template server-side (fail-closed, so a stale link or direct POST cannot install one). Unknown value → treated as `available` + one WARN, never a broken template. **Do NOT take an app out of circulation by deleting or moving its directory** — that orphans every customer already running it, which is what the 2026-07-21 `retired/` experiment got wrong. The resolvability gate skips non-available apps, so an abandoned app's dead image is not a standing red. | | **Catalog gates — THE entry point** | `scripts/catalog_gates.py` | **Run `python3 scripts/catalog_gates.py ` after ANY template change** (mandated in `CLAUDE.md`). Runs all four gates below in order — image-pins, image-resolvable, volume-persistence, engine-major (2026-09-13; git-history diff, hook-only until CI fetches deeper, R-452) — and exits **non-zero if any fails**; **2 (UNDETERMINED) is reported distinctly and is never a pass**, 1 (convicted) outranks 2 in the summary. Naming app(s) scopes the two gates that accept scoping, which is the normal after-a-change run; with no names the RUNTIME gate deploys every template, so that form is **scratch host only**. **Why a runner** (operator ruling 2026-08-02, R-161): the only gates in this project that ever get run are the ones with a single entry point named in a CLAUDE.md — `felhom.eu/scripts/site_gates.py` is run, R-29's three orphans are named nowhere and have stopped nothing. Controller-side enforcement was rejected because a load-time check reads only the file and a static audit reports the catalog clean **including papra** — it would pass on the very defect it exists to catch; CI was rejected for now (neither repo has any, no users yet). Adding a fourth gate here means adding it to `GATES` in this file — nothing else. | diff --git a/scripts/box_walk.py b/scripts/box_walk.py new file mode 100644 index 0000000..556b175 --- /dev/null +++ b/scripts/box_walk.py @@ -0,0 +1,563 @@ +#!/usr/bin/env python3 +"""box_walk.py — the BOX venue's client (moved into the catalog 2026-09-30 from the audits' walk.py, so the monthly +re-test `retest-floating.py` has a stable home). ONE app's walk on scratch guest 9202, through the product's own +endpoints. Configuration by environment: SC (a 0600 scratch dir holding `.ctlpw`, the 9202 dashboard password — +never committed), EV (where evidence goes), GUEST/BASE/DOMAIN as before. + +EVIDENCE, NOT PRODUCT. It presses exactly the buttons a person presses: + POST /api/stacks//deploy · POST /api/sync · POST /api/stacks/rescan + POST /api/stacks//update · POST /api/stacks//remove +and reads GET /api/stacks/. No controller code exists for it. + +The walk, per `09` §6.4 and the update-night brief §4: + 1 deploy from the DRILL catalog at the LIVE pin + 2 seed through the app's OWN front door (R-156: never a volume, never SQL) + 3 read the seed back <- control C1; a fixture that cannot prove itself proves nothing + 4 „Mentés most" + 5 commit the real one-step bump to the DRILL repo, sync, rescan, read the badge in BOTH languages + 6 press the guarded Update, record every phase with timestamps + 7 read the seed back through the front door + 8 the four version observables side by side + 9 write the verdict record in `09`'s JSON shape + +`inconclusive` is a first-class verdict and is NEVER collapsed into `failed`. +""" +import argparse, json, os, re, subprocess, sys, time +from datetime import datetime, timezone + +SC = os.environ.get('SC', os.path.expanduser('~/.felhom-retest')) +EV = os.environ.get('EV', os.path.join(SC, 'evidence')) +DRILL = "/mnt/5_hdd/felhom.eu/drill/app-catalog-drill" +# GUEST=9201 selects demo-hp's hub-enabled guest (the mail proof); default 9202, the scratch guest. +GUEST = os.environ.get("GUEST", "9202") +BASE = os.environ.get("BASE") or {"9202": "https://192.168.0.114", "9201": "https://192.168.0.155"}[GUEST] +DOMAIN = os.environ.get("DOMAIN", "enkisfelhom.hu") +HOSTHDR = f"Host: felhom.{DOMAIN}" +HP = "demo-hp" + +LOG = [] + + +def say(*a): + line = " ".join(str(x) for x in a) + ts = datetime.now().strftime("%H:%M:%S") + print(f"{ts} {line}", flush=True) + LOG.append(f"{ts} {line}") + + +def sh(args, timeout=300, inp=None): + try: + return subprocess.run(args, capture_output=True, text=True, timeout=timeout, input=inp) + except (subprocess.TimeoutExpired, OSError) as e: + return subprocess.CompletedProcess(args, 124, "", f"{e}") + + +def guest(script, timeout=600): + """Run a bash script inside guest 9202. Piped as a file — never as an argument (quoting).""" + # ONE TEMP FILE PER CALL (night 2026-09-23): the shared /tmp/w.sh swapped scripts under + # two concurrent walks (memory: guest-helper-shares-one-tmp-file). + import secrets as _s + t = f"/tmp/w{GUEST}-{os.getpid()}-{_s.token_hex(4)}.sh" + r = sh(["ssh", "-o", "ConnectTimeout=20", "-o", "StrictHostKeyChecking=accept-new", HP, + f"export LC_ALL=C; cat > {t}; pct push {GUEST} {t} {t} >/dev/null 2>&1; " + f"pct exec {GUEST} -- bash {t}; pct exec {GUEST} -- rm -f {t}; rm -f {t}"], + timeout=timeout, inp=script) + return r.stdout or "" + + +def login(): + pw = open(f"{SC}/.ctlpw").read().strip() + sh(["curl", "-sk", "-D", f"{SC}/hdr{os.getpid()}.txt", "-o", "/dev/null", "-H", HOSTHDR, + "-X", "POST", "--data-urlencode", f"password={pw}", f"{BASE}/login"]) + h = open(f"{SC}/hdr{os.getpid()}.txt").read() + m = re.search(r"felhom_session=[A-Za-z0-9._-]+", h, re.I) + if not m: + sys.exit("login failed: no session cookie") + open(f"{SC}/sess{os.getpid()}.txt", "w").write(m.group(0)) + r = sh(["curl", "-sk", "-L", "-H", HOSTHDR, "-H", f"Cookie: {m.group(0)}", f"{BASE}/"]) + c = re.search(r' the felhom_gate cookie the household's browser would hold (setup gate, v0.280.0) + + +def _loc(out): + m = re.search(r"(?im)^location:\s*(\S+)", out or "") + return m.group(1) if m else "" + + +def gate_cookie(sub): + """Pass the setup gate (`09` decision 46) the way the HOUSEHOLD does: the app host redirects to the + dashboard's /__gate/start, which (with the dashboard session) redirects back to the app host's + /__felhom_gate/cb, which sets `felhom_gate`. Never printed.""" + import urllib.parse + sess = open(f"{SC}/sess{os.getpid()}.txt").read().strip() + r = sh(["curl", "-sk", "-D", "-", "-o", "/dev/null", "-H", "Accept: text/html", "-H", f"Host: {sub}.{DOMAIN}", f"{BASE}/"]) + loc = _loc(r.stdout) + if "/__gate/start" not in loc: + GATE[sub] = "" + return "" # not gated (open, or no gate for this app) + u = urllib.parse.urlsplit(loc) + r = sh(["curl", "-sk", "-D", "-", "-o", "/dev/null", "-H", "Accept: text/html", "-H", f"Host: {u.hostname}", "-H", f"Cookie: {sess}", + f"{BASE}{u.path}?{u.query}"]) + loc = _loc(r.stdout) + u = urllib.parse.urlsplit(loc) + if "/__felhom_gate/cb" not in u.path: + say(f" gate: the dashboard did not hand back a callback for {sub} ({loc[:80]})") + return "" + r = sh(["curl", "-sk", "-D", "-", "-o", "/dev/null", "-H", "Accept: text/html", "-H", f"Host: {u.hostname}", f"{BASE}{u.path}?{u.query}"]) + m = re.search(r"(?im)^set-cookie:\s*(felhom_gate=[^;\r\n]+)", r.stdout or "") + GATE[sub] = m.group(1) if m else "" + say(f" gate: {sub} is gated — passed as the household (cookie {'set' if GATE[sub] else 'NOT set'})") + return GATE[sub] + + +def app_curl(sub, path, *extra, method=None, data=None, timeout=45, _retry=True): + """A call to the APP's own front door on 9202 — the household's route, not ours. Carries the setup + gate's cookie when the app is gated, merged into a fixture's own Cookie header (never a second one).""" + raw = list(extra) + gc = GATE[sub] if sub in GATE else gate_cookie(sub) + ext = list(raw) + if gc: + merged = False + for i, a in enumerate(ext): + if isinstance(a, str) and a.lower().startswith("cookie:") and i > 0 and ext[i - 1] == "-H": + ext[i] = a + "; " + gc + merged = True + if not merged: + ext = ["-H", f"Cookie: {gc}"] + ext + args = ["curl", "-sSk", "--max-time", str(timeout), "-H", f"Host: {sub}.{DOMAIN}", + "-w", "\n%{http_code} %{redirect_url}"] + if method: + args += ["-X", method] + if data is not None: + args += ["--data-binary", "@-"] + args += ext + [f"{BASE}{path}"] + r = sh(args, timeout=timeout + 30, inp=data) + body, _, tail = (r.stdout or "").rpartition("\n") + code, _, redir = tail.strip().partition(" ") + if _retry and "/__gate/start" in redir: + GATE.pop(sub, None) # the gate cookie expired or was never taken — log in as the household again + return app_curl(sub, path, *raw, method=method, data=data, timeout=timeout, _retry=False) + return r.returncode, code.strip(), body + + +def stack(name): + _, d = ctl("GET", f"/api/stacks/{name}") + return (d.get("data") or {}) if isinstance(d, dict) else {} + + +def wait_app(sub, path="/", want=("200", "302", "303", "401", "403"), tries=60, delay=5): + """Settling says the container runs; this says the APP answers. Not the same thing.""" + last = None + for _ in range(tries): + rc, code, _ = app_curl(sub, path, timeout=15) + last = (rc, code) + if rc == 0 and code in want: + return True + time.sleep(delay) + say(f" app never answered on {sub}{path} (last rc={last[0]} code={last[1]})") + return False + + +# ------------------------------------------------------------------ the walk + + +DRIVE = "/mnt/felhom-drives/scratch_hdd/userdata" + +# What THIS run generated for a deploy, per app. Deploy secrets are ENCRYPTED AT REST in +# `app.yaml` (`ENC:…`), which is right and which means a fixture cannot read an app's admin +# password back off the box — the household sees it once. So the value the harness itself +# generated is kept here for the life of the run, and nowhere else. +GENERATED = {} + + +def deploy_values(name, sub): + """Fill EVERY required deploy field the way the wizard would, by asking the box what this app + asks for — `GET /api/stacks//deploy-fields` — instead of assuming DOMAIN+SUBDOMAIN. + + Measured 2026-09-21: three apps in one batch refused at the deploy with a correct 400 because + a required field was absent — `HDD_PATH` (navidrome, audiobookshelf) and an admin password + (grafana). The refusals happen BEFORE anything is created (`deploy.go:324`), which is the only + reason this was safe to discover by running it (live-probes rule). + + A `path` field must name a directory that ALREADY EXISTS (`deploy.go:330`), so one is made on + the scratch drive first — the same act the drive browser performs for a household. + """ + code, d = ctl("GET", f"/api/stacks/{name}/deploy-fields") + fields = (((d.get("data") or {}).get("metadata") or {}).get("deploy_fields")) or [] + values = {"DOMAIN": DOMAIN, "SUBDOMAIN": sub} + made = [] + for f in fields: + ev, ty = f.get("env_var"), f.get("type") + if ev in values: + continue + # `type: password` is MANDATORY whatever `required` says — `deploy.go:305-312` refuses + # when the caller sends none, deliberately ("the user needs to know their password"), + # while `.felhom.yml` declares `required: false` and the API serves that verbatim. A + # caller that trusts the contract gets a 400. Measured tonight on grafana; filed. + if not f.get("required") and ty != "password": + continue # the controller generates the optional secrets itself + if ty == "path": + p = f"{DRIVE}/{name}" + values[ev] = p + made.append(p) + elif ty in ("secret", "password"): + import secrets as _s + values[ev] = "Drill-" + _s.token_hex(12) + GENERATED.setdefault(name, {})[ev] = values[ev] + elif f.get("default"): + values[ev] = f["default"] + else: + values[ev] = f"drill-{name}" + if made: + guest("mkdir -p " + " ".join(made) + "; ls -ld " + " ".join(made)) + say(f" [1] made the drive paths this app requires: {made}") + extra = [k for k in values if k not in ("DOMAIN", "SUBDOMAIN")] + if extra: + say(f" [1] required fields filled beyond DOMAIN/SUBDOMAIN: {extra}") + return values + + +def deploy(name, sub, extra_values=None): + st = stack(name) + if st.get("deployed"): + say(f" [1] {name} already deployed — reusing") + return True + values = deploy_values(name, sub) + if extra_values: + values.update(extra_values) + body = {"values": values} + if os.environ.get("KEPT"): # decision 36: the household's answer when the drive holds old data ("fresh" moves it aside, deletes nothing) + body["kept_data"] = os.environ["KEPT"] + code, d = ctl("POST", f"/api/stacks/{name}/deploy", body) + say(f" [1] deploy -> {code} {str(d)[:120]}") + if code != "202": + return False + # WAIT FOR `deployed`, NOT FOR `running`. Measured 2026-09-21 on tandoor: docker reported the + # container `healthy` while the controller's own state read `unhealthy` — a gate on `running` + # alone therefore times out on an app that is up. The state is RECORDED rather than required; + # the real gate is the fixture's own `wait_app`, which asks whether the APP answers. + seen = None + for _ in range(90): + time.sleep(5) + st = stack(name) + seen = st.get("state") + # `deployed` alone is NOT enough and `state` alone is NOT right. Measured 2026-09-21: + # tandoor reads `unhealthy` while serving (R-618), so gating on "running" hangs; and romm + # read `deployed=True, state=degraded, pinned_images=None` twenty seconds in, i.e. the + # deploy had not finished writing app.yaml. The PIN is the deploy's own completion mark + # (`runComposeDeploy` writes it), so that is what to wait for. + pins = (st.get("app_config") or {}).get("pinned_images") + if st.get("deployed") and pins and seen in ("running", "unhealthy", "degraded"): + say(f" [1] deployed, controller state={seen}, " + f"pinned={(st.get('app_config') or {}).get('pinned_images')}") + if seen != "running": + say(f" [1] NOTE: the controller's own state is {seen!r}, not 'running' — recorded, " + f"not treated as a failure; the fixture's front-door wait is the real gate") + return True + say(f" [1] never became deployed (last controller state={seen!r})") + return False + + +def backup_now(name): + """R-648 (2026-09-23): NO whole-box „Mentés most" from a drill, ever. + + `POST /api/backup/run` is the only backup endpoint and it is WHOLE-BOX: on 9201 it stopped and + restarted 9 of 10 standing apps twice, and on 9202 it broke a deploy in flight (R-634). The product + has NO per-app backup endpoint (router.go: /backup/run, /backup/tier2 only); the per-app backup + exists only inside the guarded update, whose `backing-up` phase calls RunAppBackupNow for the one + app. So this presses nothing: the update takes the throwaway app's own backup, and says so in its + phase list. A seed written "after the backup" is therefore written before the update's own backup + — the undo's last-second copy is still the one that must bring it back.""" + say(f" [4] backup press SKIPPED for {name} (R-648: whole-box only; the update's backing-up phase backs up {name} alone)") + return None + +def drill_bump(app, frm, to, service_hint=None): + """Serialised across concurrent walks: one git working tree, one lock.""" + import fcntl + with open(f"{SC}/drill.lock", "w") as lk: + fcntl.flock(lk, fcntl.LOCK_EX) + sh(["git", "-C", DRILL, "pull", "-q", "--rebase", "origin", "main"], timeout=120) + return _drill_bump(app, frm, to, service_hint) + + +def _drill_bump(app, frm, to, service_hint=None): + """Commit the edge to the DRILL repo. catalog_since set by hand (the drill repo has no gates). + + `frm`/`to` may be comma-separated lists of the SAME length: an app whose own version lives in + two images (adventurelog's backend and frontend) moves both in one edge, while its engine + sidecar stays where it is — `09` §3b Q3's rule is per SERVICE, and an app-half edge must move + every service that carries the app's own version and no others. + """ + comp = f"{DRILL}/templates/{app}/docker-compose.yml" + fy = f"{DRILL}/templates/{app}/.felhom.yml" + s = open(comp).read() + froms = [x.strip() for x in frm.split(",") if x.strip()] + tos = [x.strip() for x in to.split(",") if x.strip()] + if len(froms) != len(tos): + say(f" [5] from/to lists differ in length: {froms} vs {tos}") + return None + for f1, t1 in zip(froms, tos): + if f"image: {f1}" not in s: + say(f" [5] FROM ref not found in compose: {f1}") + return None + s = s.replace(f"image: {f1}", f"image: {t1}") + open(comp, "w").write(s) + f = open(fy).read() + today = datetime.now().strftime("%Y-%m-%d") + f = re.sub(r'^catalog_since:.*$', f'catalog_since: "{today}"', f, count=1, flags=re.M) + open(fy, "w").write(f) + sh(["git", "-C", DRILL, "add", "-A"]) + sh(["git", "-C", DRILL, "commit", "-q", "-m", f"DRILL {app}: {frm} -> {to}"]) + r = sh(["git", "-C", DRILL, "push", "-q", "origin", "main"], timeout=120) + h = sh(["git", "-C", DRILL, "rev-parse", "--short=12", "HEAD"]).stdout.strip() + say(f" [5] drill commit {h}: {app} {frm} -> {to} (push rc={r.returncode})") + return h + + +def sync_rescan(expect_app=None, expect_ref=None, tries=12, delay=5): + """Sync, rescan, and — when told what to expect — WAIT FOR THE BADGE TO CATCH UP. + + R-607: `POST /api/sync` answers "nincs valtozas" while the catalog HAS moved, and + `catalog_images` stays stale until a separate rescan. Tonight showed the rescan alone is not + enough either: mealie's badge read "Naprakesz" seconds after its bump was pushed, and the + Update that followed moved nothing and still reported "Frissitve". So when the caller knows + which reference should appear, this polls for it and SAYS HOW LONG IT TOOK — which is the + NUMBER R-607 asks for and has never had. + """ + t0 = time.time() + ctl("POST", "/api/sync") + time.sleep(2) + ctl("POST", "/api/stacks/rescan") + time.sleep(2) + if not expect_app or not expect_ref: + return None + for i in range(tries): + cat = stack(expect_app).get("catalog_images") or {} + if expect_ref in cat.values(): + waited = round(time.time() - t0, 1) + if i: + say(f" [sync] the badge needed {waited}s and {i+1} sync+rescan rounds to catch up " + f"to {expect_ref} — R-607's window, measured") + return waited + time.sleep(delay) + ctl("POST", "/api/sync") + time.sleep(1) + ctl("POST", "/api/stacks/rescan") + say(f" [sync] the badge NEVER caught up to {expect_ref} in {round(time.time()-t0,1)}s — " + f"catalog_images = {stack(expect_app).get('catalog_images')}") + return None + + +def badges(name): + out = {} + for lang, suffix in (("hu", ""), ("en", "?lang=en")): + h = page(f"/apps/{name}{suffix}") + m = re.findall(r']*title="([^"]*)"[^>]*>([^<]*)<', h) + out[lang] = [{"title": a.strip(), "text": b.strip()} for a, b in m][:3] + return out + + +def press_update(name, poll=1.0, cap_s=1800): + code, d = ctl("POST", f"/api/stacks/{name}/update") + say(f" [6] Update -> {code} {str(d)[:220]}") + if code not in ("202", "200"): + return {"accepted": False, "http": code, "refusal": d, "phases": [], "duration_s": 0} + phases, seen, t0 = [], None, time.time() + while time.time() - t0 < cap_s: + st = stack(name) + ph = st.get("update_phase") + if ph != seen: + seen = ph + rec = {"t": round(time.time() - t0, 1), "phase": ph, + "label": st.get("update_phase_label"), "updating": st.get("updating"), + "error": st.get("update_error"), "hold": st.get("hold_reason")} + phases.append(rec) + say(f" +{rec['t']:>6.1f}s phase={ph} label={rec['label']} " + f"err={rec['error']} hold={rec['hold']}") + if not st.get("updating") and ph in ("done", "failed", "undone", None) and time.time() - t0 > 3: + break + time.sleep(poll) + st = stack(name) + return {"accepted": True, "http": code, "phases": phases, + "duration_s": round(time.time() - t0, 1), + "final_phase": st.get("update_phase"), "update_error": st.get("update_error"), + "hold_reason": st.get("hold_reason"), "state": st.get("state")} + + +def observables(name): + st = stack(name) + ac = st.get("app_config") or {} + live = guest(f""" +grep -E '^\\s+image:' /opt/docker/stacks/{name}/docker-compose.yml 2>/dev/null | sed 's/^ *//' +echo '---inspect---' +for c in $(docker ps -a --filter label=com.docker.compose.project={name} --format '{{{{.Names}}}}'); do + echo -n "$c "; docker inspect "$c" --format '{{{{.Config.Image}}}} running={{{{.State.Running}}}} restarts={{{{.RestartCount}}}}' +done +""") + a, _, b = live.partition("---inspect---") + return { + "pinned_images": ac.get("pinned_images"), + "installed_images": {k: (v.get("ref") if isinstance(v, dict) else v) + for k, v in (ac.get("installed_images") or {}).items()}, + "catalog_images": st.get("catalog_images"), + "live_compose_image_lines": [x for x in a.strip().splitlines() if x.strip()], + "docker_inspect": [x for x in b.strip().splitlines() if x.strip()], + } + + +def app_logs(name, lines=400): + """The app's own container log, DECODED. The endpoint answers a JSON envelope whose `logs` is + one string with escaped newlines — a scan over the envelope sees a single enormous line and + finds nothing, which reads exactly like "the app printed no migration line" and is not. R-96 + rule 3 in a new place: an absent line is not evidence when the instrument cannot see lines.""" + code, d = ctl("GET", f"/api/stacks/{name}/logs?lines={lines}") + if isinstance(d, dict): + data = d.get("data") + if isinstance(data, dict) and isinstance(data.get("logs"), str): + return data["logs"] + if isinstance(d.get("_raw"), str): + return d["_raw"] + return str(d) + + +def write_verdict(rec, appdir): + os.makedirs(appdir, exist_ok=True) + p = os.path.join(appdir, "verdict.json") + json.dump(rec, open(p, "w"), indent=2, ensure_ascii=False) + say(f" [9] verdict {rec['verdict']} -> {p}") + + +def remove(name): + """Remove through the PRODUCT, never `docker rm` (live-probes rule). The remove endpoint + refuses a running stack — `409 still running` — so the stop is part of the act, not a tidy-up.""" + c1, d1 = ctl("POST", f"/api/stacks/{name}/stop") + say(f" [X] stop -> {c1} {str(d1)[:100]}") + for _ in range(24): + time.sleep(5) + if stack(name).get("state") != "running": + break + code, d = ctl("POST", f"/api/stacks/{name}/remove", + {"remove_hdd_data": True, "remove_backups": True}) + say(f" [X] remove (with drive data) -> {code} {str(d)[:160]}") + if code == "409": + # R-442's fail-closed guard: when the storage subsystem cannot RESOLVE the app's drive + # path, the removal is REFUSED and the app is kept rather than half-deleted. On guest 9202 + # `/api/disks` answers `agent not configured`, so every app deployed with an HDD_PATH hits + # this. The household's other choice — remove the app, KEEP the data — is accepted, and the + # harness takes it, then tidies its own directory by name at teardown. + say(" [X] refused because the drive path cannot be resolved (R-442, fail-closed and right)" + " — removing the app and KEEPING the drive data instead") + code, d = ctl("POST", f"/api/stacks/{name}/remove", + {"remove_hdd_data": False, "remove_backups": True}) + say(f" [X] remove (keeping drive data) -> {code} {str(d)[:160]}") + time.sleep(5) + st = stack(name) + left = guest(f"ls -d /opt/docker/stacks/{name} 2>/dev/null; " + f"docker ps -a --filter label=com.docker.compose.project={name} --format '{{{{.Names}}}}'") + say(f" [X] after remove: deployed={st.get('deployed')} leftovers={left.strip()!r}") + return code + + +def app_env(name, key): + """Read one deploy value the CUSTOMER was given (e.g. the generated admin password) from the + app's own `app.yaml`. This is not seeding — it is how the household logs in; the controller + shows them the same value. Data still goes in through the app's own front door.""" + out = guest(f"grep -E '^\\s*{key}:' /opt/docker/stacks/{name}/app.yaml 2>/dev/null | head -1") + if ":" in out: + return out.split(":", 1)[1].strip().strip('"').strip("'") + return "" + + +def snapshots(name): + """The restorable copies the backups page offers for this app.""" + code, d = ctl("GET", f"/api/backup/snapshots?stack={name}") + data = d.get("data") if isinstance(d, dict) else None + if isinstance(data, dict): + for k in ("snapshots", "items", "restore_points"): + if isinstance(data.get(k), list): + return data[k] + return data if isinstance(data, list) else [] + + +def restore(name, snapshot_id=None, wait_s=1200): + """The household's own way out: the „Visszaállítás a mentésből" button on the backups page. + + A FORM post, not an API call — `POST /backup/restore` with `_csrf`, `stack_name`, + `snapshot_id` — because that is the button the sentence tells them to press. + """ + snaps = snapshots(name) + if snapshot_id is None: + if not snaps: + say(f" [R] no restorable copy offered for {name}") + return {"ok": False, "why": "no snapshot offered", "snapshots": snaps} + first = snaps[0] + snapshot_id = first.get("id") or first.get("snapshot_id") or first.get("short_id") + say(f" [R] restoring {name} from snapshot {snapshot_id!r} (of {len(snaps)} offered)") + sess = open(f"{SC}/sess{os.getpid()}.txt").read().strip() + csrf = open(f"{SC}/csrf{os.getpid()}.txt").read().strip() + r = sh(["curl", "-sk", "-D", "-", "-o", "/dev/null", "-H", HOSTHDR, "-H", f"Cookie: {sess}", + "-X", "POST", + "--data-urlencode", f"_csrf={csrf}", + "--data-urlencode", f"stack_name={name}", + "--data-urlencode", f"snapshot_id={snapshot_id}", + f"{BASE}/backup/restore"], timeout=180) + head = (r.stdout or "").split("\n")[0].strip() + loc = [l for l in (r.stdout or "").split("\n") if l.lower().startswith("location:")] + say(f" [R] POST /backup/restore -> {head} {loc[:1]}") + t0 = time.time() + last = None + while time.time() - t0 < wait_s: + code, d = ctl("GET", "/api/backup/restore-status") + dd = d.get("data") or {} + cur = (dd.get("running"), dd.get("phase") or dd.get("state"), dd.get("message")) + if cur != last: + say(f" +{round(time.time()-t0,1):>6.1f}s restore {cur}") + last = cur + if not dd.get("running", False) and time.time() - t0 > 5: + break + time.sleep(2) + st = stack(name) + say(f" [R] after restore: state={st.get('state')} hold={st.get('hold_reason')!r} " + f"phase={st.get('update_phase')}") + return {"ok": True, "snapshot_id": snapshot_id, "snapshots": snaps, + "http": head, "location": loc[:1], "seconds": round(time.time() - t0, 1), + "state_after": st.get("state"), "hold_after": st.get("hold_reason"), + "observables_after": observables(name)} diff --git a/scripts/check-test-record-move.py b/scripts/check-test-record-move.py index 04d5e4d..a77e20b 100644 --- a/scripts/check-test-record-move.py +++ b/scripts/check-test-record-move.py @@ -42,6 +42,7 @@ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) import ladder # noqa: E402 TEMPLATE_RE = re.compile(r"^templates/([^/]+)/docker-compose\.ya?ml$") +FELHOM_RE = re.compile(r"^templates/([^/]+)/\.felhom\.ya?ml$") ZERO_SHA_RE = re.compile(r"^0{40}$") MEM_RE = re.compile(r"^\s+(memory|mem_limit):", re.M) @@ -140,6 +141,45 @@ def judge_app(app, a, b, resolver, network=True): return problems, inconclusive +def judge_retests(app, a, b, resolver, network=True): + """(problems, inconclusive) for the RE-TEST entries (`from` == `to`, decision 52) this range adds to one + template. A re-test moves no image line, so judge_app never looks at it; it changes `.felhom.yml` only. Each new + re-test must be well-formed, proven, not backfilled, the ladder's NEWEST entry naming the compose's refs, and its + digest must be what the registry serves for those refs NOW (the image a box would pull).""" + cpath, fpath = "templates/%s/docker-compose.yml" % app, "templates/%s/.felhom.yml" % app + after_c = show(b, cpath) + if after_c is None: + return [], [] + after = ladder.images_in(after_c) + _e, raws_a, _ = ladder.parse(show(a, fpath) or "") + ents_b, raws_b, errs_b = ladder.parse(show(b, fpath) or "") + old = set(raws_a) + new = [(i, e) for i, (e, raw) in enumerate(zip(ents_b, raws_b)) if raw not in old and e.get("from") == e.get("to")] + problems, inconclusive = [], [] + for i, e in new: + for q in ladder.check_entry(e): + problems.append("new re-test: " + q) + if e.get("backfilled") is not None or e.get("verdict") != "proven": + problems.append("new re-test is not a proven new test (verdict %r, backfilled %r)" % (e.get("verdict"), e.get("backfilled"))) + if i != len(ents_b) - 1 or e.get("to") != after: + problems.append("new re-test is not the ladder's newest entry naming the compose's refs %s" % after) + if problems or not new: + return problems, inconclusive + if not network: + print(" %s: re-test digest comparison SKIPPED (--no-network) — not a pass for a real push" % app) + return problems, inconclusive + e = new[-1][1] + for svc, ref in sorted(after.items()): + want = (e.get("digest") or {}).get(svc) + got, why = resolver(ref) + if got is None: + inconclusive.append("%s %s: the registry could not be asked (%s)" % (svc, ref, why)) + elif got != want: + problems.append("re-test %s %s: the registry serves %s, the re-test says %s — the re-tested image is " + "not the image a box would pull" % (svc, ref, got, want)) + return problems, inconclusive + + def main(argv, resolver=None): spec = "origin/main..HEAD" network = "--no-network" not in argv @@ -177,6 +217,13 @@ def main(argv, resolver=None): convicted[app] = p if inc: undecided[app] = inc + # decision 52: re-tests change .felhom.yml only — judged separately, for every template whose .felhom.yml changed + for app in sorted({FELHOM_RE.match(n).group(1) for n in names.split("\n") if FELHOM_RE.match(n)}): + p, inc = judge_retests(app, a, b, resolver, network) + if p: + convicted.setdefault(app, []).extend(p) + if inc: + undecided.setdefault(app, []).extend(inc) print("test-record-move gate — range %s..%s: %d compose file(s) changed" % (a, b, len(apps))) for app, ps in convicted.items(): for p in ps: diff --git a/scripts/check-test-record.py b/scripts/check-test-record.py index 76a6835..55955e6 100644 --- a/scripts/check-test-record.py +++ b/scripts/check-test-record.py @@ -16,6 +16,8 @@ WHAT IT CHECKS, per template that carries `update_ladder:` (format and field rul (verdict proven|unrecorded only; a sha256 digest per `to` service; the memory watch's peak on any entry not backfilled; marks.memory_tight agrees with the peak); 2. the ladder is CONTINUOUS — each entry's `from` is the previous entry's `to`; + 2b. a RE-TEST (`from` == `to`, `09` §3 decision 52) starts FROM the previous entry's digest + (`digest_from`), and is never the first entry; 3. the NEWEST entry's `to` is EXACTLY the compose's current image per service. This is the fact that makes the rule hold without history: a compose moved without a new entry no longer matches its ladder's head, whoever pushed it and however. @@ -55,6 +57,20 @@ def check_app(app_dir): for i in range(1, len(entries)): if entries[i].get("from") != entries[i - 1].get("to"): problems.append("entry %d's `from` is not entry %d's `to` — the ladder has a gap" % (i + 1, i)) + # rule 2b (decision 52): a RE-TEST (from == to) was tested FROM the previous entry's digest — never from some + # other build of the tag — and is never the first entry (there is nothing to re-test). + for i, e in enumerate(entries): + if e.get("from") != e.get("to") or not isinstance(e.get("digest_from"), dict): + continue + if i == 0: + problems.append("entry 1 is a re-test (from == to) — a re-test needs an earlier entry to re-test") + continue + prev = entries[i - 1].get("digest") or {} + bad = sorted(s for s, d in e["digest_from"].items() if prev.get(s) != d) + if bad: + problems.append("entry %d is a re-test FROM %s, but entry %d tested %s — a re-test starts from the " + "previous entry's digest" % (i + 1, {s: e["digest_from"][s][:19] for s in bad}, i, + {s: str(prev.get(s))[:19] for s in bad})) for i, e in enumerate(entries[:-1]): to = e.get("to") if not isinstance(to, dict) or not to: diff --git a/scripts/ladder.py b/scripts/ladder.py index 454c175..fe9fb5f 100644 --- a/scripts/ladder.py +++ b/scripts/ladder.py @@ -32,6 +32,13 @@ AN ENTRY (all keys required unless marked): `upgrade-test.py --write-ladder` only when the bench AND the box both converted it backfilled (optional) "YYYY-MM-DD" — written by the backfill from an EXISTING record, never by a new test; a new move may not carry it + digest_from (a RE-TEST only, `09` §3 decision 52) {service: "sha256:…"} — the digest the re-test + was run FROM. A re-test is an entry whose `from` equals its `to` (the same tags): the + catalog proved the same tag at a NEW digest (an upstream same-name fix). It needs + `digest_from` for every service, at least one service whose `digest` differs from it, + and `box_evidence` (both venues); `check-test-record.py` rule 2b ties `digest_from` to + the previous entry's `digest`. Written by `upgrade-test.py --write-ladder` from a + `--retest` verdict, never by hand. STEP DEFINITIONS (`09` §6.4 part 5, controller v0.268.0): every entry but the NEWEST carries its own complete compose file at `templates//steps/.yml` — the box climbs one step at a time @@ -138,6 +145,16 @@ def check_entry(e): for svc in e["digest"]: if svc not in e["to"]: p.append("digest names a service %r that `to` does not" % svc) + if e["from"] == e["to"] and v == "proven" and backfilled is None: # a RE-TEST (decision 52) + df = e.get("digest_from") + if not isinstance(df, dict) or set(df) != set(e["to"]) or not all(isinstance(x, str) and DIGEST_RE.match(x) for x in df.values()): + p.append("a re-test (from == to) needs digest_from: {service: sha256} for every service — the digest it was tested FROM") + elif all(df[s] == e["digest"].get(s) for s in e["to"]): + p.append("a re-test (from == to) whose digest is the same as its digest_from tests nothing new — no new digest") + if not (isinstance(e.get("box_evidence"), str) and e["box_evidence"].strip()): + p.append("a re-test (from == to) must cite BOTH venues: box_evidence is missing") + elif e.get("digest_from") is not None: + p.append("digest_from belongs only to a re-test (from == to)") conv = e.get("engine_conversion") if conv is not None: # `09` §6.4 part 10 — the box converts ONLY on this mark if not (isinstance(conv, dict) and set(conv) == {"service", "engine", "from", "to"} diff --git a/scripts/retest-floating.py b/scripts/retest-floating.py new file mode 100644 index 0000000..5a6be85 --- /dev/null +++ b/scripts/retest-floating.py @@ -0,0 +1,230 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +"""retest-floating.py — the MONTHLY re-test of same-tag security fixes (`09` §3 decision 52, R-740). ONE command. + + python3 scripts/retest-floating.py --dry-run # list only: which services' registry digest moved + python3 scripts/retest-floating.py [--only app,app] # re-test them: bench, box, writer — one commit per app + python3 scripts/retest-floating.py --push # ... and push each commit (the pre-push gates run) + python3 scripts/retest-floating.py --engines-only ... # database/redis lines only (decision 52's start) + +WHAT IT DOES. For every template whose ladder's NEWEST entry is its compose, it asks the registry for each service's +digest NOW and compares it with the digest that entry TESTED. A service whose digest moved is a same-name upstream +fix (typically a database or redis line). Candidates are ordered database/redis first. For each app, in order: + 1. BENCH — `upgrade-test.py --soak 600 --retest ` on the bench LXC (the full method: FROM at the tested + digest, seed, read back, TO at the new digest, read back, the 10-minute memory watch, the abort), evidence + copied off the bench before the next app; + 2. BOX — scratch guest 9202 on the DRILL catalog: a fresh install renders the OLD tested digest (the live ladder + says so), the fixture seeds; a drill-only commit adds the re-test entry; the product's guarded Update runs the + step; the seed reads back; the running digest is checked; + 3. WRITER — `upgrade-test.py --write-ladder` from both verdicts into THIS checkout (a re-test entry: `from` == + `to`, `digest_from`, `box_evidence`), `catalog_gates.py --fast `, one commit (and `--push`). +A failure stops THAT app (its reason in the summary) and never the list. Nothing is written without both venues. + +WHAT IT NEEDS (checked first; a missing one stops the run and says which): the bench LXC 9401 on demo-hp with +/opt/upg (runbook `felhom.eu/documentation/runbooks/monthly-floating-retest.md` §2 creates it), guest 9202 pointed +at the drill catalog (§3), SC= holding `.ctlpw` (9202's dashboard password — never committed), ssh to +demo-hp, and a push credential for the drill repo. It is therefore NOT a cron job: it is run by a person or a CC +session once a month, from DooPlex (the runbook says why). + +Exit: 0 every candidate done (or none) · 1 at least one app stopped · 2 could not start (a prerequisite). +""" +import argparse +import base64 +import datetime +import io +import json +import os +import re +import subprocess +import sys +import tarfile +import time + +HERE = os.path.dirname(os.path.abspath(__file__)) +CAT = os.path.dirname(HERE) +sys.path.insert(0, HERE) +import ladder # noqa: E402 +import image_digest # noqa: E402 + +ENGINE_RE = re.compile(r"(^|/)(postgres|postgis|mariadb|mysql|redis|valkey|mongo)", re.I) +DRILL = os.environ.get("DRILL", "/mnt/5_hdd/felhom.eu/drill/app-catalog-drill") +BENCH_HOST, BENCH_CT = os.environ.get("BENCH_HOST", "demo-hp"), os.environ.get("BENCH_CT", "9401") + + +def candidates(only=None): + """[(app, {svc: (ref, tested, now)}, engine_first)] — every service whose registry digest moved.""" + out = [] + for app in sorted(os.listdir(os.path.join(CAT, "templates"))): + if only and app not in only: + continue + d = os.path.join(CAT, "templates", app) + try: + entries, _, errs = ladder.parse(open(os.path.join(d, ".felhom.yml"), encoding="utf-8").read()) + comp = ladder.images_in(open(os.path.join(d, "docker-compose.yml"), encoding="utf-8").read()) + except OSError: + continue + if errs or not entries or entries[-1].get("to") != comp: + continue + tested = entries[-1].get("digest") or {} + moved = {} + for svc, ref in comp.items(): + now, why = image_digest.resolve(ref) + if not now: + moved[svc] = (ref, tested.get(svc), "UNKNOWN: " + str(why)) + elif tested.get(svc) and now != tested[svc]: + moved[svc] = (ref, tested[svc], now) + if moved: + out.append((app, moved, any(ENGINE_RE.search(r) for r, _, _ in moved.values()))) + return sorted(out, key=lambda x: (not x[2], x[0])) + + +def sh(args, timeout=3600, inp=None): + try: + return subprocess.run(args, capture_output=True, text=True, timeout=timeout, input=inp) + except (subprocess.TimeoutExpired, OSError) as e: + return subprocess.CompletedProcess(args, 124, "", str(e)) + + +def bench(script, timeout=3600): + t = "/tmp/rt-%d-%d.sh" % (os.getpid(), int(time.time() * 1000) % 100000) + return sh(["ssh", "-o", "BatchMode=yes", BENCH_HOST, + "export LC_ALL=C; cat > %s; pct push %s %s %s >/dev/null 2>&1; pct exec %s -- bash %s; rc=$?; " + "pct exec %s -- rm -f %s; rm -f %s; exit $rc" % (t, BENCH_CT, t, t, BENCH_CT, t, BENCH_CT, t, t)], + timeout=timeout, inp=script) + + +def prerequisites(): + missing = [] + r = bench("test -f /opt/upg/upgrade-test.py && echo bench-ok", timeout=120) + if "bench-ok" not in (r.stdout or ""): + missing.append("the bench LXC %s on %s with /opt/upg (runbook §2)" % (BENCH_CT, BENCH_HOST)) + if not os.path.isdir(os.path.join(DRILL, ".git")): + missing.append("the drill checkout at %s (runbook §3)" % DRILL) + if not os.path.isfile(os.path.join(os.environ.get("SC", os.path.expanduser("~/.felhom-retest")), ".ctlpw")): + missing.append("SC/.ctlpw — 9202's dashboard password (runbook §3)") + return missing + + +def sync_bench(): + """This checkout's scripts/*.py and templates/ → /opt/upg on the bench (the harness runs them as they stand).""" + tgz = io.BytesIO() + with tarfile.open(fileobj=tgz, mode="w:gz") as t: + for f in os.listdir(HERE): + if f.endswith(".py"): + t.add(os.path.join(HERE, f), arcname=f) + t.add(os.path.join(CAT, "templates"), arcname="templates") + return sh(["ssh", "-o", "BatchMode=yes", BENCH_HOST, + "cat > /tmp/rt.b64; pct push %s /tmp/rt.b64 /tmp/rt.b64; rm -f /tmp/rt.b64; pct exec %s -- bash -c " + "'mkdir -p /opt/upg && cd /opt/upg && rm -rf templates && base64 -d /tmp/rt.b64 | tar xzf - && rm -f /tmp/rt.b64 && echo synced'" + % (BENCH_CT, BENCH_CT)], timeout=600, inp=base64.b64encode(tgz.getvalue()).decode()) + + +def run_bench(app, evdir): + r = bench("cd /opt/upg && rm -rf evidence/RT-%s && timeout 3000 python3 upgrade-test.py --soak 600 --retest %s " + "> /opt/upg/RT-%s.log 2>&1; echo rc=$?" % (app, app, app), timeout=3400) + pull = bench("cd /opt/upg && tar czf - RT-%s.log evidence/RT-%s 2>/dev/null | base64 -w0" % (app, app), timeout=600) + os.makedirs(evdir, exist_ok=True) + try: + tarfile.open(fileobj=io.BytesIO(base64.b64decode(pull.stdout.strip()))).extractall(evdir) + except Exception as e: # noqa: BLE001 + return None, "the bench evidence could not be copied off (%s); bench said %s" % (e, (r.stdout or "").strip()[-80:]) + vp = os.path.join(evdir, "evidence", "RT-%s" % app, "verdict.json") + if not os.path.isfile(vp): + return None, "no bench verdict (%s)" % (r.stdout or "").strip()[-120:] + v = json.load(open(vp)) + return (vp if v.get("verdict") == "proven" else None), "bench verdict %s (%s)" % (v.get("verdict"), str(v.get("abort_detail"))[:120]) + + +def run_box(app, moved, evdir): + """The box venue: retest_box.py does it (kept apart: it holds the 9202 session).""" + r = sh([sys.executable, os.path.join(HERE, "retest_box.py"), app, evdir], timeout=3600, + inp=json.dumps({s: [v[0], v[1], v[2]] for s, v in moved.items()})) + vp = os.path.join(evdir, "box-verdict-%s.json" % app) + if not os.path.isfile(vp): + return None, "no box verdict: %s" % ((r.stdout or "") + (r.stderr or "")).strip()[-200:] + v = json.load(open(vp)) + return (vp if v.get("verdict") == "proven" else None), "box verdict %s (%s)" % (v.get("verdict"), v.get("why", "")) + + +def write(app, bench_v, box_v, ev_rel, push): + r = sh([sys.executable, os.path.join(HERE, "upgrade-test.py"), "--write-ladder", bench_v, "--box", box_v, + "--catalog", CAT, "--evidence", ev_rel + "/bench", "--box-evidence", ev_rel + "/box"], timeout=600) + if r.returncode != 0: + return False, "writer: " + (r.stdout or r.stderr).strip()[-200:] + g = sh([sys.executable, os.path.join(HERE, "catalog_gates.py"), "--fast", app], timeout=900) + if g.returncode != 0: + sh(["git", "-C", CAT, "checkout", "--", "templates/%s" % app]) + sh(["git", "-C", CAT, "clean", "-fdq", "templates/%s" % app]) + return False, "gates refused the entry — reverted: " + g.stdout.strip()[-200:] + sh(["git", "-C", CAT, "add", "templates/%s" % app]) + c = sh(["git", "-C", CAT, "commit", "-q", "-m", "%s: re-test of the same tag at a new digest (decision 52, R-740)\n\n%s\n\nEvidence: %s" + % (app, (r.stdout or "").strip(), ev_rel)]) + if c.returncode != 0: + return False, "commit failed: " + c.stderr.strip()[-160:] + if push: + p = sh(["git", "-C", CAT, "push", "-q", "origin", "main"], timeout=900) + if p.returncode != 0: + return False, "push refused (the commit stays local): " + (p.stdout + p.stderr).strip()[-200:] + return True, (r.stdout or "").strip().splitlines()[-1] + + +def main(argv): + ap = argparse.ArgumentParser() + ap.add_argument("--dry-run", action="store_true") + ap.add_argument("--only", default="") + ap.add_argument("--push", action="store_true") + ap.add_argument("--engines-only", action="store_true", + help="only database/redis lines (decision 52: start there). Measured 2026-09-30: EXACT tags are re-pushed " + "under the same name too (nextcloud 34.0.4-apache, linuxserver sonarr 4.0.20) — R-743") + ap.add_argument("--evidence", default=os.path.join(os.environ.get("SC", os.path.expanduser("~/.felhom-retest")), "evidence"), + help="evidence root; copy it into felhom.eu/documentation/audits/ for the record") + ap.add_argument("--evidence-rel", default="", help="the path the ladder entry cites (relative to the workspace root)") + a = ap.parse_args(argv) + only = set(x for x in a.only.split(",") if x) + allc = candidates(only) + cands = [c for c in allc if c[2] or not a.engines_only] + skipped = [c[0] for c in allc if c not in cands] + stamp = datetime.date.today().isoformat() + print("# retest-floating %s — catalog %s" % (stamp, sh(["git", "-C", CAT, "rev-parse", "--short", "HEAD"]).stdout.strip())) + if not cands: + print("nothing to re-test today: every ladder head's tested digest is what the registry serves" + + (" (engines only — not re-tested, not engines: %s)" % ", ".join(skipped) if skipped else "")) + return 0 + for app, moved, eng in cands: + print("%s%s:" % (app, " (engine)" if eng else "")) + for svc, (ref, old, new) in sorted(moved.items()): + print(" %s %s tested %s registry %s" % (svc, ref, (old or "-")[:19], new[:19] if not new.startswith("UNKNOWN") else new)) + if a.dry_run: + print("(dry run — nothing re-tested)") + return 0 + missing = prerequisites() + if missing: + print("CANNOT START — missing: " + "; ".join(missing)) + return 2 + s = sync_bench() + if "synced" not in (s.stdout or ""): + print("CANNOT START — the bench could not be synced: " + (s.stdout + s.stderr).strip()[-200:]) + return 2 + results = [] + for app, moved, _ in cands: + if any(v[2].startswith("UNKNOWN") for v in moved.values()): + results.append((app, False, "a registry could not be asked — not re-tested")) + continue + evdir = os.path.join(a.evidence, stamp, app) + rel = (a.evidence_rel.rstrip("/") + "/" + app) if a.evidence_rel else evdir + bv, why = run_bench(app, os.path.join(evdir, "bench")) + if not bv: + results.append((app, False, why)); continue + xv, why = run_box(app, moved, os.path.join(evdir, "box")) + if not xv: + results.append((app, False, why)); continue + ok, why = write(app, bv, xv, rel, a.push) + results.append((app, ok, why)) + print("\n# summary") + for app, ok, why in results: + print(" %-18s %s %s" % (app, "DONE " if ok else "STOPPED", why)) + return 0 if all(ok for _, ok, _ in results) else 1 + + +if __name__ == "__main__": + sys.exit(main(sys.argv[1:])) diff --git a/scripts/retest_box.py b/scripts/retest_box.py new file mode 100644 index 0000000..72588dd --- /dev/null +++ b/scripts/retest_box.py @@ -0,0 +1,158 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +"""retest_box.py (stdin: {"svc": [ref, tested_digest, new_digest], ...}) + +The BOX venue of a same-tag re-test (`09` §3 decision 52), on scratch guest 9202 pointed at the DRILL catalog. Called +by retest-floating.py; usable alone. Through the product's own endpoints only (box_walk.py): + 1. the drill checkout is pulled; its template for must be the live one (the runbook resets the drill first); + 2. is (re)installed fresh — the box renders the ladder head's TESTED (old) digest — and the running digest of + every re-tested service is read back: it must BE the old one, or the proof would start from the wrong image; + 3. the fixture seeds and reads back (C1); + 4. a DRILL-only commit appends the re-test entry (from == to, digest = new, digest_from = old); sync + rescan until + the box's catalog_digests carry the new digest; the badge is read (both languages); + 5. PRESS=update (default): the product's guarded Update; PRESS=chain: "run tonight's chain now" + (POST /api/debug/backup/night-chain) and the leg's own log line is quoted; + 6. the seed reads back, the running digest must be the NEW one, the badge is read again; + 7. /box-verdict-.json: proven only if 5 ended done, 6 read back and 6's digest is the new one. +The app is removed through the product at the end (KEEP=1 keeps it). +""" +import json +import os +import re +import subprocess +import sys +import time + +HERE = os.path.dirname(os.path.abspath(__file__)) +sys.path.insert(0, HERE) +import box_walk as w # noqa: E402 +import upgrade_fixtures_box as fixtures # noqa: E402 +import upgrade_fixtures_box28 as _f28 # noqa: E402 + +FX = dict(_f28.FIXTURES28) +FX.update(fixtures.FIXTURES) +DRILL = os.environ.get("DRILL", "/mnt/5_hdd/felhom.eu/drill/app-catalog-drill") +# RETEST_SAME_AS: the checkout the drill must equal (default: this catalog). The end-to-end proof of 2026-09-30 simulated +# the month in the drill itself and set it to the drill. +CAT = os.environ.get("RETEST_SAME_AS") or os.path.dirname(HERE) + + +def main(): + app, evdir = sys.argv[1], sys.argv[2] + moved = json.loads(sys.stdin.read() or "{}") + os.makedirs(evdir, exist_ok=True) + log = open(os.path.join(evdir, "box.txt"), "a", buffering=1) + verdict = {"app": app, "verdict": "failed", "venue": "box 9202 (drill catalog), " + os.environ.get("PRESS", "update"), + "retested": {s: {"ref": v[0], "from_digest": v[1], "to_digest": v[2]} for s, v in moved.items()}} + + def say(*a): + w.say(*a) + log.write(" ".join(str(x) for x in a) + "\n") + + def finish(why): + verdict["why"] = why + json.dump(verdict, open(os.path.join(evdir, "box-verdict-%s.json" % app), "w"), indent=2) + say("RESULT %s — %s" % (verdict["verdict"], why)) + return 0 if verdict["verdict"] == "proven" else 1 + + def running_digests(): + st = w.stack(app) + ii = (st.get("app_config") or {}).get("installed_images") or {} + return {s: (ii.get(s) or {}).get("digest") for s in moved} + + fx = FX.get(app) + if fx is None: + return finish("no box fixture for %s" % app) + sub = getattr(fx, "sub", app) + w.login() + conf = w.guest("grep -A3 '^git:' /var/lib/docker/volumes/felhom-controller-data/_data/controller.yaml") + if "app-catalog-drill" not in conf: + return finish("9202 is not on the drill catalog (runbook §3) — nothing done") + subprocess.run(["git", "-C", DRILL, "pull", "-q", "--rebase", "origin", "main"], check=True) + for f in ("docker-compose.yml", ".felhom.yml"): + if open(os.path.join(DRILL, "templates", app, f)).read() != open(os.path.join(CAT, "templates", app, f)).read(): + return finish("the drill's %s/%s differs from this checkout's — reset the drill first (runbook §3)" % (app, f)) + if w.stack(app).get("deployed"): + say("removing the existing %s first (scratch box)" % app) + w.remove(app) + w.sync_rescan() + if not w.deploy(app, sub): + return finish("the install did not complete") + before = running_digests() + say("running digests after install: %s" % before) + wrong = {s: d for s, d in before.items() if d != moved[s][1]} + if wrong: + return finish("the box did not start at the tested digest: %s" % wrong) + tok = fx.seed(w, sub, say) + if tok is None or not fx.verify(w, sub, tok, say): + return finish("C1: the fixture could not seed and read back before the re-test") + verdict["seed_read_before"] = True + # the drill-only re-test entry + fy = os.path.join(DRILL, "templates", app, ".felhom.yml") + comp = os.path.join(DRILL, "templates", app, "docker-compose.yml") + sys.path.insert(0, HERE) + import ladder + entries, _, _ = ladder.parse(open(fy).read()) + head = entries[-1] + e = dict(head) + e["from"] = dict(head["to"]) + e["digest"] = dict(head["digest"]) + e["digest_from"] = dict(head["digest"]) + for s, v in moved.items(): + e["digest"][s] = v[2] + e["digest_from"][s] = v[1] + e["tested_at"], e["evidence"], e["box_evidence"] = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()), "DRILL", "DRILL (box proof in progress)" + for k in ("engine_conversion", "backfilled"): + e.pop(k, None) + open(fy, "w").write(ladder.append_entry(open(fy).read(), e)) + subprocess.run(["git", "-C", DRILL, "commit", "-q", "-am", "DRILL %s: re-test of the same tag %s (box proof)" % (app, {s: v[2][:19] for s, v in moved.items()})], check=True) + subprocess.run(["git", "-C", DRILL, "push", "-q", "origin", "main"], check=True, capture_output=True) + say("drill:", subprocess.run(["git", "-C", DRILL, "log", "--oneline", "-1"], capture_output=True, text=True).stdout.strip()) + for i in range(24): + w.sync_rescan() + cd = w.stack(app).get("catalog_digests") or {} + if all(cd.get(s) == v[2] for s, v in moved.items()): + say("the box's catalog_digests carry the new digest after %d sync round(s)" % (i + 1)) + break + time.sleep(5) + else: + return finish("the box never read the re-test's digest from the drill catalog") + verdict["badge_before"] = w.badges(app) + say("badge before: %s" % verdict["badge_before"]) + since = w.guest("date -u +%Y-%m-%dT%H:%M:%SZ").strip() + if os.environ.get("PRESS") == "chain": + code, d = w.ctl("POST", "/api/debug/backup/night-chain") + say("night chain -> %s %s" % (code, str(d)[:200])) + leg = "" + for _ in range(240): + time.sleep(10) + leg = w.guest("docker logs --since %s felhom-controller 2>&1 | grep -E 'update-leg' | grep -v DEBUG | cut -c1-300" % since) + if re.search(r"update leg .*: done=", leg): + break + say("the leg's own lines:\n" + leg) + verdict["leg_log"] = leg.strip().splitlines() + pressed = "%s: step pressed" % app in leg + ended = re.search(r"%s: step ended (\w+)" % re.escape(app), leg) + final = ended.group(1) if ended else None + if not pressed: + return finish("the leg did not press %s" % app) + else: + res = w.press_update(app, poll=1, cap_s=1800) + final = res.get("final_phase") + time.sleep(10) + after = running_digests() + read = fx.verify(w, sub, tok, say) + verdict.update({"final_phase": final, "digests_before": before, "digests_after": after, "seed_read_after": read, + "badge_after": w.badges(app), "from": w.stack(app).get("app_config", {}).get("pinned_images"), + "to": w.stack(app).get("app_config", {}).get("pinned_images"), "measured_at": since}) + say("after: phase=%s digests=%s read_back=%s badge=%s" % (final, after, read, verdict["badge_after"])) + if final == "done" and read and all(after.get(s) == v[2] for s, v in moved.items()): + verdict["verdict"] = "proven" + code = finish("the re-test step ran on the box" if verdict["verdict"] == "proven" else "the step did not end done / did not read back / runs another digest") + if not os.environ.get("KEEP"): + w.remove(app) + return code + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/scripts/test_gate_decoys.py b/scripts/test_gate_decoys.py index 82a9695..a47b328 100644 --- a/scripts/test_gate_decoys.py +++ b/scripts/test_gate_decoys.py @@ -457,6 +457,34 @@ def test_record_cases(clone): case_tr_static("DECOY: the step's .felhom.yml exists by NAME and holds no healthcheck", clone, [(NF, two), (step_rel, step_body), (meta_rel, lambda t: "display_name: Navidrome\n")], 1, ("not a real step file",)) + # ── `09` §3 decision 52: a RE-TEST — the same tag proved at a NEW digest (from == to). ───────────── + print("-- test-record: a same-tag re-test (decision 52)") + TR_D3 = "sha256:" + "c" * 64 + frm_step_rel = "templates/navidrome/" + _l.step_file(frm) + frm_meta_rel = "templates/navidrome/" + _l.step_meta_file(frm) + same_step = lambda t: io.open(os.path.join(clone, NC), encoding="utf-8").read() + rt = lambda dig, dfrom, **kw: tr_entry(frm, frm, {"navidrome": dig}, digest_from={"navidrome": dfrom}, **kw) + good_rt = rt(TR_D2, TR_D1, box_evidence="felhom.eu/documentation/audits/x/box/") + with_steps = [(frm_step_rel, same_step), (frm_meta_rel, meta_body)] + case_tr_static("GENUINE: head + a re-test from its digest, both venues", clone, + [(NF, ladder_of(head, good_rt))] + with_steps, 0) + case_tr_static("FACT: a re-test with NO new digest", clone, + [(NF, ladder_of(head, rt(TR_D1, TR_D1, box_evidence="x")))] + with_steps, 1, ("no new digest",)) + case_tr_static("FACT: a re-test without the box venue", clone, + [(NF, ladder_of(head, rt(TR_D2, TR_D1)))] + with_steps, 1, ("BOTH venues",)) + case_tr_static("FACT: a re-test FROM a digest the previous entry never tested", clone, + [(NF, ladder_of(head, rt(TR_D2, TR_D3, box_evidence="x")))] + with_steps, 1, ("starts from the previous entry",)) + case_tr_static("DECOY: a re-test that names digest_from only in its evidence text", clone, + [(NF, ladder_of(head, tr_entry(frm, frm, {"navidrome": TR_D2}, box_evidence="x", evidence="digest_from sha256:aaaa")))] + with_steps, + 1, ("needs digest_from",)) + rt_live = lambda t: tr_append(rt(TR_D2, TR_D1, box_evidence="felhom.eu/documentation/audits/x/box/"))(t) + case_tr_move("GENUINE: a re-test whose digest the registry serves now", clone, + [(NF, rt_live)] + with_steps, 0, ("test-record-move gate",), {old: TR_D2}) + case_tr_move("FACT: a re-test whose digest the registry no longer serves", clone, + [(NF, rt_live)] + with_steps, 1, ("re-test navidrome",), {old: TR_D3}) + case_tr_move("FACT: a re-test with no new digest reaches the move gate too", clone, + [(NF, tr_append(rt(TR_D1, TR_D1, box_evidence="x")))] + with_steps, 1, ("no new digest",), {old: TR_D1}) + def main(): gate = os.path.join(ROOT, "scripts", "check-engine-major.py") if not os.path.isfile(gate): @@ -475,6 +503,14 @@ def main(): DMDB = cur_image(clone, DOCMOST, "docmost-postgres") DM_MAJ = int(DMDB.split(":")[1].split("-")[0].split(".")[0]) DM_NEXT = DMDB.replace(":%d" % DM_MAJ, ":%d" % (DM_MAJ + 1), 1) + # kimai's own image too (2026-09-30): it moved apache-2.57.0 -> 2.67.0 through its ladder, and the typed tag here + # failed every run "fixture drifted" before a single case ran (R-663's shape a third time). Read it. + KAPP = cur_image(clone, KIMAI, "kimai") + _krepo, _ktag = KAPP.rsplit(":", 1) + _kpre = _ktag[:len(_ktag) - len(_ktag.lstrip("abcdefghijklmnopqrstuvwxyz-"))] + _kmaj, _kmin = (int(x) for x in _ktag[len(_kpre):].split(".")[:2]) + KAPP_MINOR = "%s:%s%d.%d.0" % (_krepo, _kpre, _kmaj, _kmin + 1) + KAPP_MAJOR = "%s:%s%d.0.0" % (_krepo, _kpre, _kmaj + 1) if not KDB.startswith("mariadb:11."): raise SystemExit("kimai-db is %s — the cases below assume a MariaDB 11 line; fixture drifted" % KDB) @@ -491,7 +527,7 @@ def main(): # R-469 + R-450 (2026-09-21): a MariaDB major bundled with the app's own bump is the # bookstack 0b73e5e shape — two migrations behind one edge — and stays refused. case("FACT: kimai-db 11.6 -> 12.3 BUNDLED with the kimai app bump", clone, - [(KIMAI, lambda t: swap_image("kimai", "kimai/kimai2:apache-2.57.0", "kimai/kimai2:apache-2.58.0")( + [(KIMAI, lambda t: swap_image("kimai", KAPP, KAPP_MINOR)( swap_image("kimai-db", KDB, "mariadb:12.3")(t)))], expect_rc=1, must_contain=("IN THE SAME COMMIT as kimai", "OWN EDGE", "R-450")) case("FACT: kimai-db mariadb:11.6 -> mariadb:lts (major unreadable)", clone, @@ -557,7 +593,7 @@ def main(): case("DECOY: major moves only in a comment + serverVersion env", clone, [(KIMAI, comment_and_env)], expect_rc=0, must_contain=("engine-major gate OK",)) case("DECOY: the APP image crosses a major (kimai 2.57 -> 3.0)", clone, - [(KIMAI, swap_image("kimai", "kimai/kimai2:apache-2.57.0", "kimai/kimai2:apache-3.0.0"))], + [(KIMAI, swap_image("kimai", KAPP, KAPP_MAJOR))], expect_rc=0, must_contain=("engine-major gate OK",)) case("DECOY: 'mariadb:12.3' lands in README.md, not a template", clone, [("README.md", lambda t: t + "\nDecoy: mariadb:11.6 -> mariadb:12.3 pending.\n")], @@ -570,24 +606,28 @@ def main(): CS = "check-catalog-since.py" def set_since(date): def _fn(text): - new = re.sub(r'^catalog_since:\s*"?\d{4}-\d{2}-\d{2}"?', 'catalog_since: "%s"' % date, text, count=1, flags=re.M) - if new == text: + new, n = re.subn(r'^catalog_since:\s*"?\d{4}-\d{2}-\d{2}"?', 'catalog_since: "%s"' % date, text, count=1, flags=re.M) + if n == 0: # the FIELD is missing (2026-09-30: "unchanged" is not drift — kimai's date was today) raise SystemExit("kimai's .felhom.yml carries no catalog_since — fixture drifted") return new return _fn + # The cases below need kimai's catalog_since to be a PAST date at HEAD (2026-09-30: kimai moved that day, so + # "untouched" and "set to today" were the same text). The throwaway clone gets one fixture commit. + edit(clone, KIMAI_FY, lambda t: re.sub(r'^catalog_since:.*$', 'catalog_since: "2026-01-01"', t, count=1, flags=re.M)) + commit(clone, "fixture: kimai catalog_since in the past") case("FACT: kimai image moves, catalog_since untouched", clone, - [(KIMAI, swap_image("kimai", "kimai/kimai2:apache-2.57.0", "kimai/kimai2:apache-2.58.0"))], + [(KIMAI, swap_image("kimai", KAPP, KAPP_MINOR))], expect_rc=1, must_contain=("CATALOG-SINCE GATE FAILED", "kimai", "catalog_since is still"), gate=CS) case("FACT: kimai image moves, catalog_since set to a FUTURE year", clone, - [(KIMAI, swap_image("kimai", "kimai/kimai2:apache-2.57.0", "kimai/kimai2:apache-2.58.0")), + [(KIMAI, swap_image("kimai", KAPP, KAPP_MINOR)), (KIMAI_FY, set_since("2036-09-13"))], expect_rc=1, must_contain=("in the future",), gate=CS) case("GENUINE: kimai image moves AND catalog_since = today", clone, - [(KIMAI, swap_image("kimai", "kimai/kimai2:apache-2.57.0", "kimai/kimai2:apache-2.58.0")), + [(KIMAI, swap_image("kimai", KAPP, KAPP_MINOR)), (KIMAI_FY, set_since(today))], expect_rc=0, must_contain=("catalog-since gate OK", "1 image move(s) dated"), gate=CS) case("DECOY: image moves; today's date lands in a COMMENT and README, the field stays", clone, - [(KIMAI, lambda t: swap_image("kimai", "kimai/kimai2:apache-2.57.0", "kimai/kimai2:apache-2.58.0")(t).replace("services:", "# catalog_since: %s\nservices:" % today, 1)), + [(KIMAI, lambda t: swap_image("kimai", KAPP, KAPP_MINOR)(t).replace("services:", "# catalog_since: %s\nservices:" % today, 1)), ("README.md", lambda t: t + "\ncatalog_since: %s (kimai)\n" % today)], expect_rc=1, must_contain=("CATALOG-SINCE GATE FAILED",), gate=CS) case("DECOY: only a comment + env line change, images untouched, date untouched", clone, diff --git a/scripts/test_ladder_writer.py b/scripts/test_ladder_writer.py index 2e89fbf..32627f1 100644 --- a/scripts/test_ladder_writer.py +++ b/scripts/test_ladder_writer.py @@ -184,5 +184,48 @@ class WriterTest(unittest.TestCase): self.assertEqual(open(sp).read(), before, "a refused restep must not write") + # --- a RE-TEST (decision 52): the same tag at a new digest ------------------------------------------------- + def run_retest(self, new_digest, registry, box_evidence="ev/box/"): + if "update_ladder:" not in open(self.fy).read(): + rc, out = self.run_writer(bench()); self.assertEqual(rc, 0, out) # the head: LIVE -> NEXT at digest D + ref = "deluan/navidrome:" + NEXT + b = bench(frm=NEXT, to=NEXT) + b["from"] = {"navidrome": ref + "@" + D} + b["to"] = {"navidrome": ref + "@" + new_digest} + image_digest.resolve = lambda r: (registry, None) + bp, xp = os.path.join(self.tmp, "rb.json"), os.path.join(self.tmp, "rx.json") + json.dump(b, open(bp, "w")); json.dump({"verdict": "proven", "to": {"navidrome": ref}}, open(xp, "w")) + args = [bp, "--box", xp, "--catalog", self.tmp, "--evidence", "ev/bench/"] + if box_evidence: + args += ["--box-evidence", box_evidence] + buf = io.StringIO() + with redirect_stdout(buf): + rc = ut.write_ladder(args) + return rc, buf.getvalue() + + def test_retest_writes_a_same_tag_entry_the_gate_accepts(self): + """COMPANION RED-PROOF: drop the `retest` digest_from block in write_ladder → the gate refuses 'needs digest_from'.""" + E = "sha256:" + "e" * 64 + rc, out = self.run_retest(E, E) + self.assertEqual(rc, 0, out) + entries, _, errs = ladder.parse(open(self.fy).read()) + self.assertEqual(errs, []) + e = entries[-1] + self.assertEqual(e["from"], e["to"]) + self.assertEqual(e["digest"], {"navidrome": E}) + self.assertEqual(e["digest_from"], {"navidrome": D}) + import subprocess + r = subprocess.run([sys.executable, os.path.join(HERE, "check-test-record.py"), "--root", self.tmp, "navidrome"], + capture_output=True, text=True) + self.assertEqual(r.returncode, 0, r.stdout) + + def test_retest_refuses_without_the_box_and_on_a_moved_digest(self): + E, F = "sha256:" + "e" * 64, "sha256:" + "f" * 64 + rc, out = self.run_retest(E, E, box_evidence=None) + self.assertEqual(rc, 1); self.assertIn("box venue", out) + rc, out = self.run_retest(E, F) # the registry moved again after the bench tested E + self.assertEqual(rc, 1); self.assertIn("re-run", out) + + if __name__ == "__main__": unittest.main(verbosity=2) diff --git a/scripts/upgrade-test.py b/scripts/upgrade-test.py index 5e83eba..b930e99 100755 --- a/scripts/upgrade-test.py +++ b/scripts/upgrade-test.py @@ -41,6 +41,8 @@ Usage: python3 upgrade-test.py [--soak SECONDS] [ …] (se --catalog --evidence [--box-evidence ] (the ONLY ladder writer) python3 upgrade-test.py --restep --definition --catalog --evidence (rewrites ONE superseded step's own definition from a bench re-proof of it) + python3 upgrade-test.py [--soak SECONDS] --retest [ ...] (the same tags at the registry's new + digest — `09` §3 decision 52; the writer then records a re-test entry) python3 upgrade-test.py --list --soak: how long the memory watch runs after a successful readback (default 600; 0 = off) Layout: templates under /opt/upg/templates, evidence under /opt/upg/evidence @@ -153,6 +155,29 @@ LOAD_PATHS = { "/api/stats", "/api/users/me", "/api/config", "/"], } LOAD_CONCURRENCY = 4 + +# BENCH-ONLY environment overrides (R-739, 2026-09-30): what the bench must change so an app can run at all without a +# public name and TLS. wanderer's web server calls its database at the PUBLIC `https://.` (the +# only address it reads — measured in the v0.20.0 and v0.21.0 images), which the bench has no name or certificate for; +# on a box traefik answers it. The bench points it at the database's own container instead. Every verdict that used an +# override carries it (`bench_overrides`), so the difference from a box is on the record, never silent. +BENCH_ENV_OVERRIDES = { + "wanderer": {"wanderer": {"PUBLIC_POCKETBASE_URL": "http://wanderer-db:8090"}}, +} + + +def apply_bench_overrides(app: str, compose_text: str) -> str: + over = BENCH_ENV_OVERRIDES.get(app) or {} + out, cur = [], None + for line in compose_text.splitlines(): + m = re.match(r"^ ([A-Za-z0-9_-]+):\s*$", line) + if m: + cur = m.group(1) + me = re.match(r"^(\s+-\s*)([A-Z0-9_]+)=(.*)$", line) + if me and cur in over and me.group(2) in over[cur]: + line = "%s%s=%s" % (me.group(1), me.group(2), over[cur][me.group(2)]) + out.append(line) + return "\n".join(out) + ("\n" if compose_text.endswith("\n") else "") MEMORY_TIGHT = 0.80 @@ -178,7 +203,7 @@ def render(app: str, images: dict, workdir: Path, env: dict, template: str = Non line = mi.group(1) + images[cur] out.append(line) workdir.mkdir(parents=True, exist_ok=True) - (workdir / "docker-compose.yml").write_text(pg_mounts_for("\n".join(out) + "\n")) + (workdir / "docker-compose.yml").write_text(apply_bench_overrides(app, pg_mounts_for("\n".join(out) + "\n"))) (workdir / ".env").write_text("".join(f"{k}={v}\n" for k, v in env.items())) return workdir / "docker-compose.yml" @@ -791,6 +816,7 @@ def run_edge(edge_id: str) -> dict: # memory is a MEASUREMENT beside the verdict; a kill or a restart during it DOES decide # the verdict, a tight peak only marks it (R-635, 2026-09-23). "memory": None, "marks": [], + "bench_overrides": BENCH_ENV_OVERRIDES.get(app) or None, "duration_s": 0, "measured_at": None, "evidence": f"evidence/{edge_id}"} t0 = time.time() log = [] @@ -979,6 +1005,51 @@ def add_move_edge(app: str, moves: list) -> str: return eid +def plain_refs(m: dict) -> dict: + """{svc: ref} with any `@sha256:…` dropped — the ladder's `from`/`to` name TAGS; digests ride in `digest`.""" + return {k: v.split("@", 1)[0] for k, v in (m or {}).items()} + + +def ref_digest(ref: str): + return ref.split("@", 1)[1] if "@" in ref else None + + +def add_retest_edge(app: str, services: list) -> str: + """`--retest [svc …]` (`09` §3 decision 52) → an edge FROM the template's refs at the digest the ladder's + newest entry TESTED, TO the same refs at the digest the registry serves NOW — the same-tag upstream fix. With no + services named, every service whose registry digest differs is re-tested; none differing is "nothing to re-test". + The method is the full one (seed, read-back, memory watch, abort) — no shortcut because only a digest changed.""" + sys.path.insert(0, str(Path(__file__).resolve().parent)) + import ladder, image_digest + frm = template_images(app, TEMPLATES) + entries, _, errs = ladder.parse((TEMPLATES / app / ".felhom.yml").read_text()) + if errs or not entries or entries[-1].get("to") != frm: + raise SystemExit(f"--retest {app}: the template has no ladder whose newest entry is its compose ({errs or 'no entry'})") + tested = entries[-1].get("digest") or {} + now = {} + for svc, ref in frm.items(): + d, why = image_digest.resolve(ref) + if not d: + raise SystemExit(f"--retest {app}: {svc} {ref}: the registry could not be asked ({why}) — nothing decided") + now[svc] = d + pick = services or [s for s in frm if now[s] != tested.get(s)] + for s in pick: + if s not in frm: + raise SystemExit(f"--retest {app}: no service {s!r} (one of {sorted(frm)})") + pick = [s for s in pick if now[s] != tested.get(s)] + if not pick: + raise SystemExit(f"--retest {app}: nothing to re-test — every service's registry digest equals the tested one") + f = dict(frm) + t = dict(frm) + for s in pick: + f[s] = f"{frm[s]}@{tested[s]}" + t[s] = f"{frm[s]}@{now[s]}" + eid = f"RT-{app}" + EDGES[eid] = dict(app=app, note="re-test of the same tag at a new digest (decision 52): " + ", ".join( + f"{s} {tested.get(s, '?')[:19]} -> {now[s][:19]}" for s in pick), frm=f, to=t) + return eid + + def write_ladder(argv) -> int: """`--write-ladder --box --catalog --evidence [--box-evidence ]` — THE ONLY WRITER of a ladder entry (`09` §6.4 part 4; never by hand). @@ -1007,19 +1078,28 @@ def write_ladder(argv) -> int: comp_p, fy_p = tdir / "docker-compose.yml", tdir / ".felhom.yml" comp = comp_p.read_text() cur = ladder.images_in(comp) - if cur != bench["from"]: - print(f"REFUSED {app}: the template is at {cur}, the bench tested FROM {bench['from']}") + bfrom, bto = plain_refs(bench["from"]), plain_refs(bench["to"]) + retest = bfrom == bto # `09` §3 decision 52: the same tags, tested at a new digest + if cur != bfrom: + print(f"REFUSED {app}: the template is at {cur}, the bench tested FROM {bfrom}") return 1 - if box.get("to") and {k: v for k, v in box["to"].items() if k in bench["to"]} != \ - {k: v for k, v in bench["to"].items() if k in box["to"]}: - print(f"REFUSED {app}: the box walked TO {box.get('to')}, the bench tested TO {bench['to']}") + btox = plain_refs(box.get("to") or {}) + if btox and {k: v for k, v in btox.items() if k in bto} != {k: v for k, v in bto.items() if k in btox}: + print(f"REFUSED {app}: the box walked TO {box.get('to')}, the bench tested TO {bto}") + return 1 + if retest and not arg("--box-evidence"): + print(f"REFUSED {app}: a re-test must cite the box venue (--box-evidence)") return 1 digests = {} - for svc, ref in sorted(bench["to"].items()): + for svc, ref in sorted(bto.items()): d, why = image_digest.resolve(ref) if not d: print(f"INCONCLUSIVE {app}: {svc} {ref}: {why}") return 2 + tested = ref_digest(bench["to"][svc]) + if tested and d != tested: + print(f"REFUSED {app}: {svc} {ref}: the bench tested {tested[:19]}, the registry serves {d[:19]} now — re-run") + return 1 digests[svc] = d conts = (bench["memory"].get("containers") or {}).values() anon = [c.get("anon_peak_pct") for c in conts if isinstance(c.get("anon_peak_pct"), (int, float))] @@ -1035,7 +1115,7 @@ def write_ladder(argv) -> int: # harness v4 (`09` §6.4 part 10): a PostgreSQL major is written ONLY when BOTH venues converted it — # the bench by its own conversion, the box by the PRODUCT's (the walk records the controller's # `CONVERTED` line). The mark is what lets the box convert at all, and the catalog gate reads it. - conv = pg_conversion(bench["from"], bench["to"]) + conv = pg_conversion(bfrom, bto) if conv: bc, xc = bench.get("engine_conversion") or {}, box.get("engine_conversion") or {} want = {k: conv[k] for k in ("service", "engine", "from", "to")} @@ -1046,7 +1126,7 @@ def write_ladder(argv) -> int: print(f"REFUSED {app}: the box did not convert {want} through the product (its record: {xc})") return 1 marks = set(bench.get("marks") or []) - entry = {"from": bench["from"], "to": bench["to"], "digest": digests, "verdict": "proven", + entry = {"from": bfrom, "to": bto, "digest": digests, "verdict": "proven", "tested_at": bench["measured_at"], "harness_version": bench["harness_version"], "evidence": arg("--evidence"), "box_evidence": arg("--box-evidence"), "memory_peak_pct": peak, "memory_basis": "anon" if anon else "cgroup_peak", @@ -1055,6 +1135,12 @@ def write_ladder(argv) -> int: "needs_person": None, "memory_tight": peak > ladder.MEMORY_TIGHT_PCT}} if conv: entry["engine_conversion"] = {k: conv[k] for k in ("service", "engine", "from", "to")} + if retest: + head = (ladder.parse(fy_p.read_text())[0] or [{}])[-1] + entry["digest_from"] = {s: (ref_digest(bench["from"][s]) or (head.get("digest") or {}).get(s)) for s in bto} + if head.get("to") != bto: + print(f"REFUSED {app}: a re-test must follow an entry that names the same refs (the head is {head.get('to')})") + return 1 probs = ladder.check_entry(entry) if probs: print(f"REFUSED {app}: the entry would not be well-formed: {probs}") @@ -1080,18 +1166,19 @@ def write_ladder(argv) -> int: if m: svc = m.group(1) mi = re.match(r"^(\s+image:\s*)(\S+)\s*$", line) - if mi and svc in bench["to"] and mi.group(2) == bench["from"][svc]: - line = mi.group(1) + bench["to"][svc] + if mi and svc in bto and mi.group(2) == bfrom[svc]: + line = mi.group(1) + bto[svc] out.append(line) comp_p.write_text(pg_mounts_for("\n".join(out) + "\n") if conv else "\n".join(out) + "\n") - if ladder.images_in(comp_p.read_text()) != bench["to"]: + if ladder.images_in(comp_p.read_text()) != bto: comp_p.write_text(comp) print(f"REFUSED {app}: the compose could not be moved line by line — restored") return 1 fy = fy_p.read_text() fy = re.sub(r'^catalog_since:.*$', 'catalog_since: "%s"' % _dt.date.today().isoformat(), fy, count=1, flags=re.M) fy_p.write_text(ladder.append_entry(fy, entry)) - print(f"WROTE {app}: {bench['from']} -> {bench['to']} peak {peak}% marks {entry['marks']}") + print(f"WROTE {app}: {'RE-TEST ' if retest else ''}{bfrom} -> {bto} peak {peak}% marks {entry['marks']}" + + (f" digest {entry['digest_from']} -> {digests}" if retest else "")) return 0 @@ -1158,6 +1245,8 @@ def main(argv): argv = argv[2:] if argv and argv[0] == "--move": argv = [add_move_edge(argv[1], argv[2:])] + if argv and argv[0] == "--retest": + argv = [add_retest_edge(argv[1], argv[2:])] if not argv or argv[0] == "--list": for k, v in EDGES.items(): print(f"{k:5s} {v['app']:12s} {v['note']}") From efd492d0bb117f10cc82acb10de4fdcca4c1f847 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 30 Sep 2026 23:23:16 +0200 Subject: [PATCH 35/46] CHANGELOG + REPORT: same-tag re-tests (decision 52), wger's key, wanderer on the bench Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- CHANGELOG.md | 14 ++++++++++++++ REPORT.md | 18 +++++++----------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cad6a7b..c7eb6de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## Same-tag security fixes as tested steps (decision 52); wger's app login; wanderer on the bench (2026-09-30, late) + +- **Re-tests (`09` §3 decision 52, R-740)** `6a3ead9`: a ladder entry whose `from` equals its `to`, carrying `digest_from` + and `box_evidence`; `ladder.check_entry`, `check-test-record.py` rule 2b and `check-test-record-move.py` (which now judges + re-tests too — they change `.felhom.yml` only) refuse no new digest, a digest the registry stopped serving, a missing box + proof and a `digest_from` that is not the previous digest; 8 decoys (red with the rules off). `upgrade-test.py --retest`; + the ONE monthly command `scripts/retest-floating.py` (`--dry-run`, `--engines-only`, `--push`) with `retest_box.py` and the + box client `box_walk.py` moved into the catalog. Proven end to end on 9202 (docmost, redis). Today: nothing to re-test on + the engine lines; `nextcloud:34.0.4-apache` and linuxserver `sonarr:4.0.20` were rebuilt under their tags (R-743). +- **wger** `45d8482` (R-737): its app login's JWT pair made once by wger's own command, kept on its data volume. +- **Bench-only overrides** (R-739): `BENCH_ENV_OVERRIDES` lets the bench run wanderer (recorded in every verdict). Measured: + meilisearch v1.54 refuses v1.36's data unless `MEILI_UPGRADE_DB=true`; wanderer's step is not done. +- `test_gate_decoys.py` read kimai's tag and date from the clone (it had been red on main since kimai moved). + ## Twelve more steps, six first ladders, and the fixtures behind them (2026-09-30, evening, R-462) Each step: bench 9401 (harness v4, swap 0, 10-min memory watch) + box 9202 (drill catalog, the product's guarded diff --git a/REPORT.md b/REPORT.md index 28ecc69..fd2ad1a 100644 --- a/REPORT.md +++ b/REPORT.md @@ -1,13 +1,9 @@ -# REPORT — 2026-09-30 (evening): twelve more steps, six first ladders +# REPORT — 2026-09-30 (late): same-tag security fixes become tested steps (decision 52) -Evidence: `felhom.eu/documentation/audits/more-night-apps-2026-09-30/`. Operator report: `felhom.eu/REPORT-more-night-apps-2026-09-30.md`. +Evidence: `felhom.eu/documentation/audits/night-rulings-2026-09-30/`. Operator report: `felhom.eu/REPORT-night-rulings-2026-09-30.md`. -- **First ladders:** calibre-web `53a4a1d` (`files_may_change`: its library DB), gitea `d7ba60c`, wger `4ad32aa`, - crafty-controller `e1f0179`, uptime-kuma `35dd5cf`, zipline `a9700e2` + `fb87030` (4.6.1 → 4.7.0 → 4.8.0; the direct - jump fails and the box undid it). **Within-major:** emby `3e4aa77`, ghost `9a78e3b`, home-assistant `15f4d59`, outline - `b0b2514`, rallly `8d3a35a`. Each: bench 9401 (swap 0, 10-min watch, 0 kills) + box 9202 through the guarded Update. -- **Fixes:** wger runs its migrations at start `7a4ff48` (R-738 — its update left the login 500 behind a `done`); - immich's step `0b82…` re-proven at 768M and rewritten by the new `--restep` `48440ce`/`63a96b0` (R-732). -- **Harness** `5b1972b`, `63a96b0`, `84de9a9`: five fixtures, gitea's installer, HTTPS backends, named files behind - `files_may_change`, the bench's `password:N:special` (R-735), zipline's readback, the stale gate-count test. -- **Night-updatable:** 30 + 2 conditional → **35 + 3 conditional**; 15 apps have no ladder. Not done: wanderer (R-739). +- `6a3ead9`: the re-test entry, its gates and decoys, `upgrade-test.py --retest`, `scripts/retest-floating.py` (the monthly + command), `retest_box.py`, `box_walk.py`, `BENCH_ENV_OVERRIDES`. Proven end to end on 9202. Run today: nothing on the + engine lines; two exact tags rebuilt upstream (R-743). +- `45d8482`: wger's JWT key pair (R-737). +- Runbook: `felhom.eu/documentation/runbooks/monthly-floating-retest.md`. From 9e53205938c4d51df1c351cf8cbb1db529590660 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 1 Oct 2026 07:17:49 +0200 Subject: [PATCH 36/46] retest-floating: check what the bench brings (docker, python3), not what the sync puts there (R-749) The check asked for /opt/upg/upgrade-test.py before sync_bench() copies it, so a bench freshly created by the runbook was refused in one minute (2026-10-01). After the sync, the file is now required. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- scripts/retest-floating.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/retest-floating.py b/scripts/retest-floating.py index 5a6be85..806494b 100644 --- a/scripts/retest-floating.py +++ b/scripts/retest-floating.py @@ -95,9 +95,11 @@ def bench(script, timeout=3600): def prerequisites(): missing = [] - r = bench("test -f /opt/upg/upgrade-test.py && echo bench-ok", timeout=120) + # R-749: ask for what the bench must BRING (docker, python3) — /opt/upg is what sync_bench() puts there AFTER this + # check; asking for it here refused every freshly created bench. + r = bench("command -v docker >/dev/null && command -v python3 >/dev/null && docker info >/dev/null 2>&1 && echo bench-ok", timeout=120) if "bench-ok" not in (r.stdout or ""): - missing.append("the bench LXC %s on %s with /opt/upg (runbook §2)" % (BENCH_CT, BENCH_HOST)) + missing.append("the bench LXC %s on %s with docker and python3 (runbook §2)" % (BENCH_CT, BENCH_HOST)) if not os.path.isdir(os.path.join(DRILL, ".git")): missing.append("the drill checkout at %s (runbook §3)" % DRILL) if not os.path.isfile(os.path.join(os.environ.get("SC", os.path.expanduser("~/.felhom-retest")), ".ctlpw")): @@ -202,7 +204,7 @@ def main(argv): print("CANNOT START — missing: " + "; ".join(missing)) return 2 s = sync_bench() - if "synced" not in (s.stdout or ""): + if "synced" not in (s.stdout or "") or "bench-ok" not in (bench("test -f /opt/upg/upgrade-test.py && echo bench-ok", timeout=120).stdout or ""): print("CANNOT START — the bench could not be synced: " + (s.stdout + s.stderr).strip()[-200:]) return 2 results = [] From 3b59dfb1bcdc69b68d8706eceed1232693a7a298 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 1 Oct 2026 07:37:51 +0200 Subject: [PATCH 37/46] nextcloud: re-test of the same tag at a new digest (decision 52, R-740) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit STEP nextcloud: the superseded step {'nextcloud': 'nextcloud:34.0.4-apache', 'nextcloud-db': 'mariadb:12.3', 'nextcloud-redis': 'redis:7-alpine'} keeps its definition at steps/61e93c3e1a1806df.yml STEP nextcloud: … and its .felhom.yml at steps/61e93c3e1a1806df.felhom.yml WROTE nextcloud: RE-TEST {'nextcloud': 'nextcloud:34.0.4-apache', 'nextcloud-db': 'mariadb:12.3', 'nextcloud-redis': 'redis:7-alpine'} -> {'nextcloud': 'nextcloud:34.0.4-apache', 'nextcloud-db': 'mariadb:12.3', 'nextcloud-redis': 'redis:7-alpine'} peak 23.7% marks {'files_may_change': False, 'needs_person': None, 'memory_tight': False} digest {'nextcloud': 'sha256:a5ace30c695afe48c2c406e940ee7886a81e13fa382e57cd68b2416d1a66914c', 'nextcloud-db': 'sha256:805c8e104bd563d5bfa24fadd3f31cd419ea859cb5277f32b5dbf2db714f9ed1', 'nextcloud-redis': 'sha256:858f009f9709ce576febc734aa78b8f6d624b82571f9ddb6bda4377c833b3499'} -> {'nextcloud': 'sha256:37b109885aa3cba3e056362a899556a625c986f2c17cd2c0cc157d21c789f53b', 'nextcloud-db': 'sha256:805c8e104bd563d5bfa24fadd3f31cd419ea859cb5277f32b5dbf2db714f9ed1', 'nextcloud-redis': 'sha256:858f009f9709ce576febc734aa78b8f6d624b82571f9ddb6bda4377c833b3499'} Evidence: felhom.eu/documentation/audits/retest-2026-10/nextcloud --- templates/nextcloud/.felhom.yml | 3 +- .../steps/61e93c3e1a1806df.felhom.yml | 181 ++++++++++++++++++ .../nextcloud/steps/61e93c3e1a1806df.yml | 132 +++++++++++++ 3 files changed, 315 insertions(+), 1 deletion(-) create mode 100644 templates/nextcloud/steps/61e93c3e1a1806df.felhom.yml create mode 100644 templates/nextcloud/steps/61e93c3e1a1806df.yml diff --git a/templates/nextcloud/.felhom.yml b/templates/nextcloud/.felhom.yml index db73676..6438b85 100644 --- a/templates/nextcloud/.felhom.yml +++ b/templates/nextcloud/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "cloud" slug: "nextcloud" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-09-23" +catalog_since: "2026-10-01" # --- Resource hints (displayed on deploy screen) --- resources: @@ -186,3 +186,4 @@ i18n: update_ladder: - {"from": {"nextcloud": "nextcloud:34.0.1-apache", "nextcloud-db": "mariadb:11.6", "nextcloud-redis": "redis:7-alpine"}, "to": {"nextcloud": "nextcloud:34.0.1-apache", "nextcloud-db": "mariadb:12.3", "nextcloud-redis": "redis:7-alpine"}, "digest": {"nextcloud": "sha256:b52f7bc0e496f227b0e85e3b88571a42c68b6245ccde29d577e733227715dcf5", "nextcloud-db": "sha256:805c8e104bd563d5bfa24fadd3f31cd419ea859cb5277f32b5dbf2db714f9ed1", "nextcloud-redis": "sha256:858f009f9709ce576febc734aa78b8f6d624b82571f9ddb6bda4377c833b3499"}, "verdict": "proven", "tested_at": "2026-09-21T19:37:10.235635+00:00", "harness_version": 1, "evidence": "felhom.eu/documentation/audits/update-night-2026-09-21/apps/nextcloud-engine-mariadb/verdict.json", "memory_peak_pct": null, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "backfilled": "2026-09-23", "note": "backfilled from catalog commit 39374d5; box walk only (harness v1, no memory watch); digest = what the registry served on 2026-09-23, not a measurement of the tested image; the commit cited no record — this one was named by the backfill because its from/to refs are the commit's and the commit describes the same walk"} - {"from": {"nextcloud": "nextcloud:34.0.1-apache", "nextcloud-db": "mariadb:12.3", "nextcloud-redis": "redis:7-alpine"}, "to": {"nextcloud": "nextcloud:34.0.4-apache", "nextcloud-db": "mariadb:12.3", "nextcloud-redis": "redis:7-alpine"}, "digest": {"nextcloud": "sha256:a5ace30c695afe48c2c406e940ee7886a81e13fa382e57cd68b2416d1a66914c", "nextcloud-db": "sha256:805c8e104bd563d5bfa24fadd3f31cd419ea859cb5277f32b5dbf2db714f9ed1", "nextcloud-redis": "sha256:858f009f9709ce576febc734aa78b8f6d624b82571f9ddb6bda4377c833b3499"}, "verdict": "proven", "tested_at": "2026-09-23T20:16:04Z", "harness_version": 3, "evidence": "felhom.eu/documentation/audits/night-2026-09-23/apps/nextcloud/bench/evidence/MV-nextcloud/verdict.json", "box_evidence": "felhom.eu/documentation/audits/night-2026-09-23/apps/nextcloud/verdict.json", "memory_peak_pct": 24.2, "marks": {"files_may_change": true, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 100.0} + - {"from": {"nextcloud": "nextcloud:34.0.4-apache", "nextcloud-db": "mariadb:12.3", "nextcloud-redis": "redis:7-alpine"}, "to": {"nextcloud": "nextcloud:34.0.4-apache", "nextcloud-db": "mariadb:12.3", "nextcloud-redis": "redis:7-alpine"}, "digest": {"nextcloud": "sha256:37b109885aa3cba3e056362a899556a625c986f2c17cd2c0cc157d21c789f53b", "nextcloud-db": "sha256:805c8e104bd563d5bfa24fadd3f31cd419ea859cb5277f32b5dbf2db714f9ed1", "nextcloud-redis": "sha256:858f009f9709ce576febc734aa78b8f6d624b82571f9ddb6bda4377c833b3499"}, "verdict": "proven", "tested_at": "2026-10-01T05:32:19Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/retest-2026-10/nextcloud/bench", "box_evidence": "felhom.eu/documentation/audits/retest-2026-10/nextcloud/box", "memory_peak_pct": 23.7, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 36.7, "digest_from": {"nextcloud": "sha256:a5ace30c695afe48c2c406e940ee7886a81e13fa382e57cd68b2416d1a66914c", "nextcloud-db": "sha256:805c8e104bd563d5bfa24fadd3f31cd419ea859cb5277f32b5dbf2db714f9ed1", "nextcloud-redis": "sha256:858f009f9709ce576febc734aa78b8f6d624b82571f9ddb6bda4377c833b3499"}} diff --git a/templates/nextcloud/steps/61e93c3e1a1806df.felhom.yml b/templates/nextcloud/steps/61e93c3e1a1806df.felhom.yml new file mode 100644 index 0000000..f790078 --- /dev/null +++ b/templates/nextcloud/steps/61e93c3e1a1806df.felhom.yml @@ -0,0 +1,181 @@ +# ============================================================================= +# .felhom.yml - App metadata for felhom-controller +# ============================================================================= + +# --- Display info (shown on dashboard) --- +display_name: "Nextcloud" +description: "Saját felhő tárhely - Google Drive/Dropbox alternatíva" +category: "files" +subdomain: "cloud" +slug: "nextcloud" +# catalog_since: the date THIS repo last changed this app's pinned images. Any commit that +# changes an image: line must set this to the same day (see CLAUDE.md). +catalog_since: "2026-09-23" + +# --- Resource hints (displayed on deploy screen) --- +resources: + mem_request: "256M" + mem_limit: "1024M" + pi_compatible: false + needs_hdd: true + +# --- Backup classification (referential coupling; see felhom.eu documentation/audits/SPIKE-backup-classification-2026-07-14.md) --- +backup: + hdd: + - path: appdata/nextcloud + class: mandatory # THE user files — oc_filecache/shares reference them + +# --- Deploy fields (first deployment only) --- +deploy_fields: + - env_var: DOMAIN + label: "Domain" + type: domain + description: "A szerver domain neve" + locked_after_deploy: true + + - env_var: SUBDOMAIN + label: "Aldomain" + type: subdomain + default: "cloud" + required: true + locked_after_deploy: true + description: "Az alkalmazás aldomainje" + + - env_var: DB_PASSWORD + label: "Adatbázis jelszó" + type: secret + generate: "password:24" + locked_after_deploy: true + + - env_var: MYSQL_ROOT_PASSWORD + label: "MariaDB root jelszó" + type: secret + generate: "password:24" + locked_after_deploy: true + + - env_var: NEXTCLOUD_ADMIN_USER + label: "Admin felhasználónév" + type: text + default: "admin" + locked_after_deploy: true + + - env_var: NEXTCLOUD_ADMIN_PASSWORD + label: "Admin jelszó" + type: password + generate: "password:16" + description: "Első bejelentkezéshez. Utána a webes felületen módosítható." + locked_after_deploy: false + + - env_var: HDD_PATH + label: "Adattárolási útvonal" + type: path + required: true + placeholder: "/mnt/felhom-drives/hdd_1" + description: "A külső merevlemez elérési útja" + locked_after_deploy: true + +# --- App info (info page content) --- +app_info: + tagline: "A saját Google Drive-od - fájlok, naptár, névjegyek egy helyen" + default_creds: "Az admin fiók adatait a telepítéskor adod meg" + docs_url: "https://docs.nextcloud.com/server/latest/user_manual/" + + use_cases: + - 'Fájlok szinkronizálása és megosztása eszközök között' + - 'Naptár és névjegyek szinkronizálás (CalDAV/CardDAV)' + - 'Dokumentumok közös szerkesztése (OnlyOffice integrációval)' + - 'Fotó és videó automatikus feltöltés telefonról' + - 'Alkalmazásbolt - kibővíthető funkciók (Notes, Tasks, Forms, stb.)' + + first_steps: + - 'Nyisd meg a cloud.DOMAIN címet a böngészőben' + - 'Jelentkezz be a telepítéskor megadott admin fiókkal' + - 'Telepítsd a Nextcloud asztali alkalmazást a számítógépedre' + - 'Telepítsd a Nextcloud mobil alkalmazást a telefonodra' + - 'Hívd meg a családtagokat felhasználói fiókok létrehozásával' + + prerequisites: + - 'Külső HDD szükséges a fájlok tárolásához' + - 'Legalább 1 GB szabad RAM (Nextcloud + MariaDB + Redis)' + - 'x86 processzor ajánlott a legjobb teljesítményhez' + +# --- Controller-side health probe --- +healthcheck: + checks: + - type: api + port: 80 + path: "/status.php" + expect: + status: 200 + body_contains: "installed" + +# --- After a load of kept data (`09` §3 decision 36; controller ≥ the kept-data release) --- +# „Use my kept data" / „Load" restores the database from a backup under the files kept on the drive. +# MEASURED 2026-09-25 on 9202 (audits/night-2026-09-26/E/E1-README.md Q2): a file written after the backup +# is on the drive and invisible to Nextcloud until its own rescan — 0.6 s for 130 files. Run once, logged. +# An older controller ignores the key. +after_load: + service: nextcloud + user: www-data + command: ["php", "occ", "files:scan", "--all"] + +# --- App-email mapping (apps → in-controller shim → hub → Resend) --- +# Nextcloud (Symfony Mailer) has no env to skip TLS cert verification and opportunistically STARTTLS-upgrades, +# so it can't use the self-signed :2525 listener → tls_mode=plaintext points it at :2526 (STARTTLS NOT +# advertised → no upgrade attempted; plaintext on the single-tenant app bridge — accepted posture). +# Nextcloud SPLITS the From into local-part + domain, so from_var=MAIL_FROM_ADDRESS (local) + +# from_domain_var=MAIL_DOMAIN → nextcloud@felhom.eu. No security_var (SMTP_SECURE stays empty = no TLS); +# SMTP_NAME/PASSWORD unset (no auth). The official image reads these via getenv() on every boot. +smtp_mapping: + tls_mode: plaintext + host_var: SMTP_HOST + port_var: SMTP_PORT + from_var: MAIL_FROM_ADDRESS + from_domain_var: MAIL_DOMAIN + from_local: nextcloud + +# --- English copy (localisation slice 5, R-560) -------------------------------------------- +# The Hungarian above is UNCHANGED. A box on English reads this block field by field; a missing +# field shows the Hungarian one; a controller older than 0.257.0 ignores the block entirely. +i18n: + en: + description: 'Your own cloud storage - a Google Drive/Dropbox alternative' + app_info: + tagline: 'Your own Google Drive - files, calendar and contacts in one place' + default_creds: 'You set the admin account details at install time' + use_cases: + - 'Sync and share files between your devices' + - 'Calendar and contact sync (CalDAV/CardDAV)' + - 'Work on a document together (with the OnlyOffice integration)' + - 'Photos and videos upload themselves from your phone' + - 'An app store - more features when you want them (Notes, Tasks, Forms and more)' + first_steps: + - 'Open cloud.DOMAIN in your browser' + - 'Sign in with the admin account you set at install time' + - 'Install the Nextcloud desktop app on your computer' + - 'Install the Nextcloud mobile app on your phone' + - 'Invite the household by creating an account for each of them' + prerequisites: + - 'An external hard drive is needed to keep the files on' + - 'At least 1 GB of free RAM (Nextcloud + MariaDB + Redis)' + - 'An x86 processor is recommended for the best speed' + deploy_fields: + - env_var: DOMAIN + label: 'Domain' + description: 'The server domain name' + - env_var: SUBDOMAIN + label: 'Subdomain' + description: 'The subdomain this app answers on' + - env_var: DB_PASSWORD + label: 'Database password' + - env_var: HDD_PATH + label: 'Data storage path' + description: 'The path to the external hard drive' + placeholder: '/mnt/felhom-drives/hdd_1' + - env_var: MYSQL_ROOT_PASSWORD + label: 'MariaDB root password' + - env_var: NEXTCLOUD_ADMIN_USER + label: 'Admin user name' + - env_var: NEXTCLOUD_ADMIN_PASSWORD + label: 'Admin password' + description: 'For the first sign-in. You can change it in the app afterwards.' diff --git a/templates/nextcloud/steps/61e93c3e1a1806df.yml b/templates/nextcloud/steps/61e93c3e1a1806df.yml new file mode 100644 index 0000000..5990547 --- /dev/null +++ b/templates/nextcloud/steps/61e93c3e1a1806df.yml @@ -0,0 +1,132 @@ +# Nextcloud - Saját felhő tárhely - Google Drive/Dropbox alternatíva +# Domain: ${SUBDOMAIN}.${DOMAIN} +# Database: mariadb +# RAM: ~256M (mem_limit: 1024M) | Pi-compatible: No +# +# Environment variables: +# DOMAIN - Your domain (e.g., demo-felhom.eu) +# DB_PASSWORD - Adatbázis jelszó (auto-generated) +# MYSQL_ROOT_PASSWORD- MariaDB root jelszó (auto-generated) +# NEXTCLOUD_ADMIN_USER- Admin felhasználónév +# NEXTCLOUD_ADMIN_PASSWORD- Admin jelszó (auto-generated) +# HDD_PATH - Adattárolási útvonal + +services: + nextcloud: + image: nextcloud:34.0.4-apache + container_name: nextcloud + restart: unless-stopped + depends_on: + nextcloud-db: + condition: service_healthy + nextcloud-redis: + condition: service_healthy + environment: + - TZ=Europe/Budapest + - MYSQL_DATABASE=nextcloud + - MYSQL_USER=nextcloud + - MYSQL_PASSWORD=${DB_PASSWORD} + - MYSQL_HOST=nextcloud-db + - NEXTCLOUD_ADMIN_USER=${NEXTCLOUD_ADMIN_USER:-admin} + - NEXTCLOUD_ADMIN_PASSWORD=${NEXTCLOUD_ADMIN_PASSWORD} + - NEXTCLOUD_TRUSTED_DOMAINS=${SUBDOMAIN}.${DOMAIN} nextcloud + - OVERWRITEPROTOCOL=https + - OVERWRITEHOST=${SUBDOMAIN}.${DOMAIN} + - REDIS_HOST=nextcloud-redis + # App-email (managed relay). Injected by the controller only when app-email is on (global + per-app); + # empty SMTP_HOST keeps Nextcloud mail disabled. Nextcloud uses the plaintext :2526 listener + # (tls_mode=plaintext, SMTP_SECURE empty = no TLS) — it can't skip the self-signed STARTTLS cert. + # From is split: MAIL_FROM_ADDRESS=nextcloud + MAIL_DOMAIN=felhom.eu. See .felhom.yml smtp_mapping. + - SMTP_HOST=${SMTP_HOST:-} + - SMTP_PORT=${SMTP_PORT:-25} + - SMTP_SECURE=${SMTP_SECURE:-} + - MAIL_FROM_ADDRESS=${MAIL_FROM_ADDRESS:-} + - MAIL_DOMAIN=${MAIL_DOMAIN:-} + volumes: + - nextcloud_html:/var/www/html + - ${HDD_PATH}/appdata/nextcloud:/var/www/html/data + networks: + - traefik-public + - nextcloud-internal + deploy: + resources: + limits: + memory: 1024M + healthcheck: + test: ["CMD", "curl", "-f", "http://127.0.0.1:80/status.php"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 30s + labels: + - "traefik.enable=true" + - "traefik.http.routers.nextcloud.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)" + - "traefik.http.routers.nextcloud.entrypoints=websecure" + - "traefik.http.routers.nextcloud.tls=true" + - "traefik.http.routers.nextcloud.tls.certresolver=letsencrypt" + - "traefik.http.services.nextcloud.loadbalancer.server.port=80" + - "traefik.http.middlewares.nextcloud-redirect.redirectregex.regex=/.well-known/(card|cal)dav" + - "traefik.http.middlewares.nextcloud-redirect.redirectregex.replacement=/remote.php/dav/" + - "traefik.http.routers.nextcloud.middlewares=nextcloud-redirect" + + nextcloud-db: + image: mariadb:12.3 + container_name: nextcloud-db + restart: unless-stopped + environment: + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + - MYSQL_DATABASE=nextcloud + - MYSQL_USER=nextcloud + - MYSQL_PASSWORD=${DB_PASSWORD} + - TZ=Europe/Budapest + # MARIADB_AUTO_UPGRADE: on a MAJOR engine move the engine converts its own datadir (~7 s on a + # small DB, backs its system tables up first). Operator ruling 2026-09-13 on + # felhom.eu/documentation/audits/SPIKE-r459-mariadb-upgrade-2026-09-06.md. Inert until a + # major moves — and none may, until Slice 4 (R-448) ships: see CLAUDE.md, engine-major rule. + - MARIADB_AUTO_UPGRADE=1 + volumes: + - nextcloud_db_data:/var/lib/mysql + networks: + - nextcloud-internal + deploy: + resources: + limits: + memory: 512M + healthcheck: + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 20s + + nextcloud-redis: + image: redis:7-alpine + container_name: nextcloud-redis + restart: unless-stopped + command: redis-server --appendonly yes + environment: + - TZ=Europe/Budapest + volumes: + - nextcloud_redis_data:/data + networks: + - nextcloud-internal + deploy: + resources: + limits: + memory: 128M + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 20s + +volumes: + nextcloud_db_data: + nextcloud_html: + nextcloud_redis_data: + +networks: + traefik-public: + external: true + nextcloud-internal: From 1a37032f9983a7b5d48ef86a18d326a4a40ee11b Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 1 Oct 2026 07:53:44 +0200 Subject: [PATCH 38/46] sonarr: re-test of the same tag at a new digest (decision 52, R-740) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit STEP sonarr: the superseded step {'sonarr': 'lscr.io/linuxserver/sonarr:4.0.20'} keeps its definition at steps/bf0bfeab9db53720.yml STEP sonarr: … and its .felhom.yml at steps/bf0bfeab9db53720.felhom.yml WROTE sonarr: RE-TEST {'sonarr': 'lscr.io/linuxserver/sonarr:4.0.20'} -> {'sonarr': 'lscr.io/linuxserver/sonarr:4.0.20'} peak 13.9% marks {'files_may_change': False, 'needs_person': None, 'memory_tight': False} digest {'sonarr': 'sha256:a5c1a5fecbef946927ab90ad68df319ac5fe644057e5fc18cd993f01ac07b2b2'} -> {'sonarr': 'sha256:f247545d23ba8b233d6604575347e48a623fe6ad75dda02348bf81917f3b5c06'} Evidence: felhom.eu/documentation/audits/retest-2026-10/sonarr --- templates/sonarr/.felhom.yml | 3 +- .../sonarr/steps/bf0bfeab9db53720.felhom.yml | 125 ++++++++++++++++++ templates/sonarr/steps/bf0bfeab9db53720.yml | 54 ++++++++ 3 files changed, 181 insertions(+), 1 deletion(-) create mode 100644 templates/sonarr/steps/bf0bfeab9db53720.felhom.yml create mode 100644 templates/sonarr/steps/bf0bfeab9db53720.yml diff --git a/templates/sonarr/.felhom.yml b/templates/sonarr/.felhom.yml index a7da9ac..321a84e 100644 --- a/templates/sonarr/.felhom.yml +++ b/templates/sonarr/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "sonarr" slug: "sonarr" # catalog_since: the date THIS repo last changed this app's pinned images. Any commit that # changes an image: line must set this to the same day (see CLAUDE.md). -catalog_since: "2026-09-22" +catalog_since: "2026-10-01" # --- Resource hints (displayed on deploy screen) --- resources: @@ -129,3 +129,4 @@ i18n: # gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. update_ladder: - {"from": {"sonarr": "lscr.io/linuxserver/sonarr:4.0.19"}, "to": {"sonarr": "lscr.io/linuxserver/sonarr:4.0.20"}, "digest": {"sonarr": "sha256:a5c1a5fecbef946927ab90ad68df319ac5fe644057e5fc18cd993f01ac07b2b2"}, "verdict": "proven", "tested_at": "2026-09-22T11:58:13.323688+00:00", "harness_version": 1, "evidence": "felhom.eu/documentation/audits/the-28-2026-09-22/apps/sonarr/verdict.json", "memory_peak_pct": null, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "backfilled": "2026-09-23", "note": "backfilled from catalog commit 0b283d2; box walk only (harness v1, no memory watch); digest = what the registry served on 2026-09-23, not a measurement of the tested image"} + - {"from": {"sonarr": "lscr.io/linuxserver/sonarr:4.0.20"}, "to": {"sonarr": "lscr.io/linuxserver/sonarr:4.0.20"}, "digest": {"sonarr": "sha256:f247545d23ba8b233d6604575347e48a623fe6ad75dda02348bf81917f3b5c06"}, "verdict": "proven", "tested_at": "2026-10-01T05:50:14Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/retest-2026-10/sonarr/bench", "box_evidence": "felhom.eu/documentation/audits/retest-2026-10/sonarr/box", "memory_peak_pct": 13.9, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 16.8, "digest_from": {"sonarr": "sha256:a5c1a5fecbef946927ab90ad68df319ac5fe644057e5fc18cd993f01ac07b2b2"}} diff --git a/templates/sonarr/steps/bf0bfeab9db53720.felhom.yml b/templates/sonarr/steps/bf0bfeab9db53720.felhom.yml new file mode 100644 index 0000000..f1ff9cc --- /dev/null +++ b/templates/sonarr/steps/bf0bfeab9db53720.felhom.yml @@ -0,0 +1,125 @@ +# ============================================================================= +# .felhom.yml - App metadata for felhom-controller +# ============================================================================= + +# --- Display info (shown on dashboard) --- +display_name: "Sonarr" +description: "Automatikus sorozat letöltő és rendszerező" +category: "media-automation" +subdomain: "sonarr" +slug: "sonarr" +# catalog_since: the date THIS repo last changed this app's pinned images. Any commit that +# changes an image: line must set this to the same day (see CLAUDE.md). +catalog_since: "2026-09-22" + +# --- Resource hints (displayed on deploy screen) --- +resources: + mem_request: "150M" + mem_limit: "512M" + pi_compatible: true + needs_hdd: true + +# --- Backup classification (referential coupling; see felhom.eu documentation/audits/SPIKE-backup-classification-2026-07-14.md) --- +backup: + userdata: + - path: media/tv + class: excluded + - path: downloads + class: excluded + +# --- Deploy fields (first deployment only) --- +deploy_fields: + - env_var: DOMAIN + label: "Domain" + type: domain + description: "A szerver domain neve" + locked_after_deploy: true + + - env_var: SUBDOMAIN + label: "Aldomain" + type: subdomain + default: "sonarr" + required: true + locked_after_deploy: true + description: "Az alkalmazás aldomainje" + + - env_var: HDD_PATH + label: "Médiatár útvonal" + type: path + required: true + placeholder: "/mnt/felhom-drives/hdd_1" + description: "A külső merevlemez elérési útja" + locked_after_deploy: true + +# --- The setup gate (controller >= 0.281.0, `09` §3 decisions 46-47) --- +# The first visitor would create the admin; a fresh install is closed to everyone but the household until the first setup is done. +setup_gate: true + +# --- App info (info page content) --- +app_info: + tagline: "Automatikus sorozat letöltő és rendszerező" + docs_url: "https://wiki.servarr.com/sonarr" + + use_cases: + - 'Sorozatok automatikus letöltése és rendszerezése' + - 'Kívánságlista kezelés - új epizódok automatikus letöltése' + - 'Minőség kezelés (480p-tól 4K-ig, automatikus frissítés)' + - 'Integráció Jellyfin/Plex és letöltő kliensekkel' + - 'Felirat automatikus letöltés' + + first_steps: + - 'Nyisd meg a sonarr.DOMAIN címet a böngészőben' + - 'Állíts be egy letöltő klienst (pl. qBittorrent)' + - 'Add hozzá az indexereket (vagy használj Prowlarr-t)' + - 'Állítsd be a gyökérmappát (/media/shows)' + - 'Keress rá egy sorozatra és add hozzá a listádhoz' + + prerequisites: + - 'Külső HDD szükséges a médiafájlok tárolásához' + - 'Letöltő kliens szükséges (pl. qBittorrent - külön telepítendő)' + - 'Indexer hozzáférés szükséges a kereséshez' + +# --- Controller-side health probe --- +healthcheck: + checks: + - type: api + port: 8989 + path: "/ping" + expect: + status: 200 + +# --- English copy (localisation slice 5, R-560) -------------------------------------------- +# The Hungarian above is UNCHANGED. A box on English reads this block field by field; a missing +# field shows the Hungarian one; a controller older than 0.257.0 ignores the block entirely. +i18n: + en: + description: 'Series download and file themselves' + app_info: + tagline: 'Series download and file themselves' + use_cases: + - 'Series are downloaded and filed on their own' + - 'A wish list - new episodes arrive as they appear' + - 'Quality rules (480p to 4K, with an upgrade when a better copy shows up)' + - 'Works with Jellyfin/Plex and with download clients' + - 'Subtitles are fetched on their own' + first_steps: + - 'Open sonarr.DOMAIN in your browser' + - 'Set up a download client (qBittorrent, for example)' + - 'Add your indexers (or use Prowlarr)' + - 'Set the root folder (/media/shows)' + - 'Search for a series and add it to your list' + prerequisites: + - 'An external hard drive is needed to keep the media files on' + - 'A download client is needed (qBittorrent, for example - installed separately)' + - 'Access to an indexer is needed for searching' + deploy_fields: + - env_var: DOMAIN + label: 'Domain' + description: 'The server domain name' + - env_var: SUBDOMAIN + label: 'Subdomain' + description: 'The subdomain this app answers on' + - env_var: HDD_PATH + label: 'Media library path' + description: 'The path to the external hard drive' + placeholder: '/mnt/felhom-drives/hdd_1' diff --git a/templates/sonarr/steps/bf0bfeab9db53720.yml b/templates/sonarr/steps/bf0bfeab9db53720.yml new file mode 100644 index 0000000..5d030b5 --- /dev/null +++ b/templates/sonarr/steps/bf0bfeab9db53720.yml @@ -0,0 +1,54 @@ +# Sonarr - Automatikus sorozat letöltő és rendszerező +# Domain: ${SUBDOMAIN}.${DOMAIN} +# Database: None (file-based) +# RAM: ~150M (mem_limit: 512M) | Pi-compatible: Yes +# +# Environment variables: +# DOMAIN - Your domain (e.g., demo-felhom.eu) +# USERDATA_PATH - Ügyfél-tartalom gyökér (/userdata) +# +# Storage layout (felhom userdata convention): +# Sorozattár → ${USERDATA_PATH}/media/tv (írható) +# Letöltések → ${USERDATA_PATH}/downloads (SIBLING of media — same FS → hardlink/atomic move) +# Run-identity: PUID/PGID 1000 (shared content group); UMASK=002 → group-writable output. + +services: + sonarr: + image: lscr.io/linuxserver/sonarr:4.0.20 + container_name: sonarr + restart: unless-stopped + environment: + - TZ=Europe/Budapest + - PUID=1000 + - PGID=1000 + - UMASK=002 + volumes: + - sonarr_config:/config + - ${USERDATA_PATH}/media/tv:/media/tv + - ${USERDATA_PATH}/downloads:/downloads + networks: + - traefik-public + deploy: + resources: + limits: + memory: 512M + healthcheck: + test: ["CMD", "curl", "-f", "http://127.0.0.1:8989/ping"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 30s + labels: + - "traefik.enable=true" + - "traefik.http.routers.sonarr.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)" + - "traefik.http.routers.sonarr.entrypoints=websecure" + - "traefik.http.routers.sonarr.tls=true" + - "traefik.http.routers.sonarr.tls.certresolver=letsencrypt" + - "traefik.http.services.sonarr.loadbalancer.server.port=8989" + +volumes: + sonarr_config: + +networks: + traefik-public: + external: true From 804884a749c5847352715f01d9267baed33869ad Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 1 Oct 2026 07:54:39 +0200 Subject: [PATCH 39/46] image_digest.resolve honours a @digest: asks the registry for THAT manifest (R-746) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The digest was dropped and the tag's current digest returned, so 'is this digest still served' got a false yes (measured: redis:7-alpine@sha256:000…0 resolved to the tag's digest; now HTTP 404). A malformed digest is refused without a request. test_image_digest.py (no network); red-proof: the pre-fix resolver fails 3 of 4 cases. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- scripts/image_digest.py | 16 ++++++-- scripts/test_image_digest.py | 75 ++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 scripts/test_image_digest.py diff --git a/scripts/image_digest.py b/scripts/image_digest.py index be8dd33..c497f7f 100644 --- a/scripts/image_digest.py +++ b/scripts/image_digest.py @@ -34,8 +34,8 @@ UA = "felhom-catalog-digest/1.0 (read-only)" def split_ref(ref): - """'ghcr.io/a/b:1.2' -> ('ghcr.io', 'a/b', '1.2'). A digest suffix is dropped; Docker Hub - short names get `library/`.""" + """'ghcr.io/a/b:1.2' -> ('ghcr.io', 'a/b', '1.2'). A digest suffix is dropped here (resolve() asks for it by + itself); Docker Hub short names get `library/`.""" ref = ref.split("@", 1)[0] first = ref.split("/", 1)[0] if "/" in ref and ("." in first or ":" in first or first == "localhost"): @@ -69,15 +69,23 @@ def _bearer(www_auth): def resolve(ref, timeout=30): - """(digest, None) or (None, why). Read-only: one HEAD, one token fetch at most.""" + """(digest, None) or (None, why). Read-only: one HEAD, one token fetch at most. + + A ref carrying `@sha256:…` asks for THAT manifest (R-746): the answer is the digest only when the registry still + serves it, never the tag's current digest — a caller asking "is this digest still served" got a false yes.""" host, repo, tag = split_ref(ref) - url = "https://%s/v2/%s/manifests/%s" % (host, repo, tag) + want = ref.split("@", 1)[1] if "@" in ref else "" + if want and not (want.startswith("sha256:") and len(want) == 71): + return None, "not a sha256 digest: %s" % want + url = "https://%s/v2/%s/manifests/%s" % (host, repo, want or tag) headers = {"Accept": ACCEPT, "User-Agent": UA} for attempt in (1, 2): req = urllib.request.Request(url, headers=headers, method="HEAD") try: with urllib.request.urlopen(req, timeout=timeout) as r: d = r.headers.get("Docker-Content-Digest") + if want and d != want: + return None, "the registry answered %s for %s" % (d, want) if d and d.startswith("sha256:") and len(d) == 71: return d, None return None, "no Docker-Content-Digest header (HTTP %s)" % r.status diff --git a/scripts/test_image_digest.py b/scripts/test_image_digest.py new file mode 100644 index 0000000..879a996 --- /dev/null +++ b/scripts/test_image_digest.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python3 +"""R-746: image_digest.resolve honours a `@digest` — it asks the registry for THAT manifest and never answers the tag's +current digest. No network: urlopen is replaced by a fake registry that serves one tag and one digest. + +COMPANION RED-PROOF: with the pre-fix resolve (it dropped the digest and asked for the tag), the absent-digest case +answers the tag's digest and this test fails ("a digest the registry does not serve was resolved").""" +import io +import os +import sys +import unittest +import urllib.error + +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +import image_digest # noqa: E402 + +SERVED = "sha256:" + "a" * 64 +GONE = "sha256:" + "0" * 64 + + +class _Resp: + def __init__(self, digest): + self.headers = {"Docker-Content-Digest": digest} + self.status = 200 + + def __enter__(self): + return self + + def __exit__(self, *a): + return False + + +class FakeRegistry: + def __init__(self): + self.urls = [] + + def __call__(self, req, timeout=30): + url = req.full_url + self.urls.append(url) + last = url.rsplit("/", 1)[-1] + if last in ("7-alpine", SERVED): # the tag and the digest it serves + return _Resp(SERVED) + raise urllib.error.HTTPError(url, 404, "not found", {}, io.BytesIO(b"")) + + +class ResolveDigest(unittest.TestCase): + def setUp(self): + self.fake = FakeRegistry() + self.orig = image_digest.urllib.request.urlopen + image_digest.urllib.request.urlopen = self.fake + + def tearDown(self): + image_digest.urllib.request.urlopen = self.orig + + def test_plain_tag_unchanged(self): + self.assertEqual(image_digest.resolve("redis:7-alpine"), (SERVED, None)) + self.assertTrue(self.fake.urls[-1].endswith("/manifests/7-alpine")) + + def test_served_digest_is_asked_by_digest(self): + d, why = image_digest.resolve("redis:7-alpine@" + SERVED) + self.assertEqual(d, SERVED, why) + self.assertTrue(self.fake.urls[-1].endswith("/manifests/" + SERVED), self.fake.urls) + + def test_absent_digest_is_refused(self): + d, why = image_digest.resolve("redis:7-alpine@" + GONE) + self.assertIsNone(d, "a digest the registry does not serve was resolved (to %s)" % d) + self.assertIn("404", why) + + def test_malformed_digest_is_refused(self): + d, why = image_digest.resolve("redis:7-alpine@sha256:abc") + self.assertIsNone(d) + self.assertEqual(self.fake.urls, [], "a malformed digest must not reach the registry") + + +if __name__ == "__main__": + unittest.main() From 9fc705209d83c77bee425e345a481e45ed622b58 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 1 Oct 2026 08:19:19 +0200 Subject: [PATCH 40/46] outline fixture: read Outline 1.10's __Host-csrfToken cookie (R-744) Outline 1.10 names the CSRF cookie __Host-csrfToken on a secure request and csrfToken over plain HTTP (server/utils/ csrf.ts getCookieName); 1.9.1 always said csrfToken. Proven on 9202 at the live pin 1.10.1: installation.create 302, cookie __Host-csrfToken, apiKeys.create, a published document read back, unknown id and wrong key refused (felhom.eu/documentation/audits/rulings-2026-10-01/D/D2-outline-fixture-9202.txt). The old pattern cannot match that header line (the red: 2026-09-30, both venues). Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- scripts/upgrade_fixtures_box.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade_fixtures_box.py b/scripts/upgrade_fixtures_box.py index 1d13e78..c45f9c4 100644 --- a/scripts/upgrade_fixtures_box.py +++ b/scripts/upgrade_fixtures_box.py @@ -1413,12 +1413,16 @@ class Outline: self.tried = f"POST /api/installation.create -> {code}" return None rc, code, out = w.app_curl(sub, "/home", "-D", "-", "-o", "/dev/null", "-H", f"Cookie: {ck}") - csrf = re.search(r"(?im)^set-cookie:\s*csrfToken=([^;\r\n]+)", out or "") + # R-744: Outline 1.10 names the cookie `__Host-csrfToken` on a secure request (server/utils/csrf.ts getCookieName, + # shared/constants.ts CSRF.secureCookieName) and `csrfToken` over plain HTTP — 1.9.1 always said `csrfToken`. + # The double-submit check compares the cookie under the request's own name with the x-csrf-token header. + csrf = re.search(r"(?im)^set-cookie:\s*((?:__Host-)?csrfToken)=([^;\r\n]+)", out or "") if not csrf: - self.tried = "no csrfToken cookie from GET /home" + self.tried = "no csrfToken / __Host-csrfToken cookie from GET /home" return None - cs = csrf.group(1) - rc, code, out = w.app_curl(sub, "/api/apiKeys.create", "-H", f"Cookie: {ck}; csrfToken={cs}", "-H", f"x-csrf-token: {cs}", + cn, cs = csrf.group(1), csrf.group(2) + say(f" outline: CSRF cookie {cn}") + rc, code, out = w.app_curl(sub, "/api/apiKeys.create", "-H", f"Cookie: {ck}; {cn}={cs}", "-H", f"x-csrf-token: {cs}", "-H", "Content-Type: application/json", "-H", f"Origin: {o}", data=json.dumps({"name": "drill"}), method="POST") try: From a4597cd005d74593946378b4e21ec7d42840b216 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 1 Oct 2026 10:18:17 +0200 Subject: [PATCH 41/46] =?UTF-8?q?mealie:=20lockout=201=20hour=20instead=20?= =?UTF-8?q?of=2024=20(R-747,=2009=20decision=2057=20=E2=80=94=20decided=20?= =?UTF-8?q?by=20CC=20unattended,=20operator=20may=20reverse)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mealie locks the ACCOUNT after 5 wrong logins and its login names (admin, changeme@example.com) are public, so a stranger could lock the household out for a day. Measured on 9202 with SECURITY_USER_LOCKOUT_TIME=1: the right password answered 423 for 120 min (the hourly job lifts it after the hour), then 200; a wrong one still 401. Evidence: felhom.eu/documentation/audits/rulings-2026-10-01/C/. CHANGELOG also records today's re-test run and fixes. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- CHANGELOG.md | 16 ++++++++++++++++ templates/mealie/docker-compose.yml | 5 +++++ 2 files changed, 21 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7eb6de..81674ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +## The first full monthly re-test (decision 55); the digest resolver, the outline fixture, the re-test's start (2026-10-01) + +- **The monthly re-test now covers every app with a proven ladder** (`09` §3 decisions 54, 55; R-743). First full run: + **nextcloud** `34.0.4-apache` `3b59dfb` and linuxserver **sonarr** `4.0.20` `1a37032` re-tested at the registry's new + digests on both venues (bench 9401 swap 0 with the 10-minute watch; 9202 through the guarded Update) and written as + re-test entries. ~17 min per app. Evidence `felhom.eu/documentation/audits/retest-2026-10/`. +- **`retest-floating.py` could not start on a fresh bench** `9e53205` (R-749): it asked for `/opt/upg/upgrade-test.py` + before the step that copies it there. It now asks for docker + python3, and for the file after the sync. +- **`image_digest.resolve` honours a `@digest`** `804884a` (R-746): it asks the registry for that manifest; a digest + the registry no longer serves is refused (it answered the tag's current digest). `scripts/test_image_digest.py`. +- **mealie: a stranger's wrong passwords lock the household out for 1-2 hours, not a day** (R-747; `09` §3 decision 57, + decided by CC unattended — operator may reverse): `SECURITY_USER_LOCKOUT_TIME=1`. mealie locks the ACCOUNT after 5 + wrong logins and its login names are public. Measured on 9202: 5 wrong → 423 for the right password too; open again + after 120 min (the hourly job); a wrong password still refused after. Other apps with the same shape: R-752. +- **outline's fixture reads Outline 1.10's `__Host-csrfToken`** `9fc7052` (R-744): proven on 9202 at 1.10.1. + ## Same-tag security fixes as tested steps (decision 52); wger's app login; wanderer on the bench (2026-09-30, late) - **Re-tests (`09` §3 decision 52, R-740)** `6a3ead9`: a ladder entry whose `from` equals its `to`, carrying `digest_from` diff --git a/templates/mealie/docker-compose.yml b/templates/mealie/docker-compose.yml index 27169fa..1303943 100644 --- a/templates/mealie/docker-compose.yml +++ b/templates/mealie/docker-compose.yml @@ -20,6 +20,11 @@ services: restart: unless-stopped environment: - ALLOW_SIGNUP=false + # R-747 (decided by CC unattended 2026-10-01, `09` §3 decision 57 — operator may reverse): mealie locks the ACCOUNT + # after 5 wrong logins for SECURITY_USER_LOCKOUT_TIME hours (default 24), and its login names (admin, + # changeme@example.com) are public — a stranger could lock the household out for a day. 1 hour (the unit's + # minimum) keeps the guard; mealie's hourly job lifts it, so a lock lasts 1-2 h (measured on 9202: 120 min). + - SECURITY_USER_LOCKOUT_TIME=1 - PUID=1000 - PGID=1000 - TZ=Europe/Budapest From 83636352ea10a1db9eab0acb361ca2f668616cbc Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 1 Oct 2026 10:21:00 +0200 Subject: [PATCH 42/46] REPORT: the first full monthly re-test, mealie's lockout, R-744/R-746/R-749 Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- REPORT.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/REPORT.md b/REPORT.md index fd2ad1a..418a0f9 100644 --- a/REPORT.md +++ b/REPORT.md @@ -1,9 +1,14 @@ -# REPORT — 2026-09-30 (late): same-tag security fixes become tested steps (decision 52) +# REPORT — the first full monthly re-test (decision 55); mealie's lockout; two harness fixes (2026-10-01) -Evidence: `felhom.eu/documentation/audits/night-rulings-2026-09-30/`. Operator report: `felhom.eu/REPORT-night-rulings-2026-09-30.md`. +Full session report: `felhom.eu/REPORT-rulings-2026-10-01.md`. -- `6a3ead9`: the re-test entry, its gates and decoys, `upgrade-test.py --retest`, `scripts/retest-floating.py` (the monthly - command), `retest_box.py`, `box_walk.py`, `BENCH_ENV_OVERRIDES`. Proven end to end on 9202. Run today: nothing on the - engine lines; two exact tags rebuilt upstream (R-743). -- `45d8482`: wger's JWT key pair (R-737). -- Runbook: `felhom.eu/documentation/runbooks/monthly-floating-retest.md`. +- **Re-test run** (`09` §3 decisions 54, 55): `retest-floating.py --push` over every app with a proven ladder. nextcloud + `34.0.4-apache` `3b59dfb` and linuxserver sonarr `4.0.20` `1a37032` — both DONE on both venues (bench 9401 swap 0 with the + 10-minute watch; 9202 through the guarded Update). ~17 min per app. Evidence `felhom.eu/documentation/audits/retest-2026-10/`. +- **R-749** `9e53205`: the re-test refused a fresh bench (checked `/opt/upg` before copying it). Fixed; the re-run started. +- **R-746** `804884a`: `image_digest.resolve` asks for a `@digest` by digest; `scripts/test_image_digest.py`; red: the old + resolver fails 3 of 4; live: an invented digest → HTTP 404 (was the tag's digest). +- **R-744** `9fc7052`: outline's fixture reads `__Host-csrfToken` (Outline 1.10 on HTTPS); proven on 9202 at 1.10.1. +- **R-747** `a4597cd` (decision 57, decided by CC unattended — operator may reverse): mealie `SECURITY_USER_LOCKOUT_TIME=1`; + 9202: locked 120 min after 5 wrong logins, then the right password works. +- Gates: `catalog_gates.py --fast` OK before each push; every push through the pre-push gates (no `--no-verify`). From 82fff329a4bb1d44e0e3a8219e9e4fb27f93f5ab Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 1 Oct 2026 12:46:58 +0200 Subject: [PATCH 43/46] =?UTF-8?q?wger:=20a=20stranger=20locks=20only=20the?= =?UTF-8?q?=20name=20they=20try,=20for=205=20min=20=E2=80=94=20not=20every?= =?UTF-8?q?=20household=20member=20for=2030=20(R-752,=2009=20decision=2058?= =?UTF-8?q?=20=E2=80=94=20decided=20by=20CC=20unattended,=20operator=20may?= =?UTF-8?q?=20reverse)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit django-axes keyed on ip_address, and behind the tunnel every visitor has the tunnel container's address (R-753). Measured on 9202 (felhom.eu/documentation/audits/lockouts-2026-10-01/B/): live template — 10 wrong tries on admin locked the second member too; with AXES_LOCKOUT_PARAMETERS=username, AXES_COOLOFF_TIME=5 and the database handler — the second member unaffected, admin in again at 7.5 min after one retry during the lock, a wrong password still refused. Settings only: no image moves, no ladder entry (gates OK). Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/wger/docker-compose.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/templates/wger/docker-compose.yml b/templates/wger/docker-compose.yml index 2bc88c0..e73cd9f 100644 --- a/templates/wger/docker-compose.yml +++ b/templates/wger/docker-compose.yml @@ -44,6 +44,14 @@ services: # R-738: the image runs `manage.py migrate` at start ONLY with this switch (entrypoint.sh). Without it an update # that brings migrations leaves wger serving its front page over an unmigrated database (login 500). - DJANGO_PERFORM_MIGRATIONS=True + # R-752 (decided by CC unattended 2026-10-01, `09` §3 decision 58 — operator may reverse): django-axes locked by + # ip_address, and behind the tunnel every visitor has the tunnel's address (R-753) — a stranger's 10 wrong tries + # locked out EVERY household member for 30 min. Now only the targeted name, for 5 min (each try during a lock + # restarts it — wger 2.7 hard-codes that — so short is kinder), counted in the database (the default cache + # handler warns axes.W001). Measured on 9202: the other member unaffected; the targeted one in again at 7.5 min. + - AXES_LOCKOUT_PARAMETERS=username + - AXES_COOLOFF_TIME=5 + - AXES_HANDLER=axes.handlers.database.AxesDatabaseHandler - DJANGO_DB_ENGINE=django.db.backends.sqlite3 - DJANGO_DB_DATABASE=/home/wger/db/database.sqlite - DJANGO_DB_USER=wger From ed6df4b46b93eea238d957df646ece517c863884 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 1 Oct 2026 12:49:39 +0200 Subject: [PATCH 44/46] CHANGELOG + REPORT: wger lockout fix, three apps measured (R-752) Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- CHANGELOG.md | 12 ++++++++++++ REPORT.md | 22 ++++++++++------------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81674ba..d9a74e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## Strangers cannot lock a whole household out of wger; three other apps measured (2026-10-01, afternoon) + +- **wger** `82fff32` (R-752; `09` §3 decision 58, decided by CC unattended — operator may reverse): + `AXES_LOCKOUT_PARAMETERS=username`, `AXES_COOLOFF_TIME=5`, `AXES_HANDLER=axes.handlers.database.AxesDatabaseHandler`. + Behind the tunnel every visitor has one address (R-753), so axes' default (by address) let a stranger's 10 wrong tries + lock out EVERY member for 30 min — measured on 9202. Now only the targeted name, 5 min (wger 2.7 restarts the lock on + every try during it — measured at 15 min: retries kept it closed 40+ min). Settings only — no ladder entry (gates OK). + An installed wger takes it at its next Restart/Start, Update or backup restart (measured: the env changed at Restart). +- **BookStack** (1.0 min) and **Grafana** (5.0 min): measured, unchanged (decisions 59, 60). **calibre-web**: its 40-a-day + lock per name measured (only a restart clears it); waits for the operator. Evidence + `felhom.eu/documentation/audits/lockouts-2026-10-01/`. + ## The first full monthly re-test (decision 55); the digest resolver, the outline fixture, the re-test's start (2026-10-01) - **The monthly re-test now covers every app with a proven ladder** (`09` §3 decisions 54, 55; R-743). First full run: diff --git a/REPORT.md b/REPORT.md index 418a0f9..ffe7794 100644 --- a/REPORT.md +++ b/REPORT.md @@ -1,14 +1,12 @@ -# REPORT — the first full monthly re-test (decision 55); mealie's lockout; two harness fixes (2026-10-01) +# REPORT — strangers and lockouts: wger fixed, three apps measured (2026-10-01, afternoon) -Full session report: `felhom.eu/REPORT-rulings-2026-10-01.md`. +Full session report: `felhom.eu/REPORT-lockouts-2026-10-01.md`. -- **Re-test run** (`09` §3 decisions 54, 55): `retest-floating.py --push` over every app with a proven ladder. nextcloud - `34.0.4-apache` `3b59dfb` and linuxserver sonarr `4.0.20` `1a37032` — both DONE on both venues (bench 9401 swap 0 with the - 10-minute watch; 9202 through the guarded Update). ~17 min per app. Evidence `felhom.eu/documentation/audits/retest-2026-10/`. -- **R-749** `9e53205`: the re-test refused a fresh bench (checked `/opt/upg` before copying it). Fixed; the re-run started. -- **R-746** `804884a`: `image_digest.resolve` asks for a `@digest` by digest; `scripts/test_image_digest.py`; red: the old - resolver fails 3 of 4; live: an invented digest → HTTP 404 (was the tag's digest). -- **R-744** `9fc7052`: outline's fixture reads `__Host-csrfToken` (Outline 1.10 on HTTPS); proven on 9202 at 1.10.1. -- **R-747** `a4597cd` (decision 57, decided by CC unattended — operator may reverse): mealie `SECURITY_USER_LOCKOUT_TIME=1`; - 9202: locked 120 min after 5 wrong logins, then the right password works. -- Gates: `catalog_gates.py --fast` OK before each push; every push through the pre-push gates (no `--no-verify`). +- **wger** `82fff32` (decision 58, decided by CC unattended — operator may reverse): axes by username, 5 min, database + handler. 9202: control — the second member locked by a stranger's 10 tries on `admin`; fixed — the second member fine, + admin in again at 7.5 min after one retry; a wrong password still refused. +- **BookStack, Grafana**: measured 1.0 and 5.0 min — unchanged (decisions 59, 60). +- **calibre-web-automated**: 40 wrong tries a day per name lock the form for the day (measured; a restart clears it) — + operator decision (a generated login name, or the limiter off). +- Found, not changed: wger runs `manage.py runserver` (no `WGER_USE_GUNICORN`) — R-755. +- Gates: `catalog_gates.py --fast wger` OK; pushed through the pre-push gates (no `--no-verify`). From e9f50b54968a4fe559a773fcab62b310d189f7b2 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 1 Oct 2026 13:19:02 +0200 Subject: [PATCH 45/46] calibre-web: the admin login name is generated at install (09 decision 61, R-752) after_install renames admin to the generated ADMIN_USER in app.db, sets the password with cps.py -s, and proves both before its success line. Proven on 9202: 40 wrong tries on admin, the household still in at once (form and OPDS). Hungarian freeze re-captured for the five changed calibre-web strings only. Evidence: felhom.eu/documentation/audits/calibre-name-and-prune-2026-10-01/A/ Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- CHANGELOG.md | 13 ++++++++++ FIRST-ADMIN.md | 2 +- scripts/copy_freeze/hu.json | 8 ++++--- templates/calibre-web/.felhom.yml | 40 +++++++++++++++++++++---------- 4 files changed, 47 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9a74e6..a00d703 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## calibre-web: the admin login name is generated at install (2026-10-01, late afternoon) + +- **`09` §3 decision 61** (operator ruling, R-752 option A): a new deploy field `ADMIN_USER` (`type: secret`, + `generate: "hex:5"` — ten lowercase letters/digits, shown on the app page behind „Megjelenítés", `locked_after_deploy`). + `after_install` (as `abc`) renames `admin` in `app.db` to it (Calibre-Web has no rename command — `cps/cli.py` offers + only `-s user:password`; its admin page renames by setting `user.name`, `admin.py:2789`, `ub.py:264`), sets the password + with Calibre-Web's own `cps.py -s`, and PROVES it (the new name's hash takes the password, no `admin` left) before the + success line. Both values are their own arguments. Copy (hu + en) updated; the Hungarian freeze re-captured for these + five strings only. Proven on 9202: name + password sign in (form and OPDS), `admin` refused, 40 wrong tries on `admin` + and the household still in at once; the install hold covered the window (0 of 31 stranger tries). The lock itself stays. + An installed calibre-web is NOT renamed by this (its template is frozen until an Update, and `after_install` runs only + after a fresh install): demo-hp's was renamed by hand. + ## Strangers cannot lock a whole household out of wger; three other apps measured (2026-10-01, afternoon) - **wger** `82fff32` (R-752; `09` §3 decision 58, decided by CC unattended — operator may reverse): diff --git a/FIRST-ADMIN.md b/FIRST-ADMIN.md index df80bb3..848bd69 100644 --- a/FIRST-ADMIN.md +++ b/FIRST-ADMIN.md @@ -38,7 +38,7 @@ asks the probe first where there is one. Open sign-up is closed by the box after | bentopdf | 5 | browser-only PDF tool, no accounts | – | fine | R | | **bookstack** | 3 | `admin@admin.com / password` | (b) `artisan bookstack:create-admin --initial` | **FIXED** — catalog, decision 45 | **M 9202**: default fails, generated works; **M demo-hp**: default still works on the installed app (unchanged, page warns) | | **calcom** | 4 | first visitor becomes admin (`/api/auth/setup`) | **setup gate**, opened by the household's press („Kész, beállítottam", confirm first); sign-up closed by the box after the setup: `/signup`, `/auth/signup`, `/api/auth/signup` | **GATED** — catalog, 2026-09-29 (decisions 46–47) | **M 9202**: stranger → gate page / 401; household reached the first-setup screen; gate opened after the setup; the app answered after (`felhom.eu/documentation/audits/gate-rollout-2026-09-29/`) | -| **calibre-web** | 3 | `admin / admin123` | (b) `cps.py -p /config/app.db -s admin:` as `abc`; `generate: password:24:special` (controller ≥ 0.280.0) | **FIXED** — catalog, 2026-09-29 | **M 9202**: fresh install — default refused, generated signs in (302), wrong refused; **M demo-hp**: the installed app's password changed by the operator's ruling (Part A) | +| **calibre-web** | 3 | `admin / admin123` | (b) as `abc`: rename `admin` in `app.db` to the generated `ADMIN_USER` (`secret`, `hex:5`), then `cps.py -p /config/app.db -s :`, then prove the hash and that no `admin` is left; `generate: password:24:special` (controller ≥ 0.280.0) | **FIXED** — catalog, 2026-09-29; **the name generated too** 2026-10-01 (`09` §3 decision 61, R-752: Calibre-Web locks a NAME for a day after 40 wrong tries) | **M 9202** (2026-10-01): fresh install — the generated name + password sign in (form and OPDS), `admin` refused, 40 wrong tries on `admin` and the household still in at once; **M demo-hp**: the installed app renamed by hand the same way, the name in the operator's credentials file | | **claper** | 3 (+ open sign-up) | seeds `admin@claper.co / claper` | (b) `bin/claper rpc … update_user_password` | **FIXED** — catalog, decision 45 | **M 9202**: default fails, generated works, a restore keeps it | | code-server | 1 | `PASSWORD` generated, applied every start | – | fine | R | | crafty-controller | 1 | `CRAFTY_PASSWORD` → default.json | – | fine | R | diff --git a/scripts/copy_freeze/hu.json b/scripts/copy_freeze/hu.json index 1bd0156..a1d9188 100644 --- a/scripts/copy_freeze/hu.json +++ b/scripts/copy_freeze/hu.json @@ -128,7 +128,7 @@ "calibre-web": { "app_info.default_creds": "admin / admin123", "app_info.first_steps[0]": "Nyisd meg a books.DOMAIN címet a böngészőben", - "app_info.first_steps[1]": "Jelentkezz be: admin és a Beállítások oldalon látható első jelszó", + "app_info.first_steps[1]": "Jelentkezz be a Beállítások oldalon látható felhasználónévvel és első jelszóval", "app_info.first_steps[2]": "Dobj egy könyvet a Fájlkezelőben (FileBrowser) az import/calibre mappába — automatikusan feldolgozza és a media/books könyvtárba helyezi", "app_info.prerequisites[0]": "Külső HDD szükséges az e-könyvek tárolásához", "app_info.prerequisites[1]": "x86 processzor szükséges (a CWA tartalmazza a Calibre binárist)", @@ -141,8 +141,10 @@ "app_info.use_cases[4]": "KOReader szinkronizáció (olvasási pozíció, könyvjelzők)", "data_paths[calibre].label": "Beolvasandó e-könyvek", "data_paths[media/books].label": "E-könyvtár", - "deploy_fields[ADMIN_PASSWORD].description": "Az első bejelentkezéshez: admin és ez a jelszó. Kell benne kis- és nagybetű, szám és egy különleges karakter.", - "deploy_fields[ADMIN_PASSWORD].label": "Admin jelszó (admin)", + "deploy_fields[ADMIN_PASSWORD].description": "Az első bejelentkezéshez: a fenti felhasználónév és ez a jelszó. Kell benne kis- és nagybetű, szám és egy különleges karakter.", + "deploy_fields[ADMIN_PASSWORD].label": "Admin jelszó", + "deploy_fields[ADMIN_USER].description": "Az első bejelentkezéshez ez a felhasználónév kell (nem az admin). A telepítéskor készül, csak te látod.", + "deploy_fields[ADMIN_USER].label": "Admin felhasználónév", "deploy_fields[DOMAIN].description": "A szerver domain neve", "deploy_fields[DOMAIN].label": "Domain", "deploy_fields[HDD_PATH].description": "A külső merevlemez elérési útja, ahol a Calibre könyvtár található", diff --git a/templates/calibre-web/.felhom.yml b/templates/calibre-web/.felhom.yml index e4a5e7d..94a6751 100644 --- a/templates/calibre-web/.felhom.yml +++ b/templates/calibre-web/.felhom.yml @@ -63,14 +63,24 @@ deploy_fields: description: "A külső merevlemez elérési útja, ahol a Calibre könyvtár található" locked_after_deploy: true + # `09` §3 decision 61 (R-752): Calibre-Web locks a login NAME for a day after 40 wrong tries (cps/web.py:2218), and + # its default name `admin` is public — a stranger could lock the household out. The box makes the name at install + # (lowercase letters and digits, so nobody mistypes a special character) and after_install renames `admin` to it. + - env_var: ADMIN_USER + label: "Admin felhasználónév" + type: secret + generate: "hex:5" + description: "Az első bejelentkezéshez ez a felhasználónév kell (nem az admin). A telepítéskor készül, csak te látod." + locked_after_deploy: true + # `09` §3 decision 45: Calibre-Web starts with admin / admin123. The box replaces that password with this # generated one right after the install (after_install below). Its password policy demands a special character, # hence `:special` (controller >= 0.280.0). - env_var: ADMIN_PASSWORD - label: "Admin jelszó (admin)" + label: "Admin jelszó" type: password generate: "password:24:special" - description: "Az első bejelentkezéshez: admin és ez a jelszó. Kell benne kis- és nagybetű, szám és egy különleges karakter." + description: "Az első bejelentkezéshez: a fenti felhasználónév és ez a jelszó. Kell benne kis- és nagybetű, szám és egy különleges karakter." locked_after_deploy: true # --- App info (info page content) --- @@ -88,7 +98,7 @@ app_info: first_steps: - 'Nyisd meg a books.DOMAIN címet a böngészőben' - - 'Jelentkezz be: admin és a Beállítások oldalon látható első jelszó' + - 'Jelentkezz be a Beállítások oldalon látható felhasználónévvel és első jelszóval' - 'Dobj egy könyvet a Fájlkezelőben (FileBrowser) az import/calibre mappába — automatikusan feldolgozza és a media/books könyvtárba helyezi' prerequisites: @@ -96,15 +106,18 @@ app_info: - 'x86 processzor szükséges (a CWA tartalmazza a Calibre binárist)' - 'Legalább 768 MB szabad RAM ajánlott' -# --- After a fresh install (controller >= 0.280.0, decision 45) --- -# Calibre-Web's OWN `cps.py -s user:password`, as the app user. Measured on 9202 2026-09-29: afterwards admin123 no -# longer signs in, the new one does; a password without a special character is refused by its policy. +# --- After a fresh install (controller >= 0.280.0; decisions 45, 61) --- +# Calibre-Web has no command that renames a user (cps/cli.py: only `-s user:password`); its admin page renames by setting +# the user table's `name` (admin.py:2789, ub.py:264 — unique). So, as the app user: rename `admin` in app.db to the +# generated name (skipped when already done — the box retries), then Calibre-Web's OWN `cps.py -s name:password` +# (its password policy applies), then PROVE it: the new name's stored hash takes the new password and no `admin` is +# left. Only then the success line. Both values are their own arguments (sys.argv), never pasted into the code. after_install: service: calibre-web user: abc - env: [ADMIN_PASSWORD] - command: ["python3", "/app/calibre-web-automated/cps.py", "-p", "/config/app.db", "-s", "admin:${ADMIN_PASSWORD}"] - success: "Password for user 'admin' changed" + env: [ADMIN_USER, ADMIN_PASSWORD] + command: ["python3", "-c", "import sqlite3, subprocess, sys\nfrom werkzeug.security import check_password_hash\nname, pw, db = sys.argv[1], sys.argv[2], '/config/app.db'\nc = sqlite3.connect(db)\nrow = c.execute(\"SELECT id FROM user WHERE lower(name) = 'admin'\").fetchone()\nif row:\n c.execute('UPDATE user SET name = ? WHERE id = ?', (name, row[0]))\n c.commit()\nc.close()\nr = subprocess.run(['python3', '/app/calibre-web-automated/cps.py', '-p', db, '-s', name + ':' + pw], capture_output=True, text=True)\nprint(r.stdout.strip()[-120:])\nc = sqlite3.connect(db)\nh = c.execute('SELECT password FROM user WHERE name = ?', (name,)).fetchone()\nleft = c.execute(\"SELECT count(*) FROM user WHERE lower(name) = 'admin'\").fetchone()[0]\nif h and check_password_hash(h[0], pw) and left == 0:\n print('FELHOM_AFTER_INSTALL_OK')\n", "${ADMIN_USER}", "${ADMIN_PASSWORD}"] + success: "FELHOM_AFTER_INSTALL_OK" # --- Controller-side health probe --- healthcheck: @@ -129,7 +142,7 @@ i18n: - 'KOReader sync (reading position, bookmarks)' first_steps: - 'Open books.DOMAIN in your browser' - - 'Sign in: admin and the first password shown on the settings page' + - 'Sign in with the user name and the first password shown on the settings page' - 'Drop a book into the import/calibre folder in the File manager (FileBrowser) - it is processed and filed under media/books on its own' prerequisites: - 'An external hard drive is needed to keep the e-books on' @@ -146,9 +159,12 @@ i18n: label: 'E-book library path' description: 'The path to the external hard drive where the Calibre library lives' placeholder: '/mnt/felhom-drives/hdd_1' + - env_var: ADMIN_USER + label: 'Admin user name' + description: 'You need this user name for the first sign-in (not admin). It is made at install, and only you see it.' - env_var: ADMIN_PASSWORD - label: 'Admin password (admin)' - description: 'For the first sign-in: admin and this password. It needs a lower and an upper case letter, a digit and a special character.' + label: 'Admin password' + description: 'For the first sign-in: the user name above and this password. It needs a lower and an upper case letter, a digit and a special character.' data_paths: - path: 'calibre' label: 'E-books to read in' From 9c5eae999980c67726a20b93e67f42d49764b3bf Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 1 Oct 2026 13:29:50 +0200 Subject: [PATCH 46/46] CHANGELOG + REPORT: calibre-web generated login name (decision 61); an installed app's template is not frozen (R-757) Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- CHANGELOG.md | 5 +++-- REPORT.md | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a00d703..66a4a03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,9 @@ success line. Both values are their own arguments. Copy (hu + en) updated; the Hungarian freeze re-captured for these five strings only. Proven on 9202: name + password sign in (form and OPDS), `admin` refused, 40 wrong tries on `admin` and the household still in at once; the install hold covered the window (0 of 31 stranger tries). The lock itself stays. - An installed calibre-web is NOT renamed by this (its template is frozen until an Update, and `after_install` runs only - after a fresh install): demo-hp's was renamed by hand. + An installed calibre-web is NOT renamed by this (`after_install` runs only after a fresh install), and — corrected + the same day — its template is NOT frozen: it syncs, and the box then INVENTS an `ADMIN_USER` for it (R-757). demo-hp's + app was renamed by hand to the box's recorded name. ## Strangers cannot lock a whole household out of wger; three other apps measured (2026-10-01, afternoon) diff --git a/REPORT.md b/REPORT.md index ffe7794..b466502 100644 --- a/REPORT.md +++ b/REPORT.md @@ -1,12 +1,12 @@ -# REPORT — strangers and lockouts: wger fixed, three apps measured (2026-10-01, afternoon) +# REPORT — calibre-web's admin login name is generated at install (2026-10-01, late afternoon) -Full session report: `felhom.eu/REPORT-lockouts-2026-10-01.md`. +Full session report: `felhom.eu/REPORT-calibre-name-and-prune-2026-10-01.md`. -- **wger** `82fff32` (decision 58, decided by CC unattended — operator may reverse): axes by username, 5 min, database - handler. 9202: control — the second member locked by a stranger's 10 tries on `admin`; fixed — the second member fine, - admin in again at 7.5 min after one retry; a wrong password still refused. -- **BookStack, Grafana**: measured 1.0 and 5.0 min — unchanged (decisions 59, 60). -- **calibre-web-automated**: 40 wrong tries a day per name lock the form for the day (measured; a restart clears it) — - operator decision (a generated login name, or the limiter off). -- Found, not changed: wger runs `manage.py runserver` (no `WGER_USE_GUNICORN`) — R-755. -- Gates: `catalog_gates.py --fast wger` OK; pushed through the pre-push gates (no `--no-verify`). +- **`09` §3 decision 61** (operator) — catalog `e9f50b5`: `ADMIN_USER` (`type: secret`, `generate: "hex:5"`); `after_install` + renames `admin` in `app.db` (Calibre-Web has no rename command), sets the password with its own `cps.py -s`, proves both. + hu + en copy; the Hungarian freeze re-captured for the five changed calibre-web strings only; FIRST-ADMIN updated. +- **9202:** a stranger got in 0 of 31 times during the install hold; 40 wrong tries on `admin` → the household in at once + with its own name (form and OPDS); `admin` refused. +- **demo-hp:** renamed by hand; the box then injected its own `ADMIN_USER` for the installed app (R-757) — renamed again to + that value; the name is in the operator's credentials file only. +- Gates: `catalog_gates.py --fast calibre-web` OK; pushed through the pre-push gates (no `--no-verify`).