Simple self-hosted pastebin for sharing code and text snippets.
For live demo please visit paste.sobak.pl
- the best PHP syntax highlighter out there: KeyLighter
- support for over 35 languages
- context-aware syntax highlighting
- nested (e.g. PHP/CSS/JS nested in HTML) highlighting support
- creating, updating and removing pastes
- uploading pastes via multipart POST (e.g. for integrating with ShareX, see below)
- admin panel
- downloading pastes
- showing raw paste representation
- paste's programming language detection assistance
In order to set up the project you have to:
- Install the dependencies with
composer install
- Fill in
.env
file (or set these env variables in the system) based on.env.example
. Make sure to always setADMIN_USERNAME
&ADMIN_PASSWORD
envs for production, otherwise your admin panel will be publicly accessible! - Run database migrations with
php artisan migrate
You need to perform setup similar to the one described above (you can omit the ADMIN_*
env
vars, though) but you can also
- use local Docker containers setup (
docker-compose up -d
) - generate IDE helpers for Laravel's magic (
composer ide-helpers
)
Tests can be run with ./vendor/bin/phpunit
The script provides a very naive layer for detecting the paste's programming language. When user adds a new paste, and they didn't specify its language, they will be prompted with an optional confirmation dialog with a probable programming language their paste was created in.
They can accept the suggestion to reduce the likelihood of adding a paste without the programming language specified.
You can use this project together with ShareX by providing configuration similar to the below: