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 (26)

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_KINDstringuserPrincipal kind (user|service|system) assigned to the default UserContext in mock mode.
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.

scheduler (7)

VariableTypeDefaultDescription
CYODA_SCHEDULER_BATCH_SIZEint100Max due tasks pulled per scan.
CYODA_SCHEDULER_COORDINATORstringlowest-node-idCoordinator-election strategy.
CYODA_SCHEDULER_DISTRIBUTIONstringround-robinDispatch-target selection strategy: round-robin or self. Forced to self when CYODA_CLUSTER_ENABLED=false.
CYODA_SCHEDULER_ENABLEDbooltrueKill switch for the scheduled-transition coordinator scan loop.
CYODA_SCHEDULER_EXPIRY_GRACEduration100msGrace band above a scheduled transition's timeoutMs before it is expired instead of fired late; size to at least the max inter-node clock skew.
CYODA_SCHEDULER_REDISPATCH_BACKOFFduration30sBest-effort re-dispatch throttle window after a due task is picked up.
CYODA_SCHEDULER_SCAN_INTERVALduration1sCoordinator scan cadence.

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 cluster β€” cyoda cluster & dispatch configuration
    - `CYODA_CLUSTER_ENABLED` (bool, default: `false`) β€” enable multi-node clustering. - `CYODA_NODE_ID` (string, default: unset) β€” unique node identifier; required when `CYODA_CLUSTER_ENABLED=true`; any non-empty string is accepted. - `CYODA_NODE_ADDR` (string, default: `http://localhost:8080`) β€” this node's HTTP base URL; must include scheme (`http://` or `https://`). - `CYODA_GRPC_NODE_ADDR` (string, default: unset) β€” this node's gRPC endpoint advertised to peers (`host:port`, no scheme). When set, peers dial this address for cross-node gRPC callback forwarding. When unset, peers derive the gRPC address from this node's HTTP host plus their own `CYODA_GRPC_PORT` (uniform-deployment default). - `CYODA_GOSSIP_ADDR` (string, default: `:7946`) β€” gossip protocol listen address; format `[host]:port` β€” parsed via `net.SplitHostPort`; invalid format causes startup failure. - `CYODA_GOSSIP_STABILITY_WINDOW` (duration, default: `2s`) β€” gossip stability window. - `CYODA_SEED_NODES` (string, default: empty) β€” comma-separated list of seed node addresses (e.g., `node1.example.com:7946,node2.example.com:7946`); empty means single-node or seed-discovery handled externally. - `CYODA_HMAC_SECRET` (string, default: unset) β€” hex-encoded HMAC secret for inter-node dispatch authentication; required when `CYODA_CLUSTER_ENABLED=true`. Supports `_FILE` suffix. - `CYODA_PROXY_TIMEOUT` (duration, default: `30s`) β€” request proxy timeout. - `CYODA_DISPATCH_WAIT_TIMEOUT` (duration, default: `5s`) β€” how long the dispatcher polls gossip for a compute member with matching tags. - `CYODA_DISPATCH_FORWARD_TIMEOUT` (duration, default: `30s`) β€” HTTP timeout for the cross-node forwarding call. - `CYODA_TX_TOKEN_TTL` (duration, default: `90s`) β€” TTL of the signed transaction routing token minted on processor/criteria dispatch; must be β‰₯ `CYODA_DISPATCH_FORWARD_TIMEOUT` so the token remains valid through the full round-trip and callback verification, including the forwarded-chain case where two budgets stack. - `CYODA_KEEPALIVE_INTERVAL` (int, default: `10`) β€” keep-alive send interval in seconds. - `CYODA_KEEPALIVE_TIMEOUT` (int, default: `30`) β€” keep-alive timeout in seconds.
  • 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 scheduler β€” cyoda scheduled-transition scheduler configuration
    - `CYODA_SCHEDULER_ENABLED` (bool, default: `true`) β€” kill switch for the coordinator scan loop. - `CYODA_SCHEDULER_SCAN_INTERVAL` (duration, default: `1s`) β€” coordinator scan cadence. - `CYODA_SCHEDULER_BATCH_SIZE` (int, default: `100`) β€” max due tasks pulled per scan. - `CYODA_SCHEDULER_DISTRIBUTION` (string, default: `round-robin`) β€” dispatch-target selection strategy: `round-robin` or `self`. Forced to `self` whenever `CYODA_CLUSTER_ENABLED=false`. - `CYODA_SCHEDULER_COORDINATOR` (string, default: `lowest-node-id`) β€” coordinator-election strategy; the member with the lexicographically smallest node ID scans on each tick. - `CYODA_SCHEDULER_REDISPATCH_BACKOFF` (duration, default: `30s`) β€” best-effort re-dispatch throttle window applied to a task once it is picked up, so the same due task isn't immediately re-dispatched on the next scan. - `CYODA_SCHEDULER_EXPIRY_GRACE` (duration, default: `100ms`) β€” grace band above a scheduled transition's `timeoutMs` before it is expired instead of fired late; size to at least the maximum expected inter-node clock skew.
  • cyoda help config schema β€” schema configuration
    config.schema β€” schema-extension log tuning.