diff --git a/README.md b/README.md index 0b35a4d..06aca09 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Paste This is a pastebin-like, simple file sharing application targeted to run on Cloudflare Worker. -[pb.nekoul.com](http://pb.nekoul.com) is the current deployment of this project. +[pb.nekoid.cc](http://pb.nekoid.cc) is the current deployment of this project. The maximum upload file size is limited to **10 MB** and the paste will be kept for **28 days** only by default. *All data may be deleted or expired without any notification and guarantee.* Please **DO NOT** abuse this service. @@ -52,42 +52,42 @@ i.e., [encrypted store](https://developers.cloudflare.com/workers/platform/envir Upload a file (Raw body) with password enabled ```sh -$ curl --data-binary @example.txt -H "x-pass: exmaple1234" "https://pb.nekoul.com" +$ curl --data-binary @example.txt -H "x-pass: exmaple1234" "https://pb.nekoid.cc" ``` Upload a file (Formdata) with password enabled ```shell -$ curl -F u=@exmaple.txt -F "pass=example1234" "https://pb.nekoul.com" +$ curl -F u=@exmaple.txt -F "pass=example1234" "https://pb.nekoid.cc" ``` Upload command ouput as paste ```shell -$ lspci -v | curl -F u=@- 'https://pb.nekoul.com' +$ lspci -v | curl -F u=@- 'https://pb.nekoid.cc' ``` Update a paste with QR code generation of paste link ```shell -$ echo "Hello, world!" | curl -F u=@- 'https://pb.nekoul.com?qr=1' +$ echo "Hello, world!" | curl -F u=@- 'https://pb.nekoid.cc?qr=1' ``` Get paste ```shell -$ curl https://pb.nekoul.com/uuid +$ curl https://pb.nekoid.cc/uuid ``` Delete paste ```shell -$ curl -X DELETE https://pb.nekoul.com/uuid +$ curl -X DELETE https://pb.nekoid.cc/uuid ``` ### **Web** -Use [pb.nekoul.com](https://pb.nekoul.com) to submit HTTP form, as same as `curl`. +Use [pb.nekoid.cc](https://pb.nekoid.cc) to submit HTTP form, as same as `curl`. This HTML form currenly only support paste upload. ## API Specification @@ -175,6 +175,6 @@ Reference for Amazon S3 can be found in [here](https://docs.aws.amazon.com/Amazo You are welcome to use my project and depoly your own service. Due to the fact that the `SERVICE_URL` is hard-coded into the `paste.html`, -you may simply use `Ctrl`+`R` to replace `pb.nekoul.com` with your own service URL. +you may simply use `Ctrl`+`R` to replace `pb.nekoid.cc` with your own service URL. ### Of course, contribute and report issues are also welcome! \:D \ No newline at end of file diff --git a/package.json b/package.json index e155d03..b9fa1a7 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,9 @@ "version": "1.3", "dependencies": { "aws4fetch": "^1.0.17", - "nanoid": "^4.0.1", + "dedent-js": "^1.0.1", "js-sha256": "^0.9.0", - "dedent-js": "^1.0.1" + "nanoid": "^4.0.1" }, "devDependencies": { "@cloudflare/workers-types": "^4.20230321.0", diff --git a/src/index.ts b/src/index.ts index 8849d57..bb67099 100644 --- a/src/index.ts +++ b/src/index.ts @@ -22,7 +22,7 @@ import {sha256} from 'js-sha256'; import dedent from 'dedent-js'; // Constants -const SERVICE_URL = 'pb.nekoul.com'; +const SERVICE_URL = 'pb.nekoid.cc'; const PASTE_WEB_URL_v1 = 'https://raw.githubusercontent.com/rikkaneko/paste/main/web/v1'; const PASTE_WEB_URL = 'https://raw.githubusercontent.com/rikkaneko/paste/main/web/v2'; const UUID_LENGTH = 4; @@ -476,7 +476,7 @@ async function get_paste_info(uuid: string, descriptor: PasteIndexEntry, env: En const paste_info = { uuid, link, - link_qr: 'https://qrcode.nekoul.com/?' + new URLSearchParams({q: link, type: 'svg'}), + link_qr: 'https://qrcode.nekoid.cc/?' + new URLSearchParams({q: link, type: 'svg'}), type: descriptor.type ?? 'paste', title: descriptor.title?.trim(), mime_type: descriptor.mime_type, @@ -542,7 +542,7 @@ async function get_paste_info(uuid: string, descriptor: PasteIndexEntry, env: En // Console response if (need_qr) { // Cloudflare currently does not support doing a subrequest to the same zone, use service binding instead - const res = await env.QRCODE.fetch('https://qrcode.nekoul.com?' + new URLSearchParams({ + const res = await env.QRCODE.fetch('https://qrcode.nekoid.cc?' + new URLSearchParams({ q: link, type: 'utf8', })); diff --git a/web/v1/paste.html b/web/v1/paste.html index f1266ff..82fce72 100644 --- a/web/v1/paste.html +++ b/web/v1/paste.html @@ -26,7 +26,7 @@

Paste Service

- pb.nekoul.com is a pastebin-like service hosted on Cloudflare Worker.
+ pb.nekoid.cc is a pastebin-like service hosted on Cloudflare Worker.
This service is primarily designed for own usage and interest only.
All data may be deleted or expired without any notification and guarantee. Please DO NOT abuse this service.
@@ -38,7 +38,7 @@ href="https://wiki.archlinux.org/title/CURL">curl.

-
+

Upload file

@@ -169,9 +169,9 @@ document.getElementById('upload_file_form').addEventListener('submit', handle_submit_form, false);
-[Homepage] +[Homepage] [API] -[Switch to new version] +[Switch to new version]

© 2022 rikkaneko

diff --git a/web/v2/js/paste.js b/web/v2/js/paste.js index 6d82eff..2277abb 100644 --- a/web/v2/js/paste.js +++ b/web/v2/js/paste.js @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -const endpoint = 'https://pb.nekoul.com'; +const endpoint = 'https://pb.nekoid.cc'; let input_div = { file: null, @@ -292,7 +292,7 @@ $(function () { show_pop_alert('Invalid Paste ID.', 'alert-warning'); return; } - window.open(`https://pb.nekoul.com/${uuid}`); + window.open(`https://pb.nekoid.cc/${uuid}`); }); view_btn.on('click', async function () { diff --git a/web/v2/paste.html b/web/v2/paste.html index 4da50b0..6e86ed4 100644 --- a/web/v2/paste.html +++ b/web/v2/paste.html @@ -39,13 +39,13 @@