Skip to content

HalosGhost/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.

Build Requirements

  • npm
  • graphicsmagick

Runtime Requirements

Deployment

This assumes you have at least a working python and mongodb 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 --recursive

Next, copy pb/config.yaml.example to ~/.config/pb/config.yaml, and edit it appropriately. For development, its configuration might look something like:

DEBUG: true

MONGO:
  host: localhost
  port: 27017

MONGO_DATABASE: pb

You'll also need to build pbs, which requires grunt-cli:

# npm install -g grunt-cli
$ npm install
$ grunt

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 should use runonce.py to create indexes before you run pb for the first time on a new database:

(pbenv)$ cd pb
(pbenv)$ ./runonce.py

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

(pbenv)$ ./run.py

Packaging

Arch Linux

pb-git is available in the AUR. This package provides pb.service which starts a uwsgi server on port 8080 by default.

For now this requires aur/python-flask-git, until 1.0 is released upstream:

$ cower -dd pb-git
$ (cd python-flask-git && makepkg -si)
$ (cd pb-git && makepkg -si)

Next, start pb with:

# systemctl start pb

You can play with pb's uwsgi configuration in /etc/uwsgi/pb.ini.

About

@silverp1's attempt at a light pastebin; @buhman's attempt at world domination

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 94.8%
  • HTML 3.3%
  • JavaScript 1.6%
  • CSS 0.3%