PURRITO(1)

NAME
purrito - PurritoBin pastebin server

SYNOPSIS
purrito [-abcdefghijklmnpqrstvwxz] -d domain [-a slug_characters] [-b max_database_size] [-c public_cert_file] [-e dhparams_file] [-f index_file] [-g slug_size] [-h] [-i bind_ip] [-j autoclean_interval] [-k private_key_file] [-l] [-m max_paste_size] [-n server name] [-p bind_port] [-q default_time_limit] [-r max_retries] [-s storage_directory] [-t] [-v header_value] [-w passphrase] [-x header] [-z database_directory]

DESCRIPTION
The purrito server is a pastebin server for accepting files on multiple interfaces. It is designed to have very low memory and CPU requirements and on average requires 2-3 MB of RAM to run.

The options are as follows:

-d domain
    REQUIRED

    domain that will be used as prefix of returned paste

    NOTE: should be the full name, including trailing /

    e.g. “https://bsd.ac/”

-a slug_characters
    DEFAULT: 0123456789abcdefghijklmnopqrstuvwxyz

    Characters used to generate the slug.

-b max_database_size
    DEFAULT: 16777216 (16MB)

    Maximum size of database allowed when running purrito, in BYTES.

-c public_cert_file
    DEFAULT: null

    Public key certificate to use if using TLS.

-e dhparams_file
    DEFAULT: null

    Diffie-Hellman prime file to use if using TLS.

-f index_file
    DEFAULT: index.html

    Top level index file. Only used if the simple HTTP server, -t, is enabled.

-g slug_size
    DEFAULT: 7

    Length of the randomly generated slug for the paste.

-h  show help and exit

-i bind_ip
    DEFAULT: 0.0.0.0, ::

    IP on which to listen for incoming connections. Can be specified multiple times for multiple ips. If more bind_ip options than bind_port options are specified, then the last bind_port option is used for all remaining bind_ip options.

-j autoclean_interval
    DEFAULT: 300 (5 mins)

    Intervals at which to clean out old pastes, in seconds.

-k private_key_file
    DEFAULT: null

    Private key certificate to use if using TLS.

-l  Enable listening using an TLS server. If enabled then the -k, -c, -n options should also be specified, -e is optional.

-m max_paste_size
    DEFAULT: 65536 (64KB)

    Maximum paste size to accept, in BYTES.

-n server_name
    DEFAULT: null

    server_name to be used if using TLS.

-p bind_port
    DEFAULT: 42069

    Port on which to listen for connections. Can be specified multiple times for multiple ports. If more bind_port options than bind_ip options are specified, then the last bind_ip is used for all remaining bind_port options.

-q default_time_limit
    DEFAULT: 604800 (1 week)

    The default expiration time of a paste, in seconds. A paste can configure its lifetime by submitting to domain.tld/{day,week,month} or domain.tld/<time-in-minutes> to set its lifetime to a desired number of minutes. If the submission time is “0” the paste will have an infinite lifetime and will not be cleaned. The server will only clean pastes at its regular autoclean_interval.

-r max_retries
    DEFAULT: 5

    Maximum number of retries to generate an available unlocked slug, in case of a pastebin with large number of pastes.

-s storage_directory
    DEFAULT: /var/www/purritobin

    Path to the storage_directory for storing the pastes.

    NOTE: should exist prior to starting the server and should be writable by the user running purrito.

-t  Enable a simple HTTP server to serve the pastes.

    WARNING: purrito is only optimized for receiving large paste, not for serving them like an HTTP server. It is recommended to use a proper web server for serving large files.

-v header_value
    DEFAULT: null

    header_values for corresponding headers. The values are read in order, with the first header matching the first header_value. These can be used to allow the online submission portal to paste using javascript by setting the appropriate CORS attributes, see EXAMPLES.

-w passphrase
    DEFAULT: null

    passphrase for unlocking the private_key_file file if it is locked.

-x header
    DEFAULT: null

    headers for corresponding header_values. The values are read in order, with the first header_value matching the first header. These can be used to allow the online submission portal to paste using javascript by setting the appropriate CORS attributes, see EXAMPLES.

-z database_directory
    DEFAULT: /var/db/purritobin

    Path to the database_directory for storing the LMDB database of paste timestamps, used for auto-cleaning the pastes.

EXAMPLES
Run the purrito server with the domain name set to https://bsd.ac/ with, enabling the built-in HTTP server and setting the “Content-Type” header to “text/plain; charset=UTF-8”:

    $ purrito -d "https://bsd.ac/" -t \
              -x "Content-Type" -v "text/plain; charset=UTF-8"

Run the previous server with TLS and the proper SNI, while also enabling the online submission portal by setting the appropriate CORS attributes:

    $ purrito -d "https://bsd.ac/" -t \
              -x "Content-Type" -v "text/plain; charset=UTF-8" \
              -x "Access-Control-Allow-Origin" -v "https://bsd.ac" \
              -l -n bsd.ac \
              -c /etc/ssl/bsd.ac.crt -k /etc/ssl/private/bsd.ac.key

Run the previous TLS server, while listening on 10.7.0.1:9876, 192.168.1.2:9999, 134.32.10.10:42069, [2001:456:8ee4:4::1]:42069, [2001:456:8ee4:4::2]:42069 with:

    $ purrito -d "https://bsd.ac/" -t \
              -x "Content-Type" -v "text/plain; charset=UTF-8" \
              -x "Access-Control-Allow-Origin" -v "https://bsd.ac" \
              -l -n bsd.ac \
              -c /etc/ssl/bsd.ac.crt -k /etc/ssl/private/bsd.ac.key \
              -i "10.7.0.1"            -p 9876  \
              -i "192.168.1.2"         -p 9999  \
              -i "134.32.10.10"        -p 42069 \
              -i "2001:456:8ee4:4::1"           \
              -i "2001:456:8ee4:4::2"

DIAGNOSTICS
purrito logs to syslog with the purritobin identity, along with the PID of the server.