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
- python >= 3.4 requirements.txt
- mongodb >= 2.6
- varnish >= 4.0 (optional)
- gunicorn >= 19.1 (optional, or any other WSGI server)
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 --recursiveNext, 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: pbYou'll also need to build pbs, which requires
grunt-cli:
# npm install -g grunt-cli
$ npm install
$ gruntA pb development environment could
be created with something like:
$ pip install virtualenv
$ virtualenv pbenv
$ source pbenv/bin/activate
(pbenv)$ pip install -r pb/requirements.txtYou should use runonce.py to create indexes before you run pb
for the first time on a new database:
(pbenv)$ cd pb
(pbenv)$ ./runonce.pyYou can then start a pb instance via werkzeug's built-in WSGI
server.
(pbenv)$ ./run.pyPackaging
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 pbYou can play with pb's uwsgi configuration in /etc/uwsgi/pb.ini.