goatcounter-forwarder/README.md
AKP d2f90cf82a
Alter 2 files
Add .gitlab-ci.yml
Add README.md
2025-01-07 00:16:29 +00:00

878 B

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 /
}