- auth: panic at init if BACKEND_SECRET missing/short — HS256 would happily
start with an empty key, making admin tokens forgeable by anyone
- websocket: admin check now goes through AuthenticateTokenWithClaims so the
"tv" token-version revocation applies on /ws too; a logged-out or
password-changed token no longer keeps it alive for its full lifetime
- admin diagnostics: check BACKEND_SECRET not the nonexistent AUTH_SECRET
- rowing upload: 10MB cap before buffering + base64 (admin-only route, but
unbounded read = easy memory exhaustion + huge paid Claude call)
- nginx: shared security_headers.conf (XFO/nosniff/Referrer-Policy/HSTS/CSP)
included in every location that sets its own add_header — nginx drops the
parent's whole set otherwise; CSP added to the SPA document;
ssl_protocols pinned to TLSv1.2/1.3; HSTS on apex redirect
- compose: Gitea HTTP bound to 127.0.0.1 (plain HTTP was LAN-exposed);
autoheal docker socket mount read-only
Co-Authored-By: Claude Code <[email protected]>
Readability pass across all four areas of the stack. Comments explain why
rather than what, concentrated at the points where behaviour is non-obvious:
concurrency, caching, auth, scraping and nginx templating.
Backend: doc comments on every exported declaration across handlers,
services, models and resolvers. Resolver commentary lives inside function
bodies so gqlgen does not strip it on regeneration; schema files use #
comments rather than description blocks so introspection output is
unchanged. Extracted the duplicated auth-cookie blocks into helpers.
Frontend: header comments on every component, store and view, including
STATUS: notes marking which of the parallel/legacy views are still live.
Documented the non-reactive animation-state pattern, the homeData hub and
the WebSocket stale-socket guard. Removed a few dead imports and named the
reconnect-backoff and poll-interval constants.
Python: module and function docstrings covering the Travelodge scraping
contract, the deadline threading, the two-executor concurrency and the
NDJSON streaming protocol.
Infra: header blocks on every compose file, nginx template, Dockerfile and
entrypoint, covering the config selection, envsubst allow-lists, rate-limit
semantics and volume persistence. Hoisted the duplicated envsubst variable
list in nginx/entrypoint.sh.
New: backend/README.md, python/README.md, DEPLOYMENT.md, .env.example,
backend/graph/doc.go. Refreshed vue/README.md. Corrected CLAUDE.md, which
stated a 24h access token where main.go sets 7 days.
No behaviour change. go build/vet, vite build, py_compile and docker
compose config all pass.
Co-Authored-By: Claude Opus 5 <[email protected]>
Admins can flag a chat message as private so only other admin
connections receive it, and can delete any message. Admin status is
read from the auth cookies on the WebSocket upgrade request.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
The CheckOrigin function only accepted the production domain, rejecting
localhost connections in dev. Also removed redundant error response after
a failed upgrade since the upgrader already writes its own HTTP response.
Co-Authored-By: Claude Opus 4.6 <[email protected]>