OpenBSD Handbook

    Theme
    • Part I. Install & Configure
      • Introduction to OpenBSD
      • Installing OpenBSD
      • The X Window System
      • Networking on OpenBSD
      • System Configuration
      • OpenBSD Basics
      • Managing Software: Packages and Ports
    • Part II. Daily Operations
      • OpenBSD Desktop Environments
      • Multimedia
      • Printing
      • Linux Compatibility
      • Windows Compatibility
      • Games
    • Part III. System Administration
      • Virtualization
      • Storage and File Systems
      • Updating and Upgrading
      • Localization
      • The OpenBSD Boot Process
      • Security
    • Part IV. Networking & Daemons
      • Services
        • Database
          • MariaDB
          • PostgreSQL
          • Redis
          • memcached
        • Directory
          • YP (NIS)
          • LDAP
        • File
          • NFS
          • Samba
        • FTP Services
          • ftpd
          • ProFTPD
          • vsftpd
          • Pure-FTPd
          • TFTP
        • Mail
          • OpenSMTPD Mail Server
          • Dovecot IMAP and POP3 Server
          • Postfix
          • Exim
          • Rspamd
        • Name
          • Unbound DNS Resolver
          • NSD Authoritative DNS Server
          • BIND DNS Server
        • Networking
          • OpenBGPD
          • rad
          • DHCP on OpenBSD
          • slaacd
        • Web
          • Apache HTTP Server
          • nginx Web Server
          • OpenBSD httpd Web Server
          • relayd Reverse Proxy
        • Logging
          • syslogd
        • Monitoring
          • SNMP
        • Remote Access
          • Audit OpenSSH
          • OpenSSH Server
        • File Synchronization
          • rsync
        • Messaging
          • RabbitMQ Message Broker
        • Time
          • NTP Time Synchronization
      • PF
        • pfctl cheat sheet
        • PF Anchors
        • PF Filter Rules
        • PF Forwarding
        • PF Lists and Macros
        • PF Load Balancing
        • PF Logging
        • PF NAT
        • PF Options
        • PF Policies
        • PF Shortcuts
        • PF Tables
      • Advanced Networking
        • High Availability and State Replication
        • Multi-WAN and Policy-Based Routing
        • VPN and Cryptographic Tunneling
        • Classic and Lightweight Tunnels
        • IPv6 at Scale
        • QoS and Traffic Shaping
        • MPLS and Label Distribution
        • Network Services at Scale
        • Virtualization and Host Networking
        • Large-Scale L2 and L3 Design
        • Telemetry, Logging, and Flow Export
        • Hardening and Operational Safety
        • Reference Architectures
        • Troubleshooting Playbooks
      • Serial Communication
    • Part V. Miscellaneous
      • Virtualization Cheat Sheet
      • OpenBSD Cheatsheet
      • How-to Guides
        • Complete the First 30 Minutes After Installation
        • Check Hardware Compatibility Before Installing
        • Bootstrap Wi-Fi Firmware Without Ethernet
        • Set Up OpenBSD as a Laptop or Workstation
        • Configure Laptop Power Management
        • Run OpenBSD as a Virtual Machine Guest
        • Install OpenBSD on a VPS or Cloud Server
        • Install OpenBSD with Full-Disk Encryption
        • Troubleshoot Web Browsers on OpenBSD
        • Create an Administrator Account with doas and SSH Keys
        • Establish a Conservative Security Baseline
        • Manage OpenBSD with Ansible
        • Recover Access and Reset the Root Password
        • Collect OpenBSD Diagnostic Evidence
        • Configure Secure Remote Access with OpenSSH
        • Set Up WordPress on OpenBSD
        • Build Third-Party Software from Ports
        • Use FIDO Security Keys with OpenSSH
        • Build OpenBSD from Source
        • Configure Wi-Fi Roaming and Wired Failover
        • Dual-Boot OpenBSD on a UEFI System
        • Troubleshoot PF, NAT, and Routing
        • Automate OpenBSD Installation with Autoinstall and PXE
        • Route Multiple VLANs with PF
        • Configure a Road-Warrior WireGuard VPN
        • Troubleshoot Package Installation and Update Failures
        • Route IPv6 Networks without NAT
        • Schedule Recurring Maintenance
        • Plan a Docker Workload Migration to OpenBSD
        • Build a Mail Server with OpenSMTPD, Dovecot, and Rspamd
        • Build a Simple Router and Firewall
        • Monitor an OpenBSD System
        • Back Up and Restore an OpenBSD System
        • Configure softraid RAID1
        • Recover an OpenBSD System That Does Not Boot
        • Install Z shell (zsh)
      • OpenBSD for Linux Users
      • OpenBSD for FreeBSD Users
      • OpenBSD for macOS Users
    • OpenBSD FAQ
    • OpenBSD Architectures
      • OpenBSD Package Search

        purritobin-0.6.7p4

        Package search / Categories / OpenBSD 8.0 release
        โ† Back to search
        OpenBSD branch
        OpenBSD 8.0 releaseCurrent snapshot

        OpenBSD 8.0 release ยท amd64

        minimalistic command line pastebin

        Project homepage: https://bsd.ac/

        Description

        Purrito Bin is an ultra fast, minimalistic, encrypted command line paste-bin server written in C++ for handling large number of requests. It is very easy to integrate with any standard http server such as httpd(8), apache or nginx and follows the KISS principle towards handling pastes. It supports pledge(2) and unveil(2) in OpenBSD to be secure to outside script attacks.

        Package information

        Ports path
        www/purritobin
        Package architecture
        amd64
        Maintainer
        Aisha Tammy <aisha@openbsd.org>
        Categories
        www, net
        Available flavors
        None listed
        Only for architectures
        aarch64, amd64, arm, i386, mips64, mips64el, powerpc, powerpc64, riscv64, sparc64, alpha, hppa

        Ports list build and test dependencies as well as runtime dependencies. pkg_add selects those needed for installation.

        Direct dependencies

        Library

        • databases/lmdb
        • net/usockets

        Build

        • databases/lmdbxx
        • net/curl
        • sysutils/coreutils
        • www/uwebsockets
        • devel/meson STEM->=1.12.1v0
        OpenBSD README

        This README contains unresolved ports variables; replace them before using its commands.

        +-------------------------------------------------------------------------------
        | Running PurritoBin on OpenBSD
        +-------------------------------------------------------------------------------
        
        Set proper daemon flags
        =======================
        
        You need to set at least the following option for PurritoBin
          -d <domain-name>   # e.g. https://bsd.ac/
                             # needs to include the trailing slash
        
          rcctl set purritobin flags -d <domain-name>
        
        To take a quick look at all the possible options and descriptions
          purrito -h
        
        For an in-depth explanation
          man purrito
        
        
        Exposing a webserver
        ====================
        
        PurritoBin saves all the pastes to a single folder.
        By default it is the folder ${LOCALSTATEDIR}/www/purritobin.
        So it is possible to just expose the folder via httpd(8)
        
        sample httpd(8) configuration
        -----------------------------
        http_port=80
        https_port=443
        ext_if=egress
        
        # so that non suffixed paste files are recognized as
        # plain text files
        default type text/plain
        
        server "bsd.ac" {
        	alias "www.bsd.ac"
        	listen on $ext_if port $http_port
        	location "/.well-known/acme-challenge/*" {
        		root { "/acme" }
        		request strip 2
        	}
        	location "/*" {
        		block return 301 "https://$HTTP_HOST$REQUEST_URI"
        	}
        }
        
        server "bsd.ac" {
        	alias "www.bsd.ac"
        	listen on $ext_if tls port $https_port
        	tls {
        		certificate "/etc/ssl/bsd.ac.crt"
        		key "/etc/ssl/private/bsd.ac.key"
        	}
        	root "/purritobin"
        	directory index "index.html"
        }
        
        
        sample nginx(8) configuration
        -----------------------------
        user nginx;
        worker_processes 1;
        error_log /var/log/nginx/error.log warn;
        pid /var/run/nginx.pid;
        
        events {
        	worker_connections 1024;
        }
        
        http {
        	include	           /etc/nginx/mime.types;
        	default_type       text/plain;
        	charset            utf-8;
        	log_format  main   '$remote_addr - $remote_user [$time_local] "$request" '
        			   '$status $body_bytes_sent "$http_referer" '
        			   '"$http_user_agent" "$http_x_forwarded_for"';
        	access_log         /var/log/nginx/access.log  main;
        	sendfile           on;
        	keepalive_timeout  65;
        
        	server {
        		listen 80 default_server;
        		location / {
        			return 301 https://$host$request_uri;
        		}
        		location /.well-known/acme-challenge/ {
        			alias /var/www/acme-challenge/;
        		}
        	}
        
        	server {
        		listen 443 ssl;
        		server_name bsd.ac www.bsd.ac;
        
        		ssl_certificate     /etc/ssl/bsd.ac.crt;
        		ssl_certificate_key /etc/ssl/private/bsd.ac.key;
        
        		# to allow online paste submission
        		add_header 'Access-Control-Allow-Origin' 'https://bsd.ac:42069';
        
        		root /var/www/purritobin;
        		location /.well-known/acme-challenge/ {
        			alias /var/www/acme-challenge/;
        		}
        	}
        }
        
        
        Encrypted pastes
        ================
        
        The default clients of PurritoBin are installed to
        /usr/local/share/PurritoBin/POSIX_shell_client.sh
        
        To enable server side support for these pastes
        make sure that paste.html file located at
        /usr/local/share/PurritoBin/paste.html
        is available for viewing, typically possible by just
        dumping the file into ${LOCALSTATEDIR}/www/purritobin
        
        
        Online pasting through web-portal
        =================================
        
        To paste using the javascript form, the CORS header
        from both the paste server and the http server need to
        allow each other in the "Access-Control-Allow-Origin"
        HTTP header.
        
        An example for setting the CORS header in purrito(1)
        is available in the man page. As httpd(8) does not allow
        setting HTTP headers, relayd(8) can be used as a workaround,
        or the above nginx(8) example can be used.
        
        
        PF bruteforce blocking
        ======================
        
        PurritoBin exposes ports using -p <port> (by default: 42069) for
        clients to post their pastes.
        PurritoBin does not enforce any rate limiting for number of pastes
        at a time as this can be done much better using pf(4)
        
        sample pf.conf for rate limiting
        --------------------------------
        table <bruteforce> persist
        purritobin_port=42069
        
        set skip on lo
        
        block return	# block stateless traffic
        pass		# establish keep-state
        
        block quick from <bruteforce>
        
        # no more than 1 connection every 3 seconds
        pass in on egress proto tcp from any to any port $purritobin_port \
        		flags S/SA keep state \
        		(max-src-conn-rate 1/3, \
        		overload <bruteforce> flush global)
        
        # By default, do not permit remote connections to X11
        block return in on ! lo0 proto tcp to port 6000:6010
        
        # Port build user does not need network
        block return out log proto {tcp udp} user _pbuild
        

        Package guides

        • Installing and updating packages

        Package details as JSON

        Report a bug