Commit Graph
99 Commits
Author SHA1 Message Date
adamfandClaude Opus 5.5 263e16b70d usaco: let running jobs finish on stop, add a Claude budget
Test and deploy / test (push) Successful in 1m20s
Test and deploy / deploy (push) Successful in 1m12s
The site now waits up to 5 minutes on SIGTERM for running Claude jobs, so
stop_grace_period must be longer than Docker's 10s default.
USACO_CLAUDE_MONTHLY_BUDGET caps its estimated monthly Claude spend.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 22:10:08 +01:00
adamfandClaude Opus 5.5 fce6821f84 Add the usaco site's code runner
Test and deploy / test (push) Successful in 1m13s
Test and deploy / deploy (push) Successful in 18s
usaco-runner compiles, runs and lints solutions for the usaco site's
solve page. It runs submitted code, so it gets no environment, sits
only on usaco-runner-net (internal: no internet, and only the site can
reach it), and runs read-only apart from an exec-able /tmp tmpfs, with
memory, CPU and pids limits, no capabilities and no-new-privileges.
The site joins that network and finds it through RUNNER_URL.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 11:25:47 +01:00
adamfandClaude Opus 5.5 582b190698 Give the usaco site an OpenAI key and a private audio bucket for reviews
Test and deploy / test (push) Successful in 1m7s
Test and deploy / deploy (push) Successful in 56s
The site's new recording reviews transcribe the admin's audio with
OpenAI (USACO_OPENAI_API_KEY) and, when USACO_S3_* is set, keep the
recordings in Garage's private usaco-audio bucket for playback. The
public uploads bucket is never used. The endpoint, region and bucket
are derived from the key, so a blank key leaves all five S3_* blank:
the site refuses to start with only some of them set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 01:57:05 +01:00
adamfandClaude Opus 5.5 0e48befbc7 Give the usaco site the Claude key for its Explain button
Test and deploy / test (push) Successful in 1m4s
Test and deploy / deploy (push) Has been cancelled
The usaco site now has an admin Explain button that asks Claude for a
diagrammed explanation of a problem. Pass it CLAUDE_API_KEY, and its own
model setting, USACO_CLAUDE_MODEL (blank is claude-opus-5-5), so the
rowing reader's CLAUDE_MODEL is unaffected. Without the key the button
is off and the rest of the site works.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 20:38:05 +01:00
adamfandClaude Opus 5.5 66db14d0c5 Keep nginx serving through a stalled worker, and gate Gitea's crawler targets
Test and deploy / deploy (push) Successful in 37s
Test and deploy / test (push) Successful in 1m13s
On 2026-10-19 nginx's only worker stalled for 4.6 hours. The master kept
the container "Up" and the tunnel stayed connected, so nothing noticed,
while every request timed out in the TLS handshake.

- worker_processes auto in the production and dev configs, so one stuck
  worker no longer takes the whole site down.
- A /nginx-health endpoint on :80 in all three configs, answered by nginx
  and unlogged, and a compose healthcheck on it.
- autoheal is back (retired 2026-10-01), pinned by digest, with no network,
  restarting only containers labelled autoheal=true: just nginx.
- Gitea's commit-pinned views, archives and compare pages go through the
  site admin gate. A swarm of 103k IPs made 129k requests to them in two
  days, 89% in those shapes; the branch views stay public for the CV links.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 19:15:38 +01:00
adamfandClaude Opus 5.5 65fddfcfa2 Give uploads one path end to end, and serve /uploads/ from Garage first
Test and deploy / deploy (push) Successful in 3m48s
Test and deploy / test (push) Successful in 37s
Frontend: src/uploads.js is the one way to store or show a file
(uploadFile, ACCEPT, kindOf, isUploadUrl, tagFor, mediaSize). Chat,
the box editor, canvas drops and the background editor all use it;
views/home3/upload.js and the chat store's own axios call are gone.

Backend: POST /api/uploads (was /messages/upload) is a thin wrapper over
services.Uploads.Save, which owns validation, naming and storage. The
three per-extension maps are now one UploadTypes table, and a refused
file is an *UploadError whose message is safe to show.

nginx now fetches /uploads/ from Garage first and falls back to the
volume on a 404 or any 5xx, so the bucket is the source of truth and
deleting a file in garage-webui unpublishes it, while a Garage outage
still only affects bucket-only files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 21:04:37 +01:00
adamfandClaude Opus 5.5 422cde4708 Store public uploads in a Garage S3 bucket, with garage-webui at /garage/
Test and deploy / test (push) Successful in 50s
Test and deploy / deploy (push) Successful in 1m10s
Opt-in and built so Garage can never take the site down:
- the backend writes to the bucket only once S3_ENDPOINT is set, and
  falls back to the uploads volume (with a log line) if a write fails;
- nginx serves /uploads/ from the volume first and Garage's anonymous
  website endpoint second, so every existing URL keeps working and nginx
  boots with no garage container;
- nothing depends_on garage and no variable is required, so a missing
  secret cannot fail a deploy.

Private attachments stay on disk, since nginx cannot gate a bucket.
garage/bootstrap.sh sets up the layout, bucket, key and website access;
the runbook is "Garage" in DEPLOYMENT.md.

Also lifts the body limit on the internal auth subrequest, which 413'd
large uploads to gated locations, and reserves the garage and dozzle
page slugs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 20:42:09 +01:00
adamfandClaude Opus 5.5 0ac3321c41 Gate /jobs/ and /tracker/ behind the nginx admin auth_request, like /sb/
Test and deploy / test (push) Successful in 27s
Test and deploy / deploy (push) Successful in 15s
The bearer-token routes a session cookie never reaches stay public at
nginx and are guarded by the apps: /jobs/api/capture and the job-capture
userscript, /tracker/api/v1/ and tracker.user.js.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 18:57:18 +01:00
adamfandClaude Opus 5.5 529e80242f Set Gitea's SSH_DOMAIN and DOMAIN from GITEA_SSH_DOMAIN in .env
Test and deploy / test (push) Successful in 30s
Test and deploy / deploy (push) Successful in 34s
Moving hosts meant hand-editing the live app.ini, which the template
cannot reach once it exists. Gitea's environment-to-ini now writes the
value on every start, so a move is a one-line .env change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 17:54:03 +01:00
adamfandClaude Opus 5.5 f5ab1e81be Drop references to the removed sync-secrets.sh
Test and deploy / deploy (push) Successful in 1m33s
Test and deploy / test (push) Successful in 2m56s
The script no longer exists; .env is edited by hand on the host.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 17:48:56 +01:00
adamfandClaude Opus 5.5 58880a4e07 Log request bodies at nginx and view logs in Dozzle
Test and deploy / deploy (push) Has been cancelled
Test and deploy / test (push) Has been cancelled
nginx writes one JSON line per request, body included, to
logs/nginx/payloads.log (nginx/payload_log.conf). Bodies mentioning a
password, token or secret are logged as [redacted]. A `traffic` container
tails the file so it shows up as its own stream in Dozzle, which is served
at /dozzle/ behind the admin auth_request.

Dozzle replaces the admin panel's Diagnostics tab, so that tab and the
/admin/logs endpoint behind it are removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 15:46:26 +01:00
adamfandClaude Opus 5.5 604ac32028 Remove the admin panel's Environment tab and env-apply
Test and deploy / test (push) Successful in 2m2s
Test and deploy / deploy (push) Successful in 1m35s
.env is edited by hand again. Drops the /admin/env endpoints, EnvManager
and its registry, the host-side apply.py watcher and its install script,
the backend's env-apply bind mount, and the Environment tab.

The deploy and maintenance workflows still serialise docker compose, now
on .compose.lock in the checkout instead of env-apply/run/lock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 15:29:55 +01:00
adamfandClaude Opus 5.5 6d5420fab2 Point the tunnel at the site's own name instead of No TLS Verify
Test and deploy / test (push) Successful in 1m45s
Test and deploy / deploy (push) Successful in 22s
nginx now carries DOMAIN and www.DOMAIN as aliases on app-network, so
cloudflared's origin can be https://www.DOMAIN: it resolves to nginx over
the bridge and the Let's Encrypt certificate verifies, with no TLS
overrides in the Cloudflare dashboard.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 14:17:59 +01:00
adamfandClaude Opus 5.5 602aa522d6 Serve the site through a Cloudflare tunnel
Test and deploy / test (push) Successful in 2m9s
Test and deploy / deploy (push) Successful in 1m45s
A cloudflared container dials out to Cloudflare and forwards the site's
hostnames to nginx on :443, so the router's 80/443 forwards can close.
nginx takes the visitor's address from CF-Connecting-IP, trusted only from
cloudflared's fixed IP, so rate limits stay per visitor.

certbot can now validate over DNS-01 through the Cloudflare API when
CLOUDFLARE_DNS_API_TOKEN is set, so renewal needs no inbound port; without
it, it falls back to the webroot as before. DEPLOYMENT.md covers setup and
what stays off the tunnel: registry traffic on the Pi (pin the apex to
127.0.0.1 to dodge the 100 MB body cap), Gitea SSH and the radio harbor
(Tailscale).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 14:03:10 +01:00
adamfandClaude Opus 5.5 c5a722bd1e Add the usaco service and its /usaco/ route
Test and deploy / test (push) Successful in 2m14s
Test and deploy / deploy (push) Successful in 1m36s
The USACO practice log from the usaco repo's site/: one container, git
as its store (a clone in ./usaco-data), behind nginx with the prefix
kept, like /jobs/. Gitea may now deliver webhooks to it by name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 21:49:48 +01:00
adamfandClaude Opus 5.5 1b5c8fc4a9 Document the activity tracker's admin-gated pages
Test and deploy / test (push) Successful in 1m39s
Test and deploy / deploy (push) Successful in 26s
The tracker now gates its dashboard and new setup page on the site's
admin session, as jobs does. Pass it AUTH_VALIDATE_URL built from
BACKEND_HOST/PORT so it follows the backend if that is renamed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 21:27:02 +01:00
adamfandClaude Opus 5.5 d28524e8c0 Run the activity tracker as its own published image at /tracker/
Test and deploy / test (push) Successful in 2m0s
Test and deploy / deploy (push) Successful in 1m29s
Same shape as jobs: adam-french.co.uk/adamf/activity-tracker, published by
the adamf/ccp repo's CI, with an explicit environment list and its own
database role. nginx strips the /tracker prefix. The env test now covers
the new service's allow-list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 20:39:05 +01:00
adamfandClaude Opus 5.5 99fe175ebf Delete the old job code now that the tracker runs on its own
Test and deploy / test (push) Successful in 1m9s
Test and deploy / deploy (push) Successful in 1m33s
The job tracker has run from its own image at /jobs/ since 931b02c, so its
old copy here goes: the GraphQL schema, resolvers and models for
applications, references, sources, leads and the search profile; the
capture and email handlers and services; the Python posting reader, lead
scorer and email classifier; the Vue pages, stores and the capture-token
card on the Environment tab; and the userscript (nginx already redirects
its old URL to /jobs/).

The six old tables stay in the stp database: AutoMigrate never drops
anything, and dropping them is a manual step. The env variables stay in
the registry, where they already belong to the jobs service.

Docs (CLAUDE.md, DEPLOYMENT.md and the three READMEs) now describe the
site without the tracker, and DEPLOYMENT.md lists the jobs service and
./jobs-data.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 17:35:18 +01:00
adamfandClaude Opus 5.5 931b02c9e4 Run the job tracker as its own container at /jobs/
Test and deploy / test (push) Successful in 2m3s
Test and deploy / deploy (push) Successful in 1m31s
The tracker (applications, leads, email pipeline, capture userscript) now
lives in the adamf/job-tracker repo and runs here from its published image.

- docker-compose.yml: a `jobs` service with an explicit environment list
  (its own database role; none of the site's other secrets), ./jobs-data
  mounted at /data, and nginx waiting for it. The dev override seeds it.
- nginx: /jobs/ proxied to it with the prefix kept, and 301s from
  /cv/jobs, /cv/leads and the old userscript URL.
- env_registry.json and .env.example: the email and job-lead variables now
  belong to the jobs service; CLAUDE_* to python and jobs; new
  POSTGRES_JOBS_* and JOBS_IMAGE_TAG. The compose environment test now
  checks the jobs service's list as well as python's.
- backend: no longer starts the email and job-lead schedulers or serves
  the capture and email routes, since the tracker reads the same settings
  and would otherwise process everything twice. The old job code stays
  until the tracker has run for a while.
- vue: the CV page's Jobs button goes to /jobs/; the old routes are gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 17:08:18 +01:00
adamfandClaude Opus 5.5 3764ea9c0b Default to Sonnet 5.5 and make the Claude model an admin setting
Every Claude call used a hard-coded claude-haiku-4-5. The model is now
CLAUDE_MODEL, read by the Python service, defaulting to
claude-sonnet-5-5 and offered on the admin panel's Environment tab as a
choice of Haiku 4.5, Sonnet 5.5 and Opus 5.5.

The request is shaped per model. Sonnet and Opus think by default and
bill that against max_tokens, so they get low effort and 4,000 tokens of
headroom over each caller's reply ceiling; Haiku 4.5 rejects the effort
setting and keeps the plain request. A refusal is logged and reported as
the route's failed message instead of surfacing as an empty reply.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 15:52:33 +01:00
adamfandClaude Opus 5.5 810d3118b3 Document make check, schema-level auth and the Python Claude routes
Test and deploy / test (push) Successful in 5m12s
Test and deploy / deploy (push) Successful in 2m1s
Bring CLAUDE.md, README.md and DEPLOYMENT.md in line with the CI gate,
the GraphQL directives, the shared nginx routes partial and the move of
every Claude call to the Python service. CLAUDE.md also said there was
no token revocation; logout and password changes bump TokenVersion.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 14:39:19 +01:00
adamfandClaude Opus 5.5 2786bce022 Manage .env from the admin panel
Add an Environment tab to /admin that lists every variable in .env.example
and lets keys, OAuth settings, email settings and generated secrets be
changed without SSH. Secrets are write-only; infrastructure variables are
shown read-only.

The backend never writes .env or touches Docker. It validates an edit and
queues it in env-apply/run/request.json; env-apply/apply.py, run on the host
by a systemd path unit (env-apply/install.sh), rewrites .env atomically,
keeps .env.bak, and recreates only the services that read the change.

backend/services/env_registry.json is the single list of variables, shared
by the backend and the host script; a test keeps it in step with
.env.example. It replaces the drifted checklist in handle_admin.go. The job
capture token card moves to the new tab.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 14:02:28 +01:00
adamfandClaude Opus 5.5 b8670246a8 Add browser job capture to the job tracker
Deploy with Docker Compose / deploy (push) Successful in 1m31s
A Violentmonkey userscript, served by the site and installed from /cv/jobs,
adds the posting open in the browser (LinkedIn, an ATS, any company page) to
the tracker. Claude reads the title, company and location off the page text.

- Three token-guarded REST routes under /api/jobs/capture (status, extract,
  upsert). They take a bearer token, JOB_CAPTURE_TOKEN, because the auth
  cookies are SameSite=Lax and never sent from another origin. An unset token
  switches the routes off.
- The upsert matches on a canonical posting URL, then (company, job title),
  so a capture and the email pipeline do not make two rows for one job.
- The Claude call is a new internal Python route, /internal/jobs/extract,
  alongside the rowing reader; the client and fence stripping they share move
  to python/app/claude.py.
- New "saved" status ranked below "applied", and a description column holding
  the posting text, shown per row on the tracker.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 13:33:28 +01:00
adamfandClaude Opus 5.5 f8d48ba9af Move the rowing photo Claude call to the Python service
POST /rowing in the Go backend no longer calls the Anthropic SDK. It keeps
the admin gate, EXIF date, duplicate check, sanity bounds and insert, and
sends the image to a new internal Python route, POST /internal/rowing/read,
which makes the Claude call and returns the three numbers it read.

The route spends a paid call and has no auth of its own, so nginx 404s
/py/internal/ and the route refuses anything carrying the proxy headers
nginx adds. The python container now receives CLAUDE_API_KEY.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 11:46:17 +01:00
adamfandClaude Opus 5.5 8d7606bbe8 Retire quartz, hasura and autoheal into .deprecated/
Deploy with Docker Compose / deploy (push) Successful in 1m1s
Quartz was already replaced by silverbullet-public; its build context moves
to .deprecated/quartz. Hasura and autoheal are removed from the stack, with
their compose services (and Hasura's nginx blocks) kept verbatim under
.deprecated/ alongside a README on how to bring each back.

Removes the /hasura/ route from both nginx templates and the envsubst
allow-list, and updates the docs and comments that referred to the three
services. With autoheal gone nothing restarts an unhealthy container; the
healthchecks are now informational only, and the docs say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-01 14:58:17 +01:00
adamfandClaude Opus 5.5 7ce86f08ec Replace Quartz with a read-only SilverBullet for public /notes/
/notes/ is now served by silverbullet-public: the same SilverBullet 2.11.0
image as the /sb/ editor, run with SB_READ_ONLY over a read-only mount of
the vault. Quartz is retired (quartz/ kept with a STATUS header).

Keeping private/ off the public site needs nginx, not just SilverBullet:
SB_SPACE_IGNORE only filters the file listing. Verified with curl that
2.11.0 still serves ignored paths via /.fs/<path>, via server-rendered page
URLs, and exposes the vault's .git through /.fs/.git/. nginx now 404s any
private/ or templates/ segment at any depth and any nested dot-folder under
/notes/. SB_REVISIONS=disabled stops /.revisions serving git history, and
nginx blocks it as a second layer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-30 20:37:10 +01:00
adamfandClaude Opus 5 fea22871cf Stop hiding private/ and templates/ from the notes editor
Deploy with Docker Compose / deploy (push) Successful in 9s
SB_SPACE_IGNORE was set to quartz's ignorePatterns, which was the wrong thing
to copy. The two settings answer different questions: quartz hides private/
because it must never be published, whereas SilverBullet is the editor, behind
the admin gate, and hiding notes from it only stops them being edited.

Now ignores .obsidian alone, which is editor config and plugin JS rather than
notes. Quartz keeps its own ignorePatterns, so /notes/ publishes exactly what
it did before; these files were already tracked in the notes repo, so nothing
becomes newly reachable.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BCQFvkvorAw1xwhd5gL2qZ
2026-09-22 13:44:48 +01:00
adamfandClaude Opus 5 85ab27d241 Fix silverbullet-git push failing with "No user exists for uid 1000"
Deploy with Docker Compose / deploy (push) Successful in 28s
The sidecar runs as uid 1000 so its commits match the vault's ownership on
the host, but alpine/git has no passwd entry for that uid. ssh resolves the
calling uid before it does anything else and aborts when it cannot, so every
push failed at "No user exists for uid 1000" without reaching the deploy key.

Mount a minimal passwd file that defines the uid. SilverBullet's own entrypoint
creates the user at boot for the same reason; this container has no entrypoint
of its own, so the entry is supplied as a file.

Verified on the Pi: with the mount, ssh authenticates as the silverbullet-git
deploy key; without it, the uid error reproduces.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BCQFvkvorAw1xwhd5gL2qZ
2026-09-21 15:37:27 +01:00
adamfandClaude Opus 5 fdf76f75e9 Add SilverBullet as a web editor for the Obsidian vault
Deploy with Docker Compose / deploy (push) Successful in 2m17s
Quartz renders the vault but has no write path, so editing a note meant
editing files on the Pi or pushing through git. SilverBullet serves the same
vault as an editable PWA at /sb/, behind the same nginx admin gate /notes/
uses. Quartz stays as the read view; its --serve watcher picks up SilverBullet's
writes, so /notes/ follows within seconds.

The vault is now the `notes` repo rather than `obsidian_vault`, and the
silverbullet-git sidecar commits and pushes what the editor writes while
pulling what Obsidian pushes from elsewhere. The vault's own deploy workflow
has been removed in that repo: it pulled from the old remote and restarted
quartz, and a second git process in the same clone would race the sidecar.

Notes on the configuration:

- Single-space mode, auto-detected because the mounted folder is not empty.
  SilverBullet writes no database or metadata into the vault, so the folder
  stays plain markdown that quartz and Obsidian still understand.
- /sb/ is the one proxied app whose prefix is NOT stripped. SB_URL_PREFIX=/sb
  tells the PWA its own base path and its service-worker scope is built from
  that; stripping the prefix serves a blank page with nothing in the log.
- SB_SPACE_IGNORE mirrors quartz's ignorePatterns and must be newline
  separated. A comma separated list is accepted silently and does nothing.
- No SB_USER is set, so the container is open to anything reaching it on
  app-network. The nginx auth_request gate is the only protection.
- The sidecar runs as uid 1000 to match the vault's ownership, and is a
  separate container rather than SilverBullet's own shell backend, which would
  hand anyone past the nginx gate command execution inside the container.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BCQFvkvorAw1xwhd5gL2qZ
2026-09-21 15:33:28 +01:00
adamfandClaude Opus 5 25ac1cde1c Fix security issues, bugs, and convoluted code across the stack
Security:
- Token revocation. User gains a TokenVersion counter embedded in both
  tokens as a "tv" claim; AuthenticateToken rejects a token whose version
  no longer matches the row. Logout bumps it, so logging out now kills
  outstanding tokens rather than only clearing cookies. Costs one
  primary-key SELECT per authenticated request, which is the price of
  having revocation at all.
- Spotify OAuth CSRF. The fixed SPOTIFY_AUTH_STATE constant is replaced by
  a per-request one-shot nonce, verified and consumed on callback.
- Private chat attachments. Attachments on private messages are written to
  /backend/uploads/private/ and served at /uploads/private/, gated by the
  same nginx auth_request admin check used for /hasura/ and /notes/.
  Private uploads are rejected from non-admin callers.
- The icecast admin UI (/radio/admin/) is behind the admin gate; listener
  traffic is untouched.
- Store caches are mutex-guarded, so -race is clean.

Bugs:
- The email pipeline no longer drops emails permanently on transient
  failure. Failures record an attempt counter and are retried up to 3
  times; the fetch window rewinds to the oldest retryable email's
  ReceivedAt, without which a retry could never re-fetch it.
- Rowing duplicate detection distinguishes ErrRecordNotFound from a real
  DB error, so a transient failure no longer causes a duplicate insert
  plus a paid Claude call.
- DeletePost propagates its delete error instead of reporting success.
- RecentlyPlayed populates the cache it reads.
- main.go exits non-zero if r.Run fails, so a port conflict is visible.
- Python: the scan truncation flag is set on every deadline path;
  timed_out is reported by the worker rather than inferred from the clock;
  date validation uses Europe/London rather than server-local time.
- Vue: Time.vue and Radio.vue intervals are cleared on unmount; Feed.vue
  guards a missing author; Timer.vue gets an explicit state machine and
  compares total elapsed seconds; Elle.vue's comma-operator call and
  per-frame console.log are fixed.

Simplification:
- One TTLCache replaces three near-identical cache implementations, with
  the differing eviction rules as explicit parameters.
- run_scan's transport index no longer uses one object as both ordering
  record and live output; its three phases are separate functions.
- _price_hotels submits all work to a single pool, so the nested-executor
  deadlock hazard is gone by construction.
- The NDJSON event generators share one implementation.
- IMAP FETCH responses pair each line with its literal in the type, so
  callers no longer hand-skip alternate entries.
- Shared helpers for slice-of-pointers, markdown fences and auth cookies.
- Vue: useHotelSearch, createMirrorStore, useRotation, useCreateForm,
  useLinkAttrs, ListWidget and LinkTableItems replace duplicated blocks.
- nginx dev config's duplicated :80/:443 bodies share one partial.

Infra: certbot passes --deploy-hook touching a sentinel that nginx's
watcher reloads on, so renewed certs are served without a restart, and the
watcher also removes the manual restart after first issuance. db is gated
on service_healthy, autoheal is pinned, and the unused envsubst entries
are dropped.

Verified: go build/vet, npx vite build, py_compile, docker compose config
for both overlays, bash -n on all scripts, and an envsubst render of every
nginx template (no leftover placeholders, runtime vars preserved, braces
balanced).

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-16 16:12:21 +01:00
adamfandClaude Opus 5 64df70e5d2 Document codebase: comments, per-area READMEs, deployment guide
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]>
2026-09-16 15:57:48 +01:00
adamfandClaude Fable 5.1 152f60ee32 Add Python FastAPI service, cheap hotels page, and Tailwind theme refactor
Deploy with Docker Compose / deploy (push) Successful in 1m29s
- Replace searxng and open-webui with a FastAPI `python/` service proxied
  at /py/ (Travelodge hotel search, rate-limited in nginx)
- Add CheapHotels view and CreateToggle component
- Move design tokens into Tailwind @theme in styles.css and migrate
  components/views to utility classes; CVLayout re-points tokens for light theme
- Update README, CLAUDE.md, and .gitignore accordingly

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dphx7LL5JC8dAFYU7MMpoA
2026-09-08 00:06:04 +01:00
adamfandClaude Opus 4.7 aa6de883be Move Open-WebUI to chat.${DOMAIN} subdomain
Deploy with Docker Compose / deploy (push) Successful in 34s
Open-WebUI's SvelteKit frontend hardcodes asset/API paths at build time,
so subpath hosting under /openwebui/ produced 404s on /_app/... assets.
Move it to its own subdomain so it can run at root.

- certbot: request cert with chat.${DOMAIN} as a third SAN via --expand
- nginx (prod): drop /openwebui blocks; add chat.${DOMAIN} HTTP redirect
  + HTTPS server with the existing admin auth gate
- nginx (dev): drop /openwebui blocks (no chat.localhost in dev)
- compose: WEBUI_URL points to https://chat.${DOMAIN}

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-04-30 17:29:29 +01:00
adamfandClaude Opus 4.7 26a35719eb Add Open-WebUI service behind /openwebui/ admin gate
Deploy with Docker Compose / deploy (push) Successful in 13m13s
Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-04-30 15:51:27 +01:00
adamf 3844a32751 Big formatting spree
Deploy with Docker Compose / deploy (push) Successful in 3m50s
2026-04-29 09:06:41 +01:00
adamfandClaude Sonnet 4.6 2b5745b946 Move scroll animations to Rust/WASM, enable Hasura, and move bookmarks to home sidebar
Deploy with Docker Compose / deploy (push) Successful in 12m7s
Port AutoScroll and Headline scroll logic from Vue/JS to Rust compiled
to WASM via wasm-pack. Add multi-stage Docker build for WASM compilation,
Vite WASM plugins, and top-level await for WASM init. Enable Hasura
service in docker-compose. Move bookmarks from a separate route to an
inline sidebar component on the home page. Fix ToggleHeader click
propagation.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-14 16:34:24 +01:00
adamfandClaude Sonnet 4.6 cc6a423ef0 Add backend healthcheck and autoheal for automatic restart
Deploy with Docker Compose / deploy (push) Successful in 19s
Adds a Docker healthcheck to the backend service (polling GET / every 30s)
and the willfarrell/autoheal container to automatically restart any unhealthy containers.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-14 10:59:48 +01:00
adamfandClaude Opus 4.6 d344497393 Gate searxng, notes, and hasura behind admin auth via nginx auth_request
Deploy with Docker Compose / deploy (push) Has been cancelled
Add ValidateAdmin endpoint that checks JWT admin claim for use as an
nginx auth_request subrequest. Widen cookie path from backend endpoint
to "/" so the access_token is sent on all paths. Extend access token
lifetime from 24h to 7 days. Disable hasura service by default via
Docker profile.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-12 21:33:41 +01:00
adamfandClaude Opus 4.6 ee97ec9b23 Pin app-network subnet to match trusted proxy CIDR
Deploy with Docker Compose / deploy (push) Successful in 38s
Gin's trusted proxies list is hardcoded to 172.28.0.0/16, but Docker was
assigning the bridge network whatever subnet was free, so c.ClientIP()
often returned nginx's container IP instead of the real client.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-11 00:43:29 +01:00
adamfandClaude Opus 4.6 7afd1be81b Add Gitea entrypoint to generate app.ini from template on startup
Deploy with Docker Compose / deploy (push) Successful in 6s
Since app.ini is gitignored, the container needs to create it at
runtime. The entrypoint copies the template on first start, then
Gitea's env var overrides handle secrets.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-07 14:40:38 +01:00
adamfandClaude Opus 4.6 4edc5b1b22 Remove uptime-kuma and wallabag services, fix searxng base URL
Deploy with Docker Compose / deploy (push) Failing after 1s
Remove unused uptime-kuma and wallabag services from docker-compose,
nginx configs, and vite proxy. Use BASE_URL env var in searxng
settings template instead of hardcoded URL.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-07 13:37:24 +01:00
adamfandClaude Opus 4.6 d04496ad11 Remove gitea-runner service and related files
Deploy with Docker Compose / deploy (push) Waiting to run
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-07 13:14:17 +01:00
adamfandClaude Opus 4.6 74f606459f Build gitea-runner with docker CLI installed natively
Deploy with Docker Compose / deploy (push) Waiting to run
Mounting host docker binary failed due to glibc/musl incompatibility.
Instead, extend the act_runner image and install docker-cli and
docker-cli-compose via apk.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-07 13:02:06 +01:00
adamfandClaude Opus 4.6 ce1a1ee757 Mount docker CLI and compose plugin into gitea-runner
Deploy with Docker Compose / deploy (push) Failing after 0s
The act_runner container had the Docker socket but not the docker
binary, so deploy workflow steps using docker compose failed.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-07 13:00:50 +01:00
adamf a967a249c2 Add base url to new containers
Deploy with Docker Compose / deploy (push) Failing after 0s
2026-04-07 12:57:16 +01:00
adamfandClaude Sonnet 4.6 8a6e34dd69 Fix gitea-runner compatibility for deploy workflow
Deploy with Docker Compose / deploy (push) Failing after 1s
Mount the deploy directory at the same absolute path in the runner
container so docker compose bind mounts resolve correctly on the host
Docker daemon. Add git safe.directory config to avoid ownership errors
when the runner (root) operates on host-owned files.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-07 12:45:52 +01:00
adamfandClaude Sonnet 4.6 108f58e527 Add UptimeKuma, Searxng, Wallabag services
CI/CD / Deploy (push) Has been cancelled
CI/CD / Build Frontend (push) Has been cancelled
CI/CD / Build & Test Backend (push) Has been cancelled
Deploy with Docker Compose / deploy (push) Has been cancelled
- Add uptime-kuma, searxng, and wallabag Docker services with Postgres integration for wallabag
- Add nginx reverse proxy location blocks for /uptime-kuma/, /searxng/, /wallabag/ in both prod and dev templates
- Update entrypoint.sh envsubst to include new HOST/PORT vars
- Add Vite dev proxy entries for all three services
- Update gitea-runner config: add self-hosted label and allow all volumes
- Add Gitea CI/CD workflow

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-07 12:14:56 +01:00
adamf 01adee7941 Revert quartz changes
Deploy with Docker Compose / deploy (push) Successful in 9s
2026-04-06 13:58:57 +01:00
adamf fa79fe9cdb Fix path
Deploy with Docker Compose / deploy (push) Successful in 9s
2026-04-06 13:46:36 +01:00
adamfandClaude Sonnet 4.6 b6623de23a Add Quartz service for serving Obsidian notes at /notes/
Deploy with Docker Compose / deploy (push) Successful in 2m28s
Replaces the custom Go/Vue notes system with Quartz v4, a polished
static site generator for Obsidian vaults. Mounts OBSIDIAN_DIR as the
Quartz content directory and serves it at /notes/ with hot-reload via
`npx quartz build --serve`.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-06 13:27:10 +01:00