Skip to content

Loudbooks/PasteBook

Repository files navigation

PasteBook

An easy on the eyes, portable, lightning fast pastebin written in Svelte and Rust.

Installation

Note

If you'd like to host on Railway, you can find the template here. Otherwise, follow the instructions below for selfhosting.

The following is a guide to get PasteBook running on your system under your domain with SSL. All of this was tested on Ubuntu Linux, and Docker is required.

Preparation

  • Download docker-compose.yml here.

Configuration

Caution

Do not modify docker-compose.yml. You will break things.

Create a file by the name of .env in the same directory as these other two files. Add the following.

TITLE=
DESCRIPTION=
DISABLE_NEW=
FAVICON_URL=
MAX_PAYLOAD_SIZE=

All of these options are optional. You can leave it all blank, or not even have a .env file at all.

By default, PasteBook will run on port 8080.

  • TITLE - The title to be used in the browser tab.
  • DESCRIPTION - The blurb to be used on the about page.
  • DISABLE_NEW - Disables the new paste page. API is still accessible.
  • FAVICON_URL - The URL that the favicon will be provided with.
  • MAX_PAYLOAD_SIZE - The maximum paste size in megabytes.

Creation

Run the following.

sudo systemctl enable docker
docker compose up -d

Awesome! PasteBook is now running.

Nginx Configuration

In order to run PasteBook under a domain, you will need to use a reverse proxy. The following will serve as a guide to setting up Nginx.

Prerequisites

  • PasteBook is fully installed with the instructions above.
  • A working Nginx installation. Learn more here.
  • A working Certbot installation. Learn more here.

Nginx Preparation

Navigate to /etc/nginx/sites-enabled.

Domain Preparation

You will need to create a DNS A record pointing to your machine. I use CloudFlare.

Configuration

Download pastebook.conf here and place it in /etc/nginx/sites-enabled.

<DOMAIN> - Change this to your domain name. For example, mine is pastebook.dev.

Note

You can easily replace all instances of <DOMAIN> with your domain with the following command. In this example, I used pastebook.dev. Make sure to use yours.

DOMAIN=pastebook.dev && sudo sed -i "s/<DOMAIN>/${DOMAIN}/g" /etc/nginx/sites-available/pastebook.conf

SSL Configuration

Run the following, with <DOMAIN> changed to your domain.

sudo certbot certonly --standalone -d <DOMAIN>

Committing Changes

Run the following.

systemctl restart nginx

Updating PasteBook

Note

Make sure that docker-compose.yml and pastebook.conf are up to date before proceeding.

Run the following commands in succession.

docker compose stop
docker compose pull
docker compose up -d

Final Notes

Wow. There was a lot that can go wrong there. If you need help, you can email me at contact@loudbook.dev or find me elsewhere.

💜

About

A configurable, portable, aesthetically pleasing pastebin.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors 7