Skip to content

rennerdo30/vcpkg-harbor

Repository files navigation

vcpkg-harbor logo

vcpkg-harbor

A high-performance binary cache server for vcpkg

CI Docker License: MIT Python 3.11+ PyPI version

FeaturesQuick StartDocumentationContributing


vcpkg-harbor caches compiled C++ packages, allowing teams to share pre-built binaries and dramatically reduce build times. It supports multiple storage backends and provides a web dashboard for monitoring.

Features

  • 🚀 Multiple Storage Backends - MinIO, AWS S3, Azure Blob, Google Cloud Storage, or local filesystem
  • 🔌 Plugin Architecture - Easy to add custom storage backends via entry points
  • 📊 Web Dashboard - Monitor cache statistics and browse packages in real-time
  • 📈 Prometheus Metrics - Built-in metrics endpoint for monitoring and alerting
  • 🔐 Authentication - Token and HTTP Basic authentication support
  • High Performance - Async Python with streaming uploads/downloads
  • 🐳 Docker Ready - Production-ready Docker images and compose files

Quick Start

Option 1: Using pip (Simplest)

# Install vcpkg-harbor
pip install vcpkg-harbor

# Start with filesystem storage (default)
vcpkg-harbor

Option 2: Using Docker

# Simple deployment (filesystem storage)
docker run -d -p 15151:15151 -v vcpkg-cache:/app/cache \
  ghcr.io/rennerdo30/vcpkg-harbor:latest

# Or with Docker Compose (includes MinIO)
git clone https://github.com/rennerdo30/vcpkg-harbor.git
cd vcpkg-harbor
docker-compose up -d

Option 3: From Source

git clone https://github.com/rennerdo30/vcpkg-harbor.git
cd vcpkg-harbor
./run.sh

Configure vcpkg

# Set environment variable
export VCPKG_BINARY_SOURCES="clear;http,http://localhost:15151/{name}/{version}/{sha}/{triplet},readwrite"

# Install packages (binaries will be cached)
vcpkg install zlib boost

Storage Backends

Backend Use Case Configuration
Filesystem (default) Development, small teams VCPKG_STORAGE_TYPE=filesystem
MinIO On-premises, S3-compatible VCPKG_STORAGE_TYPE=minio
AWS S3 AWS deployments VCPKG_STORAGE_TYPE=s3
Azure Blob Azure deployments VCPKG_STORAGE_TYPE=azure
Google Cloud Storage GCP deployments VCPKG_STORAGE_TYPE=gcs

Configuration

vcpkg-harbor is configured via environment variables:

# Server
VCPKG_SERVER_HOST=0.0.0.0
VCPKG_SERVER_PORT=15151

# Storage (filesystem is default)
VCPKG_STORAGE_TYPE=filesystem
VCPKG_STORAGE_PATH=./cache

# Logging
VCPKG_LOG_LEVEL=INFO

# Authentication (optional)
VCPKG_AUTH_ENABLED=true
VCPKG_AUTH_TYPE=token
VCPKG_AUTH_TOKEN=your-secret-token

API Endpoints

Endpoint Method Description
/{name}/{version}/{sha}/{triplet} HEAD Check if package exists
/{name}/{version}/{sha}/{triplet} GET Download package
/{name}/{version}/{sha}/{triplet} PUT Upload package
/health GET Health check
/metrics GET Prometheus metrics
/ GET Web dashboard

Documentation

📚 Full Documentation

Development

# Setup development environment
./scripts/setup-dev.sh

# Start development server
./scripts/dev-server.sh

# Run tests
./scripts/test.sh

# Run linter
./scripts/lint.sh

Contributing

Contributions are welcome! Please read our Contributing Guide for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • vcpkg - C++ package manager by Microsoft
  • FastAPI - Modern Python web framework
  • MinIO - High-performance object storage