vaultaris /docs

Configuration

Complete reference for all Vaultaris environment variables.

Vaultaris is configured entirely through environment variables — no config files required. Values can be provided via a .env file (loaded with dotenvy) or injected by your container runtime / secret manager.

Server

VariableDefaultDescription
SERVER_HOST0.0.0.0IP address to bind
SERVER_PORT8080TCP port to listen on
EXTERNAL_URLhttp://localhost:8080Public-facing base URL. Used in OAuth redirects, emails, and as the WebAuthn Relying Party origin. Changing it invalidates registered passkeys.

Database

VariableDefaultDescription
DATABASE_URLpostgres://postgres:postgres@localhost:5432/vaultarisPostgreSQL connection string
DATABASE_MAX_CONNECTIONS10Maximum pool size per node
DATABASE_MIN_CONNECTIONS1Minimum idle connections
DATABASE_ACQUIRE_TIMEOUT_SECS30Seconds to wait for a pool connection

Multi-node: Total DB connections = nodes × DATABASE_MAX_CONNECTIONS. Keep below PostgreSQL max_connections.

Security & Encryption

VariableDefaultDescription
JWT_SECRETchange-me-in-productionHMAC-SHA256 signing key for short-lived internal tokens (MFA tokens, setup tokens). Change in production.
JWT_ISSUER$EXTERNAL_URLiss claim in all issued tokens
ENCRYPTION_KEYchange-me-in-production-32-charsAES-256-GCM key for encrypting sensitive data at rest (TOTP secrets). Must be exactly 32 bytes.

Access, refresh, and ID tokens use rotating ed25519 / ECDSA keys from the JWK set, not JWT_SECRET. Token lifetimes are configured per-tenant in the dashboard or via API.

Email

Common settings

VariableDefaultDescription
EMAIL_ENABLEDfalseWhen false, tokens are logged to stdout only. Set to true for production.
EMAIL_PROVIDERsmtpActive provider: smtp · sendgrid · mailgun · ses · brevo
EMAIL_FROM_ADDRESSnoreply@vaultaris.localSender address
EMAIL_FROM_NAMEVaultarisSender display name

SMTP (EMAIL_PROVIDER=smtp)

VariableDefaultDescription
SMTP_HOSTlocalhostSMTP server hostname
SMTP_PORT587587 = STARTTLS · 465 = implicit TLS · 25 = plain
SMTP_USERNAMESMTP username
SMTP_PASSWORDSMTP password or API key
SMTP_TLStrueEnable STARTTLS

SendGrid (EMAIL_PROVIDER=sendgrid)

VariableDefaultDescription
SENDGRID_API_KEYAPI key from the SendGrid dashboard

Brevo (EMAIL_PROVIDER=brevo)

VariableDefaultDescription
BREVO_API_KEYAPI key from the Brevo dashboard

Mailgun (EMAIL_PROVIDER=mailgun)

VariableDefaultDescription
MAILGUN_API_KEYAPI key
MAILGUN_DOMAINSending domain, e.g. mg.example.com
MAILGUN_EU_REGIONfalseUse EU endpoint (api.eu.mailgun.net)

AWS SES (EMAIL_PROVIDER=ses)

The IAM user needs ses:SendEmail permission. Uses SES v2 HTTP API with AWS Signature Version 4 — no SDK required.

VariableDefaultDescription
SES_ACCESS_KEY_IDAWS access key ID
SES_SECRET_ACCESS_KEYAWS secret access key
SES_REGIONus-east-1AWS region

Redis (distributed rate limiting)

VariableDefaultDescription
REDIS_URLunsetredis://localhost:6379. When unset, rate limiting is in-memory (single-node only).

Rate Limiting

VariableDefaultDescription
RATE_LIMIT_MAX_REQUESTS120Requests per IP per window
RATE_LIMIT_WINDOW_SECS60Rolling window in seconds

Uses Redis sliding-window algorithm (Lua script). Falls back to in-memory fixed-window when Redis is unavailable. Returns 429 with Retry-After header.

GeoIP (optional)

VariableDefaultDescription
GEOIP_DATABASE_PATHunsetPath to a MaxMind GeoLite2-Country .mmdb file. When unset, falls back to ip-api.com (45 req/min free tier).

Download from MaxMind (registration required).

Control Plane integration

These variables connect a self-hosted Vaultaris instance to the cloud control plane for license management and telemetry. Omit entirely for air-gapped deployments.

VariableDefaultDescription
CONTROL_PLANE_URLunsetBase URL of the control plane API, e.g. https://cp.vaultaris.net
HEARTBEAT_INTERVAL_SECS60How often the instance reports to the control plane
TELEMETRY_INTERVAL_SECS900How often usage telemetry is sent (leader node only)
GRACE_PERIOD_HOURS168Hours after a missed heartbeat before entering read-only mode (7 days)

On each heartbeat, the control plane returns the current license limits and a status (ok or read_only). If the control plane is unreachable, the instance operates normally until the grace period expires, then switches to read-only mode (logins still work, all writes blocked).

License limits received from the control plane are applied immediately: a downgrade triggers LIFO freeze, an upgrade triggers FIFO unfreeze.

Billing shadow service token

Used by the cloud control plane to manage billing shadow tenants on this instance. Only required on cloud-managed deployments.

VariableDefaultDescription
BILLING_SHADOW_SERVICE_TOKENunsetPre-shared token. Constant-time comparison protects against timing attacks.

Metrics

VariableDefaultDescription
METRICS_ENABLEDtrueExpose Prometheus-compatible metrics at /metrics

Logging

# Development
RUST_LOG=info,vaultaris=debug,tower_http=debug

# Production (structured JSON via tracing-subscriber)
RUST_LOG=info

Minimum production checklist

DATABASE_URL=postgres://vaultaris:strong-pass@db:5432/vaultaris
JWT_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 16)
EXTERNAL_URL=https://auth.example.com
REDIS_URL=redis://redis:6379
RATE_LIMIT_MAX_REQUESTS=60
EMAIL_ENABLED=true
EMAIL_PROVIDER=sendgrid
SENDGRID_API_KEY=SG.xxxxx