From 0829994440ca3f87e0cb6101dcbc38af550a2bc7 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 28 Oct 2026 11:57:12 +0100 Subject: [PATCH] HTTP2Shell (CVE-2026-111497) lane batch 4: security-fix step adventurelog v0.13.1 (Node 26.12.1 read from the image; 9202 proven); health-check start_period 300 s (slow start after migrations) (felhom.eu R-1332) --- CHANGELOG.md | 14 ++ REPORT.md | 20 +- templates/adventurelog/.felhom.yml | 3 +- templates/adventurelog/docker-compose.yml | 14 +- .../steps/98453c3d7331b5a2.felhom.yml | 211 ++++++++++++++++++ .../adventurelog/steps/98453c3d7331b5a2.yml | 160 +++++++++++++ 6 files changed, 408 insertions(+), 14 deletions(-) create mode 100644 templates/adventurelog/steps/98453c3d7331b5a2.felhom.yml create mode 100644 templates/adventurelog/steps/98453c3d7331b5a2.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 512cbbd..87b9d72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## 2026-10-28 (day, attended) — HTTP2Shell lane batch 4: AdventureLog security-fix step v0.13.0 → v0.13.1, with a 300 s health-check start period (felhom.eu R-1332) + +Pushed on the operator's yes at the batch-4 STOP. +- **adventurelog v0.13.0 → v0.13.1** (backend + frontend; Node.js 26.3.0 → 26.12.1, read from the image): box walk + `--security` on 9202 `proven` — Update 231 s, the seeded superuser read back, soak 600 s peak 73.8 % anon (backend), + no kill, no restart. +- **Health-check `start_period` 30 s → 300 s on the backend; a `start_period: 300s`-only block on the frontend** (Docker + keeps the image's own test and takes this field — read back with `docker inspect` on 9202). Two earlier walks + FAILED on `unhealthy`: after an update the backend runs its migrations for ~2 min 45 s, so with 30 s Docker marked + both services unhealthy for about a minute every start (v0.13.0 on a fresh install too); the walk read the state in + that minute. Measured every 10 s (felhom.eu `audits/runtime-fixes-2026-10-28/walks/adventurelog/run3-…` and + `run4-…`): with 300 s the services go „starting" → „healthy", never „unhealthy". The step carries the change, so a + box on v0.13.0 (demo-hp) gets it with the update tonight. + ## 2026-10-28 (day, attended) — HTTP2Shell lane batch 3: Papra and Dawarich security-fix steps; the walk loads the drill into the box before the install (felhom.eu R-1332) Pushed on the operator's yes at the batch-3 STOP. Same method as batches 1 and 2 (runtime read from the image; box walk diff --git a/REPORT.md b/REPORT.md index bc76b3d..b5f4f7f 100644 --- a/REPORT.md +++ b/REPORT.md @@ -1,14 +1,16 @@ -# REPORT — 2026-10-28: HTTP2Shell lane batch 3 — Papra and Dawarich security-fix steps (CVE-2026-111497) +# REPORT — 2026-10-28: HTTP2Shell lane batch 4 — AdventureLog security-fix step v0.13.0 → v0.13.1 (CVE-2026-111497) -**What changed.** Two security-fix steps in the same main version: papra 26.7.1-rootless (Node.js 26.12.1) and -dawarich 1.19.0 (no Node.js in the image any more), read from the images. The box walk loads the drill into the box -before it installs. Pushed on the operator's yes. (Batch 1: `abf3db3`; batch 2: `71e3fdf`.) +**What changed.** AdventureLog v0.13.1 (backend + frontend, Node.js 26.12.1, read from the image) as a security-fix +step, and its health checks get 300 s to start instead of 30 s. Pushed on the operator's yes. demo-hp runs AdventureLog +and takes the step at night. (Batches 1–3 today: `abf3db3`, `71e3fdf`, `651a991`.) -**Proof.** Box walk `--security` on 9202: both `proven` — the guarded Update, healthy, TO on all four observables, no -undo, no hold, a clean 600 s soak, the seeded data read back (felhom.eu -`documentation/audits/runtime-fixes-2026-10-28/walks//`). The two tool fixes of the earlier batches are proven by -these walks (Papra's Origin header; Dawarich's two services moved together). No bench fixture exists for these apps. +**Proof.** Box walk `--security` on 9202, run 4: `proven` — the guarded Update in 231 s, healthy, TO on all four +observables, no undo, no hold, a clean 600 s soak (peak 73.8 % anon), the seeded superuser read back. Runs 1 and 3 +failed: Docker marked the slow-starting services unhealthy for about a minute and the walk read the state in it; a +10-second health record shows it, and shows the 300 s start period removes it (felhom.eu +`documentation/audits/runtime-fixes-2026-10-28/walks/adventurelog/`). Run 2 was inconclusive (the box's drill mirror +was stale; fixed in batch 3). -**Gates.** `catalog_gates.py --fast papra dawarich`: all OK. `test_box_walk_drill_move.py`: 6 OK. +**Gates.** `catalog_gates.py --fast adventurelog`: all OK. Findings go to felhom.eu `OPEN-ITEMS.md` (R-391). diff --git a/templates/adventurelog/.felhom.yml b/templates/adventurelog/.felhom.yml index d81a299..2fb1394 100644 --- a/templates/adventurelog/.felhom.yml +++ b/templates/adventurelog/.felhom.yml @@ -10,7 +10,7 @@ subdomain: "travel" slug: "adventurelog" # 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-27" +catalog_since: "2026-10-28" # --- Resource hints (displayed on deploy screen) --- resources: @@ -215,6 +215,7 @@ i18n: # gated by scripts/check-test-record.py. An image: move without a proven entry here is refused. update_ladder: - {"from": {"adventurelog": "ghcr.io/seanmorley15/adventurelog-backend:v0.12.1", "adventurelog-postgres": "postgis/postgis:16-3.5-alpine", "adventurelog-frontend": "ghcr.io/seanmorley15/adventurelog-frontend:v0.12.1"}, "to": {"adventurelog": "ghcr.io/seanmorley15/adventurelog-backend:v0.13.0", "adventurelog-postgres": "postgis/postgis:16-3.5-alpine", "adventurelog-frontend": "ghcr.io/seanmorley15/adventurelog-frontend:v0.13.0"}, "digest": {"adventurelog": "sha256:0250d9cb0d745a8d768f31d3cdc68ac14bfa8b43dedfe0f550158e3861c12db7", "adventurelog-frontend": "sha256:51ee22428b4192f4372b54f84c8b90cd710311ad99993c5045f53b51717dd3f7", "adventurelog-postgres": "sha256:47e961a569fd52ff31f0fe205ed91eeab17d9f5fff6722e6d7ea6b588748b293"}, "verdict": "proven", "tested_at": "2026-09-27T10:29:35Z", "harness_version": 4, "evidence": "felhom.eu/documentation/audits/version-travel-2026-09-26/C/apps/adventurelog/bench/evidence/MV-adventurelog/verdict.json", "box_evidence": "felhom.eu/documentation/audits/version-travel-2026-09-26/C/apps/adventurelog/box/box-verdict-adventurelog.json", "memory_peak_pct": 73.0, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "memory_basis": "anon", "memory_cgroup_peak_pct": 100.0} + - {"from": {"adventurelog": "ghcr.io/seanmorley15/adventurelog-backend:v0.13.0", "adventurelog-postgres": "postgis/postgis:16-3.5-alpine", "adventurelog-frontend": "ghcr.io/seanmorley15/adventurelog-frontend:v0.13.0"}, "to": {"adventurelog": "ghcr.io/seanmorley15/adventurelog-backend:v0.13.1", "adventurelog-postgres": "postgis/postgis:16-3.5-alpine", "adventurelog-frontend": "ghcr.io/seanmorley15/adventurelog-frontend:v0.13.1"}, "digest": {"adventurelog": "sha256:8c45e21f95875ccd35a6e68f7da72504df9e837d6ee703379512cb8de6a67082", "adventurelog-frontend": "sha256:568b1be1c42f456df066a8bb55be8ce0046b2c6fc96b1650db5d2162eb4f1ce9", "adventurelog-postgres": "sha256:47e961a569fd52ff31f0fe205ed91eeab17d9f5fff6722e6d7ea6b588748b293"}, "verdict": "security_fix", "tested_at": "2026-10-28T10:40:49Z", "harness_version": null, "evidence": null, "box_evidence": "documentation/audits/runtime-fixes-2026-10-28/walks/adventurelog/run4-proven-start-period-300", "memory_peak_pct": 73.8, "marks": {"files_may_change": false, "needs_person": null, "memory_tight": false}, "security": {"ids": ["CVE-2026-111497"], "advisory": "https://nvd.nist.gov/vuln/detail/CVE-2026-111497", "fixed_in": "v0.13.1"}, "seed": "read_back", "memory_basis": "box_soak"} # --- Security watch (felhom.eu R-1303): where each image's security notices are published --- # One line per image in docker-compose.yml; the grammar is in NEW-APP-CHECKLIST.md (1.10). diff --git a/templates/adventurelog/docker-compose.yml b/templates/adventurelog/docker-compose.yml index 229470e..96941af 100644 --- a/templates/adventurelog/docker-compose.yml +++ b/templates/adventurelog/docker-compose.yml @@ -10,7 +10,7 @@ services: adventurelog: - image: ghcr.io/seanmorley15/adventurelog-backend:v0.13.0 + image: ghcr.io/seanmorley15/adventurelog-backend:v0.13.1 container_name: adventurelog restart: unless-stopped depends_on: @@ -87,7 +87,9 @@ services: interval: 30s timeout: 10s retries: 3 - start_period: 30s + # 300 s, not 30 s: after an update the backend runs its migrations and needs ~2 min 45 s before /api/ answers; + # with 30 s Docker marked it unhealthy for a minute every start (9202, 2026-10-28, v0.13.0 and v0.13.1 alike) + start_period: 300s adventurelog-postgres: image: postgis/postgis:16-3.5-alpine container_name: adventurelog-postgres @@ -113,7 +115,7 @@ services: start_period: 20s adventurelog-frontend: - image: ghcr.io/seanmorley15/adventurelog-frontend:v0.13.0 + image: ghcr.io/seanmorley15/adventurelog-frontend:v0.13.1 container_name: adventurelog-frontend restart: unless-stopped environment: @@ -139,7 +141,11 @@ services: resources: limits: memory: 256M - # No healthcheck override (R-655): v0.12.1's image has none and keeps node at /nodejs/bin/node only; + healthcheck: + # start_period ONLY: Docker keeps the image's own test (/health, which needs the backend) and takes this field + # from here. The frontend waits for the backend's ~3 min after an update (9202, 2026-10-28). + start_period: 300s + # No test override (R-655): v0.12.1's image has none and keeps node at /nodejs/bin/node only; # v0.13.0's image brings its own (`node` on the PATH, /usr/bin/node, fetching /health, which needs the # backend). No single exec path works on both versions (measured 2026-09-27), and the old override # (/nodejs/bin/node) left v0.13.0 unhealthy forever. diff --git a/templates/adventurelog/steps/98453c3d7331b5a2.felhom.yml b/templates/adventurelog/steps/98453c3d7331b5a2.felhom.yml new file mode 100644 index 0000000..3dc85b7 --- /dev/null +++ b/templates/adventurelog/steps/98453c3d7331b5a2.felhom.yml @@ -0,0 +1,211 @@ +# ============================================================================= +# .felhom.yml - App metadata for felhom-controller +# ============================================================================= + +# --- Display info (shown on dashboard) --- +display_name: "AdventureLog" +description: "Utazási napló és kalandtervező" +category: "travel" +subdomain: "travel" +slug: "adventurelog" +# 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-27" + +# --- Resource hints (displayed on deploy screen) --- +resources: + mem_request: "400M" + mem_limit: "896M" # the sum of the compose limits (384+256+256) — R-758; was "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: "travel" + 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 + # Data-encrypting key: the app secures stored data with it, so it must NOT be regenerated on + # restore (that would render restored data unreadable). The recovery unit stays secret-free; at + # restore the controller recovers this key from the guest's own app.yaml (live, or via the PBS + # whole-guest snapshot) and FAILS CLOSED (refuse + warn) if it cannot — never silently restores. + data_key: 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 +# Decision 47: the app's own sign-up address is closed once the gate opens (measured on 9202 2026-09-29: a stranger's sign-up succeeded after the setup; case-insensitive and slash-tolerant because termix's router ignores case (measured 2026-09-29)). +signup_block: "PathRegexp(`(?i)^/+(signup/*$|auth/+browser/+v1/+auth/+signup|_allauth/+browser/+v1/+auth/+signup|accounts/+signup)`)" +# The app's OWN sign-up switch, set once the gate opens (measured on 9202 2026-09-29: with it on a stranger's +# sign-up is refused even straight at the app; it also refuses the household's own first account, so it goes on AFTER the setup). The compose default stays open, so an installed app is +# unchanged by the catalog. +after_setup: + env: + SIGNUP_CLOSED: "true" + +# --- App info (info page content) --- +app_info: + tagline: "Utazási napló - utazások dokumentálása térképpel és fotókkal" + add_people: "Nyisd meg a regisztrációt 15 percre, és a családtagod a saját címével regisztrál." + docs_url: "https://adventurelog.app/docs/" + + use_cases: + - 'Utazások dokumentálása képekkel és jegyzetekkel' + - 'Térképes megjelenítés a meglátogatott helyekről' + - 'Úti tervek készítése és szervezése' + - 'Statisztikák - meglátogatott országok, városok' + - 'Kalandok megosztása családdal és barátokkal' + + first_steps: + - 'Nyisd meg a travel.DOMAIN címet a böngészőben' + - 'Hozd létre a fiókodat' + - 'Add hozzá az első utazásodat' + - 'Jelöld meg a meglátogatott helyeket a térképen' + guide: + checked_version: "v0.13.0" + sections: + - title: "Egy utazás megtervezése" + intro: "Egy dátumos gyűjtemény teljes útitervvé válik: helyek, szállás és közlekedés egy helyen." + steps: + - "A felső sávban nyisd meg a „Gyűjtemények” oldalt." + - "Kattints a jobb alsó sarokban a plusz gombra, és válaszd a „Gyűjtemény” pontot." + - "Add meg a „Név”, a „Kezdés dátuma” és a „Befejezés dátuma” mezőt, majd kattints a „Mentés” gombra." + - "Nyisd meg a gyűjteményt, és az „Új hozzáadása...” menüben vegyél fel helyet, „Szállás”, „Közlekedés” vagy „Ellenőrzőlista” tételt, például egy csomaglistát." + - "A gyűjtemény kártyájának menüjében a „PDF letöltése” ponttal nyomtatható, napokra bontott útitervet kapsz." + - title: "Fotók és látogatás egy helyhez" + intro: "Egy helyhez képeket és látogatásokat adhatsz, így lesz belőle emlék." + steps: + - "A hely kártyájának menüjében válaszd a „Hely szerkesztése” pontot." + - "A „Média” lépésben kattints a „Feltöltés eszközről” lehetőségre, és válaszd ki a fotókat." + - "A „Látogatások” lépésben add meg, mikor jártál ott, és írj hozzá jegyzetet." + - "Kattints a „Látogatás hozzáadása” gombra, majd a „Kész” gombra." + - title: "Meglátogatott országok és régiók" + intro: "A világtérképen látod, hol jártál már, és mennyi van még hátra." + steps: + - "A felső sávban nyisd meg a „Világutazás” oldalt." + - "Keresd meg az országot, és kattints a kártyájára." + - "A régiók listájában kattints a pipára („Megjelölés látogatottként”) mindenhol, ahol jártál." + - "Az ország kártyája mutatja, hány régióját láttad már." + - title: "Utazás megosztása a családdal" + intro: "Egy gyűjteményt megoszthatsz a család egy másik tagjával, így közösen tervezhettek." + steps: + - "A családtag a saját fiókjában nyissa meg a „Beállítások” oldalt, kapcsolja be a „Nyilvános profil” kapcsolót, és kattintson a „Frissítés” gombra." + - "Te a gyűjtemény kártyájának menüjében válaszd a „Megosztás” pontot." + - "Az „Elérhető felhasználók” listában kattints a családtag mellett a „Meghívás küldése” gombra." + - "A családtag a „Gyűjtemények” oldal „Meghívók” lapján kattint az „Elfogadás” gombra." + faq: + - q: "Hogyan kap fiókot a családtagom?" + a: "Idegen nem regisztrálhat: a doboz ezt lezárta. A vezérlőpulton nyisd meg a regisztrációt 15 percre, és a családtagod a saját címével regisztrál." + - q: "Látják mások a helyeimet?" + a: "Nem: egy új hely vagy gyűjtemény privát. Ha a gyűjteménynél bekapcsolod a „Nyilvános gyűjtemény” kapcsolót, a link birtokában bárki megnézheti." + - q: "Mi a különbség a tervezett és a látogatott hely között?" + a: "Ha egy helynek nincs látogatása, vagy csak jövőbeli, akkor tervezett. Amint van múltbeli dátumú látogatása, látogatottnak számít." + - q: "Át tudom állítani a nyelvet?" + a: "Igen. Az AdventureLog a böngésződ nyelvét követi, de a felső sáv menüjében a „Nyelv” pontnál másikat is választhatsz." + - q: "Hová kerülnek a feltöltött fotók?" + a: "A dobozra, az AdventureLog saját tárhelyére. A doboz mentéseit a vezérlőpulton, az „Adatok és mentés” fülön látod." + + +# --- Controller-side health probe --- +healthcheck: + checks: + - type: api + port: 8000 + path: "/api/" + 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: 'Travel journal and trip planner' + app_info: + tagline: 'Travel journal - keep your trips with a map and photos' + add_people: "Open sign-up for 15 minutes, and your family member signs up with their own address." + use_cases: + - 'Keep your trips with pictures and notes' + - 'See everywhere you have been on a map' + - 'Plan and organise trips before you go' + - 'Statistics - the countries and cities you have visited' + - 'Share your adventures with family and friends' + first_steps: + - 'Open travel.DOMAIN in your browser' + - 'Create your account' + - 'Add your first trip' + - 'Mark the places you have been on the map' + guide: + sections: + - title: "Plan a trip" + intro: "A collection with dates becomes a full itinerary: places, lodging and transport in one place." + steps: + - "In the top bar, open the „Collections” page." + - "Select the plus button in the bottom right corner and choose „Collection”." + - "Fill in „Name”, „Start Date” and „End Date”, then select „Save”." + - "Open the collection, and in the „Add New...” menu add a place, „Lodging”, „Transportation” or a „Checklist”, for example a packing list." + - "In the menu of the collection's card, „Download PDF” gives you a printable itinerary, day by day." + - title: "Photos and a visit for a place" + intro: "You can add pictures and visits to a place, so it becomes a memory." + steps: + - "In the menu of the place's card, choose „Edit Location”." + - "In the „Media” step, select „Upload From Device” and choose the photos." + - "In the „Visits” step, give the dates you were there and add a note." + - "Select „Add Visit”, then „Done”." + - title: "Countries and regions you visited" + intro: "The world map shows where you have been and how much is still left." + steps: + - "In the top bar, open the „World Travel” page." + - "Find the country and select its card." + - "In the list of regions, select the tick („Mark Visited”) everywhere you have been." + - "The country's card shows how many of its regions you have seen." + - title: "Share a trip with the family" + intro: "You can share a collection with another family member, so you plan it together." + steps: + - "In their own account, the family member opens the „Settings” page, turns on „Public Profile” and selects „Update”." + - "In the menu of the collection's card, you choose „Share”." + - "In the „Available Users” list, select „Send Invite” next to the family member." + - "The family member selects „Accept” on the „Invites” tab of the „Collections” page." + faq: + - q: "How does a family member get an account?" + a: "Strangers cannot sign up: the box closed that. On the dashboard, open sign-up for 15 minutes, and your family member signs up with their own address." + - q: "Can others see my places?" + a: "No: a new place or collection is private. If you turn on „Public Collection” for a collection, anyone with the link can view it." + - q: "What is the difference between a planned and a visited place?" + a: "A place with no visit, or only a future one, is planned. As soon as it has a visit with a past date, it counts as visited." + - q: "Can I change the language?" + a: "Yes. AdventureLog follows your browser's language, but you can choose another one under „Language” in the menu of the top bar." + - q: "Where do the uploaded photos go?" + a: "Onto the box, into AdventureLog's own storage. You see the box's backups on the dashboard, on the „Data and backup” tab." + 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' diff --git a/templates/adventurelog/steps/98453c3d7331b5a2.yml b/templates/adventurelog/steps/98453c3d7331b5a2.yml new file mode 100644 index 0000000..51080af --- /dev/null +++ b/templates/adventurelog/steps/98453c3d7331b5a2.yml @@ -0,0 +1,160 @@ +# AdventureLog - Utazási napló és kalandtervező +# Domain: ${SUBDOMAIN}.${DOMAIN} +# Database: postgres +# RAM: ~100M (mem_limit: 384M) | Pi-compatible: Yes +# +# Environment variables: +# DOMAIN - Your domain (e.g., demo-felhom.eu) +# SECRET_KEY - Titkosítási kulcs (auto-generated) +# DB_PASSWORD - Adatbázis jelszó (auto-generated) + +services: + adventurelog: + image: ghcr.io/seanmorley15/adventurelog-backend:v0.13.0 + container_name: adventurelog + restart: unless-stopped + depends_on: + adventurelog-postgres: + condition: service_healthy + environment: + # decision 47: the app's own sign-up switch — open until the box closes it after the first admin (after_setup) + - DISABLE_REGISTRATION=${SIGNUP_CLOSED:-false} + - DJANGO_SECRET_KEY=${SECRET_KEY} + - SECRET_KEY=${SECRET_KEY} + # R-482: the image defaults DEBUG to True (settings: getenv('DEBUG','True')), which serves full + # Django debug pages — settings, paths, tracebacks — on the internet-facing origin. Measured + # 2026-09-13 on demo-hp. Upstream's own compose sets it False; so do we. + - DEBUG=False + - PGHOST=adventurelog-postgres + - PGDATABASE=adventurelog + - PGUSER=adventurelog + - PGPASSWORD=${DB_PASSWORD} + - PUBLIC_URL=https://${SUBDOMAIN}.${DOMAIN} + - CSRF_TRUSTED_ORIGINS=https://${SUBDOMAIN}.${DOMAIN} + - FRONTEND_URL=https://${SUBDOMAIN}.${DOMAIN} + # `09` §3 decision 41 (R-655): the world-data download stays. v0.13.0 runs `download-countries` at EVERY + # start and fetches only when the file is ABSENT — a cut-off file from an interrupted download (v0.12.1 + # ignored such failures) makes every start fail with `IncompleteJSONError`. Before the image's own + # entrypoint, a file that does not parse to its end is SET ASIDE (renamed, never deleted), so the + # command downloads it again. The same entrypoint and command as the image's (both versions, measured). + entrypoint: + - /bin/bash + - -c + - | + for f in /code/media/countries+regions+states-*.json; do + [ -s "$$f" ] || continue + if ! python3 -c 'import ijson,sys; [0 for _ in ijson.items(open(sys.argv[1],"rb"),"item")]' "$$f" 2>/dev/null; then + mv "$$f" "$$f.cutoff-$$(date +%Y%m%d%H%M%S)" + echo "felhom: $$f did not parse to its end - set aside, it is downloaded again" >&2 + fi + done + exec /code/entrypoint.sh "$$@" + - -- + command: ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] + volumes: + - adventurelog_media:/code/media + networks: + - traefik-public + - adventurelog-internal + # R-483: the backend serves the uploaded photos (/media), Django's static files, the admin and the + # account pages ITSELF; the frontend does not proxy them. With every path routed to the frontend an + # uploaded photo rendered as a broken "Uploaded content" (measured 2026-09-13 on demo-hp; the + # operator's k3s install routes exactly these four prefixes to the backend and renders photos). + # Higher priority than the frontend router, same host. + labels: + - "traefik.enable=true" + - "traefik.http.routers.adventurelog-backend.rule=Host(`${SUBDOMAIN}.${DOMAIN}`) && (PathPrefix(`/media`) || PathPrefix(`/static`) || PathPrefix(`/admin`) || PathPrefix(`/accounts`))" + # R-753: this app reads the LEFTMOST X-Forwarded-For entry, which a stranger writes once traefik keeps the + # tunnel's chain — so its chain is removed here (it then reads traefik's X-Real-Ip or peer; never forgeable). + - "traefik.http.middlewares.adventurelog-backend-xff.headers.customrequestheaders.X-Forwarded-For=" + - "traefik.http.routers.adventurelog-backend.middlewares=adventurelog-backend-xff" + - "traefik.http.routers.adventurelog-backend.priority=20" + - "traefik.http.routers.adventurelog-backend.entrypoints=websecure" + - "traefik.http.routers.adventurelog-backend.tls=true" + - "traefik.http.routers.adventurelog-backend.tls.certresolver=letsencrypt" + - "traefik.http.routers.adventurelog-backend.service=adventurelog-backend" + # Port 80, not 8000: the backend image runs nginx in front of gunicorn, and Django answers a + # /media request with an X-Accel-Redirect that ONLY that nginx can serve — straight to gunicorn + # (8000) the photo comes back as a 200 with an empty body (measured 2026-09-13). The k3s + # service targets port 80 for the same reason. + - "traefik.http.services.adventurelog-backend.loadbalancer.server.port=80" + deploy: + resources: + limits: + memory: 384M + healthcheck: + test: ["CMD-SHELL", "python -c 'import urllib.request; urllib.request.urlopen(\"http://127.0.0.1:8000/api/\")'"] + interval: 30s + timeout: 10s + retries: 3 + # 300 s, not 30 s: after an update the backend runs its migrations and needs ~2 min 45 s before /api/ answers; + # with 30 s Docker marked it unhealthy for a minute every start (9202, 2026-10-28, v0.13.0 and v0.13.1 alike) + start_period: 300s + adventurelog-postgres: + image: postgis/postgis:16-3.5-alpine + container_name: adventurelog-postgres + restart: unless-stopped + environment: + - POSTGRES_USER=adventurelog + - POSTGRES_PASSWORD=${DB_PASSWORD} + - POSTGRES_DB=adventurelog + - TZ=Europe/Budapest + volumes: + - adventurelog_postgres_data:/var/lib/postgresql/data + networks: + - adventurelog-internal + deploy: + resources: + limits: + memory: 256M + healthcheck: + test: ["CMD-SHELL", "pg_isready -U adventurelog -d adventurelog"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 20s + + adventurelog-frontend: + image: ghcr.io/seanmorley15/adventurelog-frontend:v0.13.0 + container_name: adventurelog-frontend + restart: unless-stopped + environment: + - PUBLIC_SERVER_URL=http://adventurelog:8000 + - BODY_SIZE_LIMIT=Infinity + - ORIGIN=https://${SUBDOMAIN}.${DOMAIN} + networks: + - traefik-public + - adventurelog-internal + labels: + - "traefik.enable=true" + - "traefik.http.routers.adventurelog.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)" + # R-753: this app reads the LEFTMOST X-Forwarded-For entry, which a stranger writes once traefik keeps the + # tunnel's chain — so its chain is removed here (it then reads traefik's X-Real-Ip or peer; never forgeable). + - "traefik.http.middlewares.adventurelog-xff.headers.customrequestheaders.X-Forwarded-For=" + - "traefik.http.routers.adventurelog.middlewares=adventurelog-xff" + - "traefik.http.routers.adventurelog.priority=10" + - "traefik.http.routers.adventurelog.entrypoints=websecure" + - "traefik.http.routers.adventurelog.tls=true" + - "traefik.http.routers.adventurelog.tls.certresolver=letsencrypt" + - "traefik.http.services.adventurelog.loadbalancer.server.port=3000" + deploy: + resources: + limits: + memory: 256M + healthcheck: + # start_period ONLY: Docker keeps the image's own test (/health, which needs the backend) and takes this field + # from here. The frontend waits for the backend's ~3 min after an update (9202, 2026-10-28). + start_period: 300s + # No test override (R-655): v0.12.1's image has none and keeps node at /nodejs/bin/node only; + # v0.13.0's image brings its own (`node` on the PATH, /usr/bin/node, fetching /health, which needs the + # backend). No single exec path works on both versions (measured 2026-09-27), and the old override + # (/nodejs/bin/node) left v0.13.0 unhealthy forever. + +volumes: + adventurelog_media: + adventurelog_postgres_data: + +networks: + traefik-public: + external: true + adventurelog-internal: