# Global Registry Prefix (optional)
# GLOBAL_REGISTRY=

# Sub2API image version
SUB2API_VERSION=0.1.124

# Dependency image versions
SUB2API_POSTGRES_VERSION=18-alpine
SUB2API_REDIS_VERSION=8-alpine

# Timezone
TZ=UTC

# Host port for the Sub2API web UI and API
SUB2API_PORT_OVERRIDE=8080

# Application modes
SUB2API_SERVER_MODE=release
SUB2API_RUN_MODE=standard

# PostgreSQL settings
SUB2API_POSTGRES_USER=sub2api
SUB2API_POSTGRES_PASSWORD=sub2api
SUB2API_POSTGRES_DB=sub2api

# Redis settings
SUB2API_REDIS_PASSWORD=
SUB2API_REDIS_DB=0

# Admin bootstrap account
SUB2API_ADMIN_EMAIL=admin@sub2api.local
# Leave empty to auto-generate the admin password on first startup
SUB2API_ADMIN_PASSWORD=

# Session and 2FA secrets
# Set fixed values in production to keep logins and TOTP valid across restarts
SUB2API_JWT_SECRET=
SUB2API_TOTP_ENCRYPTION_KEY=
SUB2API_JWT_EXPIRE_HOUR=24

# Database pool tuning
SUB2API_DATABASE_MAX_OPEN_CONNS=50
SUB2API_DATABASE_MAX_IDLE_CONNS=10
SUB2API_DATABASE_CONN_MAX_LIFETIME_MINUTES=30
SUB2API_DATABASE_CONN_MAX_IDLE_TIME_MINUTES=5

# Redis pool tuning
SUB2API_REDIS_POOL_SIZE=1024
SUB2API_REDIS_MIN_IDLE_CONNS=10

# Optional security relaxations for trusted internal networks only
SUB2API_SECURITY_URL_ALLOWLIST_ENABLED=false
SUB2API_SECURITY_URL_ALLOWLIST_ALLOW_INSECURE_HTTP=false
SUB2API_SECURITY_URL_ALLOWLIST_ALLOW_PRIVATE_HOSTS=false

# Optional proxy for online updates and pricing data
# SUB2API_UPDATE_PROXY_URL=socks5://127.0.0.1:1080

# Resource limits for the Sub2API application
SUB2API_CPU_LIMIT=1.0
SUB2API_MEMORY_LIMIT=1024M
SUB2API_CPU_RESERVATION=0.25
SUB2API_MEMORY_RESERVATION=256M

# Resource limits for PostgreSQL
SUB2API_POSTGRES_CPU_LIMIT=1.0
SUB2API_POSTGRES_MEMORY_LIMIT=1024M
SUB2API_POSTGRES_CPU_RESERVATION=0.25
SUB2API_POSTGRES_MEMORY_RESERVATION=256M

# Resource limits for Redis
SUB2API_REDIS_CPU_LIMIT=0.50
SUB2API_REDIS_MEMORY_LIMIT=512M
SUB2API_REDIS_CPU_RESERVATION=0.10
SUB2API_REDIS_MEMORY_RESERVATION=128M
