diff --git a/readme.md b/readme.md index d22cc0f..513d974 100644 --- a/readme.md +++ b/readme.md @@ -65,12 +65,15 @@ These can be overridden with CLI flags or environment variables: - `--port` or `PORT` - `--proxy-api-key` or `PROXY_API_KEY` +For mass deployments, set `PROXY_API_KEY` to the token generated by the deployment system. The +app will use that token as the required `Authorization: Bearer ...` value. + ## Verify ```bash curl -s http://localhost:3000/api/healthz curl -s http://localhost:3000/dashboard | head -curl -s -H "Authorization: Bearer dev-proxy-key" http://localhost:3000/v1/models +curl -s -H "Authorization: Bearer ${PROXY_API_KEY:-dev-proxy-key}" http://localhost:3000/v1/models ``` Expected without provider flags: dashboard, health, and model list work; chat completions return `503`. diff --git a/setup.md b/setup.md index adc6cbd..2ebc440 100644 --- a/setup.md +++ b/setup.md @@ -2,6 +2,11 @@ Clone and run https://git.komnenos.me/springfw/random-proxy in ./random-proxy. Goal: get the app running once, with Replit AI Integrations wired, on port 3000. +The deployment system may provide a generated bearer token for this instance. Use that exact +token as the `PROXY_API_KEY` environment variable/secret. Do not invent, rotate, print, or +replace it. If no generated token is provided, leave `PROXY_API_KEY` unset and use the app +default only for verification. + Do not: - add it to a parent workspace - move it into artifacts/ @@ -20,13 +25,16 @@ Steps: - OpenAI - Anthropic -3. Open ./random-proxy and use the configured Replit Run button. +3. Set `PROXY_API_KEY` to the deployment-provided/generated token if one was provided. -4. Wait briefly, then verify: +4. Open ./random-proxy and use the configured Replit Run button. + +5. Wait briefly, then verify. Use the generated token in the Authorization header when +`PROXY_API_KEY` was set; otherwise use `dev-proxy-key`: curl -s http://localhost:3000/api/healthz curl -s http://localhost:3000/dashboard | head - curl -s -H "Authorization: Bearer dev-proxy-key" http://localhost:3000/v1/models + curl -s -H "Authorization: Bearer ${PROXY_API_KEY:-dev-proxy-key}" http://localhost:3000/v1/models Report only: - local URL