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]>
This commit is contained in:
2026-10-19 20:38:05 +01:00
co-authored by Claude Opus 5.5
parent ece1b654c7
commit 0e48befbc7
2 changed files with 14 additions and 4 deletions
+9 -3
View File
@@ -205,9 +205,10 @@ CLOUDFLARE_TUNNEL_TOKEN=
CLOUDFLARE_DNS_API_TOKEN=
# --- Third-party API keys (backend) ------------------------------------------
# CLAUDE_API_KEY is used by the python service, which makes every Claude call
# in the stack: the rowing photo reader, the job posting reader and the email
# pipeline's classifier. The backend no longer calls Claude itself.
# CLAUDE_API_KEY is used by the python service, which makes the main site's
# Claude calls: the rowing photo reader, the job posting reader and the email
# pipeline's classifier. The backend no longer calls Claude itself. The jobs
# and usaco containers get the same key for their own calls.
CLAUDE_API_KEY=
# Which model those calls use: claude-haiku-4-5 (cheapest), claude-sonnet-5-5
# (the default when blank) or claude-opus-5-5. Recreate the python service
@@ -243,6 +244,11 @@ USACO_GIT_TOKEN=
# (http://usaco:8080/usaco/api/hooks/gitea). Blank turns the hook off and
# the site only pulls every 10 minutes. Generate with `openssl rand -hex 32`.
USACO_WEBHOOK_SECRET=
# Model for the problem explanations (the admin's Explain button), separate
# from CLAUDE_MODEL because those are long, considered answers rather than
# extraction. Blank means claude-opus-5-5. The key is CLAUDE_API_KEY above;
# without it the button is off and the rest of the site works.
USACO_CLAUDE_MODEL=
# --- Activity tracker (/tracker/) --------------------------------------------
# An image built and published by the ccp repo's CI. Blank runs :latest; set a
+5 -1
View File
@@ -555,7 +555,9 @@ services:
# It has no database: git is its store. It keeps a clone of adamf/usaco in
# ./usaco-data, pulled over the Docker network when Gitea's push webhook
# fires (USACO_WEBHOOK_SECRET signs it), and commits the admin's edits
# (status, link, notes) back with USACO_GIT_TOKEN. ./usaco-data holds only
# (status, link, notes, statement, explanations) back with USACO_GIT_TOKEN.
# CLAUDE_API_KEY powers the admin's Explain button (USACO_CLAUDE_MODEL picks
# the model; blank is claude-opus-5-5). ./usaco-data holds only
# that clone, so deleting it is safe; the image runs as uid 1000, so the
# directory must be owned by it.
#
@@ -575,6 +577,8 @@ services:
- GIT_TOKEN=${USACO_GIT_TOKEN:-}
- WEBHOOK_SECRET=${USACO_WEBHOOK_SECRET:-}
- AUTH_VALIDATE_URL=http://${BACKEND_HOST}:${BACKEND_PORT}/auth/validate-admin
- CLAUDE_API_KEY=${CLAUDE_API_KEY:-}
- CLAUDE_MODEL=${USACO_CLAUDE_MODEL:-}
volumes:
- ./usaco-data:/data