@@ -10,13 +10,8 @@ bun install
1010
1111# Copy and edit config
1212cp config.example.yaml config.yaml
13- <<< <<< < Updated upstream
14-
1513# Log in (OAuth, browser-based)
1614bun run src/index.ts auth login zai # or: bigmodel
17- =======
18- # Log in first via OAuth (see Authentication below)
19- >>>>>>> Stashed changes
2015
2116# Start the proxy
2217bun run src/index.ts
@@ -245,7 +240,7 @@ file (best-effort; never affects handling). Requires a TTY with at least
245240| -------| ---------| ---------| -------------|
246241| ` server.port ` | ` ZCODE_PROXY_PORT ` | ` 8080 ` | Listen port |
247242| ` auth.proxyApiKey ` | ` ZCODE_PROXY_API_KEY ` | — | Client auth key |
248- | ` auth.oauthCredentialsPath ` | — | ` ~/.zcode-proxy/credentials.json ` | Encrypted credential store from ` auth login ` |
243+ | ` auth.oauthCredentialsPath ` | — | — | Parsed but currently not honored — the credential store path is fixed at ` ~/.zcode-proxy/credentials.json ` |
249244| ` provider ` | ` ZCODE_PROVIDER ` | ` zai ` | Upstream provider |
250245| ` plan ` | — | ` coding-plan ` | Plan tier: ` coding-plan ` (direct upstream) or ` start-plan ` (zcode.z.ai gateway + JWT + captcha) |
251246| ` identity.appVersion ` | ` ZCODE_APP_VERSION ` | ` 3.10.0 ` | ` User-Agent: ZCode/{version} ` |
@@ -268,7 +263,7 @@ Client Request
268263Proxy API Key Auth (shared secret)
269264 │
270265 ▼
271- Route Detection + Plan-aware Routing (both plans post Anthropic upstream, v2.4 +)
266+ Route Detection + Plan-aware Routing (both plans post Anthropic upstream, v4.5.0 +)
272267 /v1/chat/completions (OpenAI client format)
273268 ├─ coding-plan → TRANSLATE OpenAI→Anthropic → provider's anthropic endpoint
274269 │ (remapped to zcode.z.ai ultra endpoints via server-controlled mapping)
@@ -344,10 +339,11 @@ encrypted credential store. Log in on the host with a fixed encryption seed
344339ZCODE_PROXY_CREDENTIAL_SECRET=" a-long-random-secret" \
345340 bun run src/index.ts auth login zai
346341
347- # 2. Point auth.oauthCredentialsPath in config.yaml at the mounted store, then run:
342+ # 2. Mount the store at the path the proxy reads. The image runs as user `bun`
343+ # (home /home/bun) and the store path is fixed, not configurable:
348344docker run --rm -p 8080:8080 \
349345 -v " $( pwd) /config.yaml:/data/config.yaml:ro" \
350- -v " $( HOME) /.zcode-proxy/credentials.json:/data /credentials.json:ro" \
346+ -v " $( HOME) /.zcode-proxy/credentials.json:/home/bun/.zcode-proxy /credentials.json:ro" \
351347 -e ZCODE_PROXY_CREDENTIAL_SECRET=" a-long-random-secret" \
352348 ghcr.io/tridefender/zcode-proxy:latest
353349```
@@ -373,7 +369,7 @@ services:
373369 - " 8080:8080"
374370 volumes :
375371 - ./config.yaml:/data/config.yaml:ro
376- - ./credentials.json:/data /credentials.json:ro
372+ - ./credentials.json:/home/bun/.zcode-proxy /credentials.json:ro
377373 environment :
378374 ZCODE_PROVIDER : zai
379375 ZCODE_PROXY_API_KEY : " your-proxy-secret"
0 commit comments