Skip to content

GermainZ/pb

 
 

Repository files navigation

pb

pb is a lightweight pastebin (and url shortener) built using flask.

The official instance of pb can be found at ptpb.pw. Feel free to deploy pb elsewhere.

Requirements

Deployment

This assumes you have at least a working python and mysqld with versions strictly matching the the above. Consult your distribution's documentation on how to do that.

Start by cloning pb:

$ git clone https://github.com/silverp1/pb.git

You should then proceed to create a database and optionally database user for pb:

$ mysql -u root <<EOF
CREATE USER 'pb'@'localhost' IDENTIFIED BY 'green socks and sharp knives';
CREATE DATABASE pb;
GRANT ALL PRIVILEGES ON pb.* to 'pb'@'localhost';
FLUSH PRIVILEGES;
EOF

The schema also needs to be present:

$ mysql -u root pb < pb/schema.sql

Next, copy pb/config.yaml.example to ~/.config/pb/config.yaml, and edit it appropriately. If you've followed the above steps exactly, its contents should look something like:

DEBUG: true

MYSQL:
  user: pb
  password: green socks and sharp knives
  database: pb

A pb development environment could be created with something like:

$ pip install virtualenv
$ virtualenv pbenv
$ source pbenv/bin/activate
(pbenv)$ pip install -r pb/requirements.txt

You can then start a pb instance via werkzeug's built-in WSGI server.

(pbenv)$ (cd pb; ./run.py)

About

My attempt at a light pastebin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.5%
  • CSS 2.5%