Configuration Reference

Complete list of CLI flags and environment variables for Simple Relay.

Simple Relay adheres to the 12-factor application methodology. Configuration options are supplied via command-line flags and environment variables. Command-line flags take precedence over environment variables, which override default values.


Server Daemon Settings Matrix

When running Simple Relay as a background daemon (relay or relay serve), the following flags and environment variables are supported. Both standard POSIX flags (--host) and single-dash flags (-host) are accepted:

CLI FlagEnvironment VariableDefaultDescription
--host, -hostRELAY_HOST0.0.0.0Server host address.
--port, -portRELAY_PORT (or PORT)8080Server HTTP port.
--db, -dbRELAY_DB_PATHrelay.dbPath to persistent SQLite database file.
--log-level, -log-levelRELAY_LOG_LEVELinfoLogging verbosity: debug, info, warn, error.
--workers, -workersRELAY_WORKER_CONCURRENCY20Outbound worker pool concurrency.
--dispatcher-buffer, -dispatcher-bufferRELAY_DISPATCHER_BUFFER0 (dynamic: 2 * workers)Dispatcher jobs channel buffer capacity.
--dispatcher-poll-ms, -dispatcher-poll-msRELAY_DISPATCHER_POLL_MS500Dispatcher polling interval in milliseconds.
--cleaner-interval, -cleaner-intervalRELAY_CLEANER_INTERVAL1hStorage retention cleaner execution interval.
--drain-timeout, -drain-timeoutRELAY_DRAIN_TIMEOUT30sGraceful shutdown drain timeout.
--trust-proxy, -trust-proxyRELAY_TRUST_PROXYfalseTrust X-Forwarded-For and X-Real-IP headers from reverse proxy for client IP extraction and login rate limiting.
--sqlite-sync, -sqlite-syncRELAY_SQLITE_SYNCNORMALSQLite WAL PRAGMA synchronous durability mode (NORMAL or FULL). Set to FULL on single-node bare-metal hosts without UPS or Litestream replication.
--max-body-size-mb, -max-body-size-mbRELAY_MAX_BODY_SIZE_MB10Maximum allowable HTTP request body size in megabytes.
—RELAY_RETENTION_SUCCESS_DAYS7Retention period in days for successfully delivered records.
—RELAY_RETENTION_FAILED_DAYS30Retention period in days for failed/dead-lettered records.
—RELAY_ADMIN_PASSWORD""Admin authentication password. When empty (""), unauthenticated access is restricted to loopback (127.0.0.1 / ::1); remote callers must provide X-API-Key.
—RELAY_BATCH_SIZE50Maximum requests grouped per SQLite WAL write transaction.
—RELAY_BATCH_TIMEOUT_MS10Maximum batch linger duration before flushing to SQLite.

CLI Subcommands Settings Matrix

When executing operator subcommands (relay health, relay queue, relay dlq), the following global persistent flags and environment variables configure remote daemon connectivity and output formatting:

CLI FlagEnvironment VariableDefaultDescription
-s, --serverRELAY_SERVER_URLhttp://127.0.0.1:8080Target Simple Relay daemon HTTP/HTTPS address.
-k, --api-keyRELAY_API_KEY""Admin API key for protected management endpoints.
-o, --outputRELAY_OUTPUTtableOutput format: table (human-readable) or json (scripting).
--timeoutRELAY_TIMEOUT10sHTTP client request timeout duration.

[!TIP] Detailed Subcommand Documentation For subcommand recipes, interactive confirmation overrides, and orchestration probe configurations, see the CLI Reference.


Dynamic Route Configuration

Routes in Simple Relay are managed dynamically at runtime via the REST API (/api/v1/routes) or the embedded Web UI, avoiding static configuration files and service restarts. Routes are persisted in SQLite and hot-reloaded into memory.

Route Creation Example (POST /api/v1/routes)

curl -X POST http://localhost:8080/api/v1/routes \
  -H "Content-Type: application/json" \
  -d '{
    "name": "stripe-inbound",
    "type": "inbound",
    "mode": "async",
    "path": "/api/v1/webhook/stripe",
    "destination_url": "http://internal-backend:8000/webhooks/stripe",
    "signature_provider": "stripe",
    "signature_secret": "whsec_...",
    "max_attempts": 10,
    "timeout_ms": 15000,
    "retry_backoff_strategy": "exp",
    "base_backoff_ms": 5000,
    "max_backoff_ms": 900000,
    "retry_non_idempotent": false
  }'