A simple Pastebin.
Go to file
2024-04-11 01:00:41 +02:00
static Applied PEP 8 style. | Added number lines on view_paste. | Improved some of the code and fixed some bugs. 2024-03-27 19:20:58 +01:00
templates Renamed everything ElitePaste to TechPaste 2024-04-11 01:00:41 +02:00
.gitignore Applied PEP 8 style. | Added number lines on view_paste. | Improved some of the code and fixed some bugs. 2024-03-27 19:20:58 +01:00
config.yaml Added Classes and a YAML config to make it easier for users to configure the pastebin 2024-03-27 19:40:43 +01:00
paste.py Made the API work other than web based usage. 2024-04-10 23:28:11 +02:00
README.md Update README.md 2024-04-10 23:34:50 +02:00
requirements.txt Added requirements.txt 2024-04-10 14:22:07 +02:00

TechPaste

TechPaste is a simple pastebin software that uses client side encryption for web based usage, and server side encryption for API usage.

Installation

Clone the repository and install the dependencies:

git clone https://github.com/yourusername/pasteapi.git
cd pasteapi
pip install -r requirements.txt

API Usage

Create a new paste

To create a new paste, send a POST request to /api/v1/secure-paste with a JSON body containing the data field. You can also include an optional expiry field to specify when the paste should expire.

curl -X POST -H "Content-Type: application/json" -d '{"data":"Hello, World!", "expiry":"2022-12-31 23:59:59"}' curl -X POST -H "Content-Type: application/json" -d '{"data":"Hello, World!", "expiry":"2022-12-31 23:59:59"}' http://localhost:5000/api/v1/secure-paste

The response will be a JSON object with a success field and, if the request was successful, an id field containing the id of the created paste.

Retrieve a paste

To retrieve a paste, send a GET request to /api/v1/secure-paste/{paste_id}, replacing {paste_id} with the id of the paste.

curl -X GET http://localhost:5000/api/v1/secure-paste/1234567890

The response will be the content of the paste if it exists and has not expired. If the paste does not exist or has expired, the response will be an error message.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Please replace localhost:5000 and yourusername with the actual server address and port where your application is running and your actual GitHub username respectively.