A semi-private paste service, self-hostable on the free tier of Cloudflare Workers and KV.
- Privacy controls - Straightforward controls for who can view your pastes (public, private, or logged-in users only)
- Syntax highlighting - Code formatting for ~all programming languages
- Expiration options - Set pastes to expire from 1 hour to 1 year, or keep forever
- Image uploads - Store and share images via API (JPEG, PNG, GIF, WebP, SVG — up to 10 MB), served through the app so visibility rules apply
- API access - Simple JSON API for creating pastes and uploading images programmatically
- Serverless - Built on Cloudflare Workers with KV and R2 storage
- SSO Authentication - Integration with Auth0 out of the box, but any providers supported by Auth.js are easy enough to add
- Bun runtime
- Cloudflare account with Workers and KV access
- Auth0 account for authentication
-
Clone the repository:
-
Install dependencies:
bun install
-
Create a
.dev.varsfile with your Auth0 credentials. For production you'll need to do this in your Cloudflare dashboard.AUTH_SECRET="your-auth-secret-key-here" AUTH_AUTH0_ID=your-auth0-client-id AUTH_AUTH0_SECRET=your-auth0-client-secret -
Update
wrangler.jsoncwith your Auth0 domain:"vars": { "AUTH_AUTH0_DOMAIN": "https://your-auth0-domain.auth0.com", "GITHUB_REPO": "https://github.com/your-username/paste" }
-
Create a KV namespace and update the binding in
wrangler.jsonc:wrangler kv:namespace create "PASTE_KV" -
Create an R2 bucket for image storage and update the binding in
wrangler.jsonc:wrangler r2 bucket create paste-images
-
Start the development server:
bun run dev
curl -X POST https://your-domain/api/create \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"content": "hello world", "visibility": "public"}'curl -X POST https://your-domain/api/upload \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "[email protected]" \
-F "visibility=public"Images are served at /api/image/[slug] and respect visibility settings. The paste page at /p/[slug] displays the image inline.
MIT
