Documentation

Complete guide to using the Package Repo

Table of Contents

Getting Started

This is a schema-driven package repository with secure, content-addressed artifact storage backed by PostgreSQL and a C++ Drogon backend.

Quick Start

# Build and start with the manager CLI
./manager repo build
./manager repo up

# Or use Docker Compose directly
cd tools/packagerepo
docker compose up -d

# Frontend:  http://localhost:3000
# Backend:   http://localhost:5050
# Endpoints: /health, /v1/*, /admin/*

Manager Commands

./manager repo build   # Build backend image
./manager repo up      # Start stack (DB + backend)
./manager repo down    # Stop stack
./manager repo status  # Show container status
./manager repo logs    # Tail backend logs

API Usage

Authentication

Most endpoints require a Bearer token. Get one via the login endpoint:

curl -X POST http://localhost:5050/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":"admin"}'

# Response: { "token": "...", "user": {...} }
# Use token in subsequent requests:
Authorization: Bearer YOUR_TOKEN

Publishing a Package

curl -X PUT \
  -H "Authorization: Bearer $TOKEN" \
  --data-binary @package.tar.gz \
  http://localhost:5050/v1/acme/myapp/1.0.0/linux-amd64/blob

Downloading a Package

curl -H "Authorization: Bearer $TOKEN" \
  http://localhost:5050/v1/acme/myapp/1.0.0/linux-amd64/blob \
  -o myapp.tar.gz

Getting Latest Version

curl -H "Authorization: Bearer $TOKEN" \
  http://localhost:5050/v1/acme/myapp/latest

Listing Versions

curl -H "Authorization: Bearer $TOKEN" \
  http://localhost:5050/v1/acme/myapp/versions

Browse All Packages

curl http://localhost:5050/v1/packages

Setting a Tag

curl -X PUT \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"target_version":"1.0.0","target_variant":"linux-amd64"}' \
  http://localhost:5050/v1/acme/myapp/tags/stable

Schema Configuration

The repository uses a declarative schema stored in PostgreSQL to define its behavior:

View the full schema configuration in the Admin panel or at the /schema endpoint.