|Julien Palard 636bb82dfb|
Pasteque is a free and open source (MIT License) Pastebin like application written in Python/Django.
An instance can be found at: p.afpy.org. The AFPy instance is installed by ansible, the role is available here: https://git.afpy.org/AFPy/infra/src/branch/main/roles/pasteque.
- Support any database supported by Django (Sqlite3, MySQL, PostgreSQL, Oracle, ...)
- Syntax highlighting for a bunch of languages using Pygments.
- Rendering of Markdown as HTML.
- Easy paste from command line or any programming language.
Where's the homepage?
This pastebin has no homepage: its homepage is a paste like any other. So to create one for your instance, just paste something to it, like:
$ curl localhost:8000 -XPUT -H "Authorization: Secret supersecret" --data-binary @using.fr.md
Authorization allows you to update the paste by uploading it again.
I want a robots.txt
Just past it:
$ printf "User-agent: *\nDisallow: /\n" | curl localhost:8000/robots.txt -XPUT -H "Authorization: Secret supersecret" --data-binary @-
It'll work as
.txt files are not pretty printed.
Where's the admin?
The admin is hosted as
/::/admin/. As almost any URL can be used by pastes, we "burry" the admin here.
And no paste can start with
What's this Authorization header?
By providing a secret in the
Authorization header, one can edit its
PUTting to it, and list all its pastes by querying:
curl localhost:8000/::/list/ -H "Authorization: Secret supersecret"
In a venv, install the requirements:
pip install -r requirements.txt
local_settings.py file, at the root of the repo:
DISPLAY_NAME = 'YourCompany-Paste' COMPRESS_ENABLED = True DEBUG = False SECRET_KEY = 'fill_a_secret_key_here' ALLOWED_HOSTS = ['localhost', '127.0.0.1', 'paste.henriet.eu']
Create the database:
If you're in production collect static files: