ATHELOS
Reference

Environment Variables

Every environment variable ATHELOS reads, with defaults.

Environment Variables

ATHELOS reads configuration from environment variables across three files. This page lists every variable and what it does.

The three env files

FileUsed by
.envScripts and Drizzle Kit (from repo root)
apps/web/.env.localThe web application at runtime
docker/.envDocker Compose services

Each has an .example template. Copy and fill in real values.

Root .env

Used by scripts that run outside the web app — database migrations, seeds, and maintenance tasks.

VariableRequiredPurpose
DATABASE_URLYesPostgres connection string
REDIS_URLYesRedis connection string
MEILI_HOSTYesMeilisearch HTTP endpoint
MEILI_MASTER_KEYYesMeilisearch admin key
AUTH_SECRETYesSession signing secret

Example:

DATABASE_URL=postgres://soc:password@localhost:5433/soc_solo
REDIS_URL=redis://:password@localhost:6379
MEILI_HOST=http://localhost:7700
MEILI_MASTER_KEY=<generate with openssl rand -base64 32>
AUTH_SECRET=<generate with openssl rand -base64 32>

apps/web/.env.local

The full runtime config for the web app.

Database

VariableRequiredPurpose
DATABASE_URLYesPostgres connection string

Auth

VariableRequiredPurpose
AUTH_SECRETYesSession signing key. Write-once.
AUTH_TRUST_HOSTYesSet to true for local dev behind a proxy
NEXTAUTH_URLYesThe public URL of the app (http://localhost:3000)

Redis

VariableRequiredPurpose
REDIS_URLYesRedis connection string

Meilisearch

VariableRequiredPurpose
MEILI_HOSTYesHTTP endpoint
MEILI_MASTER_KEYYesAdmin key

MinIO

VariableRequiredPurpose
MINIO_ENDPOINTYesHostname (e.g. localhost)
MINIO_PORTYesPort (9000)
MINIO_USE_SSLYesfalse locally, true in production
MINIO_ACCESS_KEYYesAccess key ID
MINIO_SECRET_KEYYesSecret access key
MINIO_BUCKETYesBucket for evidence files (soc-evidence)

Ollama

VariableRequiredPurpose
OLLAMA_HOSTNoEndpoint (default http://localhost:11434)
OLLAMA_MODELNoChat model (default llama3.2:3b)
OLLAMA_NUM_CTXNoContext window (default 2048)
OLLAMA_EMBED_MODELNoEmbedding model (default nomic-embed-text)

Optional. If Ollama isn't running, the AI features hide themselves.

TOTP encryption

VariableRequiredPurpose
TOTP_ENCRYPTION_KEYYes if TOTP enabledAES-256-GCM key for encrypting TOTP secrets. Write-once.

Generate:

openssl rand -base64 32

WebAuthn

VariableRequiredPurpose
WEBAUTHN_RP_IDYes if WebAuthn enabledRelying Party ID — the domain (localhost for dev)
WEBAUTHN_RP_NAMEYes if WebAuthn enabledDisplay name shown in the browser
WEBAUTHN_ORIGINYes if WebAuthn enabledThe origin (http://localhost:3000)

SMTP (optional)

VariableRequiredPurpose
SMTP_HOSTNoMail server
SMTP_PORTNoPort (587 or 465)
SMTP_USERNoLogin
SMTP_PASSWORDNoPassword
SMTP_FROMNoFrom address
SMTP_TONoDestination address
SMTP_SECURENotrue for implicit TLS

Webhooks (optional)

VariableRequiredPurpose
WEBHOOK_URLNoEndpoint to POST notifications to
WEBHOOK_SECRETNoHMAC signing secret

Notification control

VariableRequiredPurpose
EMAIL_NOTIFICATIONSNotrue to enable email (default false)
WEBHOOK_NOTIFICATIONSNotrue to enable webhooks (default false)
QUIET_HOURS_STARTNoe.g. 22:00
QUIET_HOURS_ENDNoe.g. 07:00
NOTIFY_DIGESTNotrue for digest mode
DIGEST_HOURNoe.g. 08:00

docker/.env

Used by Docker Compose to set service passwords.

VariableRequiredPurpose
POSTGRES_PASSWORDYesPostgres password for the soc user
REDIS_PASSWORDYesRedis AUTH password
MINIO_ROOT_USERYesMinIO admin username
MINIO_ROOT_PASSWORDYesMinIO admin password
MEILI_MASTER_KEYYesMeilisearch admin key

Important: the values here must match the corresponding values in apps/web/.env.local — the app has to know the passwords to connect.

backups/.env

Used by restic.

VariableRequiredPurpose
RESTIC_REPOSITORYYese.g. b2:bucket-name
RESTIC_PASSWORDYesEncryption passphrase. Write-once.
B2_ACCOUNT_IDYesBackblaze key ID
B2_ACCOUNT_KEYYesBackblaze application key

Write-once secrets

Three secrets must never change after first use:

SecretWhy
AUTH_SECRETRotating invalidates all active sessions
TOTP_ENCRYPTION_KEYRotating makes existing TOTP secrets undecryptable
RESTIC_PASSWORDRotating locks you out of existing backup snapshots

Back each one up to a password manager and on paper. Never commit them. Never email them. Never paste them into a chat.

Generating strong values

For passwords and secrets:

openssl rand -base64 32

For hex secrets:

openssl rand -hex 32

Use a different random value for each variable. Never reuse.

Where variables are read

  • Web app — apps/web/.env.local
  • Worker — reads from apps/web/.env.local (same config)
  • Scripts — root .env
  • Docker services — docker/.env
  • Restic — backups/.env

When scripts fail with "variable not set," check the correct file.

Reloading after changes

Env changes require a restart:

  • Web app — kill and restart pnpm dev or pnpm dev:site
  • Worker — kill and restart pnpm dev:worker
  • Docker services — docker compose up -d re-reads docker/.env

The web app doesn't hot-reload env changes.

Where to go next