Skip to main content

Module config

Module config 

Source
Expand description

Server configuration with startup validation.

Loads configuration from environment variables and validates that all required values are present at startup, not at first use.

§Environment Variables

VariableRequiredDefaultDescription
DATABASE_URLprod-PostgreSQL connection string
JWT_SECRETproddev defaultJWT signing secret
WORKER_TOKENproddev defaultWorker-to-API auth token
PORTno3000HTTP listen port
ALLOWED_ORIGINSnosame-originComma-separated CORS origins
DASHBOARD_DIRnoembeddedFilesystem path to dashboard assets
WEBHOOK_URLno-Outbound webhook URL for notifications
IRONFLOW_ENVnodevelopmentproduction or development
RATE_LIMIT_AUTHno10Auth rate limit (req/min/IP). 0 = disabled
RATE_LIMIT_GENERALno60General rate limit (req/min/IP). 0 = disabled
ARTIFACTS_DIRno-Filesystem root for artifact blobs. Unset disables artifacts
ARTIFACT_MAX_BYTESno104857600Maximum size of a single artifact
PURGE_MAX_AGE_DAYSno90Runs older than this are purged
PURGE_MAX_RUNS_PER_WORKFLOWno1000Max terminal runs kept per workflow
PURGE_DRY_RUNnofalseLog what would be purged without deleting
PURGE_INTERVAL_SECSno86400Seconds between purge ticks (min 60)

§Examples

use ironflow_api::config::ServerConfig;

let config = ServerConfig::from_env()?;
println!("Listening on port {}", config.port);

Structs§

ConfigError
Configuration validation error.
ServerConfig
Server configuration loaded from environment variables.