Skip to content
Settings

Configuration

cyoda-go reads configuration from CYODA_* environment variables and from .env-format files. The model โ€” how sources compose, how profiles work, and how secrets are mounted from files โ€” is described below, and the authoritative key list (every variable, its type, its default) is mirrored in full under All variables. The binary remains the source of truth: run cyoda help config to read it directly.

Values resolve in this order, highest to lowest:

  1. Shell environment
  2. .env.{profile} files (in CYODA_PROFILES declaration order; later profiles override earlier ones within their group)
  3. .env in the project directory
  4. User config file
  5. System config file
  6. Hardcoded defaults

Format is .env only (godotenv-parsed). No TOML, no YAML, no --config flag. Subcommand flags (e.g. cyoda init --force) are operation-scoped and do not override server-runtime configuration.

User config path varies by OS: ~/.config/cyoda/cyoda.env (Linux, macOS with XDG), %AppData%\cyoda\cyoda.env (Windows). System config lives at /etc/cyoda/cyoda.env on POSIX.

CYODA_PROFILES is comma-separated and evaluated in declaration order. Within a profile, regular .env precedence applies; across profiles, later entries in the list override earlier ones.

Any variable that accepts a credential (Postgres URL, JWT signing key, metrics bearer, gossip HMAC, bootstrap client secret) accepts a companion *_FILE variable that reads from a mounted file. Trailing whitespace is stripped. The _FILE variant takes precedence when both are set โ€” the pattern designed for Kubernetes Secrets and Docker secrets mounts.

Every CYODA_* variable the engine reads, grouped by topic. Empty Default or Type cells mean the binary reports none. This table is generated from the pinned cyoda-go configuration surface.

admin (5)

VariableTypeDefaultDescription
CYODA_ADMIN_BIND_ADDRESSstring127.0.0.1Admin listener bind address.
CYODA_ADMIN_PORTint9091Admin port for health and metrics.
CYODA_METRICS_BEARERstringโ€”Static Bearer token for GET /metrics. Supports _FILE suffix.
CYODA_METRICS_REQUIRE_AUTHboolfalseRequire Bearer auth on /metrics; startup fails if true and CYODA_METRICS_BEARER is empty.
CYODA_OTEL_ENABLEDboolfalseEnable OpenTelemetry tracing and metrics.

auth (25)

VariableTypeDefaultDescription
CYODA_BOOTSTRAP_CLIENT_IDstringโ€”Bootstrap M2M client ID.
CYODA_BOOTSTRAP_CLIENT_SECRETstringโ€”Bootstrap M2M client secret; must be set when CYODA_BOOTSTRAP_CLIENT_ID is set. Supports _FILE suffix.
CYODA_BOOTSTRAP_ROLEScsvROLE_ADMIN,ROLE_M2MComma-separated roles granted to the bootstrap client.
CYODA_BOOTSTRAP_TENANT_IDstringdefault-tenantTenant for the bootstrap client.
CYODA_BOOTSTRAP_USER_IDstringadminUser ID for the bootstrap client.
CYODA_IAM_KEYPAIR_DEFAULT_VALIDITY_DAYSint365Default validity for the bootstrap signing key and runtime-issued keypairs.
CYODA_IAM_M2M_ADMIN_ROLE_ENABLEDboolfalseGates the withAdminRole=true query parameter on POST /clients.
CYODA_IAM_MOCK_ROLEScsvROLE_ADMIN,ROLE_M2MComma-separated default user roles assigned to all requests in mock mode.
CYODA_IAM_MODEstringmockAuthentication mode: mock or jwt.
CYODA_IAM_TRUSTED_KEY_MAX_JWK_PROPERTIESint20Caps the number of properties in a registered JWK.
CYODA_IAM_TRUSTED_KEY_MAX_PER_TENANTint10Per-tenant cap on registered trusted keys; 0 means unbounded.
CYODA_IAM_TRUSTED_KEY_MAX_VALIDITY_DAYSint365Default validity for trusted keys when the registration request omits validTo.
CYODA_IAM_TRUSTED_KEY_REGISTRATION_ENABLEDboolfalseGates the /oauth/keys/trusted/* endpoints; disabled returns 404 FEATURE_DISABLED.
CYODA_JWT_AUDIENCEstringโ€”Expected JWT audience (aud); empty disables the audience check.
CYODA_JWT_BOOTSTRAP_AUDIENCEstringclientAudience for the bootstrap signing key derived from CYODA_JWT_SIGNING_KEY; client or human.
CYODA_JWT_EXPIRY_SECONDSint3600Token lifetime in seconds.
CYODA_JWT_ISSUERstringcyodaJWT issuer claim (iss).
CYODA_JWT_SIGNING_KEYstringโ€”RSA private key in PEM format; required in jwt mode. Supports _FILE suffix.
CYODA_OIDC_ALLOW_PRIVATE_NETWORKSboolfalseBypass the SSRF blocklist so private-network OIDC providers can be registered; test/dev only, never in production.
CYODA_OIDC_CONNECTION_REQUEST_TIMEOUT_MSint5000Connection-pool request timeout in milliseconds for OIDC discovery and JWKS endpoint fetches.
CYODA_OIDC_CONNECT_TIMEOUT_MSint5000TCP connect timeout in milliseconds for OIDC discovery and JWKS endpoint fetches.
CYODA_OIDC_REQUIRE_HTTPSbooltrueReject federated OIDC provider registration when the well-known config URI is not https.
CYODA_OIDC_ROLES_CLAIMstringrolesJWT claim name from which role values are read for tokens issued by a federated OIDC provider.
CYODA_OIDC_SOCKET_TIMEOUT_MSint5000HTTP read timeout in milliseconds for OIDC discovery and JWKS endpoint fetches.
CYODA_REQUIRE_JWTboolfalseProduction safety floor; refuses to start unless IAM mode is jwt and a signing key is set.

cluster (14)

VariableTypeDefaultDescription
CYODA_CLUSTER_ENABLEDboolfalseEnable multi-node clustering.
CYODA_DISPATCH_FORWARD_TIMEOUTduration30sHTTP timeout for the cross-node forwarding call.
CYODA_DISPATCH_WAIT_TIMEOUTduration5sHow long the dispatcher polls gossip for a compute member with matching tags.
CYODA_GOSSIP_ADDRstring:7946Gossip protocol listen address ([host]:port).
CYODA_GOSSIP_STABILITY_WINDOWduration2sGossip stability window.
CYODA_GRPC_NODE_ADDRstringโ€”This node's gRPC endpoint advertised to peers (host:port, no scheme).
CYODA_HMAC_SECRETstringโ€”Hex-encoded HMAC secret for inter-node dispatch authentication; required when CYODA_CLUSTER_ENABLED=true. Supports _FILE suffix.
CYODA_KEEPALIVE_INTERVALint10Keep-alive send interval in seconds.
CYODA_KEEPALIVE_TIMEOUTint30Keep-alive timeout in seconds.
CYODA_NODE_ADDRstringhttp://localhost:8080This node's HTTP base URL; must include scheme.
CYODA_NODE_IDstringโ€”Unique node identifier; required when CYODA_CLUSTER_ENABLED=true.
CYODA_PROXY_TIMEOUTduration30sRequest proxy timeout.
CYODA_SEED_NODEScsvโ€”Comma-separated list of seed node addresses.
CYODA_TX_TOKEN_TTLduration1m30sTTL of the signed transaction routing token minted on processor/criteria dispatch.

cors (2)

VariableTypeDefaultDescription
CYODA_CORS_ALLOWED_ORIGINScsvโ€”Comma-separated allowed origins, or * for wildcard mode; empty selects loopback mode.
CYODA_CORS_ENABLEDbooltrueEnable CORS middleware; false hands CORS handling to an upstream ingress.

database (10)

VariableTypeDefaultDescription
CYODA_POSTGRES_AUTO_MIGRATEโ€”trueRun embedded SQL migrations on startup
CYODA_POSTGRES_MAX_CONNSโ€”25Max pool connections
CYODA_POSTGRES_MAX_CONN_IDLE_TIMEโ€”5mMax idle time before closing connection
CYODA_POSTGRES_MIN_CONNSโ€”5Min pool connections
CYODA_POSTGRES_URLโ€”โ€”PostgreSQL connection string
CYODA_SQLITE_AUTO_MIGRATEโ€”trueRun embedded SQL migrations on startup
CYODA_SQLITE_BUSY_TIMEOUTโ€”5sWait time for write lock
CYODA_SQLITE_CACHE_SIZEโ€”64000Page cache in KiB
CYODA_SQLITE_PATHโ€”$XDG_DATA_HOME/cyoda/cyoda.db (Windows: %LocalAppData%\cyoda\cyoda.db)Database file path
CYODA_SQLITE_SEARCH_SCAN_LIMITโ€”100000Max rows examined per search with residual filter

grpc (4)

VariableTypeDefaultDescription
CYODA_COMPUTE_GRPC_ENDPOINTstringโ€”gRPC endpoint for a compute node to connect to (compute-client side).
CYODA_COMPUTE_HTTP_BASEstringโ€”HTTP base URL of the cyoda instance a compute node calls back into (compute-client side).
CYODA_COMPUTE_TOKENstringโ€”Bearer token for compute-node authentication (compute-client side).
CYODA_GRPC_PORTint9090gRPC listen port.

schema (2)

VariableTypeDefaultDescription
CYODA_SCHEMA_EXTEND_MAX_RETRIESโ€”8Max retries on concurrent schema extension
CYODA_SCHEMA_SAVEPOINT_INTERVALโ€”64Rows per savepoint during schema extension
VariableTypeDefaultDescription
CYODA_SEARCH_MAX_SORT_KEYSint16Maximum number of sort keys per search request; values <= 0 clamp to the default.
CYODA_SEARCH_REAP_INTERVALduration5mSearch snapshot reap interval.
CYODA_SEARCH_SNAPSHOT_TTLduration1hSearch snapshot TTL.
CYODA_STATS_GROUP_MAXint10000Cardinality ceiling for grouped-stats results; also caps the request limit parameter. Values <= 0 clamp to the default.

server (11)

VariableTypeDefaultDescription
CYODA_CONTEXT_PATHstring/apiURL prefix for all routes.
CYODA_DEBUGโ€”โ€”Reserved; not currently read by the server.
CYODA_ERROR_RESPONSE_MODEstringsanitizedError detail level: sanitized (generic message + ticket UUID for 5xx) or verbose (internal detail included; development only).
CYODA_HTTP_PORTint8080HTTP listen port.
CYODA_LOG_LEVELstringinfoLog level: debug|info|warn|error.
CYODA_MAX_STATE_VISITSint10Max visits per state in workflow cascade.
CYODA_MODEL_CACHE_LEASEduration5mModel cache lease duration; actual expiry is jittered ยฑ10%.
CYODA_PROFILEScsvโ€”Comma-separated profile names; loads cyoda.<name>.env files before the process's own environment is consulted.
CYODA_STARTUP_TIMEOUTduration30sDeadline for plugin init, TM init, and (cluster mode) the gossip seed-join retry loop.
CYODA_STORAGE_BACKENDstringmemoryStorage backend selection (memory|sqlite|postgres).
CYODA_SUPPRESS_BANNERboolfalseSilence startup and mock-auth banners (CI/tests only).

tx (3)

VariableTypeDefaultDescription
CYODA_TX_OUTCOME_TTLduration5mTransaction outcome TTL.
CYODA_TX_REAP_INTERVALduration10sTransaction reap interval.
CYODA_TX_TTLduration1mTransaction TTL.
  • cyoda help config โ€” cyoda configuration reference
    Environment variables beat default values. The `_FILE` suffix variant takes precedence over the plain variable when both are set โ€” for example, `CYODA_POSTGRES_URL_FILE=/etc/secrets/db-url` wins over `CYODA_POSTGRES_URL`. There are no command-line flags for configuration values; env vars are the sole configuration surface.
  • cyoda help config auth โ€” auth configuration
    config.auth โ€” IAM mode, JWT issuer, HMAC secret, and admin bootstrap controls.
  • cyoda help config cors โ€” CORS configuration
    config.cors โ€” Cross-Origin Resource Sharing (CORS) controls for the public HTTP surface.
  • cyoda help config database โ€” database configuration
    config.database โ€” storage backend selection and per-backend connection settings.
  • cyoda help config grpc โ€” grpc configuration
    config.grpc โ€” gRPC listener settings and compute-node credentials.
  • cyoda help config schema โ€” schema configuration
    config.schema โ€” schema-extension log tuning.