Skip to content

elastic-io/plus

Repository files navigation

Plus Artifacts Server

A modern, high-performance package repository server written in Go, designed to replace traditional nginx+createrepo solutions with a unified, cloud-native approach.

Go Report Card License: MIT Docker Pulls

🚀 Features

Core Capabilities

  • Multi-format Support: RPM and DEB packages
  • RESTful API: Complete package management via HTTP API
  • Real-time Metadata: Automatic repository metadata generation
  • Batch Operations: Efficient bulk package uploads
  • Built-in Monitoring: Metrics and health checks
  • Web Interface: Modern UI for repository management
  • High Performance: Built with fasthttp for maximum throughput

Storage Options

  • Local Storage: Direct filesystem storage
  • Cloud Storage: S3-compatible object storage (planned)
  • Flexible Backend: Pluggable storage architecture

🎯 Why Choose Plus Over nginx+createrepo?

Feature nginx+createrepo Plus Advantage
Static File Serving ✅ nginx ✅ fasthttp Comparable performance, lighter weight
Metadata Generation ✅ createrepo_c ✅ Pure Go No external dependencies
Package Upload ❌ Custom scripts needed ✅ Built-in API Simpler integration
Batch Operations ❌ Manual scripting ✅ Native support Higher efficiency
Real-time Monitoring ❌ Additional tools required ✅ Built-in metrics Out-of-the-box
Multi-format Support ❌ RPM only ✅ RPM+DEB More flexible
Container Ready ❌ Complex setup ✅ Single binary Cloud-native

📦 Quick Start

Using Docker (Recommended)

# Pull and run
docker run -d \
  --name plus-server \
  -p 8080:8080 \
  -v $(pwd)/storage:/app/storage \
  elastic-io/plus:latest

# Or use docker-compose
curl -O https://raw.githubusercontent.com/elastic-io/plus/main/docker-compose.yml
docker-compose up -d

Binary Installation

# Download latest release
wget https://github.com/elastic-io/plus/releases/latest/download/plus-linux-amd64
chmod +x plus-linux-amd64
mv plus-linux-amd64 /usr/local/bin/plus

# Run with default config
plus --config config.yaml

From Source

git clone https://github.com/elastic-io/plus.git
cd plus

# Build using make
make build      # Build for your current platform
make build-all  # Build for all supported platforms

# Run the application
./bin/plus --config config.yaml

Using Make Commands

make deps       # Install dependencies
make test       # Run tests
make build-amd  # Build for Linux AMD64
make build-arm  # Build for Linux ARM
make clean      # Clean build artifacts
make help       # Show all available commands

⚙️ Configuration

Basic Configuration

# config.yaml
server:
  listen: ":8080"
  dev_mode: false
  
storage:
  type: "local"
  path: "./storage"
  
logging:
  level: "info"
  format: "json"

🔧 API Usage

Repository Management

# List all repositories
curl http://localhost:8080/repos

# Create a new repository
curl -X POST http://localhost:8080/repos \
  -H "Content-Type: application/json" \
  -d '{"name": "my-repo", "path": "centos/7"}'

# Get repository information
curl http://localhost:8080/repo/my-repo

# Delete repository
curl -X DELETE http://localhost:8080/repo/my-repo

Package Management

# Upload a package
curl -X POST http://localhost:8080/repo/my-repo/upload \
  -F "[email protected]"

# Download a package
curl -O http://localhost:8080/repo/my-repo/rpm/package.rpm

# Get package checksum
curl http://localhost:8080/repo/my-repo/checksum/package.rpm

Repository Operations

# Refresh repository metadata
curl -X POST http://localhost:8080/repo/my-repo/refresh

# Browse repository files
curl http://localhost:8080/repo/my-repo/files/

🖥️ Web Interface

Access the modern web interface at http://localhost:8080/static/

Features:

  • Repository browsing and management
  • Package upload with drag-and-drop
  • Real-time metrics dashboard
  • Batch operations interface

📊 Monitoring & Metrics

Health Checks

# Basic health check
curl http://localhost:8080/health

# Readiness check
curl http://localhost:8080/ready

# Detailed metrics
curl http://localhost:8080/metrics

🐳 Container Deployment

Docker Compose

version: '3.8'
services:
  plus:
    image: elastic-io/plus:latest
    ports:
      - "8080:8080"
    volumes:
      - ./storage:/app/storage
      - ./config.yaml:/app/config.yaml
    environment:
      - PLUS_CONFIG=/app/config.yaml
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
      interval: 30s
      timeout: 10s
      retries: 3

🔄 Migration from nginx+createrepo

See our Migration Guide for detailed instructions on migrating from traditional nginx+createrepo setups.

📈 Performance Benchmarks

Throughput Comparison

Scenario nginx+createrepo Plus Improvement
Static File Serving 10,000-15,000 QPS 15,000-25,000 QPS +67%
Package Upload Manual process 500-1000 uploads/min
Metadata Generation 30-60 seconds 1-5 seconds 10x faster
Memory Usage ~200MB (nginx+tools) ~50MB 75% less

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

📚 Documentation

🗺️ Roadmap

v1.1.0 (Next Release)

  • Authentication and authorization
  • S3-compatible storage backend
  • Package signing verification
  • Advanced metrics and alerting

v1.2.0

  • Multi-tenant support
  • Package vulnerability scanning
  • GraphQL API

📄 License

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

🆘 Support

🙏 Acknowledgments

  • Built with fasthttp for high performance
  • Inspired by modern package management needs
  • Thanks to all contributors and users

Plus Artifacts Server - Modern package repository management made simple.