Skip to content

SafePaste is an open-source service similar to Pastebin where you are able to store any piece of text and generate links for easy cross platform sharing. Data is preserved forever!

License

Notifications You must be signed in to change notification settings

misobarisic/SafePaste

Repository files navigation

Welcome to SafePaste 👋

License: MIT

SafePaste is an open-source service similar to Pastebin where you are able to store any piece of text and generate links for easy cross platform sharing.

What makes SafePaste stand out is its lack of a database. It is 100% frontend (client side).

Advantages:

  • Your links cannot be deleted
  • Your links cannot be censored
  • The server hosting SafePaste (including any fork using the same encode process) have no access to your data
  • Your data will be accessible forever (as long as you have the link)
  • Data is decoded on your device
  • AES256 + Base64 encoding

Text Alignment

Make sure your editor string starts with either --left or --right to change the text alignment. Otherwise it defaults to center.

Markdown support

The only currently supported markdown use case is [title](link).

How it works

When you click on "Generate URL", SafePaste generates a link based on your input: paste.misobarisic.com/<your data>

When you open a link, SafePaste reads and decodes whatever comes after the first / upon which the appropriate data is displayed in the editor.

HTTP REST

SafePaste links can be easily created or read with a HTTP GET request:

Make sure to use x-www-form-urlencoded to pass data.

The accept header should include application/json or */*.

data refers to the original (redirect) URL, whereas link refers to the part of the URL after paste.misobarisic.com/

Encode

GET /api/encode
Body should contain: data

Example response:
{
    "data": "this is an example",
    "link": "dGhpcyBpcyBhbiBleGFtcGxl"
} 

Encode with password

GET /api/encode
Body should contain: data, pass

// Password is not sent back in the response
Example response:
{
    "data": "this is an example",
    "link": "dGhpcyBpcyBhbiBleGFtcGxl"
} 

Decode

GET /api/decode
Body should contain: link

Example response:
{
  "data": "another example",
  "link": "YW5vdGhlciBleGFtcGxl"
}

Decode with password

GET /api/decode
Body should contain: link, pass

// Password is not sent back in the response
Example response:
{
  "data": "another example",
  "link": "YW5vdGhlciBleGFtcGxl"
}

Forks

If you wish for all SafePaste links to be accessible on your fork of this project make sure not to edit these fields

config.js

module.exports.base = {
    key: "safepaste"
}

utils/urlUtils.js

module.exports.generateURL = input => base64.encode(aes256.encrypt(key, input))
module.exports.decodeURL = input => aes256.decrypt(key, base64.decode(input))

Deploy your own

Deploy with Vercel

Author

👤 Mišo Barišić

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2021 misobarisic.
This project is MIT licensed.

About

SafePaste is an open-source service similar to Pastebin where you are able to store any piece of text and generate links for easy cross platform sharing. Data is preserved forever!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published