No description
.gitlab-ci.yml | ||
Dockerfile | ||
go.mod | ||
main.go | ||
README.md |
goatcounter-forwarder
This is small Go app designed to sit between the Caddy webserver and Goatcounter to record pageviews as they happen.
The forward_auth
directive is (ab)used to send a copy of each request to goatcounter-forwarder that then extracts all relevant information from the request and enqueues it for submission to a Goatcounter instance.
It's configured with environment variables:
GCFWD_HTTP_ADDRESS
: the HTTP address that goatcounter-forwarder should listen on (default127.0.0.1:7000
)GCFWD_INSTANCE_ADDR
: the address of the Goatcounter instance to report statistics for (required)GCFWD_TOKEN
: a Goatcounter API token with pageview reporting access (required)
Once setup and running, it can be added to your Caddy config as so:
forward_auth <goatcounter-forwarder address> {
uri /
}