docs: add environment variables documentation#6483
Conversation
This commit adds comprehensive documentation for important server environment variables, specifically covering authentication and UI control. Added documentation for: - ELIZA_SERVER_AUTH_TOKEN: API authentication token for securing endpoints - ELIZA_UI_ENABLE: Web UI control for security and deployment flexibility The documentation includes: - Purpose and default behavior for each variable - Usage examples and configuration values - Security implications - Common deployment scenarios (production, development, headless API) - References to related implementation files Closes #5716
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Claude finished @lalalune's task in 44s —— View job Review Summary
Overall: Good documentation for key security environment variables ✅
Findings
Positives
|
| ## Related Files | ||
|
|
||
| - **Configuration**: `.env.example` - Template with all available environment variables | ||
| - **Authentication**: `packages/server/src/authMiddleware.ts` - API key validation logic |
There was a problem hiding this comment.
The authentication middleware is at packages/server/src/middleware/api-key.ts, not packages/server/src/authMiddleware.ts.
| - **Authentication**: `packages/server/src/authMiddleware.ts` - API key validation logic | |
| - **Authentication**: `packages/server/src/middleware/api-key.ts` - API key validation logic |
| ## Related Files | ||
|
|
||
| - **Configuration**: `.env.example` - Template with all available environment variables | ||
| - **Authentication**: `packages/server/src/authMiddleware.ts` - API key validation logic |
There was a problem hiding this comment.
incorrect file path - should be packages/server/src/middleware/api-key.ts
| - **Authentication**: `packages/server/src/authMiddleware.ts` - API key validation logic | |
| - **Authentication**: `packages/server/src/middleware/api-key.ts` - API key validation logic |
Reopened from #6377 (was merged then rolled back)
Made with Cursor
Greptile Overview
Greptile Summary
Added new documentation file explaining two server environment variables:
ELIZA_SERVER_AUTH_TOKENfor API authentication andELIZA_UI_ENABLEfor web UI control. The documentation includes:Issue found:
Confidence Score: 4/5
docs/environment-variables.mdline 77Important Files Changed
Sequence Diagram
sequenceDiagram participant Dev as Developer participant Doc as environment-variables.md participant Env as .env.example participant Middleware as API Key Middleware participant Config as Config Utils Dev->>Doc: Reads documentation Note over Doc: Explains ELIZA_SERVER_AUTH_TOKEN<br/>and ELIZA_UI_ENABLE variables Doc->>Env: References template Dev->>Env: Sets configuration alt API Authentication Flow Env->>Middleware: AUTH_TOKEN configured Note over Middleware: Validates X-API-KEY header<br/>Returns 401 if invalid else No Auth Flow Env->>Middleware: AUTH_TOKEN not set Note over Middleware: Skips validation<br/>Allows all requests end alt UI Toggle Flow Env->>Config: UI_ENABLE set to true/false Config->>Dev: Force enable or disable UI else Automatic UI Flow Env->>Config: UI_ENABLE not set Config->>Dev: Enable in dev, disable in prod end