A basic self-hosted analytics system that ingests logs from the Caddy HTTP server
This repository has been archived on 2025-07-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Find a file
2023-04-05 17:59:58 +01:00
.github/workflows Add docker-image.yml 2023-04-05 17:59:58 +01:00
config Update datasette-metadata.json 2023-04-05 17:47:27 +01:00
datasette_plugin Switch back to using proxy-based authentication 2023-04-05 17:52:44 +01:00
ingest Update default listener address 2023-04-05 17:41:31 +01:00
screenshots/web-ui Alter 3 files 2023-04-03 13:59:38 +01:00
.gitignore Initial processing and storage of logs 2023-03-31 18:30:14 +01:00
docker-entrypoint.sh Add (awful) Dockerfile 2023-04-05 17:36:34 +01:00
Dockerfile Add (awful) Dockerfile 2023-04-05 17:36:34 +01:00
go.mod Remove all HTTP components and rename analytics to ingest 2023-04-05 14:24:23 +01:00
go.sum Remove all HTTP components and rename analytics to ingest 2023-04-05 14:24:23 +01:00
LICENSE Alter 2 files 2023-03-31 13:44:11 +01:00
oidc.py Alter 2 files 2023-04-05 17:46:50 +01:00
README.md Update README.md 2023-04-05 17:53:45 +01:00

codemicro/analytics

A basic self-hosted analytics system that ingests logs from the Caddy HTTP server.

Note that this is designed to be used with Authentik's proxy provider and may be insecure when used without adequate authentication in place.

Architecture

  • Ingest server
    • A Go app listening on a TCP socket to ingest JSON logs from the Caddy web server
    • Groups requests into sessions and persists them to a database
  • Datasette
    • Provides a frontend, data explorer and visualisation tool

Docker

Dockerfile can be used for deployment. The directory containing the database and configuration file (which must be called analytics.db and config.yml respectively) should be mounted at /analytics/run within the container.

The ingest server listens on 0.0.0.0:7500 and Datasette listens on 0.0.0.0:8001.

The following environment variables should be set:

  • BASE_URL: the URL at which the Datasette instance can be accessed at.

Caddy logging configuration

log {
    output net whateveraddr:7500
    format json
}

Last commit containing the original web UI: b817d6a23ff2ea51bd55a9a8209e44feeebb20ff