From 6d9e9d083c01db041249bc1298cf301b8d8fe391 Mon Sep 17 00:00:00 2001 From: JSONbored <49853598+JSONbored@users.noreply.github.com> Date: Tue, 7 Jul 2026 16:56:30 -0700 Subject: [PATCH] docs(selfhost): add Claude Code + Codex token setup and rotation guide --- .../routes/docs.self-hosting-ai-providers.tsx | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/apps/gittensory-ui/src/routes/docs.self-hosting-ai-providers.tsx b/apps/gittensory-ui/src/routes/docs.self-hosting-ai-providers.tsx index fb694c42f6..8711602164 100644 --- a/apps/gittensory-ui/src/routes/docs.self-hosting-ai-providers.tsx +++ b/apps/gittensory-ui/src/routes/docs.self-hosting-ai-providers.tsx @@ -166,6 +166,74 @@ AI_ON_MERGE=either`} ]} /> +
+ No API key — claude-code runs your existing Claude subscription through the{" "}
+ claude CLI. Generate a long-lived token once with{" "}
+ claude setup-token and store it as CLAUDE_CODE_OAUTH_TOKEN.
+
+ Rotating it: when the subscription's usage limit resets or the token needs
+ replacing, run claude setup-token again and paste the new value into{" "}
+ .env. CLAUDE_CODE_OAUTH_TOKEN is baked into the container at
+ creation time, so a plain restart keeps serving the old value — recreate the service
+ instead:
+
+ Codex has no equivalent of claude setup-token. Instead of an environment
+ variable, it stores an OAuth credential file, auth.json. Authenticate against
+ the running container so the file lands on the volume the image expects (
+ /data/codex, mounted at ~/.codex):
+
+ This also needs the explicit opt-in shown in the fallback example above (
+ GITTENSORY_ENABLE_UNSAFE_CODEX_REVIEWER=1) — see the Subscription CLI safety
+ note below for why it defaults to off.
+
auth.json fresh on every review — each review spawns a new{" "}
+ codex subprocess. Once codex auth succeeds, the very next review
+ authenticates correctly; there is no service to recreate and no env var to change.
+ + Both subscription CLIs fail loudly in the self-host logs instead of silently degrading the + review: +
+