Rustypaste is a minimal file upload/pastebin service.
Features
- File upload & URL shortening & upload from URL
- supports basic HTTP authentication
- random file names (optional)
- pet name (e.g.
capital-mosquito.txt) - alphanumeric string (e.g.
yB84D2Dv.txt)
- pet name (e.g.
- supports expiring links
- supports one shot links (can only be viewed once)
- guesses MIME types
- supports overriding and blacklisting
- no duplicate uploads (optional)
- Single binary
- Simple configuration
- supports hot reloading
- Easy to deploy
- No database
- filesystem is used
- Self-hosted
- centralization is bad!
- Written in Rust
- blazingly fast!
Installation
From crates.io
Binary releases
See the available binaries on releases page.
Build from source
Usage
The standalone command line tool (rpaste) is available here.
CLI
* consider reading authorization headers from a file. (e.g. -H @rpaste_auth)
# upload a file
# paste from stdin
Expiration
(supported units: ns, us, ms, sec, min, hours, days, weeks, months, years)
One shot
Cleaning up expired files
URL shortening
Paste file from remote URL
Server
To start the server:
If the configuration file is not found in the current directory, specify it via CONFIG environment variable:
To enable basic HTTP auth, set the AUTH_TOKEN environment variable (via .env):
See config.toml for configuration options.
Docker
Following command can be used to run a container which is built from the Dockerfile in this repository:
- uploaded files go into
./upload(on the host machine) - set the
AUTH_TOKENvia-eor--env-fileto enable auth
You can build this image using docker build -t rustypaste . command.
If you want to run the image using docker compose, simply run docker-compose up -d. (see docker-compose.yml)
Nginx
Example server configuration with reverse proxy:
server {
listen 80;
location / {
proxy_pass http://localhost:8000/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
add_header X-XSS-Protection "1; mode=block";
add_header X-Frame-Options "sameorigin";
add_header X-Content-Type-Options "nosniff";
}
}
If you get a 413 Request Entity Too Large error during upload, set the max body size in nginx.conf:
http {
# ...
client_max_body_size 100M;
}
Roadmap
Nothing here yet! 🎉
Contributing
Pull requests are welcome!
Consider submitting your ideas via issues first. Also, see the roadmap and/or run the following command to see what is needed to be done: