goatcounter: update to 2.2.3, add service

This commit is contained in:
Daniel Lewan 2022-07-02 16:14:49 +02:00 committed by Đoàn Trần Công Danh
parent a8d8f5a7e5
commit d9954e0322
4 changed files with 35 additions and 3 deletions

View file

@ -0,0 +1,16 @@
The system service /etc/sv/goatcounter runs goatcounter as system user _goatcounter.
By default sqlite database is used. The database will be stored in
/var/db/goatcounter/db.sqlite3.
To initialize the database, make sure you run goatcounter as the _goatcounter user:
$ sudo -u _goatcounter goatcounter db create site \
-user.email 'admin@domain.name' \
-vhost site.name \
-db sqlite+/var/db/goatcounter/db.sqlite3
By default the service listens on 5000 port and does not use TLS. In production
envirnment you must adjust service config by creating /var/goatcounter/conf
OPTS=-listen ... -db ...

View file

@ -0,0 +1,2 @@
#!/bin/sh
exec logger -p daemon.notice -t goatcounter

View file

@ -0,0 +1,7 @@
#!/bin/sh
[ -r ./conf ] && . ./conf
: "${OPTS:=-db sqlite+/var/db/goatcounter/db.sqlite3?_busy_timeout=200&_journal_mode=wal&cache=shared -listen :5000 -public-port 5000 -tls none}"
exec chpst -u _goatcounter goatcounter serve ${OPTS}

View file

@ -1,9 +1,9 @@
# Template file for 'goatcounter'
pkgname=goatcounter
version=2.0.3
version=2.2.3
revision=1
build_style=go
go_import_path=zgo.at/goatcounter
go_import_path=zgo.at/goatcounter/v2
go_package="${go_import_path}/cmd/goatcounter"
go_ldflags="-X zgo.at/goatcounter.Version=${version}"
depends="tzdata"
@ -12,4 +12,11 @@ maintainer="Martin Tournoij <martin@arp242.net>"
license="EUPL-1.2"
homepage="https://www.goatcounter.com/"
distfiles="https://github.com/zgoat/goatcounter/archive/v${version}.tar.gz"
checksum=d7477240602c4d6522fb528276378879cda35dea0ba4b174143e36a410398023
checksum=5b3b07afda42752d7c9600a8671bbb30e70a98c656505eda99a4e67b309a94fc
system_accounts="_goatcounter"
make_dirs="/var/db/goatcounter 0750 _goatcounter _goatcounter"
post_install() {
vsv goatcounter
vdoc $FILESDIR/README.voidlinux
}