Skip to content

Configuration

Vein is configured with a single TOML file, vein.toml by default (override with --config). Generate a starter file with vein init, or copy vein.example.toml.

crates.io and npm work with defaults; add an [upstream] section only when you want Vein to fetch uncached RubyGems.

[server]
port = 8346 # default
[storage]
path = "./cache" # default
[server]
host = "0.0.0.0"
port = 8346
workers = 4 # Rama worker threads (default: CPU count)
[storage]
path = "./cache" # local filesystem storage for cached artifacts
[database]
# Preferred: a URL. SQLite:
url = "sqlite://./vein.db"
# path = "./vein.db" # alternative to url for SQLite
# Or PostgreSQL:
# url = "postgres://user:pass@db.internal/vein"
# max_connections = 32
[database.reliability.retry]
enabled = true # default: true
max_attempts = 5 # including the initial request, default: 5
initial_backoff_ms = 500 # default: 500
max_backoff_secs = 30 # default: 30
backoff_strategy = "exponential" # "exponential" | "fibonacci" | "constant"
[logging]
level = "info" # debug, info, warn, error
json = false # true for JSON-formatted logs
[hotcache]
# Six-field cron: "sec min hour day month weekday"
refresh_schedule = "0 0 * * * *" # every hour; "" disables automatic refresh
[hotcache.reliability.retry]
enabled = true
max_attempts = 3
initial_backoff_ms = 1000
max_backoff_secs = 2
backoff_strategy = "constant"
# Optional - RubyGems only. crates.io and npm use fixed upstreams.
# By default Vein runs in cache-only mode for RubyGems.
[upstream]
url = "https://rubygems.org"
fallback_urls = ["https://gems.coop"] # tried in order if primary is unreachable
timeout_secs = 30
connection_pool_size = 128
[upstream.reliability.retry]
enabled = true
max_attempts = 3
initial_backoff_ms = 100
max_backoff_secs = 2
backoff_strategy = "exponential"
# Supply chain protection - see /quarantine/
[delay_policy]
enabled = false
default_delay_days = 3
skip_weekends = true
business_hours_only = true
release_hour_utc = 9
[[delay_policy.gems]]
name = "rails*"
pattern = true
delay_days = 7
[[delay_policy.pinned]]
name = "rails"
version = "8.0.1"
reason = "Security patch - verified safe"

The sqlite and postgres Cargo features are mutually exclusive - a single build picks one:

Terminal window
# SQLite (default)
cargo build --release
# PostgreSQL
cargo build --release --no-default-features --features postgres,tls

See Architecture for what the database and storage layers are each responsible for, and Deployment for Docker/systemd examples that wire this file in.