Skip to main content
Github PyPi Release Latest Travis CI Build Code Coverage License Python Versions Join the chat at https://gitter.im/thekad/pasttle Docker build status

Overview

Pasttle is based upon http://sprunge.us, born out of the necessity to:

  • Have a lightweight pastebin software

  • Not depend on Google AE

  • Paste via CLI

Also, I wanted to play more with http://bottlepy.org

Pasttle 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 instance

  • Client: Entirely written in bash. These are just thin wrappers around curl, you can use this to post to a pasttle server

Installing/Upgrading pasttle-server

Pasttle is part of PyPI, you can just:

pip install pasttle

… 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:

python setup.py install

… 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 server

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

Should start the server. If you want to use a different config file, just set the environment variable PASTTLECONF to the file you want to read before starting the server, like this:

export PASTTLECONF=/etc/pasttle/mypasttle.ini
pasttle-server.py
# optionally, specify a different config section, e.g. [development]
export PASTTLECONF=/etc/pasttle/mypasttle.ini:development
pasttle-server.py

Alternatively, an uWSGI configuration is provided in the .ini file. Here is a script to run the server with virtualenv option:

#!/usr/bin/sh

if [ -n "$VIRTUAL_ENV" ]; then
    OPT="-H $VIRTUAL_ENV"
fi

exec uwsgi pasttle.ini --plugin python $OPT

Available 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]
import bottle
print(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 client

Running the client just requires 2 steps:

  • Source pasttle.bashrc

  • Run pasttle -h or gettle -h to check usage

Metadata

Release files for pasttle 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pasttle 0.10.0
File Size Uploaded Provenance Actions
pasttle-0.10.0.tar.gz 17.2 kB Without provenance Details for pasttle-0.10.0.tar.gz

Release files / pasttle-0.10.0.tar.gz

Download URL pasttle-0.10.0.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3c6023598c00657053ecb485e8aea8e3a8d3868e24ea6723d61fdeb51af65dfe
BLAKE2b-256 checksum
How to use checksums
48b24345a31a4237d7acfe3a2c2fae20dacb77a731dc522173f1bd41a0f8b138
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/2.7

Security for pasttle 0.10.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page