Skip to main content

Configuration Guide

This document explains how to configure Decision Engine for local and on-prem deployments.

Primary Config Files

  • config/development.toml: used for host/source runs
  • config/docker-configuration.toml: used for Docker and Compose runs
  • helm-charts/config/development.toml: Kubernetes chart template config
These files already exist with all required sections. Edit the one that matches your runtime rather than copying from config.example.toml, which is incomplete.

Config Sections

Server

host is the bind address. Use 0.0.0.0 for Docker/deployed, 127.0.0.1 for local-only.

Logging

log_format accepts "default" (human-readable) or "json" (structured, recommended for prod).

Metrics

Prometheus metrics are exposed at host:port/metrics. Used by the monitoring Compose profile (Prometheus scrapes 9094, Grafana at 3000).

Rate Limiting

Controls rate limiting on the delete APIs. request_count requests allowed per duration seconds.

Redis cache config

Database

MySQL and PostgreSQL use separate config sections. MySQL:
PostgreSQL:
For Docker Compose runs both are pre-wired via service names in config/docker-configuration.toml.

Multi-Tenant Schema

Maps tenant identifiers to database schemas. The shipped config files (config/development.toml, config/docker-configuration.toml) define only the public tenant — add entries for any additional tenant you want to support. Some routes resolve the tenant from an x-tenant-id request header rather than the authenticated merchant, and reject the request outright if it’s missing (TE_03). Send x-tenant-id: public on GET /health/diagnostics, every GET /analytics/* route, and POST /gateway-score/reset — see API Guide.

Redis

Redis is required — it’s used for caching routing config and service config. For Docker, use the service name as host.

Auth

Use a strong, random jwt_secret — 32+ characters recommended. Set email_verification_enabled = true if you’ve wired an email provider.

Admin Secret

Used to authenticate the POST /merchant-account/create endpoint (admin bootstrap). Change this in production.

API Key Auth

Top-level flag. When true, protected routes accept x-api-key in addition to JWT bearer tokens. When false, the auth middleware allows all requests through without authentication — this effectively disables auth for every protected route. Do not set this to false in any environment that should enforce auth.

Analytics

Both Kafka and ClickHouse require enabled = true — without it, analytics is disabled even if the connection details are configured.
Decision outcomes are published to Kafka and consumed into ClickHouse. Both are required for analytics and audit dashboard views. For Docker runs, these are pre-configured and enabled via the Compose profiles.

TLS

Paths to PEM-format certificate and key files. Only needed if you’re terminating TLS at the app layer rather than a reverse proxy.

API Client

Controls the outbound HTTP client used for upstream calls. Set identity to a PEM path if you need mTLS.

Secrets Management

By default, secrets in config are stored in plaintext. For production, use one of the two supported backends.

AWS KMS

Requires the kms-aws feature (included in the release feature set).

HashiCorp Vault

Requires the kms-hashicorp-vault feature.
When a secrets manager is configured, sensitive fields like database.password and user_auth.jwt_secret are resolved from the vault rather than the config file.

Environment Overrides

Selected values can be overridden at runtime via environment variables. This is useful in Helm deployments via extraEnvVars. Consult src/config.rs for the full mapping.