Skip to content

elara-bots/hastebin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Selfhosted Hastebin (Cloudflare Worker)


Public Instances:


Notes:

  • You can host this on Cloudflare for free, there is limits to Cloudflare workers but I doubt this will ever hit it.
  • 100k Requests per-day
  • 1GB Data limit for KV (unless you're storing millions of hastes per-expire date, you'll be fine.)
  1. Go to your Cloudflae Workers page and sign in.
  2. Click on the Workers & Pages tab on the left.
  3. Click on KV tab below Workers & Pages tab.
  4. Click on Create namespace on the page, then use the name HASTES then press Add
  5. Go back to Workers & Pages tab, then click Create application.
  6. Click on Create worker and enter the name of what you want the site to be called, then scroll down to Deploy
  7. Now open both Configure Worker and Edit Code buttons.

For: Configure Worker:

  • Click on Settings then Variables
  • Scroll down to KV Namespace Bindings
  • Click on Add Binding
  • Set Variable name to HASTES and point the KV Namespace to the one you just created.

For: Edit Code:

  • Copy the worker.js file in this repo.
  • Paste it into the editor.
  • Change the details you want to in the options object at the top of the file.
  • After you're done with that now press on Deploy on the top right and your site should be working!

Features:

  • Create & View Hastes on the site.
  • API support
  • Stores hastes for 2 weeks (configurable in worker.js with the options.expireTTL option, requires it to be in seconds)
  • API KEYS
API KEY INFO 1) Go to the application's settings tab
2) Go to `Variables` then go to `Environment Variables`
3) Create a `Variable` with the name `HASTE_KEYS` with the `value` being any keys you want to be able to create hastes (through the API and Website)

To add more than one key just split the keys by ,

  • Example: key1, key2, key3

API:

  • POST: https://<website_url>/documents with text/plain header and send the string in the body of the request.
  • GET: https://<website_url>/documents/:id to get the info

TODO:

  • Encrypt the content being stored.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors