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.
36 lines
840 B
Makefile
36 lines
840 B
Makefile
## simple makefile to log workflow
|
|
.PHONY: all test clean build install
|
|
|
|
GOFLAGS ?= $(GOFLAGS:)
|
|
dbtype=$(shell grep dbtype config.json | cut -d \" -f 4)
|
|
dbname=$(shell grep dbname config.json | cut -d \" -f 4)
|
|
dbtable=$(shell grep dbtable config.json | cut -d \" -f 4)
|
|
|
|
all: clean install build
|
|
|
|
build:
|
|
gofmt -w pastebin.go
|
|
go build $(GOFLAGS) ./...
|
|
ifeq ($(dbtype),sqlite3)
|
|
cat database.sql | sed 's/pastebin/$(dbtable)/' | sqlite3 $(dbname)
|
|
endif
|
|
|
|
install:
|
|
go get github.com/dchest/uniuri
|
|
go get github.com/ewhal/pygments
|
|
go get github.com/mattn/go-sqlite3
|
|
go get github.com/gorilla/mux
|
|
go get github.com/go-sql-driver/mysql
|
|
go get github.com/lib/pq
|
|
|
|
test: install
|
|
go install $(GOFLAGS) ./...
|
|
|
|
bench: install
|
|
go test -run=NONE -bench=. $(GOFLAGS) ./...
|
|
|
|
clean:
|
|
go clean $(GOFLAGS) -i ./...
|
|
rm -rf ./build
|
|
rm -rf pastebin.db
|