Skip to content

Configuration

Dispatch uses YAML configuration files with environment variable overrides.

Config Files

FileEnvironment
config.local.yamlLocal development
config.dev.yamlDevelopment/staging
config.prod.yamlProduction

The ENV environment variable selects which file to load.

Server

yaml
server:
  port: 8080
  mode: release  # debug | release
  trusted_proxies:
    - 10.0.0.0/8

Database

yaml
database:
  host: localhost
  port: 5432
  name: dispatch
  ssl_mode: disable
  max_open_conns: 25
  max_idle_conns: 5

Credentials via env: DB_USER, DB_PASSWORD.

Redis

yaml
redis:
  host: localhost
  port: 6379

Password via env: REDIS_PASSWORD (optional).

SMTP Server

yaml
smtp:
  host: 0.0.0.0
  port: 587
  tls_port: 465
  domain: smtp.dispatch.techtranslab.com
  max_message_size: 10485760  # 10 MB
  max_recipients: 50

Authentication

yaml
auth:
  jwt_expiry: 24h
  webauthn:
    rp_display_name: Dispatch
    rp_id: dispatch.techtranslab.com
    rp_origin: https://dispatch.techtranslab.com

Logging

yaml
logging:
  level: info        # debug | info | warn | error
  format: json       # text | json
  output: stdout     # stdout | file | both
  file_path: logs/backend.log
  rotate_max_size_mb: 100
  rotate_max_backups: 7
  rotate_compress: true

Rate Limiting

Built-in IP-based rate limits:

EndpointLimit
Register / Login10 req / 5 min
Forgot password5 req / 15 min
Resend verification5 req / 10 min
SMS requests3 req / 1 hr
SMTP login attempts10 / 15 min per IP
SMTP connections5 concurrent per IP

TechTrans Lab