Minimalist, self-hosted pastebin built with Hono + Vite + React 19 + SQL (SQLite, MariaDB/MySQL, or PostgreSQL).
Try the Live Demo → Runs 100% client-side in your browser's memory on GitHub Pages — nothing is saved to any server or database, and refreshing the tab resets all state. Jump directly to the Editor, Syntax Viewer, or Admin Dashboard.
Full-screen #1e1e1e Editor |
Highlighted Paste Viewer (Collapsible imports) |
|---|---|
![]() |
![]() |
| Overview & Metrics | Search, Regex Filters & Bulk Actions |
|---|---|
![]() |
![]() |
- Minimalist Dark UI (
#1e1e1e): Full-screen distraction-free editor (/withCtrl+Ssave & 2-spaceTab/Shift+Tabindentation), syntax-highlighted viewer across 20 languages (includingdiffand safe GFM Markdown Preview toggle), live state editing directly from/:idor/dashboard/pastes(public/private,permanent/30d/7d/24h/1h/1 read, owner reassignment), collapsibleimportblocks, clickable line-range links (#L12/#L10-L25), Copy / Raw (/raw/:id) / Smart Download / Clone actions, and a flat 5-section dashboard (/dashboard,/dashboard/pastes,/dashboard/users,/dashboard/settings,/dashboard/account). - Terminal Upload (
POST /raw) & Personal API Tokens: Pipe files or logs straight from any shell (cat build.log | curl -fsS --data-binary @- https://your-host/raworcurl -fsS -T script.py https://your-host/raw/script.py) with optionalX-TTL,X-Name, andX-Visibility: privateheaders, and mint revocable SHA-256-hashedcb_...personal API tokens in/dashboard/account. - Public / Private Visibility, Selectable TTL & Burn-After-Read: Toggle Public vs Private (visible strictly to owner, collaborators, and admins; returns
404otherwise), choose per-paste expiration (1h,24h,7d,30d,1 readburn-after-read with atomic self-destruction on first open, orPermanentfor signed-in users), and optionally enable zero-knowledge client-side E2EE (AES-256-GCM) where the decryption key stays strictly in the URL#k=...fragment. - Role-Scoped Auth, Granular Quotas & Flexible Registration: Switch between Invite-only and Open registration (with optional Resend email verification and configurable per-user limits for total, public, private pastes, and compressed MB on disk) from
/dashboard/settings. Administrators enforce mandatory RFC 6238 TOTP 2FA (with ISO high-contrast SVG QR onboarding & anti-replay protection) or WebAuthn Passkeys, while standard users can sign in immediately and opt into 2FA or Passkeys anytime in/dashboard/account. - Ultra-Compact SQL Storage: Compresses pure paste text with Brotli quality 11 (
BROTLI_MODE_TEXT) stored as raw binaryBLOBs onSQLite(zero JSON wrapper or Base64 inflation, incremental auto-vacuum, and one-clickVACUUMcompaction in/dashboard/settings), while supportingMariaDB/MySQLandPostgreSQLout of the box.
# Anonymous paste (returns https://your-host/<id>)
cat app.log | curl -fsS --data-binary @- https://your-host/raw
# Upload file preserving filename + 24h TTL
curl -fsS -H "X-TTL: 24h" -T deploy.sh https://your-host/raw/deploy.sh
# Permanent owned paste using a personal API token from /dashboard/account
cat notes.md | curl -fsS \
-H "Authorization: Bearer cb_your_token" \
-H "X-TTL: permanent" \
-H "X-Name: Architecture Notes.md" \
--data-binary @- https://your-host/rawcp .env_example .env
# Edit .env and set AUTH_SECRET, ADMIN_EMAIL, ADMIN_PASSWORD
npm install
npm run dev| Script | Description |
|---|---|
npm run dev |
Starts Hono API + Vite HMR dev server |
npm run build |
Builds production Vite SPA (dist/client) and server TypeScript (dist/server) |
npm run build:demo |
Builds the static in-memory browser demo (VITE_DEMO_MODE=1 → dist/demo) |
npm run start |
Runs the production Hono server on 0.0.0.0:${PORT:-3000} |
npm run typecheck |
Runs strict TypeScript checks across client, shared, tests, and server |
npm test |
Runs the Vitest automated test suite |
npm run backup |
Creates a hot consistent snapshot in DATA_DIR/backups/ (also runs automatically daily via BACKUP_CRON, retaining BACKUP_KEEP=7 snapshots) |
Configure via DATABASE__SAVE_TYPE in .env:
SQLite(default):DATABASE__SQLITE_DB_PATH=./data/pastes.dbPostgreSQL:DATABASE__POSTGRES_URI=postgresql://user:pass@host:5432/cleanbinMariaDB/MySQL:DATABASE__MARIADB_URI=mysql://user:pass@host:3306/cleanbin
When running behind a reverse proxy (such as Nginx, Caddy, or Cloudflare), set TRUST_PROXY=1 and forward Host, X-Forwarded-Proto, and X-Forwarded-For. Leave APP_URL and PASSKEY_RP_ID unset if you want setup links and WebAuthn Relying Party IDs derived automatically from each incoming domain.
Feature and documentation changes land on the dev branch first (verified by CI across npm audit, strict TypeScript checks, Vitest suite, production build, and static demo build) before merging into main.
MIT



