| Crates.io | vein |
| lib.rs | vein |
| version | 0.4.0 |
| created_at | 2025-10-25 14:47:50.709387+00 |
| updated_at | 2025-12-28 11:26:02.775505+00 |
| description | A fast, intelligent RubyGems proxy/mirror server written in Rust |
| homepage | https://github.com/contriboss/vein |
| repository | https://github.com/contriboss/vein |
| max_upload_size | |
| id | 1900300 |
| size | 389,909 |
A fast, intelligent RubyGems proxy/mirror server. Part of the ore ecosystem alongside ore-light.
Vein is a smart caching proxy for RubyGems that:
# Run with Docker
docker run -p 8346:8346 -v vein-data:/data ghcr.io/contriboss/vein:latest
# Or with docker-compose
curl -O https://raw.githubusercontent.com/contriboss/vein/master/docker-compose.yml
docker-compose up -d
# Or build from source
cargo build --release
./target/release/vein serve
Client Request β Vein β Local Cache?
ββ Hit β Serve from filesystem
ββ Miss β Fetch from rubygems.org
ββ Cache locally
ββ Serve to client
Permanent Caching: Once a gem is cached, it's served locally forever. No re-fetching.
Simple Architecture: SQLite for metadata + filesystem for gem files.
./gems/)# (Optional) write a config file β defaults are similar to this snippet
cat <<'TOML' > vein.toml
[server]
host = "0.0.0.0"
port = 8346
[upstream]
url = "https://rubygems.org"
[storage]
path = "./gems"
[database]
path = "./vein.db"
TOML
# Start the proxy (streams uncached gems through Rama)
cargo run -- serve --config vein.toml
# Inspect cache statistics
cargo run -- stats --config vein.toml
make admin then browse to http://127.0.0.1:9400/catalog/<gem>?version=<version> to preview the generated SBOM and download the JSON directly from the UI.GET /.well-known/vein/sbom?name=<gem>&version=<version>[&platform=<platform>] against the running Vein proxy. The response is a CycloneDX 1.5 document with Content-Type: application/json and a download-friendly filename. Omit the platform query for default ruby builds; supply it for native variants (e.g. arm64-darwin).Vein can delay new gem versions from appearing in Bundler's index, giving the community time to catch malicious packages before they reach your CI/CD.
How it works:
bundle update and bundle outdated won't see quarantined versionsgem install foo -v 1.2.3) still work (explicit choice)Real-world scenario (rest-client 1.6.13, August 2019):
bundle update during that window got compromisedEnable in config:
[delay_policy]
enabled = true
default_delay_days = 3
skip_weekends = true # Don't release on Sat/Sun
release_hour_utc = 10 # Release at 10:00 UTC
# Per-gem overrides (glob patterns supported)
[[delay_policy.gems]]
pattern = "rails*"
delay_days = 7 # Extra scrutiny for Rails ecosystem
[[delay_policy.gems]]
pattern = "internal-*"
delay_days = 0 # Trust internal gems
# Pin specific versions for immediate availability
[[delay_policy.pinned]]
name = "rails"
version = "8.0.1"
reason = "Security patch - verified safe"
CLI commands:
# Show quarantine status
vein quarantine status
# List versions in quarantine
vein quarantine list
# Manually promote expired versions
vein quarantine promote
# Approve a version for immediate release
vein quarantine approve rails 8.0.1 --reason "Security patch"
# Block a malicious version
vein quarantine block badgem 1.0.0 --reason "Malware detected"
Admin UI: Browse to /quarantine on the admin server to view stats and approve/block versions.
Minimal config (most settings have sensible defaults):
# vein.toml
[server]
port = 8346 # default
[upstream]
url = "https://rubygems.org" # default
[storage]
path = "./gems" # default
Full config options:
[server]
host = "0.0.0.0"
port = 8346
threads = 4 # Rama worker threads
[upstream]
url = "https://rubygems.org"
timeout_secs = 30
connection_pool_size = 100
[storage]
path = "./gems"
[database]
path = "vein.db" # SQLite inventory
[logging]
level = "info" # debug, info, warn, error
[hotcache]
# Automatic refresh schedule (cron format: "sec min hour day month weekday year")
refresh_schedule = "0 0 * * * *" # Every hour (default)
# refresh_schedule = "0 */30 * * * *" # Every 30 minutes
# refresh_schedule = "" # Disabled
[delay_policy]
enabled = false # Enable quarantine system
default_delay_days = 3 # Default quarantine period
skip_weekends = true # Don't release on weekends
release_hour_utc = 10 # Hour to release (0-23)
Vein uses a dual-database architecture for optimal performance:
vein.db) - Persistent Metadata StorePurpose: Authoritative source of truth for all cached gems
Stores:
When Used:
# Build
cargo build
# Run (with logging)
RUST_LOG=debug cargo run -- serve
# Test
cargo test
# Check code
cargo clippy
# Pull the image
docker pull ghcr.io/contriboss/vein:latest
# Run with persistent volumes
docker run -d \
--name vein \
-p 8346:8346 \
-v vein-gems:/data/gems \
-v vein-db:/data/db \
-e RUST_LOG=info \
ghcr.io/contriboss/vein:latest
# View logs
docker logs -f vein
# Start the service
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the service
docker-compose down
# Create config file
cp vein.example.toml vein.toml
# Edit as needed...
# Run with custom config
docker run -d \
--name vein \
-p 8346:8346 \
-v $(pwd)/vein.toml:/data/vein.toml:ro \
-v vein-gems:/data/gems \
-v vein-db:/data/db \
vein:latest serve --config /data/vein.toml
[Unit]
Description=Vein RubyGems Proxy
After=network.target
[Service]
Type=simple
User=vein
ExecStart=/usr/local/bin/vein serve --config /etc/vein/vein.toml
Restart=always
[Install]
WantedBy=multi-user.target
upstream vein {
server localhost:8346;
}
server {
listen 443 ssl http2;
server_name gems.company.com;
location / {
proxy_pass http://vein;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Together they provide a complete, modern Ruby dependency management ecosystem:
Vein was initially built on Cloudflare's Pingora framework. However, FreeBSD support is completely lacking in Pingora, and contributions to fix this are ignored. A PR to add FreeBSD support received no response.
So I migrated to Rama, which:
Rama is a healthier choice for projects that need flexibility and multi-platform support.
Thanks, Cloudflare.
Vein is built on Rama, a modular service framework developed by Plabayo.
Project Status: Vein is a side project and will remain free and open source. It is not commercialized.
HTTP Features: Intentionally basic. Vein does what it needs to do: proxy, cache, serve gems. No plans to add complex HTTP features or enterprise-grade capabilities.
Need More? Companies requiring additional features (advanced routing, auth, monitoring, protocol extensions) should hire Plabayo directly to extend Vein:
Support Contracts: Plabayo offers commercial service contracts for Rama-based projects. Contact them at https://plabayo.tech
Vein is dual-licensed:
You may choose the license that best suits your use case. If using within a commercial organization, AGPL-3.0 terms apply.