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:
+26
-14
@@ -9,9 +9,9 @@
|
|||||||
# 2. `env_file: ./.env` on a service. Injects the WHOLE file as environment
|
# 2. `env_file: ./.env` on a service. Injects the WHOLE file as environment
|
||||||
# variables inside that container. nginx, backend, db, icecast2,
|
# variables inside that container. nginx, backend, db, icecast2,
|
||||||
# certbot and gitea all do this.
|
# certbot and gitea all do this.
|
||||||
# The `python` service deliberately does neither wholesale — it uses an
|
# The `python` and `jobs` services deliberately do neither wholesale — each
|
||||||
# explicit `environment:` allow-list, so it never sees the database password
|
# uses an explicit `environment:` allow-list, so neither sees the site's
|
||||||
# or any API key other than the two it uses (TFL_APP_KEY, CLAUDE_API_KEY).
|
# database password, the JWT secret, or any key it does not use.
|
||||||
#
|
#
|
||||||
# HOW TO USE
|
# HOW TO USE
|
||||||
# cp .env.example .env then fill in every value.
|
# cp .env.example .env then fill in every value.
|
||||||
@@ -37,15 +37,20 @@
|
|||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
# --- Postgres ----------------------------------------------------------------
|
# --- Postgres ----------------------------------------------------------------
|
||||||
# One instance, two databases: POSTGRES_DB for the Go backend, POSTGRES_GITEA_DB
|
# One instance, three databases: POSTGRES_DB for the Go backend,
|
||||||
# for Gitea. Only POSTGRES_DB is auto-created on first init; the Gitea one must
|
# POSTGRES_GITEA_DB for Gitea, POSTGRES_JOBS_DB for the job tracker (with its
|
||||||
# be created by hand on a fresh volume.
|
# own role). Only POSTGRES_DB is auto-created on first init; the other two must
|
||||||
|
# be created by hand on a fresh volume (the job tracker's README has the
|
||||||
|
# commands).
|
||||||
# POSTGRES_HOST doubles as the db container's name.
|
# POSTGRES_HOST doubles as the db container's name.
|
||||||
POSTGRES_USER=
|
POSTGRES_USER=
|
||||||
POSTGRES_PASSWORD=
|
POSTGRES_PASSWORD=
|
||||||
POSTGRES_DB=
|
POSTGRES_DB=
|
||||||
POSTGRES_PORT=5432
|
POSTGRES_PORT=5432
|
||||||
POSTGRES_HOST=db
|
POSTGRES_HOST=db
|
||||||
|
POSTGRES_JOBS_DB=jobs
|
||||||
|
POSTGRES_JOBS_USER=jobs
|
||||||
|
POSTGRES_JOBS_PASSWORD=
|
||||||
|
|
||||||
# --- Gitea -------------------------------------------------------------------
|
# --- Gitea -------------------------------------------------------------------
|
||||||
# GITEA_HOST is the container name AND the nginx upstream host.
|
# GITEA_HOST is the container name AND the nginx upstream host.
|
||||||
@@ -68,7 +73,7 @@ GITEA_RUNNER_HOST=
|
|||||||
GITEA_RUNNER_NAME=pi-runner
|
GITEA_RUNNER_NAME=pi-runner
|
||||||
GITEA_RUNNER_REGISTRATION_TOKEN=
|
GITEA_RUNNER_REGISTRATION_TOKEN=
|
||||||
|
|
||||||
# --- Email ingest (backend) --------------------------------------------------
|
# --- Email ingest (job tracker) -----------------------------------------------
|
||||||
# EMAIL_BACKEND selects the mail source: "graph" (Microsoft Graph API, OAuth)
|
# EMAIL_BACKEND selects the mail source: "graph" (Microsoft Graph API, OAuth)
|
||||||
# or "imap" (fallback; Microsoft has retired IMAP basic auth for outlook.com,
|
# or "imap" (fallback; Microsoft has retired IMAP basic auth for outlook.com,
|
||||||
# so imap+app-password only works with non-Microsoft providers like Gmail).
|
# so imap+app-password only works with non-Microsoft providers like Gmail).
|
||||||
@@ -77,11 +82,12 @@ GITEA_RUNNER_REGISTRATION_TOKEN=
|
|||||||
# (default tenant = "consumers"); add a delegated Mail.Read permission with
|
# (default tenant = "consumers"); add a delegated Mail.Read permission with
|
||||||
# admin/user consent, and create a client secret. Redirect URI type "Web",
|
# admin/user consent, and create a client secret. Redirect URI type "Web",
|
||||||
# value must live behind the site's real HTTPS origin, e.g.
|
# value must live behind the site's real HTTPS origin, e.g.
|
||||||
# https://<YOUR_DOMAIN>/email/callback (callback route already exists in the
|
# https://<YOUR_DOMAIN>/jobs/api/email/callback (served by the job tracker,
|
||||||
# backend). Backend code exchanges a code there. TenantID must be "consumers"
|
# which exchanges the code there). TenantID must be "consumers" for a personal
|
||||||
# for a personal outlook.com account.
|
# outlook.com account.
|
||||||
# The first sync prints an authorisation URL into the container log; visit it,
|
# The tracker's Settings page (/jobs/settings) shows the authorisation link
|
||||||
# consent, and the refresh token is persisted to backend/token/msgraph_token.json.
|
# until you sign in; the refresh token is persisted to
|
||||||
|
# jobs-data/msgraph_token.json.
|
||||||
# OAuth flow reference: https://learn.microsoft.com/en-us/graph/auth-v2-user
|
# OAuth flow reference: https://learn.microsoft.com/en-us/graph/auth-v2-user
|
||||||
EMAIL_BACKEND=
|
EMAIL_BACKEND=
|
||||||
MSGRAPH_CLIENT_ID=
|
MSGRAPH_CLIENT_ID=
|
||||||
@@ -97,8 +103,8 @@ IMAP_PASSWORD=
|
|||||||
EMAIL_SYNC_INTERVAL=
|
EMAIL_SYNC_INTERVAL=
|
||||||
EMAIL_SYNC_ENABLED=
|
EMAIL_SYNC_ENABLED=
|
||||||
|
|
||||||
# --- Job leads (backend) -----------------------------------------------------
|
# --- Job leads (job tracker) --------------------------------------------------
|
||||||
# The lead fetcher polls the sources listed on /cv/leads and files new
|
# The lead fetcher polls the sources listed on /jobs/leads and files new
|
||||||
# postings in the leads inbox. JOB_LEADS_ENABLED=true runs it on a timer;
|
# postings in the leads inbox. JOB_LEADS_ENABLED=true runs it on a timer;
|
||||||
# "Check now" on that page works whether or not it is set. JOB_LEADS_INTERVAL
|
# "Check now" on that page works whether or not it is set. JOB_LEADS_INTERVAL
|
||||||
# is a Go duration (default 6h). Scoring uses CLAUDE_API_KEY, above.
|
# is a Go duration (default 6h). Scoring uses CLAUDE_API_KEY, above.
|
||||||
@@ -201,5 +207,11 @@ SEED_DB=
|
|||||||
PYTHON_HOST=python
|
PYTHON_HOST=python
|
||||||
PYTHON_PORT=8000
|
PYTHON_PORT=8000
|
||||||
|
|
||||||
|
# --- Job tracker (/jobs/) -----------------------------------------------------
|
||||||
|
# An image built and published by the job-tracker repo's CI. Blank runs
|
||||||
|
# :latest; set a commit sha to pin. Changing it needs
|
||||||
|
# `docker compose pull jobs && docker compose up -d jobs`.
|
||||||
|
JOBS_IMAGE_TAG=
|
||||||
|
|
||||||
# TfL Unified API key (500 req/min); used by the Python hotel finder
|
# TfL Unified API key (500 req/min); used by the Python hotel finder
|
||||||
TFL_APP_KEY=
|
TFL_APP_KEY=
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ icecast2/fallback_music/*
|
|||||||
certbot/conf
|
certbot/conf
|
||||||
certbot/www
|
certbot/www
|
||||||
backend/token/
|
backend/token/
|
||||||
|
jobs-data/
|
||||||
.env
|
.env
|
||||||
.env.bak
|
.env.bak
|
||||||
|
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ Dockerized multi-service personal website self-hosted on a Raspberry Pi.
|
|||||||
|
|
||||||
**Python API** (`python/`): FastAPI app served by uvicorn on port 8000. Nginx proxies `/py/` to it and strips the prefix, so routes in `python/app/main.py` are written relative to `/`. Swagger UI at `/py/docs`. Dev mode mounts `python/app` and runs uvicorn with `--reload`. **Every Claude call in the stack lives here**, behind four internal routes: `/internal/rowing/read` (behind `POST /api/rowing`), `/internal/jobs/extract` (behind `POST /api/jobs/capture/extract`), `/internal/jobs/score` (behind the job-lead pipeline) and `/internal/email/classify` (behind the email sync). The Go backend calls them directly over the Docker network through `services.CallPython`, and nginx 404s `/py/internal/`. The model is one setting for all four, `CLAUDE_MODEL` (default `claude-sonnet-5-5`), chosen on the admin panel's Environment tab; `python/app/claude.py` shapes the request per model. Adding another route is a short recipe in `python/README.md` ("Internal routes").
|
**Python API** (`python/`): FastAPI app served by uvicorn on port 8000. Nginx proxies `/py/` to it and strips the prefix, so routes in `python/app/main.py` are written relative to `/`. Swagger UI at `/py/docs`. Dev mode mounts `python/app` and runs uvicorn with `--reload`. **Every Claude call in the stack lives here**, behind four internal routes: `/internal/rowing/read` (behind `POST /api/rowing`), `/internal/jobs/extract` (behind `POST /api/jobs/capture/extract`), `/internal/jobs/score` (behind the job-lead pipeline) and `/internal/email/classify` (behind the email sync). The Go backend calls them directly over the Docker network through `services.CallPython`, and nginx 404s `/py/internal/`. The model is one setting for all four, `CLAUDE_MODEL` (default `claude-sonnet-5-5`), chosen on the admin panel's Environment tab; `python/app/claude.py` shapes the request per model. Adding another route is a short recipe in `python/README.md` ("Internal routes").
|
||||||
|
|
||||||
|
**Job tracker** (`jobs` service, `/jobs/`): the job application tracker, leads inbox, email pipeline and capture userscript now live in their own repo (`adamf/job-tracker` on Gitea) and run here as a published image, with their own Postgres database and role. It has no login: it asks the backend's `/auth/validate-admin` with the visitor's cookies. **Transitional:** the old job code is still in `backend/`, `python/` and `vue/` but unused (the backend no longer starts its schedulers or serves the capture and email routes, and `/cv/jobs` and `/cv/leads` redirect). Delete it once the tracker has run for a while; until then, sections below that describe job features in this repo are out of date.
|
||||||
|
|
||||||
**Nginx** (`nginx/`): Reverse proxy + SPA server. Config is templated (`nginx.conf.template`) and selected at runtime by `entrypoint.sh` based on `DEV_MODE` and certificate presence. Rate limiting on login (5/min), API (30/sec), uploads (5/min). Proxied routes are written once, in `nginx/nginx_routes.conf.template`, which both the production and dev configs include — add a new route there. Production-only pieces (TLS, static asset caching, the GraphQL rate-limit zone, security headers) stay in `nginx.conf.template`; a new rate-limit zone must be declared in both `http` blocks.
|
**Nginx** (`nginx/`): Reverse proxy + SPA server. Config is templated (`nginx.conf.template`) and selected at runtime by `entrypoint.sh` based on `DEV_MODE` and certificate presence. Rate limiting on login (5/min), API (30/sec), uploads (5/min). Proxied routes are written once, in `nginx/nginx_routes.conf.template`, which both the production and dev configs include — add a new route there. Production-only pieces (TLS, static asset caching, the GraphQL rate-limit zone, security headers) stay in `nginx.conf.template`; a new rate-limit zone must be declared in both `http` blocks.
|
||||||
|
|
||||||
## Backend Structure
|
## Backend Structure
|
||||||
|
|||||||
+9
-18
@@ -1,7 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
@@ -203,12 +202,11 @@ func main() {
|
|||||||
protected := r.Group("/", store.AuthMiddlewear)
|
protected := r.Group("/", store.AuthMiddlewear)
|
||||||
admin := r.Group("/", store.AuthMiddlewear, store.AdminMiddleware)
|
admin := r.Group("/", store.AuthMiddlewear, store.AdminMiddleware)
|
||||||
|
|
||||||
// JOB CAPTURE: called by the browser userscript from other origins, so
|
// JOB CAPTURE and EMAIL SYNC routes moved to the job tracker app
|
||||||
// these authenticate with a bearer token instead of the session cookies.
|
// (adamf/job-tracker, served at /jobs/). They are no longer registered
|
||||||
capture := r.Group("/jobs/capture", store.CaptureTokenMiddleware)
|
// here, so an old userscript gets a 404 instead of writing into tables
|
||||||
capture.GET("/status", store.JobCaptureStatus)
|
// the tracker no longer reads. The handlers are deleted in a later
|
||||||
capture.POST("/extract", store.JobCaptureExtract)
|
// commit, once the tracker has run for a while.
|
||||||
capture.POST("", store.JobCapture)
|
|
||||||
|
|
||||||
// ROWING
|
// ROWING
|
||||||
r.GET("/rowing", store.GetRowing)
|
r.GET("/rowing", store.GetRowing)
|
||||||
@@ -221,10 +219,6 @@ func main() {
|
|||||||
r.POST("/auth/logout", store.Logout)
|
r.POST("/auth/logout", store.Logout)
|
||||||
r.GET("/auth/validate-admin", store.ValidateAdmin)
|
r.GET("/auth/validate-admin", store.ValidateAdmin)
|
||||||
|
|
||||||
// EMAIL SYNC
|
|
||||||
r.GET("/email/callback", store.CompleteEmailAuth)
|
|
||||||
admin.POST("/email/sync", store.TriggerEmailSync)
|
|
||||||
|
|
||||||
// SPOTIFY
|
// SPOTIFY
|
||||||
// The callback must be open — Spotify redirects a logged-out browser to
|
// The callback must be open — Spotify redirects a logged-out browser to
|
||||||
// it — and is protected by the state nonce instead. Starting the flow is
|
// it — and is protected by the state nonce instead. Starting the flow is
|
||||||
@@ -314,13 +308,10 @@ func main() {
|
|||||||
c.JSON(200, gin.H{"message": "Hello World"})
|
c.JSON(200, gin.H{"message": "Hello World"})
|
||||||
})
|
})
|
||||||
|
|
||||||
// The scheduler runs until ctx is cancelled, which in practice only
|
// The email sync and job-lead schedulers are NOT started: the job tracker
|
||||||
// happens if r.Run returns — there is no signal handling or graceful
|
// runs them now, and it reads the same EMAIL_SYNC_ENABLED and
|
||||||
// shutdown, so the container is simply killed.
|
// JOB_LEADS_ENABLED from .env, so starting them here as well would
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
// process every email and board twice.
|
||||||
defer cancel()
|
|
||||||
go store.EmailSync.StartScheduler(ctx)
|
|
||||||
go store.JobLeads.StartScheduler(ctx)
|
|
||||||
|
|
||||||
port := os.Getenv("BACKEND_PORT")
|
port := os.Getenv("BACKEND_PORT")
|
||||||
// Blocks until the server stops. Any return is a failure — a port clash,
|
// Blocks until the server stops. Any return is a failure — a port clash,
|
||||||
|
|||||||
@@ -63,16 +63,16 @@ func TestEnvRegistryMatchesEnvExample(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// composePythonEnv returns the variable names in the `environment:` list of
|
// composeServiceEnv returns the variable names in the `environment:` list of
|
||||||
// the `python` service in docker-compose.yml.
|
// one service in docker-compose.yml.
|
||||||
//
|
//
|
||||||
// It reads the file as text rather than through a YAML library — there is
|
// It reads the file as text rather than through a YAML library — there is
|
||||||
// none among this module's direct dependencies, and the shape needed is
|
// none among this module's direct dependencies, and the shape needed is
|
||||||
// narrow: a two-space-indented `python:` key under `services:`, a
|
// narrow: a two-space-indented `<service>:` key under `services:`, a
|
||||||
// four-space-indented `environment:` under it, and `- NAME=value` items. If
|
// four-space-indented `environment:` under it, and `- NAME=value` items. If
|
||||||
// the compose file is ever restructured so that this finds nothing, the test
|
// the compose file is ever restructured so that this finds nothing, the test
|
||||||
// below fails loudly rather than passing on an empty list.
|
// below fails loudly rather than passing on an empty list.
|
||||||
func composePythonEnv(t *testing.T) []string {
|
func composeServiceEnv(t *testing.T, service string) []string {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
raw, err := os.ReadFile("../../docker-compose.yml")
|
raw, err := os.ReadFile("../../docker-compose.yml")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -81,7 +81,7 @@ func composePythonEnv(t *testing.T) []string {
|
|||||||
|
|
||||||
item := regexp.MustCompile(`^ - ["']?([A-Z][A-Z0-9_]*)(=|["']?\s*$)`)
|
item := regexp.MustCompile(`^ - ["']?([A-Z][A-Z0-9_]*)(=|["']?\s*$)`)
|
||||||
var names []string
|
var names []string
|
||||||
inPython, inEnvironment := false, false
|
inService, inEnvironment := false, false
|
||||||
for _, line := range strings.Split(string(raw), "\n") {
|
for _, line := range strings.Split(string(raw), "\n") {
|
||||||
trimmed := strings.TrimSpace(line)
|
trimmed := strings.TrimSpace(line)
|
||||||
if trimmed == "" || strings.HasPrefix(trimmed, "#") {
|
if trimmed == "" || strings.HasPrefix(trimmed, "#") {
|
||||||
@@ -91,50 +91,57 @@ func composePythonEnv(t *testing.T) []string {
|
|||||||
switch {
|
switch {
|
||||||
case indent <= 2:
|
case indent <= 2:
|
||||||
// A new service (or a top-level key) ends the block.
|
// A new service (or a top-level key) ends the block.
|
||||||
inPython, inEnvironment = line == " python:", false
|
inService, inEnvironment = line == " "+service+":", false
|
||||||
case inPython && indent == 4:
|
case inService && indent == 4:
|
||||||
inEnvironment = trimmed == "environment:"
|
inEnvironment = trimmed == "environment:"
|
||||||
case inPython && inEnvironment:
|
case inService && inEnvironment:
|
||||||
match := item.FindStringSubmatch(line)
|
match := item.FindStringSubmatch(line)
|
||||||
if match == nil {
|
if match == nil {
|
||||||
t.Fatalf("python.environment has an entry this test cannot read: %q", line)
|
t.Fatalf("%s.environment has an entry this test cannot read: %q", service, line)
|
||||||
}
|
}
|
||||||
names = append(names, match[1])
|
names = append(names, match[1])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(names) == 0 {
|
if len(names) == 0 {
|
||||||
t.Fatal("found no python.environment list in docker-compose.yml; has the file's layout changed?")
|
t.Fatalf("found no %s.environment list in docker-compose.yml; has the file's layout changed?", service)
|
||||||
}
|
}
|
||||||
return names
|
return names
|
||||||
}
|
}
|
||||||
|
|
||||||
// The python service is the one container given an explicit `environment:`
|
// explicitEnvServices are the containers given an explicit `environment:`
|
||||||
// list instead of the whole .env, so that it never holds the database
|
// list instead of the whole .env, so that they never hold the database
|
||||||
// password or the JWT secret. The cost is a third place a new Python variable
|
// password or the JWT secret: the Python service, and the job tracker (an
|
||||||
// has to be added — the registry, .env.example and that list — and forgetting
|
// image from its own repo, which gets its own database role besides). The
|
||||||
// the third is silent: the variable is simply empty inside the container.
|
// cost is a third place a new variable for one of them has to be added — the
|
||||||
//
|
// registry, .env.example and that list — and forgetting the third is silent:
|
||||||
// So the registry's claim "python reads this" and the compose list must
|
// the variable is simply empty inside the container.
|
||||||
|
var explicitEnvServices = []string{"python", "jobs"}
|
||||||
|
|
||||||
|
// So the registry's claim "this service reads this" and the compose list must
|
||||||
// agree, in both directions:
|
// agree, in both directions:
|
||||||
//
|
//
|
||||||
// - a variable the registry says python reads must be passed to it;
|
// - a variable the registry says the service reads must be passed to it;
|
||||||
// - an editable variable that is passed to it must say so in the registry,
|
// - an editable variable that is passed to it must say so in the registry,
|
||||||
// or changing it in the admin panel would not recreate the container.
|
// or changing it in the admin panel would not recreate the container.
|
||||||
//
|
//
|
||||||
// Locked variables are exempt from the second rule. They are never applied
|
// Locked variables are exempt from the second rule. They are never applied
|
||||||
// through the panel, so the registry gives none of them a services list
|
// through the panel, so the registry gives none of them a services list
|
||||||
// (PYTHON_PORT is passed to python and is one of these). Names in the compose
|
// (PYTHON_PORT is passed to python and is one of these). Names in the compose
|
||||||
// list that are not registry variables at all, such as the literal ROOT_PATH,
|
// list that are not registry variables at all, such as the literal ROOT_PATH
|
||||||
// are not this test's business.
|
// or the jobs service's composed DATABASE_URL, are not this test's business.
|
||||||
func TestEnvRegistryMatchesComposePythonEnvironment(t *testing.T) {
|
func TestEnvRegistryMatchesComposeEnvironments(t *testing.T) {
|
||||||
compose := composePythonEnv(t)
|
|
||||||
|
|
||||||
registry := map[string]EnvVar{}
|
registry := map[string]EnvVar{}
|
||||||
for _, v := range newEnvManager(t).Vars() {
|
for _, v := range newEnvManager(t).Vars() {
|
||||||
registry[v.Name] = v
|
registry[v.Name] = v
|
||||||
if slices.Contains(v.Services, "python") && !slices.Contains(compose, v.Name) {
|
}
|
||||||
t.Errorf("%s lists the python service in env_registry.json but is not in "+
|
|
||||||
"python.environment in docker-compose.yml, so the container never receives it", v.Name)
|
for _, service := range explicitEnvServices {
|
||||||
|
compose := composeServiceEnv(t, service)
|
||||||
|
|
||||||
|
for _, v := range registry {
|
||||||
|
if slices.Contains(v.Services, service) && !slices.Contains(compose, v.Name) {
|
||||||
|
t.Errorf("%s lists the %s service in env_registry.json but is not in "+
|
||||||
|
"%s.environment in docker-compose.yml, so the container never receives it", v.Name, service, service)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,9 +150,10 @@ func TestEnvRegistryMatchesComposePythonEnvironment(t *testing.T) {
|
|||||||
if !known || !v.Editable {
|
if !known || !v.Editable {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if !slices.Contains(v.Services, "python") {
|
if !slices.Contains(v.Services, service) {
|
||||||
t.Errorf("%s is passed to the python service in docker-compose.yml but env_registry.json "+
|
t.Errorf("%s is passed to the %s service in docker-compose.yml but env_registry.json "+
|
||||||
"does not list python among its services, so editing it would not recreate the container", name)
|
"does not list %s among its services, so editing it would not recreate the container", name, service, service)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[
|
[
|
||||||
{"name": "CLAUDE_API_KEY", "group": "API keys", "purpose": "Claude calls, all made by the Python service: email classifier, rowing photo reader, job posting reader, job lead scorer", "kind": "secret", "editable": true, "services": ["python"], "docsUrl": "https://console.anthropic.com/settings/keys"},
|
{"name": "CLAUDE_API_KEY", "group": "API keys", "purpose": "Claude calls: the job tracker (lead scorer, email classifier, posting reader) and the Python service (rowing photo reader)", "kind": "secret", "editable": true, "services": ["python", "jobs"], "docsUrl": "https://console.anthropic.com/settings/keys"},
|
||||||
{"name": "CLAUDE_MODEL", "group": "API keys", "purpose": "Model for every Claude call: lead scoring, email classifier, posting reader, rowing photo reader. Blank uses claude-sonnet-5-5. Rough cost per million tokens in/out: Haiku $1/$5, Sonnet $2/$10, Opus $4/$20", "kind": "enum", "options": ["claude-haiku-4-5", "claude-sonnet-5-5", "claude-opus-5-5"], "editable": true, "services": ["python"]},
|
{"name": "CLAUDE_MODEL", "group": "API keys", "purpose": "Model for every Claude call: lead scoring, email classifier, posting reader (job tracker), rowing photo reader (Python). Blank uses claude-sonnet-5-5. Rough cost per million tokens in/out: Haiku $1/$5, Sonnet $2/$10, Opus $4/$20", "kind": "enum", "options": ["claude-haiku-4-5", "claude-sonnet-5-5", "claude-opus-5-5"], "editable": true, "services": ["python", "jobs"]},
|
||||||
{"name": "STEAM_API_KEY", "group": "API keys", "purpose": "Steam status widget", "kind": "secret", "editable": true, "services": ["backend"], "docsUrl": "https://steamcommunity.com/dev/apikey"},
|
{"name": "STEAM_API_KEY", "group": "API keys", "purpose": "Steam status widget", "kind": "secret", "editable": true, "services": ["backend"], "docsUrl": "https://steamcommunity.com/dev/apikey"},
|
||||||
{"name": "STEAM_ID", "group": "API keys", "purpose": "Steam account the widget reports on (64-bit ID)", "kind": "text", "editable": true, "services": ["backend"]},
|
{"name": "STEAM_ID", "group": "API keys", "purpose": "Steam account the widget reports on (64-bit ID)", "kind": "text", "editable": true, "services": ["backend"]},
|
||||||
{"name": "TFL_APP_KEY", "group": "API keys", "purpose": "TfL Unified API, used by the hotel finder", "kind": "secret", "editable": true, "services": ["python"], "docsUrl": "https://api-portal.tfl.gov.uk/profile"},
|
{"name": "TFL_APP_KEY", "group": "API keys", "purpose": "TfL Unified API, used by the hotel finder", "kind": "secret", "editable": true, "services": ["python"], "docsUrl": "https://api-portal.tfl.gov.uk/profile"},
|
||||||
@@ -10,23 +10,23 @@
|
|||||||
{"name": "SPOTIFY_REDIRECT_URI", "group": "Spotify", "purpose": "Must match the URI registered in the Spotify dashboard exactly", "kind": "url", "editable": true, "services": ["backend"]},
|
{"name": "SPOTIFY_REDIRECT_URI", "group": "Spotify", "purpose": "Must match the URI registered in the Spotify dashboard exactly", "kind": "url", "editable": true, "services": ["backend"]},
|
||||||
{"name": "SPOTIFY_AUTH_STATE", "group": "Spotify", "purpose": "Former fixed OAuth state", "kind": "secret", "editable": false, "lockedReason": "No longer read: the OAuth state is a per-request nonce."},
|
{"name": "SPOTIFY_AUTH_STATE", "group": "Spotify", "purpose": "Former fixed OAuth state", "kind": "secret", "editable": false, "lockedReason": "No longer read: the OAuth state is a per-request nonce."},
|
||||||
|
|
||||||
{"name": "EMAIL_BACKEND", "group": "Email ingest", "purpose": "Mail source for the email pipeline", "kind": "enum", "options": ["graph", "imap"], "editable": true, "services": ["backend"]},
|
{"name": "EMAIL_BACKEND", "group": "Email ingest", "purpose": "Mail source for the email pipeline", "kind": "enum", "options": ["graph", "imap"], "editable": true, "services": ["jobs"]},
|
||||||
{"name": "EMAIL_SYNC_ENABLED", "group": "Email ingest", "purpose": "Run the periodic email sync", "kind": "bool", "editable": true, "services": ["backend"]},
|
{"name": "EMAIL_SYNC_ENABLED", "group": "Email ingest", "purpose": "Run the periodic email sync", "kind": "bool", "editable": true, "services": ["jobs"]},
|
||||||
{"name": "EMAIL_SYNC_INTERVAL", "group": "Email ingest", "purpose": "Time between syncs, as a Go duration such as 30m (default 30m)", "kind": "duration", "editable": true, "services": ["backend"]},
|
{"name": "EMAIL_SYNC_INTERVAL", "group": "Email ingest", "purpose": "Time between syncs, as a Go duration such as 30m (default 30m)", "kind": "duration", "editable": true, "services": ["jobs"]},
|
||||||
{"name": "MSGRAPH_CLIENT_ID", "group": "Email ingest", "purpose": "Microsoft Graph app registration", "kind": "text", "editable": true, "services": ["backend"], "docsUrl": "https://entra.microsoft.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade"},
|
{"name": "MSGRAPH_CLIENT_ID", "group": "Email ingest", "purpose": "Microsoft Graph app registration", "kind": "text", "editable": true, "services": ["jobs"], "docsUrl": "https://entra.microsoft.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade"},
|
||||||
{"name": "MSGRAPH_CLIENT_SECRET", "group": "Email ingest", "purpose": "Microsoft Graph app registration", "kind": "secret", "editable": true, "services": ["backend"], "docsUrl": "https://entra.microsoft.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade"},
|
{"name": "MSGRAPH_CLIENT_SECRET", "group": "Email ingest", "purpose": "Microsoft Graph app registration", "kind": "secret", "editable": true, "services": ["jobs"], "docsUrl": "https://entra.microsoft.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade"},
|
||||||
{"name": "MSGRAPH_TENANT_ID", "group": "Email ingest", "purpose": "\"consumers\" for a personal outlook.com account", "kind": "text", "editable": true, "services": ["backend"]},
|
{"name": "MSGRAPH_TENANT_ID", "group": "Email ingest", "purpose": "\"consumers\" for a personal outlook.com account", "kind": "text", "editable": true, "services": ["jobs"]},
|
||||||
{"name": "MSGRAPH_REDIRECT_URI", "group": "Email ingest", "purpose": "OAuth callback, behind the site's HTTPS origin", "kind": "url", "editable": true, "services": ["backend"]},
|
{"name": "MSGRAPH_REDIRECT_URI", "group": "Email ingest", "purpose": "OAuth callback: https://<domain>/jobs/api/email/callback, registered in Entra", "kind": "url", "editable": true, "services": ["jobs"]},
|
||||||
{"name": "IMAP_HOST", "group": "Email ingest", "purpose": "IMAP fallback server", "kind": "text", "editable": true, "services": ["backend"]},
|
{"name": "IMAP_HOST", "group": "Email ingest", "purpose": "IMAP fallback server", "kind": "text", "editable": true, "services": ["jobs"]},
|
||||||
{"name": "IMAP_PORT", "group": "Email ingest", "purpose": "IMAP fallback port (993)", "kind": "number", "editable": true, "services": ["backend"]},
|
{"name": "IMAP_PORT", "group": "Email ingest", "purpose": "IMAP fallback port (993)", "kind": "number", "editable": true, "services": ["jobs"]},
|
||||||
{"name": "IMAP_EMAIL", "group": "Email ingest", "purpose": "IMAP fallback account", "kind": "text", "editable": true, "services": ["backend"]},
|
{"name": "IMAP_EMAIL", "group": "Email ingest", "purpose": "IMAP fallback account", "kind": "text", "editable": true, "services": ["jobs"]},
|
||||||
{"name": "IMAP_PASSWORD", "group": "Email ingest", "purpose": "App-specific password, not the account password", "kind": "secret", "editable": true, "services": ["backend"]},
|
{"name": "IMAP_PASSWORD", "group": "Email ingest", "purpose": "App-specific password, not the account password", "kind": "secret", "editable": true, "services": ["jobs"]},
|
||||||
|
|
||||||
{"name": "JOB_LEADS_ENABLED", "group": "Job leads", "purpose": "Run the periodic job-lead fetch; \"Check now\" on /cv/leads works either way", "kind": "bool", "editable": true, "services": ["backend"]},
|
{"name": "JOB_LEADS_ENABLED", "group": "Job leads", "purpose": "Run the periodic job-lead fetch; \"Check now\" on /jobs/leads works either way", "kind": "bool", "editable": true, "services": ["jobs"]},
|
||||||
{"name": "JOB_LEADS_INTERVAL", "group": "Job leads", "purpose": "Time between fetches, as a Go duration such as 6h (default 6h)", "kind": "duration", "editable": true, "services": ["backend"]},
|
{"name": "JOB_LEADS_INTERVAL", "group": "Job leads", "purpose": "Time between fetches, as a Go duration such as 6h (default 6h)", "kind": "duration", "editable": true, "services": ["jobs"]},
|
||||||
{"name": "ADZUNA_APP_ID", "group": "Job leads", "purpose": "Adzuna job search, for adzuna lead sources", "kind": "text", "editable": true, "services": ["backend"], "docsUrl": "https://developer.adzuna.com/admin/access_details"},
|
{"name": "ADZUNA_APP_ID", "group": "Job leads", "purpose": "Adzuna job search, for adzuna lead sources", "kind": "text", "editable": true, "services": ["jobs"], "docsUrl": "https://developer.adzuna.com/admin/access_details"},
|
||||||
{"name": "ADZUNA_APP_KEY", "group": "Job leads", "purpose": "Adzuna job search, for adzuna lead sources", "kind": "secret", "editable": true, "services": ["backend"], "docsUrl": "https://developer.adzuna.com/admin/access_details"},
|
{"name": "ADZUNA_APP_KEY", "group": "Job leads", "purpose": "Adzuna job search, for adzuna lead sources", "kind": "secret", "editable": true, "services": ["jobs"], "docsUrl": "https://developer.adzuna.com/admin/access_details"},
|
||||||
{"name": "REED_API_KEY", "group": "Job leads", "purpose": "Reed job search, for reed lead sources", "kind": "secret", "editable": true, "services": ["backend"], "docsUrl": "https://www.reed.co.uk/developers/jobseeker"},
|
{"name": "REED_API_KEY", "group": "Job leads", "purpose": "Reed job search, for reed lead sources", "kind": "secret", "editable": true, "services": ["jobs"], "docsUrl": "https://www.reed.co.uk/developers/jobseeker"},
|
||||||
|
|
||||||
{"name": "ICECAST_SOURCE_PASSWORD", "group": "Radio", "purpose": "Liquidsoap to Icecast, and live broadcasters to the harbor port", "kind": "generated", "editable": true, "services": ["icecast2"], "warning": "Live broadcasting clients must be given the new password."},
|
{"name": "ICECAST_SOURCE_PASSWORD", "group": "Radio", "purpose": "Liquidsoap to Icecast, and live broadcasters to the harbor port", "kind": "generated", "editable": true, "services": ["icecast2"], "warning": "Live broadcasting clients must be given the new password."},
|
||||||
{"name": "ICECAST_RELAY_PASSWORD", "group": "Radio", "purpose": "Icecast relay clients", "kind": "generated", "editable": true, "services": ["icecast2"]},
|
{"name": "ICECAST_RELAY_PASSWORD", "group": "Radio", "purpose": "Icecast relay clients", "kind": "generated", "editable": true, "services": ["icecast2"]},
|
||||||
@@ -45,6 +45,7 @@
|
|||||||
{"name": "BACKEND_ENDPOINT", "group": "Infrastructure", "purpose": "URL prefix nginx mounts the API at", "kind": "text", "editable": false, "lockedReason": "The Vue app assumes /api."},
|
{"name": "BACKEND_ENDPOINT", "group": "Infrastructure", "purpose": "URL prefix nginx mounts the API at", "kind": "text", "editable": false, "lockedReason": "The Vue app assumes /api."},
|
||||||
{"name": "PYTHON_HOST", "group": "Infrastructure", "purpose": "Python container name and nginx upstream", "kind": "text", "editable": false, "lockedReason": "Renames a container and repoints nginx."},
|
{"name": "PYTHON_HOST", "group": "Infrastructure", "purpose": "Python container name and nginx upstream", "kind": "text", "editable": false, "lockedReason": "Renames a container and repoints nginx."},
|
||||||
{"name": "PYTHON_PORT", "group": "Infrastructure", "purpose": "Python listen port", "kind": "text", "editable": false, "lockedReason": "Renames a container or repoints nginx."},
|
{"name": "PYTHON_PORT", "group": "Infrastructure", "purpose": "Python listen port", "kind": "text", "editable": false, "lockedReason": "Renames a container or repoints nginx."},
|
||||||
|
{"name": "JOBS_IMAGE_TAG", "group": "Infrastructure", "purpose": "Job tracker image tag to run (default latest)", "kind": "text", "editable": false, "lockedReason": "Changing it needs a pull: docker compose pull jobs && docker compose up -d jobs."},
|
||||||
{"name": "ICECAST_HOST", "group": "Infrastructure", "purpose": "Icecast container name and nginx upstream", "kind": "text", "editable": false, "lockedReason": "Renames a container and repoints nginx."},
|
{"name": "ICECAST_HOST", "group": "Infrastructure", "purpose": "Icecast container name and nginx upstream", "kind": "text", "editable": false, "lockedReason": "Renames a container and repoints nginx."},
|
||||||
{"name": "ICECAST_PORT", "group": "Infrastructure", "purpose": "Icecast listen port", "kind": "text", "editable": false, "lockedReason": "Renames a container or repoints nginx."},
|
{"name": "ICECAST_PORT", "group": "Infrastructure", "purpose": "Icecast listen port", "kind": "text", "editable": false, "lockedReason": "Renames a container or repoints nginx."},
|
||||||
{"name": "ICECAST_MOUNT", "group": "Infrastructure", "purpose": "Listener-facing stream mount", "kind": "text", "editable": false, "lockedReason": "The player and nginx both assume this mount."},
|
{"name": "ICECAST_MOUNT", "group": "Infrastructure", "purpose": "Listener-facing stream mount", "kind": "text", "editable": false, "lockedReason": "The player and nginx both assume this mount."},
|
||||||
@@ -61,6 +62,9 @@
|
|||||||
{"name": "POSTGRES_PASSWORD", "group": "Database", "purpose": "Database password", "kind": "secret", "editable": false, "lockedReason": "Only applied when the volume is first initialised; changing it here locks the backend out."},
|
{"name": "POSTGRES_PASSWORD", "group": "Database", "purpose": "Database password", "kind": "secret", "editable": false, "lockedReason": "Only applied when the volume is first initialised; changing it here locks the backend out."},
|
||||||
{"name": "POSTGRES_DB", "group": "Database", "purpose": "Backend database name", "kind": "text", "editable": false, "lockedReason": "Only applied when the volume is first initialised."},
|
{"name": "POSTGRES_DB", "group": "Database", "purpose": "Backend database name", "kind": "text", "editable": false, "lockedReason": "Only applied when the volume is first initialised."},
|
||||||
{"name": "POSTGRES_GITEA_DB", "group": "Database", "purpose": "Gitea database name", "kind": "text", "editable": false, "lockedReason": "Created by hand on a fresh volume."},
|
{"name": "POSTGRES_GITEA_DB", "group": "Database", "purpose": "Gitea database name", "kind": "text", "editable": false, "lockedReason": "Created by hand on a fresh volume."},
|
||||||
|
{"name": "POSTGRES_JOBS_DB", "group": "Database", "purpose": "Job tracker database name", "kind": "text", "editable": false, "lockedReason": "Created by hand on first install; see the job-tracker README."},
|
||||||
|
{"name": "POSTGRES_JOBS_USER", "group": "Database", "purpose": "Job tracker database role", "kind": "text", "editable": false, "lockedReason": "Created by hand on first install; changing it here locks the tracker out."},
|
||||||
|
{"name": "POSTGRES_JOBS_PASSWORD", "group": "Database", "purpose": "Job tracker database password", "kind": "secret", "editable": false, "lockedReason": "Set on the role by hand; changing it here locks the tracker out."},
|
||||||
|
|
||||||
{"name": "GITEA_HOST", "group": "Gitea", "purpose": "Gitea container name and nginx upstream", "kind": "text", "editable": false, "lockedReason": "Renames a container and repoints nginx."},
|
{"name": "GITEA_HOST", "group": "Gitea", "purpose": "Gitea container name and nginx upstream", "kind": "text", "editable": false, "lockedReason": "Renames a container and repoints nginx."},
|
||||||
{"name": "GITEA_PORT", "group": "Gitea", "purpose": "Gitea HTTP port", "kind": "text", "editable": false, "lockedReason": "Renames a container or repoints nginx."},
|
{"name": "GITEA_PORT", "group": "Gitea", "purpose": "Gitea HTTP port", "kind": "text", "editable": false, "lockedReason": "Renames a container or repoints nginx."},
|
||||||
|
|||||||
@@ -75,6 +75,16 @@ services:
|
|||||||
command: ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port ${PYTHON_PORT:-8000} --root-path /py --reload"]
|
command: ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port ${PYTHON_PORT:-8000} --root-path /py --reload"]
|
||||||
volumes:
|
volumes:
|
||||||
- ./python/app:/app/app
|
- ./python/app:/app/app
|
||||||
|
# The tracker's image ships no hot reload; for that, run its own repo's
|
||||||
|
# `npm run dev`. Seeded like the backend, with the GraphQL playground at
|
||||||
|
# /jobs/api/graphql. Login still goes through the backend's seeded admin.
|
||||||
|
jobs:
|
||||||
|
environment:
|
||||||
|
- DEV_MODE=true
|
||||||
|
- SEED_DB=true
|
||||||
|
- GQL_PLAYGROUND=true
|
||||||
|
- GQL_INTROSPECTION=true
|
||||||
|
- MSGRAPH_REDIRECT_URI=https://localhost/jobs/api/email/callback
|
||||||
certbot:
|
certbot:
|
||||||
# Profiles are opt-in: a service with a profile is only started when
|
# Profiles are opt-in: a service with a profile is only started when
|
||||||
# that profile is explicitly requested. Nothing ever requests
|
# that profile is explicitly requested. Nothing ever requests
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ services:
|
|||||||
- silverbullet
|
- silverbullet
|
||||||
- silverbullet-public
|
- silverbullet-public
|
||||||
- python
|
- python
|
||||||
|
- jobs
|
||||||
networks:
|
networks:
|
||||||
- app-network
|
- app-network
|
||||||
ports:
|
ports:
|
||||||
@@ -424,6 +425,54 @@ services:
|
|||||||
retries: 3
|
retries: 3
|
||||||
start_period: 10s
|
start_period: 10s
|
||||||
|
|
||||||
|
# The job application tracker, served at /jobs/. Built and published by its
|
||||||
|
# own repo (adamf/job-tracker on this Gitea), whose README covers the
|
||||||
|
# first-time database setup and the cutover from the old in-backend tracker.
|
||||||
|
#
|
||||||
|
# Like python, it gets an explicit `environment:` list rather than the whole
|
||||||
|
# .env: it never sees the site's database password or JWT secret, and has a
|
||||||
|
# database role of its own. backend/services/env_manager_test.go checks the
|
||||||
|
# list against env_registry.json.
|
||||||
|
#
|
||||||
|
# It has no login. AUTH_VALIDATE_URL is the backend's validate-admin route
|
||||||
|
# (the one nginx's auth_request uses), which the tracker asks with the
|
||||||
|
# visitor's cookies on each admin request.
|
||||||
|
#
|
||||||
|
# ./jobs-data holds the Microsoft Graph session and the capture token. The
|
||||||
|
# image runs as uid 1000, so the directory must be owned by it.
|
||||||
|
jobs:
|
||||||
|
image: adam-french.co.uk/adamf/job-tracker:${JOBS_IMAGE_TAG:-latest}
|
||||||
|
container_name: jobs
|
||||||
|
restart: always
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
networks:
|
||||||
|
- app-network
|
||||||
|
environment:
|
||||||
|
- DATABASE_URL=postgres://${POSTGRES_JOBS_USER:-jobs}:${POSTGRES_JOBS_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_JOBS_DB:-jobs}?sslmode=disable
|
||||||
|
- AUTH_VALIDATE_URL=http://${BACKEND_HOST}:${BACKEND_PORT}/auth/validate-admin
|
||||||
|
- CLAUDE_API_KEY=${CLAUDE_API_KEY:-}
|
||||||
|
- CLAUDE_MODEL=${CLAUDE_MODEL:-}
|
||||||
|
- EMAIL_BACKEND=${EMAIL_BACKEND:-}
|
||||||
|
- EMAIL_SYNC_ENABLED=${EMAIL_SYNC_ENABLED:-}
|
||||||
|
- EMAIL_SYNC_INTERVAL=${EMAIL_SYNC_INTERVAL:-}
|
||||||
|
- MSGRAPH_CLIENT_ID=${MSGRAPH_CLIENT_ID:-}
|
||||||
|
- MSGRAPH_CLIENT_SECRET=${MSGRAPH_CLIENT_SECRET:-}
|
||||||
|
- MSGRAPH_TENANT_ID=${MSGRAPH_TENANT_ID:-}
|
||||||
|
- MSGRAPH_REDIRECT_URI=${MSGRAPH_REDIRECT_URI:-}
|
||||||
|
- IMAP_HOST=${IMAP_HOST:-}
|
||||||
|
- IMAP_PORT=${IMAP_PORT:-}
|
||||||
|
- IMAP_EMAIL=${IMAP_EMAIL:-}
|
||||||
|
- IMAP_PASSWORD=${IMAP_PASSWORD:-}
|
||||||
|
- JOB_LEADS_ENABLED=${JOB_LEADS_ENABLED:-}
|
||||||
|
- JOB_LEADS_INTERVAL=${JOB_LEADS_INTERVAL:-}
|
||||||
|
- ADZUNA_APP_ID=${ADZUNA_APP_ID:-}
|
||||||
|
- ADZUNA_APP_KEY=${ADZUNA_APP_KEY:-}
|
||||||
|
- REED_API_KEY=${REED_API_KEY:-}
|
||||||
|
volumes:
|
||||||
|
- ./jobs-data:/data
|
||||||
|
|
||||||
# Self-hosted git, served at /gitea/ and on port 3000 directly. Also the CI
|
# Self-hosted git, served at /gitea/ and on port 3000 directly. Also the CI
|
||||||
# server: .gitea/workflows/deploy.yaml redeploys this whole stack on push to
|
# server: .gitea/workflows/deploy.yaml redeploys this whole stack on push to
|
||||||
# main, executed by the act_runner that lives outside docker (gitea-runner/).
|
# main, executed by the act_runner that lives outside docker (gitea-runner/).
|
||||||
|
|||||||
@@ -74,6 +74,9 @@
|
|||||||
set $upstream_silverbullet http://$SILVERBULLET_HOST:$SILVERBULLET_PORT;
|
set $upstream_silverbullet http://$SILVERBULLET_HOST:$SILVERBULLET_PORT;
|
||||||
set $upstream_silverbullet_public http://$SILVERBULLET_PUBLIC_HOST:$SILVERBULLET_PUBLIC_PORT;
|
set $upstream_silverbullet_public http://$SILVERBULLET_PUBLIC_HOST:$SILVERBULLET_PUBLIC_PORT;
|
||||||
set $upstream_python http://$PYTHON_HOST:$PYTHON_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 -----------------------------------------------------
|
# ---- Backend API -----------------------------------------------------
|
||||||
# Two patterns repeat through every proxied location below:
|
# Two patterns repeat through every proxied location below:
|
||||||
@@ -337,6 +340,43 @@
|
|||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
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/) ----
|
# ---- Admin gate (/sb/, /radio/admin/, /uploads/private/) ----
|
||||||
# (/uploads/private/ is declared in the including template, not here;
|
# (/uploads/private/ is declared in the including template, not here;
|
||||||
# it points at the two locations below by name.)
|
# it points at the two locations below by name.)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
/**
|
/**
|
||||||
* Layout shell for /cv and /cv/jobs. It renders nothing but the RouterView —
|
* Layout shell for /cv. It renders nothing but the RouterView —
|
||||||
* its whole job is the UNSCOPED <style> block below, which re-points the site's
|
* its whole job is the UNSCOPED <style> block below, which re-points the site's
|
||||||
* design tokens from the dark palette in assets/styles.css to ink-on-paper
|
* design tokens from the dark palette in assets/styles.css to ink-on-paper
|
||||||
* values for everything inside .cv-layout.
|
* values for everything inside .cv-layout.
|
||||||
@@ -18,7 +18,7 @@ import { RouterView } from "vue-router";
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Light theme for /cv and /cv/jobs.
|
Light theme for /cv.
|
||||||
|
|
||||||
Unscoped on purpose. It re-points the site's colour tokens (defined in
|
Unscoped on purpose. It re-points the site's colour tokens (defined in
|
||||||
src/assets/styles.css) to ink-on-paper values so the global element styles
|
src/assets/styles.css) to ink-on-paper values so the global element styles
|
||||||
|
|||||||
+2
-12
@@ -105,18 +105,8 @@ const router = createRouter({
|
|||||||
name: "cv",
|
name: "cv",
|
||||||
component: () => import("@/views/CV/CV.vue"),
|
component: () => import("@/views/CV/CV.vue"),
|
||||||
},
|
},
|
||||||
{
|
// /cv/jobs and /cv/leads moved to the job tracker app at
|
||||||
path: "jobs",
|
// /jobs/; nginx redirects the old paths.
|
||||||
name: "job-applications",
|
|
||||||
component: () => import("@/views/CV/JobApplications.vue"),
|
|
||||||
meta: { requiresAdmin: true },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: "leads",
|
|
||||||
name: "job-leads",
|
|
||||||
component: () => import("@/views/CV/JobLeads.vue"),
|
|
||||||
meta: { requiresAdmin: true },
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
* the chrome, and cv-shared.css sizes the pages.
|
* the chrome, and cv-shared.css sizes the pages.
|
||||||
*/
|
*/
|
||||||
import { ref, shallowRef } from "vue";
|
import { ref, shallowRef } from "vue";
|
||||||
import { RouterLink } from "vue-router";
|
|
||||||
// import CVGeneral from "./CVGeneral.vue";
|
// import CVGeneral from "./CVGeneral.vue";
|
||||||
import CVProgramming from "./CVProgramming.vue";
|
import CVProgramming from "./CVProgramming.vue";
|
||||||
import CoverLetters from "./CoverLetters.vue";
|
import CoverLetters from "./CoverLetters.vue";
|
||||||
@@ -67,9 +66,9 @@ function print() {
|
|||||||
{{ t.label }}
|
{{ t.label }}
|
||||||
</button>
|
</button>
|
||||||
<button class="cv-btn cv-print-btn" @click="print()">Print</button>
|
<button class="cv-btn cv-print-btn" @click="print()">Print</button>
|
||||||
<RouterLink to="/cv/jobs" class="cv-btn cv-jobs-btn"
|
<!-- The tracker is its own app (adamf/job-tracker) at /jobs/,
|
||||||
>Jobs</RouterLink
|
so this is a full page load, not a RouterLink. -->
|
||||||
>
|
<a href="/jobs/" class="cv-btn cv-jobs-btn">Jobs</a>
|
||||||
</div>
|
</div>
|
||||||
<Transition name="cv-fade" mode="out-in">
|
<Transition name="cv-fade" mode="out-in">
|
||||||
<component :is="currentComponent" :key="selected" />
|
<component :is="currentComponent" :key="selected" />
|
||||||
|
|||||||
Reference in New Issue
Block a user