42e1fe83c7
test: check and clean up correctpath
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Id14f80297f3e157ebcf5b2612220cd4b6a6a6964
2026-03-10 08:56:04 +03:00
ffa2af62be
api/handler: check if each IP in X-Forwarded-For is *not* in trusted networks before accepting
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Id54c1584650fcee64de70d1f99e542c16a6a6964
2026-03-10 08:56:03 +03:00
d1181d38f0
watchdog: add log sanitization and request tracking
...
Stuff to prevent possible log injection attacks via weird characters,
now sanitized with `strconv` stuff.
- X-Request-ID is now traced in ingestion handler
- ValidateWithMap renamed to Validate (xd)
- Some new tests :D
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I286ec399a5c4a407f0cc117472c079446a6a6964
2026-03-10 08:43:53 +03:00
4189d14d65
api/event: remove legacy validate function; use domain map
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I9a68733cf16b09ef6381161452bda1e56a6a6964
2026-03-10 08:43:52 +03:00
02c4f11619
api/handler: O(n) linear scan -> O(1) map lookup
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ic2080f59be1eea905e8ca95e90e34d4d6a6a6964
2026-03-10 08:43:51 +03:00
d2f28ded61
aggreggate/uniques: use string builder for hashing
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I7371a878c05f704feef26c6e86a04b956a6a6964
2026-03-10 08:43:50 +03:00
0f38a062e9
various: reduce file I/O & pre-parse CIDRs
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I288c299d35fdc833c802e22682f14b8e6a6a6964
2026-03-10 08:43:33 +03:00
ad50debb62
ci: only trigger test workflow when relevant files change
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ideee10cc79f6d3a3d542b5ae6bc375156a6a6964
2026-03-07 11:40:18 +03:00
4cd0b3b0cf
docs: provide VictoriaMetrics-specific instructions
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I10f9958209a6cc8a71cbee481bb846c36a6a6964
2026-03-07 11:37:05 +03:00
83a7aac1c9
ci: remove redundant checkout step for release; merge multiple outputs
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I64cbd7dfc64089c38bee4cffbbc279c96a6a6964
2026-03-07 11:14:15 +03:00
417e3a2b0f
ci: ugh
...
v1.0.0
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ic86ba74f3229943a299b187329a3d63b6a6a6964
2026-03-07 10:36:17 +03:00
91933dc5aa
meta: set version to 1.0.0
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I658bb4afcf5ed5df41a5b0bca79cdfe26a6a6964
2026-03-07 10:27:30 +03:00
781fa2af1a
ci: create a release on tag
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I718a6f8ce6ad08fe9da15225bf4009466a6a6964
2026-03-07 10:04:31 +03:00
f90244189b
chore: tidy up deps
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ida03ef53da70ba76531b9ce165a95e5f6a6a6964
2026-03-07 10:04:30 +03:00
b7b1d62cfc
various: resolve linter warnings
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ia83658dd31f9e4042d0a3a754fc6e4106a6a6964
2026-03-07 10:04:30 +03:00
675f8cc1c7
chore: bump dependencies
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6ec7858564223f643a2ceea8b104827a6a6a6964
2026-03-07 10:04:29 +03:00
9efabc8f76
cmd: infer version from version.json; add version flag
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I0f429ef3345444c0c4bedbc80ee3d5e06a6a6964
2026-03-07 10:04:07 +03:00
c1033bed39
ci: set up build & lint workflow
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I98f116b592535a5a1b97563b8e9d26da6a6a6964
2026-03-07 08:48:33 +03:00
d975c7b2d1
internal/aggregate: implement hourly salt rotation for unique visitors
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I5861c5bb55153349d0710cc07c1595a96a6a6964
2026-03-07 08:48:32 +03:00
093160a42a
meta: release under EUPL v1.2
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I43a55b5f6264adb54ec98556ab04828f6a6a6964
2026-03-07 08:28:07 +03:00
e7297bcc8d
meta: provide sample grafana dashboard; basic promql docs
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Icb48454e2b0d37fea290c1681ccddcfe6a6a6964
2026-03-06 00:03:31 +03:00
df06ed38bf
docs: provide obserability stack guide
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ibadc31d02413da836e85eaa3d446eb9e6a6a6964
2026-03-02 22:38:33 +03:00
13343ef2bd
nix: format Markdown with deno fmt
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Id652cb01903d1ca4de4b8839118fac556a6a6964
2026-03-02 22:38:32 +03:00
3363e5c923
docs: include process metrics under available exports
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I0df00ecfddf98db1ebc85c2fc7758e326a6a6964
2026-03-02 22:38:31 +03:00
531aafb094
docs: document configuration behaviour; notes on environment vars
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I071c766ba98ed03e0b10928c25af0d0b6a6a6964
2026-03-02 22:38:30 +03:00
dc6b6e0c0c
nix: correct ldflags
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I5806b91c9dc1dfa9690a6e01cd29059b6a6a6964
2026-03-02 22:38:29 +03:00
27b3641717
various: add internal health and runtime metrics
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iae1dcf8495a00159d588c6e2344312f36a6a6964
2026-03-02 22:38:28 +03:00
d7cdf2cc49
chore: fix typo in dailySalt comment
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I8f0d0bf4bc597f0aecfd98c292f38cdb6a6a6964
2026-03-02 22:38:27 +03:00
6977a501b1
internal: better device classification via UA parsing
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6c78f1eebe71ef4cf037ebbda2caaeb36a6a6964
2026-03-02 22:38:26 +03:00
896ec1a40a
watchdog: add metrics for blocked requests & logging
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ib1d876859422a6115772962ed9e207a46a6a6964
2026-03-02 22:38:25 +03:00
7b06c4f2ca
various: extract magic numbers into named constants
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I854b2f9b5f39e4629c32e5681e6322826a6a6964
2026-03-02 22:38:24 +03:00
f46697bd21
internal/ratelimit: prevent time drift in TokenBucket refills
...
The TokenBucket ratelimiter accumulated time drift over multiple refills
because I'm an idiot. We were using 'now' as base for lastFill calc. but
this could case rate limiting to become inaccurate over time. Now we
advance lastFill by *exact* periods from previous value.
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ia3990b441ab6072f51dfdfa4a2511b5f6a6a6964
2026-03-02 22:38:23 +03:00
4e0b8f0d0a
interal/api: replace liner array scan with hashmap lookup in domain validation
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iac969e7dc6e4ca3f93410fccac1995636a6a6964
2026-03-02 22:38:22 +03:00
987ddd92cc
internal/aggregate: make shutdown context-aware proper goroutine sync
...
Adds `WaitGroup` to track background goroutine and make Shutdown respect
context deadlines
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ia7f074725717f037412dacb93e34105b6a6a6964
2026-03-02 22:38:21 +03:00
de959ec22b
nix: configure default formatter for nix fmt
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ia75cd29276e4eed2d57a37e02281d48b6a6a6964
2026-03-02 22:38:20 +03:00
2ef2dabf93
internal/aggergate: make HLL state path configurable
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I8ff8ef25ad945aae918bea97ee39d7ea6a6a6964
2026-03-02 22:38:19 +03:00
f988174145
watchdog: migrate to Cobra and Viper for config management; search /etc for configs
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I65dbf466cb030dccc7025585d6282bd26a6a6964
2026-03-02 22:38:18 +03:00
951ed9c36f
docs: link to configuration document for overview
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ie9f7132d784bf0b40e562f3190782fb36a6a6964
2026-03-02 22:38:17 +03:00
430219ee4c
docs: finalize project README
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ib2e222bfc5e5433423186584b52d53cb6a6a6964
2026-03-02 22:38:16 +03:00
4fba5e5ea3
chore: update example configuration to patch validation schema
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Id7b0fde6295fe48e2e766b9d538d3fb06a6a6964
2026-03-02 22:38:15 +03:00
bf8390a916
chore: format with golines
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I11a2f3273abf08c8cf02e0c335e26d826a6a6964
2026-03-02 22:38:14 +03:00
214c992494
chore: update test data for multi-domain support
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I789eff29d033de4c25128e6bbc17a5966a6a6964
2026-03-02 22:38:13 +03:00
cf6a68477f
web: improve Javascript beacon for Plausible 'compatibility'
...
Some features from Plausible that I think I'll miss. Here are some of
the noteworthy ones:
- Configuration via data attributes (api, domain, hash-mode, etc.)
- Automatic localhost detection and path exclusions
- Hash-based routing for SPA support
- Custom referrer support for events
- Duplicate pageview detection
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6d19378404d0cb9920f12e0cdd163a8e6a6a6964
2026-03-02 22:38:12 +03:00
18fe1a8234
internal/api: better multi-sites support; validate events against allowed domains
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iff1ced4966b4d42cfd6dfefb0cfd97696a6a6964
2026-03-02 22:38:11 +03:00
16ace569a0
meta: provide systemd template files
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I2ed3bcfa3e0f58685a883a301c898ee86a6a6964
2026-03-02 22:38:10 +03:00
63fb5d4ada
nix: add nixosModules to the flake
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I4a63fdabe0bdee972fea926bf37d78906a6a6964
2026-03-02 22:38:09 +03:00
75018f69df
nix: initial nixos module; complete packaging
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I59ec5a4f67ddae2139e72ef4c0c113366a6a6964
2026-03-02 22:38:08 +03:00
da1fab4257
internal: fix the tests broken by hardening
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: If95a5258a393542564f68b3a1ebc7ff66a6a6964
2026-03-02 22:38:07 +03:00
326cbbc68c
watchdog: more graceful shutdown; secure static file serving
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I2a55b2c4f380a1d78ec1ffa0391720256a6a6964
2026-03-02 22:38:06 +03:00
7e1ef845e8
internal/api: resolve IPv6 handling; prevent XFF spoofing & add rate limiting
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ibe415a133bbc8bd533a21ed1ccd44cf36a6a6964
2026-03-02 22:38:05 +03:00