Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
/ paste Public archive

📓 A tiny pastebin/gist/tinypaste alternative for self-hosting. Use at your own peril.

License

Notifications You must be signed in to change notification settings

s-thom/paste

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

paste

A tiny pastebin alternative for self-hosting.

My goals with this project are as follows:

  1. Learn rust by getting it wrong the first time on a low-stakes project
  2. Keep the feature set small.

Creating new pastes

There is no form for creating a paste. Either use curl directly, or configure a program like ShareX on Windows.

Uploading is done via a multipart/form-data POST request to a path of /. The first part of the request will be used as the text content.

cat my-cool-file.txt | curl -H "Authorization: Bearer <your-secret-token>" -F file=@- http:https://localhost:80

Running it yourself

Either build and run it yourself, or use the provided Docker images.

# Before running, add environment variables to `.env`
cargo run

# OR

docker run \
  -e PASTE_BEARER_TOKEN=<your-secret-token> \
  -p <port-on-host>:80 \
  -v <path-on-host>:/app/pastes \
  ghcr.io/s-thom/paste

Configuration

Configuration is done through environment variables. Use of a .env file is supported for convenience.

Variable Name Description Default
PASTE_DIR Directory to store pastes pastes
PASTE_BEARER_TOKEN A secret that must be provided to create new pastes
SERVER_HOST Host for the app to listen on 127.0.0.1
SERVER_PORT Port for the app to listen on 80

Features / TODO List

  • Read files from directory
  • Write files to directory
  • Configuration for directory (env variable)
  • Simple bearer token authentication for creating new pastes

About

📓 A tiny pastebin/gist/tinypaste alternative for self-hosting. Use at your own peril.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published