Quickstart
-
Install
With Docker:
Terminal window docker run -p 8346:8346 -v vein-data:/data ghcr.io/contriboss/vein:latestOr build from source (SQLite backend, default):
Terminal window git clone https://github.com/contriboss/vein.gitcd veincargo build --releaseFor a PostgreSQL backend instead of SQLite:
Terminal window cargo build --release --no-default-features --features postgres,tlsSQLite and PostgreSQL are mutually exclusive at compile time - pick one.
-
Initialize a config
Terminal window cargo run -- initThis writes
vein.toml. A minimal config looks like:[server]host = "0.0.0.0"port = 8346[storage]path = "./cache"[database]url = "sqlite://./vein.db"# Optional: enable RubyGems fetching for uncached gems.# crates.io and npm work without any upstream config.# [upstream]# url = "https://rubygems.org" -
Run
Terminal window cargo run -- serve --config vein.toml# or, once built:./target/release/vein serve --config vein.toml -
Point clients at it
All three ecosystems share the same base URL (
http://localhost:8346here):Terminal window # Bundler (RubyGems)bundle config mirror.https://rubygems.org http://localhost:8346# Cargo (crates.io sparse index)export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparseexport CARGO_REGISTRIES_CRATES_IO_INDEX=http://localhost:8346/index/# npmnpm config set registry http://localhost:8346/ -
Check it’s alive
Terminal window cargo run -- health# orcurl http://localhost:8346/up
What happens on a request
Section titled “What happens on a request”- Client requests a package (gem, crate, or npm tarball).
- Vein checks its SQLite/PostgreSQL metadata store for a cache hit.
- Hit - served straight from local filesystem storage.
- Miss - fetched from the upstream (RubyGems, crates.io, or npm), cached, then served.
Index and metadata endpoints are cached with a TTL and revalidated; artifact files are cached permanently once fetched.
See Architecture for the storage model, CLI for the full command list, and Configuration for every config option.