# AtlasOS - Calypso API Configuration
# Copy this file to /etc/calypso/config.yaml and customize

server:
  port: 8080
  host: "0.0.0.0"
  read_timeout: 15s
  write_timeout: 15s
  idle_timeout: 60s
  # Response caching configuration
  cache:
    enabled: true              # Enable response caching
    default_ttl: 5m            # Default cache TTL (5 minutes)
    max_age: 300               # Cache-Control max-age in seconds (5 minutes)

database:
  host: "localhost"
  port: 5432
  user: "calypso"
  password: ""  # Set via CALYPSO_DB_PASSWORD environment variable
  database: "calypso"
  ssl_mode: "disable"
  # Connection pool optimization:
  # max_connections: Should be (max_expected_concurrent_requests / avg_query_time_ms * 1000)
  # For typical workloads: 25-50 connections
  max_connections: 25
  # max_idle_conns: Keep some connections warm for faster response
  # Should be ~20% of max_connections
  max_idle_conns: 5
  # conn_max_lifetime: Recycle connections to prevent stale connections
  # 5 minutes is good for most workloads
  conn_max_lifetime: 5m

auth:
  jwt_secret: ""  # Set via CALYPSO_JWT_SECRET environment variable (use strong random string)
  token_lifetime: 24h
  argon2:
    memory: 65536      # 64 MB
    iterations: 3
    parallelism: 4
    salt_length: 16
    key_length: 32

logging:
  level: "info"        # debug, info, warn, error
  format: "json"       # json or text

