A sensible, modern pastebin.
Pretty much every pastebin sucks. When Gist removed anonymous pastes, I realised that the pastebins out there don't do what I want them to do. I made paste to remedy that problem.
There should be a pastebin that's easy-to-use and simple, supporting multiple files, syntax highlighting, anonymity, and secure authentication. Now there is.
paste works in its current state. There may be heinous bugs, but I use it as my daily pastebin. It is not currently stable, meaning the API could change in a breaking way at any moment and that the web interface and routes may change at any moment, as well.
However, these changes are not without good reason (and are usually debated in depth) and are few and far between.
I host paste.gg. I am poor and can't afford a good machine (paste.gg is an AWS t2.micro – one core and low RAM), so please don't bombard it!
You can run your own paste server by using docker-compose. You will need Docker, obviously.
The Docker image will build and run (in release mode) the server as it is in the repository. That is to say that whatever you have checked out will be built and run.
First, you'll need to set up your configuration. All configuration files are missing by default. You will need to copy over their examples files and edit those. The example files follow this pattern:
If you need ./Rocket.toml, the example file will be located at ./Rocket.example.toml.
.docker/nginx/nginx.conf
Change anything you deem necessary.
.docker/nginx/sites
Choose the file that is best for you. There are HTTP and HTTPS configurations. nginx will load
anything that matches *.conf in that directory, so rename or copy whichever you want.
File is commented with what changes are necessary and notes.
Rocket.toml
Read the comments. Set a secret key. The repo is included in this Docker container, so certs can
be specified at .docker/nginx/run/certs.
config.toml
Change everything, basically. Read the comments.
sidekiq.yml
Probably fine, but change queue concurrency if you need to.
sidekiq.sh
This is a convenience script for you. Change the variables at the start for starting sidekiq properly to work with paste.
.env
Change this to the below.
shell
DATABASE_URL=postgres://paste:paste@postgres/paste
REDIS_URL=redis://redis
SIDEKIQ_URL=redis://redis/1
EMAIL_TEMPLATES=webserver/web/emails/*
# from the repo root
docker-compose -f .docker/docker-compose.yml up
If everything is configured correctly, it should start up, and you should see Rocket has launched
from https://0.0.0.0:8000. Note that this is not how the outside world will access paste.
nginx is set up to expose ports 80 and 443 on the host by default, but you can change
docker-compose.yml (and you'll need to change nginx.conf as well) to change that.
Access paste by connecting to the host via HTTP or HTTPS, depending on how you set up nginx.
Done!
--recursive for submodules)cargo install diesel_cli --no-default-features --features postgrescp Rocket{.example,}.toml; cp config{.example,}.toml; cp sidekiq{.example,}.ymlcargo build --releaseecho 'DATABASE_URL=postgres://username@/database' > .envdiesel migration run --migration-dir=webserver/migrations.envsidekiq.sh edited to be correctROCKET_ENV=prod and set a secret key in Rocket.tomltarget/release/paste config.tomlReverse proxy and handle /static/ with a webserver and not the included route. nginx configuration below.
nginx
location /static/ {
alias /path/to/repo/webserver/web/static/;
}
If you just want to compile paste, perhaps to test while making a contribution, there is a Docker image that has a set-up build environment.
# from repo root
docker run --rm -it -v "$(pwd)":/paste jkcclemens/paste
By default, that will build paste, but you can also append /bin/bash to the command to start a
Bash shell in the working environment.
Join the Discord server!
$ claude mcp add paste \
-- python -m otcore.mcp_server <graph>