Package: pasttle
OverviewPasttle is based uponhttp://sprunge.us, born out of the necessity to:Have a lightweight pastebin softwareNot depend on Google AEPaste via CLIAlso, I wanted to play more withhttp://bottlepy.orgPasttle is split in server and client, it depends on what you are trying to
use to run one or the other.Server: Runs on python and needs a database (defaults to using SQLite) to
store all the data. You want this if you are setting your own private
pasttle instanceClient: Entirely written in bash. These are just thin wrappers around curl,
you can use this to post to a pasttle serverInstalling/Upgrading pasttle-serverNoteIf you are upgrading pasttle-server, you’d do well in reading CHANGELOG.rst
first so you make sure the version you are upgrading has any additional
steps.Pasttle is part of PyPI, you can just:pipinstallpasttle… and it should pull all the necessary components. Whether you want to install
it in a virtual environment (which I recommend) or system-wide is totally up
to you.If you instead want to try from source code (i.e. by cloning the git repo)
then I suggest you execute:pythonsetup.pyinstall… and be done with it. Again, if you do this in a virtual environment or
not is up to you.In either case, if you want to add any other database drivers on top of the
shipped SQLite driver, you need to install it separately depending on what
method you used to install pasttle to begin with.Running the serverOnce you have it installed you need a database and (optionally) a different
WSGI runner (bottle, which pasttle runs on top of, runs on wsgiref by default)
but can run on Paste, tornado, CherryPy, and several others.Also, since pasttle uses SQLAlchemy as the backend, you have your pick of any
database that SQLAlchemy supports: SQLite (the default), MySQL and Postgres
being the most famous.Once you have your database all setup, you just need to create a pasttle.ini
(like the one in the repo) and change the values to whatever matches your
environment.After that:pasttle-server.pyShould start the server. If you want to use a different config file, just set
the environment variablePASTTLECONFto the file you want to read before
starting the server, like this:exportPASTTLECONF=/etc/pasttle/mypasttle.inipasttle-server.py# optionally, specify a different config section, e.g. [development]exportPASTTLECONF=/etc/pasttle/mypasttle.ini:developmentpasttle-server.pyAlternatively, an uWSGI configuration is provided in the.inifile.
Here is a script to run the server with virtualenv option:#!/usr/bin/shif[-n"$VIRTUAL_ENV"];thenOPT="-H$VIRTUAL_ENV"fiexecuwsgipasttle.ini--pluginpython$OPTAvailable configuration options[main]debug:<true/false> [default=true]bind:<address> [default=localhost]port:<port> [default=9669]title:<title>wsgi:<wsgi server to use> [default=wsgiref]pool_recycle:<db connection age> [default=3600]recent_items:<number to show on main page> [default=20]pygments_style:<coloration theme> [default=tango]Notepool_recycleSee documentation ofsqlalchemy.create_enginefor detailswsgiWSGI server to use, look atbottle.server_namesfor the listimportbottleprint(bottle.server_names.keys())['cgi','gunicorn','cherrypy','eventlet','tornado','geventSocketIO','rocket','diesel','twisted','wsgiref','fapws3','bjoern','gevent','meinheld','auto','flup','gae','paste','waitress']Running the clientRunning the client just requires 2 steps:Source pasttle.bashrcRunpasttle-horgettle-hto check usage