zer0bin/README.md

79 lines
5.2 KiB
Markdown
Raw Normal View History

2022-02-28 21:10:02 +00:00
<div align="center">
2022-03-05 00:44:23 +00:00
<img src="zero.png" height="110px"/>
2022-03-05 00:58:33 +00:00
<br>
<img src="zer0bin.svg" height="100"/>
<br>
Just a place to paste
2022-02-28 21:10:02 +00:00
<br>
2022-03-01 02:40:06 +00:00
<br>
2022-03-01 02:24:50 +00:00
<p align="center">
2022-03-01 02:26:19 +00:00
<a href="https://github.com/domterion/zer0bin/stargazers">
2022-03-01 19:00:29 +00:00
<img alt="Stargazers" src="https://custom-icon-badges.herokuapp.com/github/stars/domterion/zer0bin?style=for-the-badge&logo=star&color=f6c177&logoColor=31748f&labelColor=12101F"></a>
2022-03-01 02:26:19 +00:00
<!-- <a href="https://github.com/domterion/zer0bin/releases/latest">
<img alt="Releases" src="https://img.shields.io/github/release/domterion/zer0bin?style=for-the-badge&logo=github&color=31748f&logoColor=ebbcba&labelColor=12101F"/></a> -->
<a href="https://github.com/domterion/zer0bin/issues">
2022-03-01 19:00:29 +00:00
<img alt="Issues" src="https://custom-icon-badges.herokuapp.com/github/issues/domterion/zer0bin?style=for-the-badge&logo=issue-opened&color=9ccfd8&logoColor=eb6f92&labelColor=12101F"></a>
<a href="https://github.com/Domterion/zer0bin/blob/main/LICENSE">
<img alt="License" src="https://custom-icon-badges.herokuapp.com/github/license/domterion/zer0bin?style=for-the-badge&logo=law&color=c4a7e7&logoColor=ebbcba&labelColor=12101F"></a>
2022-03-01 02:24:50 +00:00
</p>
2022-02-28 21:10:02 +00:00
<br>
</div>
# API
2022-03-01 14:19:26 +00:00
**GET** /p/:id - Get a paste by ID
2022-02-28 21:10:52 +00:00
2022-03-01 14:19:26 +00:00
**POST** /p/n - Post a new paste
2022-02-28 21:10:02 +00:00
**GET** /s - Get stats about the zer0bin instance
# Public instances
2022-03-01 13:48:26 +00:00
2022-03-01 02:07:35 +00:00
Submit your public instance [here](https://github.com/Domterion/zer0bin/issues/new?assignees=&labels=&template=03_public_instance.md&title=%F0%9F%9A%80+)!
2022-03-01 02:00:07 +00:00
2022-03-05 01:29:35 +00:00
| Website | Country | Expiration | Max paste size | Version |
| ---------------------------------------------- | ------- | ---------- | -------------- | ------------ |
| zer0b.in (not up yet) | ? | 7 days | 40,000 chars | vx.x.x |
| [stepbro.voring.me](https://stepbro.voring.me) | 🇺🇸 | 365 days | 100,000 chars | v0.1.0 |
2022-03-01 02:00:07 +00:00
2022-03-05 01:54:26 +00:00
### Technologies used
Frontend: <a href="https://parceljs.org/"><img src="https://parceljs.org/parcel.fb905a63.png" height=25/></a> <a href="https://rosepinetheme.com/"><img src="https://raw.githubusercontent.com/rose-pine/rose-pine-theme/27ee1976cc42a85edff37fe22c16de180c4874dc/assets/icon.svg" height=25/></a> <a href="https://jquery.com/"><img src="https://cdn.discordapp.com/attachments/810799100940255260/949484528773234758/PngItem_2069875.png" height=25/></a> <a href="https://highlightjs.org/"><img src="https://avatars.githubusercontent.com/u/9039821?s=200&v=4" height=25/></a>
Backend: <a href="https://actix.rs/"><img src="https://cdn.discordapp.com/attachments/810799100940255260/949482823717388399/ezgif-2-1eeffc46b5.png" height=25/></a> <a href="https://github.com/mehcode/config-rs"><img src="https://cdn.discordapp.com/attachments/810799100940255260/949483776340287498/ezgif-2-bb53a86ede.png" height=25/></a>
2022-03-01 00:17:29 +00:00
# Instructions
2022-03-01 13:48:26 +00:00
2022-03-01 00:17:29 +00:00
### Requirements
2022-03-04 23:35:52 +00:00
- Rust >= 1.58.0
- Postgresql >= 12.0
- Nginx >= 1.18.0
2022-03-05 00:44:23 +00:00
- NodeJS + Yarn (`sudo npm i -g yarn`)
2022-03-04 23:35:52 +00:00
- \*nix OS
2022-03-01 00:17:29 +00:00
2022-03-01 02:18:11 +00:00
### Steps
2022-03-01 00:17:29 +00:00
1. `git clone https://github.com/Domterion/zer0bin && cd zer0bin`
2. `cp config.example.json config.json` and edit as appropriate
3. `cp example.nginx /etc/nginx/sites-avaliable/yoursite.tld`, edit as appropriate, `sudo cp /etc/nginx/sites-avaliable/yoursite.tld /etc/nginx/sites-enabled/yoursite.tld && systemctl nginx restart`
4. `psql -d postgres`
2022-03-01 00:23:20 +00:00
5. `CREATE DATABSE zer0bin;` and `\c zer0bin`
2022-03-05 01:36:36 +00:00
6. Paste contents of `schema.sql` and `\q`
7. `cd frontend && yarn && yarn run build`
8. `cd ../backend && cargo build --release`
9. `./target/release/backend` (preferably in a tmux session)
2022-03-01 13:48:26 +00:00
2022-03-01 14:14:44 +00:00
### Configuration
2022-03-05 00:44:23 +00:00
| 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 |
| frontend.api_url | Your public facing API URL| The URL that the frontend will post to, most likely `https://domain.tld/api` |