★ wanayoo — archive 1999 https://github.com/ptpb/pbNouvelle recherche | Portail wanayoo
Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
My attempt at a light pastebin
Python HTML JavaScript CSS
Branch: master
Failed to load latest commit information.
docs move varnish to docs; convert to reStructuredText
pb use appropriate max_age for sunset'ed pastes
pkg remove pkgbuild
tests add paste sunsets
.gitignore add pb icon and gruntfile
AUTHORS disambiguate/add copyright notices to all sources
Gruntfile.js add pb icon and gruntfile
LICENSE initial mongo rewrite
MANIFEST.in add archlinux packaging
README.rst update readme
config.yaml.example add archlinux packaging
package.json fix repository url
requirements.txt
run.py initial mongo rewrite
runonce.py rice runonce
setup.py add initial test coverage
tox.ini add (complete) url tests

README.rst

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

Something went wrong with that request. Please try again.