Coach: the Codex provider, and a credential that stays out of your backups
The Codex CLI adapter, its runtime and sandbox in the coach image only, and the one placement decision this PR exists to get right. Codex keeps a refreshable sign-in cache of its own rather than taking a token on the environment, so it needs somewhere durable to write. That is ./coach-auth — a sibling of ./data, never a folder inside it, mounted separately, owned by `coach`, mode 0700. The placement is the point. docs/SELF_HOSTING §5 tells owners to back up with `tar czf … data/`, so anything under ./data lands in every archive people are instructed to produce. Workout history belongs there; a live refresh token does not — it keeps working after that archive is copied to a laptop or a cloud drive. Keeping the cache outside ./data is what lets the backup instructions stay true about what they capture, and §5 now says so explicitly rather than leaving the reader to find out. I got to define this rather than fix it: no Codex path was ever committed here, so the nested layout the fork had never reached this repo. A test asserts the sibling relationship directly, because "outside ./data" is the kind of invariant a later refactor breaks by tidying. bubblewrap and the Codex CLI are added in the coach target only — bubblewrap is a Codex requirement, so an owner who never opted in carries neither. The image job now asserts both directions: present and runnable in the coach image (codex-cli 0.147.0, bubblewrap 0.11.2, /coach-auth as coach:0700), and absent from the default one. Codex is usable through the existing connect route with an API key, which needs no new surface. Its ChatGPT device-code sign-in is not in this PR — see the PR description for what that still needs. api 73/73, frontend 404/404, both image targets built and inspected, 11 locales in sync at 767, library in sync at 1324. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
64fd67cfa8
commit
ef61df50f2
9 files changed
+147
-2
No files matched your search
@@ -178,6 +178,27 @@ job environment is built from nothing rather than filtered, and the SDK's `env`
|
||||
the child environment rather than extending it — so `RP_ID`, `ADMIN_UIDS` and the VAPID keys
|
||||
cannot reach it by inheritance even by accident.
|
||||
|
||||
## Where a credential lives
|
||||
|
||||
Two shapes, because the two providers work differently:
|
||||
|
||||
- **Claude** takes its credential on the environment, so nothing is written to disk beyond the
|
||||
encrypted blob in `coach.json` — it reaches the model process as `CLAUDE_CODE_OAUTH_TOKEN` (or
|
||||
`ANTHROPIC_API_KEY`) and by no other route.
|
||||
- **Codex** keeps a refreshable sign-in cache of its own, so it needs somewhere durable to write.
|
||||
That is `./coach-auth`, mounted at `/coach-auth`, owned by the `coach` user, mode `0700`.
|
||||
|
||||
`./coach-auth` is a **sibling of `./data`, never a folder inside it**, and that placement is the
|
||||
whole point. §5 of `docs/SELF_HOSTING.md` tells owners to back up with `tar czf … data/`.
|
||||
Anything under `./data` is therefore in every backup archive people are instructed to produce —
|
||||
and unlike workout history, a refresh token keeps working after that archive is copied to a
|
||||
laptop or a cloud drive. Keeping the cache outside `./data` is what lets the backup instructions
|
||||
stay true about what they capture.
|
||||
|
||||
Per-profile credentials follow the same rule for the same reason: they live in
|
||||
`coach-auth-<uid>.json` at mode `0600`, never in the synced state blob, so they cannot ride along
|
||||
in a device sync or in a user's own JSON export.
|
||||
|
||||
## Off is really off
|
||||
|
||||
`COACH_DISABLED=1` forces the Coach off everywhere regardless of what is stored — the fleet
|
||||
|
||||
@@ -118,6 +118,13 @@ tar czf opengym-backup-$(date +%F).tar.gz data/
|
||||
That archive contains all profiles, passkeys and workout history. Restore by unpacking it back
|
||||
into the project folder. (Individual users can also export their own data as JSON from Settings.)
|
||||
|
||||
If you enabled the AI Coach with the Codex provider, note what this archive deliberately does
|
||||
**not** contain: `./coach-auth`, where that provider keeps its refreshable sign-in. It is a
|
||||
sibling of `./data` rather than a folder inside it precisely so that a live credential does not
|
||||
end up in every backup you are told to make — an archive like this gets copied to laptops and
|
||||
cloud drives, and a refresh token keeps working wherever it lands. Nothing in `./coach-auth`
|
||||
needs backing up: if you lose it, sign the provider in again.
|
||||
|
||||
## 6. Notifications
|
||||
|
||||
openGym can push two kinds of alert to your phone/desktop, even when the app isn't open:
|
||||
|
||||
Reference in new issue
Block a user