Note
This project is vibe-coded via codex. @googlefan256 reviewed most code before merge and this code is running on prod environment but be careful when running on your own resource.
Most of the README below is written by codex.
Lightweight(~50MB) & high performance(axum) container to be used with Traefik to emit access events to Umami.
LICENSE: MIT
- Built with
axum,tokio, andanyhow. - Captures request metadata (IP, method, user-agent, host, path, referrer).
- Sends Umami
eventpayloads to a configurable Umami API endpoint. - Returns
204immediately and reports to Umami asynchronously. - Automatically excludes common static-asset paths and framework-internal endpoints (Next.js/Nuxt/Astro/SvelteKit/Vite, etc.) from tracking.
| Variable | Required | Default | Description |
|---|---|---|---|
LISTEN_ADDR |
No | 0.0.0.0:8080 |
HTTP bind address. |
UMAMI_ENDPOINT |
Yes | - | Umami event endpoint (for example https://umami.example.com/api/send). |
UMAMI_WEBSITE_ID |
Yes | - | Website ID from Umami. |
EVENT_NAME |
No | traefik_access |
Umami event name. |
REQUEST_TIMEOUT_SECS |
No | 3 |
Timeout for Umami API calls. |
export UMAMI_ENDPOINT="https://umami.example.com/api/send"
export UMAMI_WEBSITE_ID="YOUR_WEBSITE_ID"
cargo run# both arm64 and amd64 are supported
export UMAMI_ENDPOINT="https://umami.example.com/api/send"
export UMAMI_WEBSITE_ID="YOUR_WEBSITE_ID"
docker run -it --rm --name traefik-umami-middleware neodyland/traefik-umami-middleware:latesthttp:
middlewares:
umami-tracker:
forwardAuth:
address: "http://traefik-umami-middleware:8080"
trustForwardHeader: true
routers:
app:
rule: "Host(`app.example.com`)"
service: app-service
middlewares:
- umami-trackerIn this mode, Traefik forwards request context headers (X-Forwarded-*) that are transformed into Umami event payloads.