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:
set -a && source .env && set +a # load all of the below at onceDatabase
Section titled “Database”| Variable | Purpose | Example |
|---|---|---|
STACKRIVET_DB_VENDOR | Dialect | mysql (default) / postgresql |
SPRING_DATASOURCE_URL | Full JDBC URL for generic deployments | jdbc:mysql://db:3306/stackrivet?... |
SPRING_DATASOURCE_USERNAME / SPRING_DATASOURCE_PASSWORD | Database user/password | (env only) |
STACKRIVET_DB_HOST / _PORT / _NAME / _USER / _PASSWORD | Used by the bundled dev, dev-postgres and aliyun profiles | localhost |
STACKRIVET_DB_VENDOR selects the Flyway vendor directory. Use it even when you provide a full SPRING_DATASOURCE_URL.
Cache (required)
Section titled “Cache (required)”Redis backs JWT revocation and the health check, so it must be configured:
| Variable | Purpose |
|---|---|
STACKRIVET_REDIS_HOST / STACKRIVET_REDIS_PORT | Redis connection |
STACKRIVET_REDIS_USERNAME / STACKRIVET_REDIS_PASSWORD | Redis auth (if set) |
STACKRIVET_REDIS_DATABASE / STACKRIVET_REDIS_SSL | DB index / TLS toggle |
| Variable | Purpose |
|---|---|
STACKRIVET_SECURITY_JWT_SECRET | Token signing secret — set a strong value in every non-local environment |
STACKRIVET_SECURITY_JWT_ACCESS_TOKEN_TTL / _REFRESH_TOKEN_TTL | Optional token TTL overrides |
Production-class profiles (prod, production, staging, aliyun) refuse the dev default secret and the seed admin password.
HTTP ports
Section titled “HTTP ports”| Variable | Purpose | Default |
|---|---|---|
STACKRIVET_PORT | Application API port | 8080 |
STACKRIVET_MANAGEMENT_PORT | Actuator management port | 9090 |
STACKRIVET_MANAGEMENT_ADDRESS | Management bind address | 127.0.0.1 |
Storage (Asset Service)
Section titled “Storage (Asset Service)”| Variable | Purpose |
|---|---|
STACKRIVET_STORAGE_TYPE | local (default) / s3 / aliyun_oss |
STACKRIVET_S3_ENDPOINT / _REGION / _ACCESS_KEY / _SECRET_KEY | S3-compatible (MinIO, AWS S3) |
STACKRIVET_ALIYUN_OSS_ENDPOINT / _ACCESS_KEY / _SECRET_KEY | Aliyun 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.
Scheduler
Section titled “Scheduler”| Key | Purpose |
|---|---|
stackrivet.scheduler.snailjob.enabled | false by default; set true to activate the optional SnailJob adapter (Pro / Enterprise). See Tasks. |
Profile
Section titled “Profile”| Variable | Purpose |
|---|---|
STACKRIVET_PROFILE | Spring 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.