{"id":13453396,"url":"https://github.com/SharzyL/pastebin-worker","last_synced_at":"2025-03-24T01:31:24.739Z","repository":{"id":43932541,"uuid":"352382320","full_name":"SharzyL/pastebin-worker","owner":"SharzyL","description":"Pastebin on Cloudflare worker, with friendly CLI usage and rich features","archived":false,"fork":false,"pushed_at":"2024-12-22T03:38:02.000Z","size":428,"stargazers_count":802,"open_issues_count":6,"forks_count":260,"subscribers_count":7,"default_branch":"goshujin","last_synced_at":"2025-03-17T16:07:13.330Z","etag":null,"topics":["cloudflare-worker","pastebin","self-hosted","wrangler"],"latest_commit_sha":null,"homepage":"https://shz.al","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SharzyL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-28T16:40:15.000Z","updated_at":"2025-03-17T14:22:06.000Z","dependencies_parsed_at":"2024-02-08T10:31:53.820Z","dependency_job_id":"0cb30bd3-2d36-4938-bed9-407d96519826","html_url":"https://github.com/SharzyL/pastebin-worker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharzyL%2Fpastebin-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharzyL%2Fpastebin-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharzyL%2Fpastebin-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharzyL%2Fpastebin-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SharzyL","download_url":"https://codeload.github.com/SharzyL/pastebin-worker/tar.gz/refs/heads/goshujin","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245194221,"owners_count":20575725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudflare-worker","pastebin","self-hosted","wrangler"],"created_at":"2024-07-31T08:00:39.346Z","updated_at":"2025-03-24T01:31:24.734Z","avatar_url":"https://github.com/SharzyL.png","language":"JavaScript","readme":"# Pastebin-worker\n\nThis is a pastebin that can be deployed on Cloudflare workers. Try it on [shz.al](https://shz.al). \n\n**Philosophy**: effortless deployment, friendly CLI usage, rich functionality. \n\n**Features**:\n\n1. Share your paste with as short as 4 characters\n2. Customize the paste URL\n4. **Update** and **delete** your paste as you want\n5. **Expire** your paste after a period of time\n6. **Syntax highlighting** powered by PrismJS\n7. Display **markdown** file as HTML\n8. Used as a URL shortener\n9. Customize returned mimetype\n\n## Usage\n\n1. You can post, update, delete your paste directly on the website (such as [shz.al](https://shz.al)). \n\n2. It also provides a convenient HTTP API to use. See [API reference](doc/api.md) for details. You can easily call API via command line (using `curl` or similar tools). \n\n3. [pb](/scripts) is a bash script to make it easier to use on command line.\n\n## Limitations\n\n1. If deployed on Cloudflare Worker free-tier plan, the service allows at most 100,000 reads and 1000 writes, 1000 deletes per day. \n2. Due to the size limit of Cloudflare KV storage, the size of each paste is bounded under 25 MB. \n\n## Deploy\n\nYou are free to deploy the pastebin on your own domain if you host your domain on Cloudflare. \n\n1. Install `node` and `yarn`.\n\n2. Create a KV namespace on Cloudflare workers dashboard, remember its ID.\n\n3. Clone the repository and enter the directory.\n\n4. Modify entries in `wrangler.toml`. Its comments will tell you how.\n\n5. Login to Cloudflare and deploy with the following steps:\n\n```console\n$ yarn install\n$ yarn wrangler login\n$ yarn deploy\n```\n\n6. Enjoy!\n\n## Auth\n\nIf you want a private deployment (only you can upload paste, but everyone can read the paste), add the following entry to your `wrangler.toml`.\n\n```toml\n[vars.BASIC_AUTH]\nuser1 = \"passwd1\"\nuser2 = \"passwd2\"\n```\n\nNow every access to POST request, and every access to static pages, requires an HTTP basic auth with the user-password pair listed above. For example:\n\n```console\n$ curl example-pb.com\nHTTP basic auth is required\n\n$ curl -Fc=@/path/to/file example-pb.com\nHTTP basic auth is required\n\n$ curl -u admin1:wrong-passwd -Fc=@/path/to/file example-pb.com\nError 401: incorrect passwd for basic auth\n\n$ curl -u admin1:this-is-passwd-1 -Fc=@/path/to/file example-pb.com\n{\n  \"url\": \"https://example-pb.com/YCDX\",\n  \"suggestUrl\": null,\n  \"admin\": \"https://example-pb.com/YCDX:Sij23HwbMjeZwKznY3K5trG8\",\n  \"isPrivate\": false\n}\n```\n\n## Administration\nDelete a paste:\n```console\n$ yarn delete-paste \u003cname-of-paste\u003e\n```\n\nList pastes:\n```console\n$ yarn -s wrangler kv:key list --binding PB \u003e kv_list.json\n```\n\n## Development\n\nRun a local simulator:\n```console\n$ yarn dev\n```\n\nRun tests:\n```console\n$ yarn test\n```\n\nRun tests with coverage report:\n```console\n$ yarn coverage\n```\n","funding_links":[],"categories":["TypeScript","📂 存储与文件管理 (R2/D1)","Dateifreigabe"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSharzyL%2Fpastebin-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSharzyL%2Fpastebin-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSharzyL%2Fpastebin-worker/lists"}