https://github.com/s-thom/paste
📓 A tiny pastebin/gist/tinypaste alternative for self-hosting. Use at your own peril.
https://github.com/s-thom/paste
docker hastebin paste pastebin rust rust-lang self-hosted
Last synced: 2 days ago
JSON representation
📓 A tiny pastebin/gist/tinypaste alternative for self-hosting. Use at your own peril.
- Host: GitHub
- URL: https://github.com/s-thom/paste
- Owner: s-thom
- License: apache-2.0
- Archived: true
- Created: 2021-12-29T05:34:46.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-09T05:05:24.000Z (over 2 years ago)
- Last Synced: 2025-04-23T12:55:26.095Z (10 days ago)
- Topics: docker, hastebin, paste, pastebin, rust, rust-lang, self-hosted
- Language: Rust
- Homepage:
- Size: 124 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-starred - s-thom/paste - 📓 A tiny pastebin/gist/tinypaste alternative for self-hosting. Use at your own peril. (self-hosted)
README
# 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](https://getsharex.com/) 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.
```sh
cat my-cool-file.txt | curl -H "Authorization: Bearer " -F file=@- http://localhost:80
```## Running it yourself
Either build and run it yourself, or use the provided [Docker images](https://github.com/s-thom/paste/pkgs/container/paste).
```sh
# Before running, add environment variables to `.env`
cargo run# OR
docker run \
-e PASTE_BEARER_TOKEN= \
-p :80 \
-v :/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
- [x] Read files from directory
- [x] Write files to directory
- [x] Configuration for directory (env variable)
- [x] Simple bearer token authentication for creating new pastes