No description
Find a file
2025-01-07 13:55:39 +00:00
.gitlab-ci.yml Alter 2 files 2025-01-07 00:16:29 +00:00
Dockerfile Update Dockerfile 2025-01-07 01:00:12 +00:00
go.mod Initial commit 2025-01-07 00:05:51 +00:00
main.go Fix incorrect JSON key for referrer 2025-01-07 13:55:39 +00:00
README.md Alter 2 files 2025-01-07 00:16:29 +00:00

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 (default 127.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 /
}