Commit graph

16 commits

Author SHA1 Message Date
c3b77696aa
internal: centralize size/length constants; better DoS protection
...also adds a bounded custom event registry for cardinality control but
I ran out of space in the commit message. Praise be to the long
descriptions...

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ic205f69804c7fb24c39fa84abdd9546b6a6a6964
2026-03-02 22:38:00 +03:00
371c5f3506
chore: bump deps; tidy
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I78644673019b40dffe3d5900cb7cba806a6a6964
2026-03-02 22:37:59 +03:00
993e47e603
internal/aggregate: add HyperLogLog unique visitor tracking
Extracts IP from X-Forwarded-For/X-Real-IP/RemoteAddr. Only active
when `config.Site.SaltRotation` is set.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ieef93b81e9894fc2e9e129451bf2dfdf6a6a6964
2026-03-02 22:37:58 +03:00
b6f2380a20
web: Javascript beacon for client-side tracking; custom event API
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I8e1f329ad3dfe7ba3f34ce450b1e1a0f6a6a6964
2026-03-02 22:37:57 +03:00
b894833ac7
various: HTTP server; migrate to cobra pattern for repository
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ifac6e992b77dfaf92e3059944aa871f16a6a6964
2026-03-02 22:37:56 +03:00
e0ec475a81
internal/api: ingestion handler; wire normalization pipeline
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I1890a039b874fcc76ac4a545c2901d4e6a6a6964
2026-03-02 22:37:55 +03:00
c5109ace92
internal/api: add event model with validation
Supports both pageview and custom event types

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iaf48291cd952865ea9ec21361ae33c746a6a6964
2026-03-02 22:37:54 +03:00
bc4d3fed53
internal: initial metrics aggregator
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I9cdd6e2b33bb65182568db9db4460bc46a6a6964
2026-03-02 22:37:53 +03:00
ce848ed6f0
internal: add bounded path registry to prevent cardinality explosion
"cardinality explosion" would make for an epic rock band name...

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I53cceb00ab9b17039b1fb1389977bf6b6a6a6964
2026-03-02 22:37:52 +03:00
be4534bac8
internal: add referrer classification
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ibcaa09bfd4767876ea1cdd5b61c53b476a6a6964
2026-03-02 22:37:51 +03:00
0691e5ee34
internal: implement path normalization w/ configurable rules
Strips query strings and URL fragmenets, prevents unbounded Prometheus
metrics by normalizing paths like:

- `/users/12345/profile -> /users/:id/profile`
- `/page?utm_source=twitter -> /page`
- `/a/../b -> /b`

etc.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I72f2fa2452f4666567143d052b5716476a6a6964
2026-03-02 22:37:50 +03:00
28abcf50e2
docs: improve introduction paragraph; tiny cleanup
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I2d331809c915f4695603b72ff52857cc6a6a6964
2026-03-02 22:37:49 +03:00
b4f3828895
meta: add direnv support
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I27df8e0c8b731759748fc6c1a734ded76a6a6964
2026-03-02 22:37:48 +03:00
4c84393286
config: data structures; basic tests
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ia7d6f19a46ec8a4987ea429ec6502f676a6a6964
2026-03-02 22:37:47 +03:00
3fca34dd6f
nix: initial tooling
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iabcad180d133f01d3c98e3d5fc9630b26a6a6964
2026-03-02 22:37:46 +03:00
7146a61326
initial commit
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Id13648d9d5579614595101592739fe2a6a6a6964
2026-03-02 22:37:45 +03:00