Rust file-hosting CDN API
  • TypeScript 42.8%
  • Rust 34.7%
  • CSS 19.1%
  • Dockerfile 1.3%
  • HTML 1.2%
  • Other 0.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
R3V3RS3_P4RAD0X ef30d76cec
All checks were successful
CI / frontend (push) Successful in 13s
CI / backend (push) Successful in 2m7s
Show text file contents inline in the detail panel.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 14:10:18 +01:00
.forgejo/workflows fix(ci): run backend job on node image so checkout action works 2026-07-25 15:03:03 +02:00
deploy Add Docker, Compose, and systemd deployment packaging. 2026-07-25 12:23:48 +01:00
frontend Show text file contents inline in the detail panel. 2026-07-25 14:10:18 +01:00
migrations Fix detail panel stacking under the nav and track file authors. 2026-07-25 14:02:15 +01:00
src Fix detail panel stacking under the nav and track file authors. 2026-07-25 14:02:15 +01:00
.dockerignore Add Docker, Compose, and systemd deployment packaging. 2026-07-25 12:23:48 +01:00
.env.example Replace API-key auth with user accounts, public browsing, and admin approval. 2026-07-25 12:34:29 +01:00
.gitignore Add React admin UI with file list API and SPA serving. 2026-07-25 12:18:21 +01:00
Cargo.lock Replace API-key auth with user accounts, public browsing, and admin approval. 2026-07-25 12:34:29 +01:00
Cargo.toml Replace API-key auth with user accounts, public browsing, and admin approval. 2026-07-25 12:34:29 +01:00
compose.yml Replace API-key auth with user accounts, public browsing, and admin approval. 2026-07-25 12:34:29 +01:00
Dockerfile Add Docker, Compose, and systemd deployment packaging. 2026-07-25 12:23:48 +01:00
README.md Replace API-key auth with user accounts, public browsing, and admin approval. 2026-07-25 12:34:29 +01:00

CDN

Rust file-hosting API with a React UI. Anyone can browse and download; uploading requires a logged-in (approved) account. Admins approve or create users.

Quick start

cp .env.example .env
# set ADMIN_PASSWORD (required, min 8 chars)

cargo run

# UI (dev) — separate terminal
cd frontend && npm install && npm run dev
  • API / production UI: http://127.0.0.1:8080
  • Vite UI: http://127.0.0.1:5173 (proxies /api to the API)

On first boot the admin from ADMIN_USERNAME / ADMIN_PASSWORD is created if none exists.

Production (single process)

cd frontend && npm install && npm run build
cd .. && cargo run

Auth model

Who Can do
Public List, view, download, copy share links
Logged-in approved user Upload, delete
Admin Manage accounts (create / approve / reject / delete)

Self-registration creates a pending account until an admin approves it.

API

Method Path Auth Description
GET /health no Liveness
GET /api/files no List files (q, type)
GET /{id} no Download / view file
POST /api/auth/register no Request account (pending)
POST /api/auth/login no Login (session cookie)
POST /api/auth/logout session Logout
GET /api/auth/me session Current user
POST /api/upload session Multipart upload (file)
DELETE /api/files/{id} session Delete file
GET /api/admin/users admin List users
POST /api/admin/users admin Create approved user
POST /api/admin/users/{id}/approve admin Approve pending
POST /api/admin/users/{id}/reject admin Reject pending
DELETE /api/admin/users/{id} admin Delete user

Examples

# public list
curl -sS "http://127.0.0.1:8080/api/files"

# login (stores cdn_session cookie)
curl -sS -c cookies.txt -X POST http://127.0.0.1:8080/api/auth/login \
  -H 'Content-Type: application/json' \
  -d '{"username":"admin","password":"your-password"}'

# upload
curl -sS -b cookies.txt -X POST http://127.0.0.1:8080/api/upload \
  -F "file=@./photo.jpg"

Deployment

Docker Compose

cp .env.example .env
# set ADMIN_PASSWORD and ideally PUBLIC_BASE_URL=https://your.domain

docker compose up -d --build

See compose.yml, Dockerfile, deploy/Caddyfile.example, and deploy/cdn.service.

Configuration

See .env.example.