
sharzyl/pastebin-worker
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
CloudflareのPastebinワーカー、CLIの使い方が親切で豊富な機能を備えています
概要
これはCloudflareワーカーで動いているパステビンです。shz.al で試してみてください。 : 手間なく展開し、CLIの使い方が親切で、豊富な機能を備えています。 1. 4文字程度のペースト共有、またはカスタマイズURLまで。1. highlight.jsによる強化。1. クライアント側暗号化。1. レンダリングされたHTML付きファイル共有。1. URL短縮機能。1. コンテンツタイプと処理のスマートで調整可能な処理。 1. 貼り付けたものをウェブサイト(例:shz.al)で直接投稿、更新、削除できます。 2. また、使いやすいHTTP APIも提供しています。詳細はAPIの参考文献を参照してください。コマンドライン(curlなどのツールを使えば)でAPIを簡単に呼び出せます。Cloudflareは単一のリクエストボディを100MBに制限しており(プラットフォームはワーカーが実行する前にHTTP 413を返します)、大きなファイルの場合はウェブサイトか下記のpb CLIを使い、アップロードを透過的にチャンク処理します。 3. pbはPythonスクリプト(Pythonが必要) 3.
概要(AI 翻訳)
これはCloudflareワーカーで動いているパステビンです。shz.al で試してみてください。
哲学:手軽な展開、親しみやすいCLIの使用、豊富な機能。
特徴:
- ペーストを4文字程度の短さで共有するか、URLをカスタマイズしても構いません。
- 構文解析のハイライト highlight.jsによるパワー提供。
- クライアント側暗号化。
- レンダリングされたHTML付きのmarkdownファイルを共有すること。
- URL短縮器。
- ライブパステビン:
/live#のリンクを共有し、テキストやファイルをリアルタイムでエンドツーエンド暗号化で全員に投稿します。 Content-TypeおよびContent-Dispositionのスマートで調整可能なハンドリング。
使用法
-
貼り付けたものをウェブサイト(例:shz.al)で直接投稿、更新、削除できます。
-
また、使いやすいHTTP APIも提供しています。詳細はAPIの参考文献を参照してください。コマンドライン(
curlや類似のツールを使った)を使ってAPIを簡単に呼び出せます。Cloudflareは単一のリクエストボディを100MBに制限しており(プラットフォームはワーカーが実行する前にHTTP413を返します)。大きなファイルの場合は、ウェブサイトまたは以下のpbCLIを使い、アップロードを透過的にチャンク処理します。 -
pbはPythonスクリプト(Pythonが必要) 3.
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
Pastebin Worker
This is a pastebin running on Cloudflare workers. Try it on shz.al.
Philosophy: effortless deployment, friendly CLI usage, rich functionality.
Features:
- Share your paste with as short as 4 characters, or even customized URL.
- Syntax highlighting powered by highlight.js.
- Client-side encryption.
- Share markdown file with rendered HTML.
- URL shortener.
- Live pastebin: share a
/live#link and post text or files to everyone on it in real time, end-to-end encrypted. - Smart and tweakable handling for
Content-TypeandContent-Disposition.
Usage
-
You can post, update, delete your paste directly on the website (such as shz.al).
-
It also provides a convenient HTTP API to use. See API reference for details. You can easily call API via command line (using
curlor similar tools). Note that a single request body is capped at 100 MB by Cloudflare (the platform returns HTTP413for larger bodies before the worker runs) — for larger files, use the website or thepbCLI below, which transparently chunk the upload. -
pb is a Python script (requires Python 3.9+ with the
requestspackage) to make it easier to use on command line; it automatically switches to multipart upload above 5 MiB and shows a progress bar. -
doc/skill.md is a concise, AI-agent-oriented packaging of the API. Make it available to your coding agent so it can upload, fetch, and manage pastes via this service.
Deploy
You are free to deploy the pastebin on your own domain if you host your domain on Cloudflare.
-
Install
nodeandpnpm. -
Clone the repository and enter the directory.
-
Create a KV namespace and R2 bucket, fill the KV namespace ID and R2 bucket name in
wrangler.toml.
$ pnpm wrangler kv namespace create PB
$ pnpm wrangler r2 bucket create
-
Modify entries in
wrangler.toml. Its comments will tell you how. -
Login to Cloudflare and deploy with the following steps:
$ pnpm install
$ pnpm wrangler login
$ pnpm build:frontend
$ pnpm deploy
- Enjoy!
Cost
The service runs on Cloudflare Workers, Workers KV, R2, and Durable Objects. Each has a free tier; beyond it you pay only for what you use. Figures below are accurate as of writing — prices change, so confirm against the official pricing pages before relying on them:
- Workers — request routing and execution. Egress is free.
- Free plan: 100 k requests/day, 10 ms CPU per invocation.
- Paid plan ($5/mo base): 10 M requests/month + 30 M ms CPU/month included, then $0.30 per additional M requests and $0.02 per additional M CPU-ms. Also unlocks the higher KV limits below (KV has no separate paid plan).
- Workers KV — small pastes and per-paste metadata.
推奨ツール
別のキーワードを試すか、フィルタを外してください。
インストール
npx skillfish add sharzyl/pastebin-worker