diff --git a/.env.example b/.env.example index 0c72f67..869ec90 100644 --- a/.env.example +++ b/.env.example @@ -249,6 +249,19 @@ USACO_WEBHOOK_SECRET= # 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= +# Recording reviews (the admin uploads themselves explaining a solution). +# Claude cannot take audio, so this OpenAI key transcribes it (whisper-1, +# about $0.006 a minute). Blank turns reviews off. +USACO_OPENAI_API_KEY= +# Optional: keep the recordings for playback in a PRIVATE Garage bucket, +# never `uploads` (that one is served publicly at /uploads/). Its own key, +# same shapes as S3_ACCESS_KEY_ID / S3_SECRET_ACCESS_KEY above. With the +# key blank the recordings are thrown away once transcribed. One-off setup: +# docker compose exec -T garage /garage bucket create usaco-audio +# docker compose exec -T garage /garage key import -n usaco-site --yes "$USACO_S3_ACCESS_KEY_ID" "$USACO_S3_SECRET_ACCESS_KEY" +# docker compose exec -T garage /garage bucket allow --read --write usaco-audio --key "$USACO_S3_ACCESS_KEY_ID" +USACO_S3_ACCESS_KEY_ID= +USACO_S3_SECRET_ACCESS_KEY= # --- Activity tracker (/tracker/) -------------------------------------------- # An image built and published by the ccp repo's CI. Blank runs :latest; set a diff --git a/docker-compose.yml b/docker-compose.yml index 7c5fe0c..3a94f98 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -557,7 +557,11 @@ services: # fires (USACO_WEBHOOK_SECRET signs it), and commits the admin's edits # (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 + # the model; blank is claude-opus-5-5). Recording reviews also need + # USACO_OPENAI_API_KEY to transcribe, and keep the audio in Garage's + # private usaco-audio bucket when USACO_S3_* is set (the site refuses to + # start with only some S3_* set, so all five go together or not at all: + # the blank-key case blanks the rest). ./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. # @@ -579,6 +583,12 @@ services: - AUTH_VALIDATE_URL=http://${BACKEND_HOST}:${BACKEND_PORT}/auth/validate-admin - CLAUDE_API_KEY=${CLAUDE_API_KEY:-} - CLAUDE_MODEL=${USACO_CLAUDE_MODEL:-} + - TRANSCRIBE_API_KEY=${USACO_OPENAI_API_KEY:-} + - S3_ACCESS_KEY_ID=${USACO_S3_ACCESS_KEY_ID:-} + - S3_SECRET_ACCESS_KEY=${USACO_S3_SECRET_ACCESS_KEY:-} + - S3_ENDPOINT=${USACO_S3_ACCESS_KEY_ID:+http://garage:3900} + - S3_REGION=${USACO_S3_ACCESS_KEY_ID:+garage} + - S3_BUCKET=${USACO_S3_ACCESS_KEY_ID:+usaco-audio} volumes: - ./usaco-data:/data