Skip to content

Configuration

StackRivet reads its configuration from environment variables (with sensible local defaults), so the same artifact runs in every environment. Secrets stay in the environment and are never committed.

The groups below are the settings you’ll use most often. A common local pattern:

Terminal window
set -a && source .env && set +a # load all of the below at once
VariablePurposeExample
STACKRIVET_DB_VENDORDialectmysql (default) / postgresql
SPRING_DATASOURCE_URLFull JDBC URL for generic deploymentsjdbc:mysql://db:3306/stackrivet?...
SPRING_DATASOURCE_USERNAME / SPRING_DATASOURCE_PASSWORDDatabase user/password(env only)
STACKRIVET_DB_HOST / _PORT / _NAME / _USER / _PASSWORDUsed by the bundled dev, dev-postgres and aliyun profileslocalhost

STACKRIVET_DB_VENDOR selects the Flyway vendor directory. Use it even when you provide a full SPRING_DATASOURCE_URL.

Redis backs JWT revocation and the health check, so it must be configured:

VariablePurpose
STACKRIVET_REDIS_HOST / STACKRIVET_REDIS_PORTRedis connection
STACKRIVET_REDIS_USERNAME / STACKRIVET_REDIS_PASSWORDRedis auth (if set)
STACKRIVET_REDIS_DATABASE / STACKRIVET_REDIS_SSLDB index / TLS toggle
VariablePurpose
STACKRIVET_SECURITY_JWT_SECRETToken signing secret — set a strong value in every non-local environment
STACKRIVET_SECURITY_JWT_ACCESS_TOKEN_TTL / _REFRESH_TOKEN_TTLOptional token TTL overrides

Production-class profiles (prod, production, staging, aliyun) refuse the dev default secret and the seed admin password.

VariablePurposeDefault
STACKRIVET_PORTApplication API port8080
STACKRIVET_MANAGEMENT_PORTActuator management port9090
STACKRIVET_MANAGEMENT_ADDRESSManagement bind address127.0.0.1
VariablePurpose
STACKRIVET_STORAGE_TYPElocal (default) / s3 / aliyun_oss
STACKRIVET_S3_ENDPOINT / _REGION / _ACCESS_KEY / _SECRET_KEYS3-compatible (MinIO, AWS S3)
STACKRIVET_ALIYUN_OSS_ENDPOINT / _ACCESS_KEY / _SECRET_KEYAliyun OSS

These feed the stackrivet.asset.* block (storage-type, max-file-size, allowed-extensions, signed-url-ttl). See Configure object storage for the full mapping and the region-match caveat.

KeyPurpose
stackrivet.scheduler.snailjob.enabledfalse by default; set true to activate the optional SnailJob adapter (Pro / Enterprise). See Tasks.
VariablePurpose
STACKRIVET_PROFILESpring profiles, e.g. dev or dev,otel to enable the OpenTelemetry profile

For environment-specific deployment, keep secrets in the runtime environment and document each deployment’s selected values in your own operations runbook.