Skip to content

ovidiuvio/relic

Repository files navigation

Relic - Artifact Storage Service

A modern, feature-rich artifact service with immutable relics, complete version history, and smart content processing. Built with FastAPI (Python), Svelte, and Tailwind CSS.

Relic Overview

Overview

Relic is a self-hosted pastebin and artifact storage system designed for developers. It goes beyond simple text storage by supporting binary files, archives, images, and providing rich previews for various content types. With a focus on immutability and versioning, Relic ensures your shared snippets and files are safe, trackable, and easy to manage.

Key Features

  • Immutable Artifacts: Each relic is permanent. Edits create new versions via forking with complete history preserved.
  • Universal Content Support:
    • Code: Syntax highlighting for 100+ languages.
    • Images: Preview and zoom support.
    • Archives: Browse ZIP/TAR contents directly in the browser.
    • Documents: PDF rendering, CSV/Excel tables, and Markdown rendering.
    • Diagrams: Integrated Excalidraw support.
  • CLI Tool: Powerful command-line interface for quick uploads from terminal.
  • Relic Indexes: Create curated collections of relics (.rix files).
  • Access Control: Public, unlisted, and private relics.
  • Expiration: Set relics to expire after 1h, 24h, 7d, 30d, or never.
  • Admin Panel: Manage users, view system stats, and moderate content.

Visual Tour

Create Relics

Upload files via drag-and-drop, paste text directly, or use the CLI. Create Relic

Rich Code Viewing

Syntax highlighting with line numbers, copy-to-clipboard, and raw view options. Source View

Image Previews

Direct image rendering with zoom capabilities. Image View

Archive Explorer

Browse the contents of ZIP and TAR files without downloading them. Archive View

Recent Relics & Management

View recently created public relics or manage your own. Recent Relics

Comments & Collaboration

Discuss code snippets and artifacts directly on the relic page. Comments

Admin Dashboard

Monitor system usage, storage, and manage relics. Admin Panel

CLI Tool

Relic comes with a powerful CLI tool for terminal-based workflows.

Quick Install

curl -sSL https://your-domain.com/install.sh | bash

Usage

# Upload from stdin
echo "Hello World" | relic

# Upload a file
relic myfile.txt

# Upload with options
relic --name "My Script" --private --expires 24h script.py

Quick Start

Prerequisites

  • Docker and Docker Compose
  • Make (optional, but recommended)

Production Deployment (Recommended)

For production/release deployments, use the default configuration:

  1. Start production services
make up

Or without Make:

docker compose -f docker-compose.prod.yml up -d --build
  1. Access the application
  1. View logs
make logs
  1. Stop services
make down

Development Setup

For local development with hot-reload:

  1. Start development services
make dev-up

Or without Make:

docker compose -f docker-compose.dev.yml up -d
  1. Access the application
  1. View logs
make dev-logs
  1. Stop services
make dev-down

Note: Development mode mounts your local code directories as volumes, enabling hot-reload for both frontend and backend. Changes to code will be reflected immediately without rebuilding.

Admin Setup

Relic supports admin users with elevated privileges (view all relics, delete any relic, manage clients, view statistics).

Setting Up an Admin User

  1. Get your Client ID

    Open your browser's Developer Tools (F12) and run this in the Console:

    localStorage.getItem('relic_client_key')

    This will output your client ID, which looks like: 5cdb7b79c38385db9f5b5f6ad884c8ef

  2. Configure Admin in Production

    Edit docker-compose.prod.yml and set the ADMIN_CLIENT_IDS environment variable:

    backend:
      environment:
        ADMIN_CLIENT_IDS: "5cdb7b79c38385db9f5b5f6ad884c8ef"

    For multiple admins, use comma-separated values:

    ADMIN_CLIENT_IDS: "5cdb7b79c38385db9f5b5f6ad884c8ef,a1b2c3d4e5f6789012345678abcdef01"
  3. Restart Services

    make down
    make up
  4. Access Admin Panel

    After restarting, the "Admin" tab will appear in the navigation. Admin privileges include:

    • View all relics (including private ones)
    • Delete any relic (not just your own)
    • View all registered clients
    • Delete clients and their relics
    • View system statistics

Development Environment

For development mode, edit docker-compose.dev.yml instead and use:

make dev-down
make dev-up

Relic Indexes

Relic indexes (.rix files) allow you to create curated collections of relics.

title: My Project Documentation
description: A collection of documentation files.
relics:
  - id: f47ac10b58cc4372a5670e02b2c3d479
    title: API Reference
  - id: a1b2c3d4e5f678901234567890abcdef

API Endpoints

All API endpoints are prefixed with /api/v1.

Create Relic

curl -X POST http://localhost/api/v1/relics \
  -F "file=@myfile.txt" \
  -F "name=My File"

Get Relic

curl http://localhost/api/v1/relics/{id}

Fork Relic

curl -X POST http://localhost/api/v1/relics/{id}/fork \
  -F "file=@new.txt"

Architecture

  • Frontend: Svelte, Tailwind CSS, Vite
  • Backend: FastAPI, SQLAlchemy, Pygments
  • Storage: PostgreSQL (Metadata), MinIO (Content)
  • Infrastructure: Docker, Nginx

License

MIT