From 20db2220e053f0776cee5bded6c21c49dcd79278 Mon Sep 17 00:00:00 2001 From: Adam French Date: Wed, 16 Sep 2026 16:12:57 +0100 Subject: [PATCH] Add TODO-NEXT.md with outstanding work Co-Authored-By: Claude Opus 5 --- TODO-NEXT.md | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 TODO-NEXT.md diff --git a/TODO-NEXT.md b/TODO-NEXT.md new file mode 100644 index 0000000..aee0c51 --- /dev/null +++ b/TODO-NEXT.md @@ -0,0 +1,124 @@ +# Outstanding work + +Follow-on from the documentation + fix pass on branch `docs/readability-pass` +(commits `64df70e` docs, `25ac1cd` fixes). Everything below is **not done**. + +Verify with: `cd backend && go build ./... && go vet ./...`, +`cd vue && npx vite build` (NOT `npm run build` — needs wasm-pack, not +installed), `cd python && python3 -m py_compile app/*.py`, +`docker compose -f docker-compose.yml config -q`. + +--- + +## 1. Must do before the next production deploy + +### 1.1 Verify the TLS reload chain end to end +Renewal was changed from "not served until nginx restarts" to a sentinel + +watcher: `certbot/entrypoint.sh` passes `--deploy-hook` which touches +`/etc/letsencrypt/.nginx-reload`; `nginx/entrypoint.sh` polls for it, deletes +it, runs `nginx -t` and reloads. **This has never run against real certbot.** + +Test on the Pi before trusting it: +``` +docker compose exec certbot touch /etc/letsencrypt/.nginx-reload +docker compose logs -f nginx # expect a reload within CERT_WATCH_INTERVAL (60s) +docker compose exec nginx nginx -t +``` +A failed `nginx -t` deliberately skips the reload, leaving the old config +serving — check the logs actually say so rather than silently doing nothing. + +### 1.2 `TokenVersion` migration +GORM AutoMigrate adds the column with `DEFAULT 1`. Existing rows should land +on 1, and `tokenVersionOf` normalises 0 to 1, so old tokens keep working. +**Confirm on first boot** that existing sessions are not all logged out: +``` +docker compose exec db psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" \ + -c 'select id, username, token_version from users;' +``` +If any row is NULL rather than 1, set it: `update users set token_version = 1 +where token_version is null;` + +### 1.3 `ProcessedEmail` gains `attempts` and `received_at` +Same story — AutoMigrate adds them. `received_at` is zero for old rows, which +is handled (those rows just cannot rewind the fetch window). No action unless +the first sync after deploy behaves oddly; watch for +`[EmailSync] Rewinding window to ...` in the logs. + +### 1.4 Pin the autoheal digest +`docker-compose.yml` pins a tag, not a digest — a digest could not be verified +without network access. On the Pi: +``` +docker pull willfarrell/autoheal: +docker image inspect willfarrell/autoheal: --format '{{index .RepoDigests 0}}' +``` +then replace the tag with `image: willfarrell/autoheal@sha256:...`. + +--- + +## 2. Known bugs still open + +1. **`Timer.vue` has no Resume button.** `pauseTimer`'s un-pause branch is + unreachable from the UI — the Paused screen only offers Reset. Pre-existing; + fixing it means adding DOM, which was out of scope. +2. **`python`: `abandoned` uses `any` across a hotel's two TfL queries, not + `all`.** A hotel where one query was abandoned reports "not priced (time + limit)" even if the other genuinely had no route. Judgement call, commented + in place — flip to `all` if you'd rather bias the other way. +3. **Scraper fails silently.** Every upstream Travelodge field is read with a + tolerant `.get()`, so a schema change on their side degrades to "no hotels + available" — indistinguishable from genuine sold-out inventory. There is no + alerting signal. Consider logging a warning when a response parses but + yields zero priced rows. +4. **Room prices can be 30 minutes stale** (`TL_CACHE_TTL_S`) before a user + clicks through to book. TfL fares can be 2 hours stale + (`TFL_CACHE_TTL_S`). + +## 3. Security, still open + +1. **No rate limiting on the GraphQL mutation surface specifically.** The + `graphql` zone exists in prod only; dev has none. +2. **`/uploads/` filenames remain the only access control for *public* + attachments.** That is intended, but note an attachment posted to a public + message that is later deleted stays fetchable — deletion is soft and does + not unlink the file. A cleanup job for orphaned uploads would close this. +3. **Icecast source password grants stream takeover** and the harbor port is + published on the host. The admin UI is now gated, but the source port is + not — it cannot be without breaking liquidsoap. +4. **Rate-limit zones key on direct client IP.** If a CDN or proxy is ever put + in front, every request collapses into one bucket. Switch to + `$http_x_forwarded_for` (with `set_real_ip_from`) at that point. +5. **Gitea's `app.ini` holds live secrets** (JWT secrets, DB password, secret + key, internal token). Correctly gitignored and untracked — never `git add + -f` it. + +## 4. Refactors deliberately not attempted + +- **`nginx.conf.template`'s `:80` and `:443` blocks are still duplicated.** + Only the *dev* template was de-duplicated into + `nginx_dev_common.conf.template`. Doing the same for prod is the obvious + follow-up, but prod is the one that carries TLS and the auth gates, so it + wants doing carefully and testing properly. +- **`main.py`'s cache and `travelodge.py`'s two caches now share `TTLCache` + but keep three different eviction configurations.** They could plausibly + converge on one policy; nobody has established which is correct. +- **`Store` is a god object** — DB, auth, Spotify, Claude, Gitea, Steam + caches and now OAuth nonces. Splitting it per-domain would be a large but + mechanical change. +- **No test suite anywhere.** The highest-value first tests, in order: + `services/auth.go` token version logic, `travelodge.py`'s pure functions + (`round_5p`, `parse_guests`, `haversine_km`, `sort_rows`), and the NDJSON + event contract in `main.py`. + +## 5. Dead code awaiting a decision + +Documented with `STATUS:` headers, kept per instruction, tree-shaken out of +the build so it costs nothing at runtime. Delete when you're ready: +`views/home/Intro.vue`, `Gym.vue`, `BadApple.vue`, the seven unlisted CV +templates, `views/unused/Notes.vue`, `components/util/wasm/AutoScroll.vue`, +`MusicPlayer.vue`, `ObjectTable.vue`, `components/elle/Elle.vue`, +`components/borders/UtenaFrame.vue`, `stores/models.js`, +`js/mobile-automata.mjs`. + +Two traps: **`views/unused/CoverLetters.vue` is live** (the Cover Letter tab +on `/cv`, just misfiled — move it out of `unused/`), and `Home2.vue` is +reachable at `/stp2` but is a static mock unlinked from any UI.