Run the job tracker as its own container at /jobs/
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]>
This commit is contained in:
@@ -74,6 +74,9 @@
|
||||
set $upstream_silverbullet http://$SILVERBULLET_HOST:$SILVERBULLET_PORT;
|
||||
set $upstream_silverbullet_public http://$SILVERBULLET_PUBLIC_HOST:$SILVERBULLET_PUBLIC_PORT;
|
||||
set $upstream_python http://$PYTHON_HOST:$PYTHON_PORT;
|
||||
# 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;
|
||||
|
||||
# ---- Backend API -----------------------------------------------------
|
||||
# Two patterns repeat through every proxied location below:
|
||||
@@ -337,6 +340,43 @@
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# ---- Job tracker (/jobs/) ----
|
||||
# Its own container (the adamf/job-tracker repo), which serves its SPA
|
||||
# and its API from the same prefix. The prefix is NOT stripped: the
|
||||
# app is built to live at /jobs/. There is no auth_request here: the
|
||||
# SPA's files are public, and every API route that is not checks the
|
||||
# session itself, by asking the backend's validate-admin with the
|
||||
# visitor's cookies. ^~ so no regex location can claim a /jobs/ path.
|
||||
location = /jobs {
|
||||
return 301 /jobs/;
|
||||
}
|
||||
|
||||
location ^~ /jobs/ {
|
||||
limit_req zone=api burst=20 nodelay;
|
||||
# "Sync now" on the Settings page runs a whole email sync before
|
||||
# answering.
|
||||
proxy_read_timeout 300s;
|
||||
proxy_pass $upstream_jobs;
|
||||
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
|
||||
# version 2.0.0 and its new API base.
|
||||
location = /cv/jobs {
|
||||
return 301 /jobs/;
|
||||
}
|
||||
location = /cv/leads {
|
||||
return 301 /jobs/leads;
|
||||
}
|
||||
location = /job-capture.user.js {
|
||||
return 301 /jobs/job-capture.user.js;
|
||||
}
|
||||
|
||||
# ---- Admin gate (/sb/, /radio/admin/, /uploads/private/) ----
|
||||
# (/uploads/private/ is declared in the including template, not here;
|
||||
# it points at the two locations below by name.)
|
||||
|
||||
Reference in New Issue
Block a user