1. When advanced configuration is needed
If ghc-api listens only on 127.0.0.1 for one local user, the defaults are usually enough. Add these controls only when sharing Copilot access, connecting from other devices, retaining requests, or synchronizing machines.
2. User tokens for a shared instance
Start with ghc-api --enable-auth, or enable enable_auth in the configuration generated by your installed version.
- A user opens
/signupand receives a one-timegha_...token. - An administrator approves the user in the dashboard.
- The client sends the approved token as a Bearer token or compatible API-key header.
- An administrator can revoke or remove the user.
Requests still use the deployer's GitHub Copilot account and upstream entitlement. They do not create separate Copilot quotas.
3. Protect administration with a reverse proxy
User-token middleware primarily protects LLM endpoints. Protect dashboards, request details, user management, and configuration APIs separately with nginx, Caddy, or another reverse proxy.
- Allow Bearer-token LLM requests to reach ghc-api without Basic Auth intercepting them.
- Require separate administrator authentication for dashboard and management paths.
- Disable proxy buffering and use a long read timeout for streaming.
- Expose only required ports and use HTTPS.
Never treat the dashboard as a public status page.
4. Request logs, OneDrive, and persistence
| Feature | Before enabling |
|---|---|
| Request files | Useful for historical statistics but may retain sensitive content. |
| OneDrive | Can synchronize config, sessions, and usage; enable only when the cloud boundary is acceptable. |
| User registry | Contains user state and tokens; restrict file access and backups. |
| Memory cache | Size it for concurrency and the sensitivity of retained requests. |
5. Deployment checklist
- Confirm account and organization model access.
- Enable user authentication and approve a test user.
- Separate LLM and administrator authentication rules.
- Verify SSE streaming is not buffered.
- Review permissions for logs, sync, and backups.
- Complete an end-to-end request with a non-admin client token.
Inspect the models and endpoints available to your account before copying a model ID into client configuration.
Inspect models and parameters →