Modern pastebin written in golang
5a0b1f5d4d
This commit is quite big rewrite and individual commits for each feature is unfortunately not available. This fork introduces quite a lot of new features, and possibly while doing so, some bugs as well. Nonetheless the features introduced are listed below. - Support for multiple database backends (sqlite3, postgresql and mysql are now supported). Configurations options like dbname/tablename/ports/adresses/etc. are supported as well. - Support for dynamically adding lexers (languages) and styles (themes) from pygments. This means no manual configuration depending on where the installation is done. There is however a way of adding "prioritized" lexers. This feature can be nice to use sine pygments now days support hundreds of languages, some more common than others. Simply add the "display name" for each lexer you want to prioritize in the file 'assets/prio-lexers' and they will show up first in the list when the user selects languages. - Support for changing styles and lexers directly from the webgui on the fly (no reload of the page, just content update). - Support for row-highlightning (on/off) and rownumbers (show/hide). - Support for showing information about when paste expires. - Support for goo.gl-shortener. - Extreme debugging. |
||
---|---|---|
assets | ||
.gitignore | ||
.travis.yml | ||
config.json | ||
database.sql | ||
highlighter-wrapper.py | ||
LICENSE.md | ||
Makefile | ||
pastebin.go | ||
README.md |
Modern self-hosted pastebin service with a restful API.
Motivation
Many Pastebin services exist but all are more complicated than they need to be. That is why I decided to write a pastebin service in golang.
Getting started
Prerequisities
- pygmentize
- go
- mariadb
pip install pygmentize
sudo yum install -y go mariadb-server mariadb
Installing
- Please note this assumes you have Mariadb and Go already setup.
- go get github.com/ewhal/Pastebin
- make
- mysql -u root -p
- CREATE USER 'paste'@'localhost' IDENTIFIED BY 'password';
- CREATE database paste;
- GRANT ALL PRIVILEGES ON paste . * TO 'paste'@'localhost';
- FLUSH PRIVILEGES;
- quit;
- mysql -u paste -p paste < database.sql
- cp config.example.json config.json
- nano config.json
- Configure port and database details
License
This project is licensed under the MIT License - see the LICENSE.md file for details