Skip to content

MSK-Scripts/msk-paste

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

53 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

MSK Paste

A privacy-friendly, self-hosted pastebin alternative β€” part of the MSK Scripts ecosystem alongside MSK Shortener.

License: AGPL-3.0 Built with Next.js

Live: paste.msk-scripts.de


✨ Features

  • πŸ“ Plain-text pastes with optional title (up to 1 MB)
  • 🎨 Syntax highlighting for 30+ languages via Shiki
  • ⏱️ Expiration β€” 10 min Β· 1 h Β· 1 d Β· 1 w Β· 1 mo Β· 1 y
  • πŸ”₯ Burn after read β€” paste self-destructs after the first view
  • πŸ”’ Password protection with bcrypt (cost 12)
  • πŸ”— Custom paste IDs (paste.msk-scripts.de/my-snippet)
  • πŸ› οΈ REST API for CLI / scripting workflows
  • 🌍 Bilingual UI (German / English) with cookie-based switching
  • πŸ“Š Public stats page β€” aggregate numbers only
  • πŸ›‘οΈ Privacy by default β€” no analytics, no GeoIP, IP addresses stored only as HMAC-SHA-256 hashes

πŸ›‘οΈ Privacy & Security

  • No tracking, no analytics, no third-party scripts other than Google Fonts.
  • IPs are never stored. Rate limiting uses HMAC-SHA-256(ip, secret).
  • Passwords are stored as bcrypt hashes (cost 12) only.
  • Expired pastes are deleted, not soft-deleted.
  • Cookies: exactly one β€” NEXT_LOCALE for the language preference.

See /privacy for the full policy.

πŸš€ Tech stack

Layer Choice
Framework Next.js 15 (App Router) + TypeScript
Database MariaDB via mysql2
Styling Tailwind CSS + MSK design tokens
Validation Zod 4
i18n next-intl v4 (cookie-based, no prefix)
Highlighting Shiki (server-rendered)
Password bcryptjs
Charts Recharts
Hosting Debian + Apache2 reverse proxy + systemd
CI/CD GitHub Actions (SCP + SSH)

Deliberately not used: Prisma, Redis, any analytics, any auth provider.

πŸƒ Quick start (development)

# 1. Clone & install
git clone https://github.com/MSK-Scripts/msk-paste.git
cd msk-paste
npm install

# 2. Configure environment
cp .env.example .env
# Edit .env: set DB credentials and IP_HASH_SECRET (openssl rand -hex 32)

# 3. Run migrations
npm run migrate

# 4. Start the dev server
npm run dev
# β†’ http://localhost:3000

For a production deploy on Debian/Ubuntu use the install script:

curl -fsSL https://raw.githubusercontent.com/MSK-Scripts/msk-paste/main/deployment/scripts/install.sh | sudo bash

Details: deployment/README.md.

πŸ“‘ REST API

POST /api/pastes

curl -X POST https://paste.msk-scripts.de/api/pastes \
  -H 'Content-Type: application/json' \
  -d '{
    "content":       "console.log(\"hello world\")",
    "title":         "My snippet",
    "language":      "javascript",
    "expiresIn":     "1w",
    "burnAfterRead": false
  }'

Response:

{
  "pasteId":       "X7q9bA2k",
  "url":           "https://paste.msk-scripts.de/X7q9bA2k",
  "rawUrl":        "https://paste.msk-scripts.de/raw/X7q9bA2k",
  "deleteToken":   "dk_a7c4f2e1...",
  "expiresAt":     "2026-05-20T16:00:00.000Z",
  "hasPassword":   false,
  "burnAfterRead": false
}
Method Path Purpose
POST /api/pastes Create a paste
GET /api/pastes/:id Fetch paste metadata + content
POST /api/pastes/:id/verify Verify password, returns content
DELETE /api/pastes/:id?token=… Delete a paste with its delete token
GET /api/stats Aggregate statistics
POST /api/locale Set language cookie (de / en)

πŸ› οΈ Scripts

npm run dev          # Start Next.js dev server
npm run build        # Production build
npm start            # Start production server on port 3012
npm run lint         # ESLint
npm run type-check   # TypeScript --noEmit
npm run migrate      # Apply DB migrations
npm run cleanup      # Delete expired pastes (run via cron)

πŸ“œ License

AGPL-3.0-or-later β€” if you fork or host MSK Paste publicly, please share your source code under the same license.

πŸ™‹ Support / contact

Author: Musiker15 β€” MSK Scripts Email: info@msk-scripts.de Website: www.msk-scripts.de

Issues and feature requests β†’ GitHub Issues

About

A privacy-friendly, self-hosted pastebin alternative

Resources

License

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Sponsor this project

 

Contributors