Skip to main content

Environment Variables

All configuration of the SuperFast backend server is done via environment variables. This page documents every supported variable, its purpose, and an example value.

Required Variablesโ€‹

These must be set for the server to start:

VariableDescriptionExample
DATABASE_URLPostgreSQL connection stringpostgresql://superfast:password@localhost:5432/superfast
REDIS_URLRedis connection stringredis://:password@localhost:6379
JWT_SECRETSecret key for signing JWT tokens (min 32 chars)a8f3e7d2c1b4... (random 64-char hex)

Databaseโ€‹

VariableDefaultDescription
DATABASE_URLโ€” (required)Full PostgreSQL connection string
DATABASE_MAX_CONNECTIONS25Maximum DB connection pool size
DATABASE_MIN_CONNECTIONS5Minimum connections kept alive
DATABASE_CONNECTION_TIMEOUT30Seconds to wait for a connection
DATABASE_SSL_MODErequirePostgreSQL SSL mode (disable, require, verify-full)
DATABASE_URL=postgresql://superfast:StrongPass123@db.yourdomain.com:5432/superfast?sslmode=require
DATABASE_MAX_CONNECTIONS=25

Redisโ€‹

VariableDefaultDescription
REDIS_URLโ€” (required)Redis connection URI
REDIS_POOL_SIZE10Redis connection pool size
REDIS_TIMEOUT5Seconds before Redis command times out
REDIS_URL=redis://:RedisPassword456@localhost:6379/0

MinIO / Object Storageโ€‹

VariableDefaultDescription
MINIO_ENDPOINTโ€” (required)MinIO host and port, no protocol
MINIO_ACCESS_KEYโ€” (required)MinIO root user / access key
MINIO_SECRET_KEYโ€” (required)MinIO root password / secret key
MINIO_BUCKETsuperfastS3 bucket name for all uploads
MINIO_USE_SSLfalseSet true if MinIO has TLS enabled
MINIO_REGIONus-east-1S3 region (used in signed URLs)
MINIO_ENDPOINT=minio.yourdomain.com:9000
MINIO_ACCESS_KEY=superfastadmin
MINIO_SECRET_KEY=SuperSecretMinioKey789
MINIO_BUCKET=superfast
MINIO_USE_SSL=true
tip

If you use AWS S3 or Cloudflare R2 instead of MinIO, set MINIO_ENDPOINT to the appropriate S3-compatible endpoint and configure the region accordingly.


JWT Authenticationโ€‹

VariableDefaultDescription
JWT_SECRETโ€” (required)HMAC-SHA256 signing secret (min 32 chars)
JWT_ACCESS_EXPIRY86400Access token TTL in seconds (default: 24h)
JWT_REFRESH_EXPIRY2592000Refresh token TTL in seconds (default: 30 days)
JWT_SECRET=f9a2e8b1c4d7e3f6a9b2c5d8e1f4a7b0c3d6e9f2a5b8c1d4e7f0a3b6c9d2e5f8
JWT_ACCESS_EXPIRY=86400
JWT_REFRESH_EXPIRY=2592000
danger

Use a cryptographically random secret of at least 32 characters. Never share it or commit it to version control. Rotate it if it is ever exposed.

Generate a secure secret:

openssl rand -hex 32

Evolution API (WhatsApp)โ€‹

VariableDefaultDescription
EVOLUTION_API_URLโ€” (required if WhatsApp used)Base URL of the Evolution API instance
EVOLUTION_API_KEYโ€” (required if WhatsApp used)Global authentication key for Evolution API
EVOLUTION_INSTANCE_NAMEsuperfastDefault WhatsApp instance name
EVOLUTION_TIMEOUT30Seconds before WhatsApp API calls time out
EVOLUTION_API_URL=https://evolution.yourdomain.com
EVOLUTION_API_KEY=evo-api-key-secret-here

Serverโ€‹

VariableDefaultDescription
PORT8080Port the Go HTTP server listens on
GIN_MODEdebugGin framework mode: debug or release
CORS_ORIGINS*Comma-separated allowed CORS origins
LOG_LEVELinfoLog verbosity: debug, info, warn, error
LOG_FORMATjsonLog output format: json or text
PORT=8080
GIN_MODE=release
CORS_ORIGINS=https://app.yourdomain.com,https://docs.yourdomain.com
LOG_LEVEL=info
LOG_FORMAT=json

Rate Limitingโ€‹

VariableDefaultDescription
RATE_LIMIT_AUTH10Max auth requests per minute per IP
RATE_LIMIT_SYNC60Max sync requests per minute per device
RATE_LIMIT_WHATSAPP30Max WhatsApp requests per minute per device

Monitoring (Optional)โ€‹

VariableDefaultDescription
SENTRY_DSN""Sentry.io DSN for error tracking (leave empty to disable)
SENTRY_ENVIRONMENTproductionSentry environment tag
SENTRY_TRACES_SAMPLE_RATE0.1Sentry performance tracing sample rate (0โ€“1)
SENTRY_DSN=https://abc123@o123456.ingest.sentry.io/789
SENTRY_ENVIRONMENT=production

Webhook (Optional)โ€‹

VariableDefaultDescription
WEBHOOK_SECRET""Secret for validating incoming webhooks (HMAC-SHA256)
WEBHOOK_URL""URL to receive outgoing webhooks on sync events

Complete Example .envโ€‹

# Database
DATABASE_URL=postgresql://superfast:DbPassword123@postgres:5432/superfast
DATABASE_MAX_CONNECTIONS=25

# Redis
REDIS_URL=redis://:RedisPass456@redis:6379/0

# MinIO
MINIO_ENDPOINT=minio:9000
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=MinioSecret789
MINIO_BUCKET=superfast
MINIO_USE_SSL=false

# JWT
JWT_SECRET=f9a2e8b1c4d7e3f6a9b2c5d8e1f4a7b0c3d6e9f2a5b8c1d4e7f0a3b6c9d2e5f8
JWT_ACCESS_EXPIRY=86400
JWT_REFRESH_EXPIRY=2592000

# Evolution API
EVOLUTION_API_URL=http://evolution-api:8080
EVOLUTION_API_KEY=evo-secret-key

# Server
PORT=8080
GIN_MODE=release
LOG_LEVEL=info
LOG_FORMAT=json
CORS_ORIGINS=https://app.yourdomain.com

# Monitoring (optional)
SENTRY_DSN=