Environment Variables
All Codality configuration is stored in a .env file. The settings UI (Admin → Environment tab) lets you edit these values without touching the file directly.
Core settings
| Variable | Description | Default | Restart required |
|---|---|---|---|
PORT |
Server listening port | 8000 |
Yes |
DATABASE_PATH |
Path to SQLite database file | — | Yes |
APP_URL |
Public URL of the application | — | Yes |
SESSION_SECRET |
Secret key for session cookies (64-char hex recommended) | — | Yes |
WORKTREE_BASE |
Base directory for git worktrees | — | Yes |
API keys
| Variable | Description | Restart required |
|---|---|---|
OPENAI_API_KEY |
OpenAI API key for the AI agent | Yes |
SENDGRID_API_KEY |
SendGrid API key for OTP emails | No |
TAVILY_API_KEY |
Tavily API key for web search tool (optional) | No |
| Variable | Description | Restart required |
|---|---|---|
FROM_EMAIL |
Sender email address for outgoing mail. Must match your SendGrid verified sender. | No |
GitHub integration
These are set automatically by the GitHub App manifest flow. You rarely need to edit them manually.
| Variable | Description | Restart required |
|---|---|---|
GITHUB_APP_ID |
GitHub App ID | No |
GITHUB_CLIENT_ID |
GitHub App OAuth client ID | No |
GITHUB_CLIENT_SECRET |
GitHub App OAuth client secret | No |
GITHUB_WEBHOOK_SECRET |
Secret for verifying GitHub webhook signatures | No |
GITHUB_PRIVATE_KEY |
GitHub App private key (PEM-encoded) | No |
GITHUB_API_BASE_URL |
GitHub API base URL. Leave empty for github.com. Set for GitHub Enterprise. | No |
Editing in the UI
Go to Admin → Environment tab. Each variable shows its current value, description, and whether a restart is required after changing it.
Sensitive values (API keys, secrets) are masked by default. Click the field to reveal.
After saving changes that require a restart, click Restart Service to apply them.
Editing the file directly
The env file is at /etc/codality/codality.env (or ~/.config/codality/codality.env on macOS). Standard KEY=value format, one per line. Restart the service after editing:
sudo systemctl restart codalityThe file has mode 0600 and is owned by the codality system user. To edit manually:
sudo nano /etc/codality/codality.env
sudo systemctl restart codality