Environment variables
This is a complete reference of all environment variables used to configure Synjar.
Generated automatically from the .env.example file.
Quick start
Copy the example file and edit it:
cp .env.example .env
Then edit the values according to your environment.
REQUIRED
Database connection (local development with docker
| Variable | Default | Required | Description |
|---|---|---|---|
DATABASE_URL | postgresql://postgres:postgres... | Yes | - |
JWT_SECRET | dev-jwt-secret-change-in-produ... | Yes | JWT configuration (change in production!) |
JWT_EXPIRES_IN | 15m | Yes | - |
DATABASE_URL
Default: postgresql://postgres:postgres@localhost:6205/synjar_dev?schema=public
JWT_SECRET
JWT configuration (change in production!)
Default: dev-jwt-secret-change-in-production-min-32-chars-required
JWT_EXPIRES_IN
Default: 15m
REQUIRED
OpenAI API (required for embeddings)
| Variable | Default | Required | Description |
|---|---|---|---|
OPENAI_API_KEY | sk-proj-your-key-here | Yes | Get your key: https://platform.openai.com/api-keys |
OPENAI_ORG_ID | org-your-org-here | Yes | - |
B2_KEY_ID | minioadmin | Yes | S3-Compatible Storage LOCAL DEV with MinIO (docker-compose.dev.yml - works out-of-box!) MinIO Console: http://localhost:6206 (minioadmin/minioadmin) |
B2_APPLICATION_KEY | minioadmin | Yes | - |
B2_BUCKET_NAME | synjar-dev | Yes | - |
B2_ENDPOINT | http://localhost:6204 | Yes | - |
OPENAI_API_KEY
Get your key: https://platform.openai.com/api-keys
Default: sk-proj-your-key-here
OPENAI_ORG_ID
Default: org-your-org-here
B2_KEY_ID
S3-Compatible Storage LOCAL DEV with MinIO (docker-compose.dev.yml - works out-of-box!) MinIO Console: http://localhost:6206 (minioadmin/minioadmin)
Default: minioadmin
B2_APPLICATION_KEY
Default: minioadmin
B2_BUCKET_NAME
Default: synjar-dev
B2_ENDPOINT
Default: http://localhost:6204
APPLICATION SETTINGS
Server
| Variable | Default | Required | Description |
|---|---|---|---|
PORT | 6200 | Yes | - |
NODE_ENV | development | Yes | - |
CORS_ORIGINS | http://localhost:6200,http://l... | Yes | - |
MAX_FILE_SIZE_MB | 50 | Yes | Limits |
MAX_STORAGE_GB | 1 | Yes | - |
MAX_DOCUMENTS | 1000 | Yes | - |
PORT
Default: 6200
NODE_ENV
Default: development
CORS_ORIGINS
Default: http://localhost:6200,http://localhost:6210,http://localhost:5173
MAX_FILE_SIZE_MB
Limits
Default: 50
MAX_STORAGE_GB
Default: 1
MAX_DOCUMENTS
Default: 1000
ENTERPRISE FEATURES (optional)
Set to 'true' to enable enterprise modules (@synjar/enterprise)
| Variable | Default | Required | Description |
|---|---|---|---|
ENABLE_ENTERPRISE | false | Yes | - |
ENABLE_ENTERPRISE
Default: false
DUAL
Deployment Mode
| Variable | Default | Required | Description |
|---|---|---|---|
DEPLOYMENT_MODE | self-hosted | Yes | - 'cloud': Multi-tenant SaaS with email verification required - 'self-hosted': Single-tenant, first user = admin, invitation-only Leave uncommented for local development (works out-of-box with Mailpit) |
EMAIL_VERIFICATION_URL | http://localhost:6210/auth/ver... | Yes | Email Verification URL (Frontend) Used in verification emails - points to your frontend verify page |
ADMIN_EMAIL | admin@yourcompany.com | Yes | Admin Contact (Self-Hosted Mode) Email shown to blocked users when registration is disabled |
DEPLOYMENT_MODE
- 'cloud': Multi-tenant SaaS with email verification required - 'self-hosted': Single-tenant, first user = admin, invitation-only Leave uncommented for local development (works out-of-box with Mailpit)
Default: self-hosted
EMAIL_VERIFICATION_URL
Email Verification URL (Frontend) Used in verification emails - points to your frontend verify page
Default: http://localhost:6210/auth/verify
ADMIN_EMAIL
Admin Contact (Self-Hosted Mode) Email shown to blocked users when registration is disabled
Default: admin@yourcompany.com
EMAIL CONFIGURATION
Local Development (with docker
| Variable | Default | Required | Description |
|---|---|---|---|
SMTP_HOST | localhost | Yes | These settings work out-of-box with Mailpit - no changes needed! View emails at: http://localhost:6203 |
SMTP_PORT | 6202 | Yes | - |
SMTP_SECURE | false | Yes | - |
SMTP_FROM_EMAIL | noreply@synjar.local | Yes | - |
SMTP_FROM_NAME | Synjar Dev | Yes | - |
SMTP_HOST
These settings work out-of-box with Mailpit - no changes needed! View emails at: http://localhost:6203
Default: localhost
SMTP_PORT
Default: 6202
SMTP_SECURE
Default: false
SMTP_FROM_EMAIL
Default: noreply@synjar.local
SMTP_FROM_NAME
Default: Synjar Dev
SECURITY
Rate limits per TTL window
| Variable | Default | Required | Description |
|---|---|---|---|
THROTTLE_LIMIT_REGISTER | 3 # 3 registration attempts... | Yes | - |
THROTTLE_LIMIT_LOGIN | 5 # 5 login attempts per... | Yes | - |
THROTTLE_LIMIT_RESEND | 1 # 1 resend verification... | Yes | - |
GRACE_PERIOD_MINUTES | 15 | Yes | Grace Period (Cloud Mode Only) Time in minutes that new unverified users can explore the platform |
THROTTLE_LIMIT_REGISTER
Default: 3 # 3 registration attempts per minute
THROTTLE_LIMIT_LOGIN
Default: 5 # 5 login attempts per minute
THROTTLE_LIMIT_RESEND
Default: 1 # 1 resend verification per minute
GRACE_PERIOD_MINUTES
Grace Period (Cloud Mode Only) Time in minutes that new unverified users can explore the platform
Default: 15
CLOUD MODE
Uncomment to enable Cloud mode with Stripe billing
BACKUP SYSTEM (sysadmin only)
Generate with: openssl rand
| Variable | Default | Required | Description |
|---|---|---|---|
BACKUP_RETENTION_DAYS | 30 | Yes | Retention policy (days) |
BACKUP_RETENTION_DAYS
Retention policy (days)
Default: 30