Go to file
Kainoa Kanter 9c30da4a06 Re-arrange assets 2022-03-13 22:44:52 -07:00
.github/ISSUE_TEMPLATE a 2022-03-13 17:48:40 -04:00
assets Re-arrange assets 2022-03-13 22:44:52 -07:00
backend Re-arrange assets 2022-03-13 22:44:52 -07:00
frontend Re-arrange assets 2022-03-13 22:44:52 -07:00
.gitignore 🥳 0.2.0 2022-03-13 16:33:00 -07:00
LICENSE a 2022-03-13 17:48:40 -04:00
README.md Re-arrange assets 2022-03-13 22:44:52 -07:00
example.nginx Nginxfmt 2022-03-13 16:20:22 -07:00

README.md



Just a place to paste

Stargazers Issues License


API

GET /p/:id - Get a paste by ID

POST /p/n - Post a new paste

GET /s - Get stats about the zer0bin instance

Public instances

Submit your public instance here!

Website Expiration Max paste size Version Country
zer0b.in (not up yet) 7 days 40,000 chars vx.x.x ?
stepbro.voring.me 365 days 69,000 chars v0.4.0 🇺🇸 US

Technologies used

Frontend:

Backend:

Self-host instructions

Requirements

  • Rust >= 1.58.0
  • Postgresql >= 12.0
  • NodeJS >= 16.0
  • Nginx
  • Domain with SSL
  • *nix OS

Steps

# export EDITOR=nano
git clone https://github.com/Domterion/zer0bin && cd zer0bin
$EDITOR example.nginx # Edit as appropriate
mv example.nginx yourdomain.tld
for i in /etc/nginx/sites-available/ /etc/nginx/sites-enabled/; do sudo cp ./yourdomain.tld $i; done
systemctl nginx restart
psql -f schema.sql -U postgres zer0bin
cd frontend
cp config.example.json config.json
$EDITOR config.json # Edit as appropriate
npm i && npm run build
cd ../backend
cp config.example.json config.json
$EDITOR config.json # Edit as appropriate
cargo build --release
./target/release/backend # Preferably in a tmux session or as a service

Configuration

Key Values Description
server.backend_host 127.0.0.1 or 0.0.0.0 The host to run the backend on
server.backend_port Any open port The port to run the backend on
pastes.character_limit Number up to 2^64 - 1 The amount of characters allowed in a single paste
pastes.days_til_expiration Number up to 2^63 or -1 The days till a paste is to expire. If set to -1 then pastes will never expire
pastes.id_length Number up to 2^64 - 1 The length of the ID for each paste
databases.postgres_uri PostreSQL Connection URI The URI to use when connecting to a PostgreSQL database
ratelimits.seconds_in_between_pastes Number up to 2^64 - 1 The seconds between paste uploads
ratelimits.allowed_pastes_before_ratelimit Number up to 2^32 - 1 Amount of requests that can be made before they are blocked and have to wait

Benchmarks

This is on a paste with 200 lines!

Lighthouse

Lighthouse

Firefox network

Firefox Network