feat(stats): first-party visit statistics in the admin console #2
Labels
No labels
area/backup
area/dsh
area/forgejo
area/host
area/security
area/web
needs-operator
priority/later
priority/next
priority/now
type/bug
type/task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
web/flango#2
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A small, privacy-first analytics module for the boilerplate — no Google, no cookies, no third-party JS.
Scope
/static,/admin,/api,/healthz,robots.txt/sitemap.xml, non-200sHMAC(SECRET_KEY, "<utc-date>:<ip>"), daily rotation, configurable retention +flask stats pruneAGENTS.md), excluded from the human headline numbers/admin/stats/: today/7d/30d views + unique visitors, top pages, top referrers, daily series, crawler hits; server-rendered, no charts libraryAcceptance
An anonymous request is not counted; a page view is counted once per request; two requests from the same hashed IP on one day count as one unique; the admin view shows the numbers; raw IPs are never persisted.
Implemented in
15c5467; CI run #1190 is green (38 tests).stats/:Visitmodel (daily HMAC of the IP, referrer host, client class — no raw IP/UA), recorder hook, dashboard queries,flask stats pruneCLI, adminStatsViewat/admin/stats/6b4f68cb1683; exclusions for static/api/admin/healthz/robots/sitemap, POSTs and non-200s; crawler bucket separate from human numbersSTATS_ENABLED/STATS_RETENTION_DAYS; README + AGENTS/AGENTS.d docs; container rebuilt and smoke-tested (migration applies, page view recorded, prune runs)One deliberate deviation from the request: the IP is not stored raw, only the daily HMAC. Same counting intent, no long-lived personal identifier. Closing.