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]>
This commit is contained in:
2026-10-14 20:39:05 +01:00
co-authored by Claude Opus 5.5
parent e788e16898
commit d28524e8c0
6 changed files with 74 additions and 8 deletions
+24
View File
@@ -77,6 +77,8 @@
# The job tracker's container name is fixed in docker-compose.yml, so
# it needs no variable (and no ENVSUBST_VARS entry).
set $upstream_jobs http://jobs:8080;
# Likewise the activity tracker's.
set $upstream_tracker http://activity-tracker:8080;
# ---- Backend API -----------------------------------------------------
# Two patterns repeat through every proxied location below:
@@ -363,6 +365,28 @@
proxy_set_header X-Forwarded-Proto $scheme;
}
# ---- Activity tracker (/tracker/) ----
# Its own container (the adamf/ccp repo): an ingest API for device
# collectors, which send batches of events with a per-device bearer
# key. The app does its own auth, so no auth_request. Unlike /jobs/
# the prefix IS stripped: the server serves /api/v1/... and /readyz
# from /. Collectors must use the www host: the apex 301 would turn
# their POSTs into GETs. Health Auto Export bodies can be several MB;
# the server-wide 50M client_max_body_size covers them.
location = /tracker {
return 301 /tracker/;
}
location ^~ /tracker/ {
limit_req zone=api burst=20 nodelay;
rewrite ^/tracker/(.*)$ /$1 break;
proxy_pass $upstream_tracker;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Where the tracker used to be. The SPA routes were client-side, so
# these only catch bookmarks and typed URLs. The userscript's old
# @updateURL lands on the third, which is how installed copies find