Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

docs(authz): document OMNIROUTE_PEER_STAMP_TOKEN in .env.example + ENVIRONMENT.md

diegosouzapw816ba12599e9
diff --git a/.env.example b/.env.example
index a16f45b3fd..300ac6e517 100644
--- a/.env.example
+++ b/.env.example
@@ -197,6 +197,14 @@ ALLOW_API_KEY_REVEAL=false
# Generate: openssl rand -base64 32
# OMNIROUTE_WS_BRIDGE_SECRET=
+# Per-process secret that proves the trusted peer-IP stamp came from OmniRoute's
+# own HTTP server (scripts/dev/peer-stamp.mjs). The custom server stamps the real
+# TCP peer IP as `<token>|<ip>`; the authz middleware trusts the locality only
+# when the token matches. Used by: src/server/authz/policies/management.ts.
+# Auto-generated per boot — leave UNSET in normal use. Only set it to pin a fixed
+# value across processes (e.g. a multi-process setup that must share the stamp).
+# OMNIROUTE_PEER_STAMP_TOKEN=
+
# Comma-separated API key IDs that skip request logging (GDPR/compliance).
# Used by: src/lib/compliance/index.ts — suppresses logs for specific keys.
# NO_LOG_API_KEY_IDS=key_abc123,key_def456
diff --git a/docs/reference/ENVIRONMENT.md b/docs/reference/ENVIRONMENT.md
index a193377523..0884a2466c 100644
--- a/docs/reference/ENVIRONMENT.md
+++ b/docs/reference/ENVIRONMENT.md
@@ -58,6 +58,7 @@ These **must** be set before the first run. Without them, the application will e
| `API_KEY_SECRET` | **Yes** | _(none)_ | `src/lib/db/apiKeys.ts` | AES encryption key for API key values at rest in SQLite. Generate with `openssl rand -hex 32`. |
| `INITIAL_PASSWORD` | **Yes** | `CHANGEME` | Bootstrap script | Sets the initial admin dashboard password (matches `.env.example` default — kept obviously insecure to force a change). **Change before first use.** After login, change via Dashboard → Settings → Security. |
| `OMNIROUTE_WS_BRIDGE_SECRET` | **Yes** (production) | _(unset)_ | `src/app/api/internal/codex-responses-ws/route.ts` | Shared secret for the internal Codex Responses WebSocket bridge. Authenticates bridge requests between the Electron/browser WS relay and OmniRoute. ⚠️ **REQUIRED in production — when unset, all WS bridge requests are rejected.** Generate with `openssl rand -base64 32`. |
+| `OMNIROUTE_PEER_STAMP_TOKEN` | No (auto) | _(auto per boot)_ | `src/server/authz/policies/management.ts` | Per-process secret proving the trusted peer-IP stamp came from OmniRoute's own HTTP server (`scripts/dev/peer-stamp.mjs`). The authz middleware trusts request locality (loopback/LAN gating of LOCAL_ONLY routes) only when the stamp carries this token. Auto-generated each boot — leave unset; only pin it for multi-process setups that must share the stamp. |
### Generation Commands