Commit graph

46 commits

Author SHA1 Message Date
578e0b2d5e
nix: update vendorHash for cobra/viper deps
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ic1f423124d308ca1604872506ebbd02b6a6a6964
2026-04-05 22:48:16 +03:00
5da43e2937
ncro: migrate CLI to cobra/viper
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I4707bb1927224624f811ce4d3f2f8a3b6a6a6964
2026-04-05 22:48:15 +03:00
2aaf84e425
prober: fix unstable sort when latency within 10% and priorities equal
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I49fed694108cfb91ffe3ffad5c02c3a96a6a6964
2026-04-05 22:48:14 +03:00
64e18cbab5
cache: create parent directory before opening SQLite database
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I935eeccd78986cf40aebafff6d28da746a6a6964
2026-04-05 22:48:13 +03:00
20029edd1c
nix: initiate NixOS module; add ncro to packages output
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I4948bbc2a53adbc64727a1dc935b750e6a6a6964
2026-04-05 22:48:12 +03:00
a35b3216ec
config: add server.cache_priority for configurable /nix-cache-info Priority
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ibe9c357ea2c56a967c75be04c2099f536a6a6964
2026-04-05 22:48:11 +03:00
a45ee57da7
server: use uppercase per-upstream status in /health; verify in tests
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I26a71054250c71747e92c2803d8c39ed6a6a6964
2026-04-05 22:48:10 +03:00
985ed1090a
server: enrich /health with per-upstream status and latency
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I7cb08fc9f55fbd4ee982c19d56798dce6a6a6964
2026-04-05 22:48:09 +03:00
f89a3e61cd
prober: fix data race in TestPersistenceCallbackFired
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I0eea8c573529836da790cf1dba4ecb016a6a6964
2026-04-05 22:48:08 +03:00
d599ef02a7
prober: persist health across restarts via callback; seed from DB on startup
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ica467d6db76c495a6ccadbad89276b536a6a6964
2026-04-05 22:48:07 +03:00
049e4202dd
server: check errors in TestNARRoutingUsesCache
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I9a4688c88fbb602cd46cbda819024e4c6a6a6964
2026-04-05 22:48:06 +03:00
118eda08a1
server: route NAR requests via route cache; extract tryNARUpstream helper
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Icd57a268015d58faa7ffc2b8c711283b6a6a6964
2026-04-05 22:48:05 +03:00
ded9b6d464
cache: include nar_url in ListRecentRoutes; test expired TTL in GetRouteByNarURL
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I952d08726f34d0d9b7c4c1880d60222c6a6a6964
2026-04-05 22:48:04 +03:00
2ae611b916
cache: store narinfo URL for direct NAR routing
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Idede08311b5b074887768e54d96c8a566a6a6964
2026-04-05 22:48:03 +03:00
8f949215bb
cache: test IsNegative SQL time predicate independently of ExpireNegatives
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ia298cc902d972a589d47de247e447d686a6a6964
2026-04-05 22:48:02 +03:00
b0ea022dc2
cache: add negative cache; router: skip race for cached 404s
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ibeb44b313850395898bb20f2d947b0b76a6a6964
2026-04-05 22:48:01 +03:00
f100342720
router: remove unused getCount from TestSingleflightDedup
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I22611938e3ef99a749905638288e4f9f6a6a6964
2026-04-05 22:48:00 +03:00
41b18dd1f8
router: add singleflight deduplication for concurrent narinfo races
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ib682889f34ad4ad4fb331ee2924dc9916a6a6964
2026-04-05 22:47:59 +03:00
e567491856
mesh: remove unused MsgSyncRequest/MsgSyncReply types
Fuck em.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I725b137678112580cd7445a8d12f52f56a6a6964
2026-04-05 22:47:58 +03:00
4b2c863bc1
docs: update mesh section to reflect peer key verification
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I287bbbd50daac69331eb9fcce022108d6a6a6964
2026-04-05 22:47:57 +03:00
de100ee611
tests: add signature verification tests for narinfo, mesh, and config
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I06ef2f37f174d278ce4f727836f339dd6a6a6964
2026-03-15 11:01:48 +03:00
f4804d2150
ncro: wire narinfo signing, mesh peer keys, and RouteEntries gauge
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iee018615044ec5c860877224238ff8ce6a6a6964
2026-03-15 11:01:47 +03:00
df92c9a4a3
router: verify narinfo signatures against configured upstream keys
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: If60c9653495c0ffd637e75797c6e55326a6a6964
2026-03-15 11:01:46 +03:00
d2e6f95140
mesh: verify sender key and ed25519 signature on every incoming packet
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I60075c597a0fb99301d5b80d5a61406d6a6a6964
2026-03-15 11:01:45 +03:00
a8106a6c5e
config: add PeerConfig; validate upstream and peer public keys
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Idc445352143f257020c88926a8f4759c6a6a6964
2026-03-15 11:01:44 +03:00
2da17e456f
narinfo: add Nix signature verification (ParsePublicKey, Fingerprint, Verify)
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I831978224aea4ef56c2e7c499e125a906a6a6964
2026-03-15 11:01:43 +03:00
d290bcf4ad
mesh: implement UDP gossip transport; wire mesh comms into main
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iea0b2f250b01df78b1c7be73d69d28c06a6a6964
2026-03-15 11:01:42 +03:00
91ffc0eadd
tests: add edge cases for server, router, cache, and prober priority
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I05b19092cee63f8efca7cb62655880286a6a6964
2026-03-15 11:01:41 +03:00
02e7065171
ncro: call Validate() in main; wire metrics, priority, and mesh stub
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I428e17606daf1833d5aea20a22461abe6a6a6964
2026-03-15 11:01:40 +03:00
8da709dc98
prober: add Priority field; honour it in latency-sorted order
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iba0ff781c4ce863379378b4ca6039dc96a6a6964
2026-03-15 11:01:39 +03:00
d055799f3d
config: add Validate() with startup checks
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iab753b2bae4fb760159d6459734293d46a6a6964
2026-03-15 11:01:38 +03:00
f504f3114f
server: fix NAR fallback; distinguish 404 vs 502; add /metrics endpoint
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ib86ef7efb3cefc34cf5642fce9c7d0ef6a6a6964
2026-03-15 11:01:37 +03:00
35b8fb2672
router: fix silent error in race; add sentinel errors; populate NarHash/NarSize
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I9fa56ed75c609f557ab601883ca899a16a6a6964
2026-03-15 11:01:36 +03:00
efca8dff6c
metrics: add Prometheus metrics
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I13becfd5a309cc2e24579244d88343a56a6a6964
2026-03-15 11:01:35 +03:00
a4f4410e5b
narinfo: implement parser :D
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ic10f3e69f18308d620b1461fd62d46386a6a6964
2026-03-15 11:01:34 +03:00
2a0c30f953
server: integration tests for route reuse and upstream fallback
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I0d476da19941238b32c6adf87dac2d876a6a6964
2026-03-15 11:01:33 +03:00
e21f186ced
nix: init package at 0.1.0
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I1fee4c7eaefdf72bf3f1b6f6866e47006a6a6964
2026-03-15 11:01:32 +03:00
605923a94a
mesh: init ed25519-signed gossip layer; conflict-resolving route store
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I92ff256da8e84e86cd9e7c2b511c0ae56a6a6964
2026-03-15 11:01:31 +03:00
ee6c2d6368
ncro: wire all components; handle shutdown more gracefully
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I81fab7fa2cfa5a109b8b317fa53f10d86a6a6964
2026-03-15 11:01:30 +03:00
3a80551898
server: implement Nix binary cache HTTP handler with zero-copy NAR streaming
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ibcafdb7084453ee4f8a8b76b1ee222466a6a6964
2026-03-15 11:01:29 +03:00
65ddeb48f6
prober: latency EMA tracking and upstream health monitoring
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I0ef237a1e6db3ac9c47bdaa72101e4d86a6a6964
2026-03-15 11:01:28 +03:00
6432b2bc5a
nix: add more formatters
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I86d867bf11e12dc42375a0b3714445326a6a6964
2026-03-15 11:01:27 +03:00
663f9995b2
cache: add SQLite route persistence; initial TTL and LRU eviction implementation
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I0370d6c114d5490634905c1a831a31526a6a6964
2026-03-15 11:01:26 +03:00
9f264fbef1
config: add Duration test coverage and fix error wrapping
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I5c08e63297f90acdedd9744de904c36b6a6a6964
2026-03-15 11:01:25 +03:00
4f8d1c64d2
config: initial loading & env overrides
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iaa7401a20506a084a2a16882e61ea0bc6a6a6964
2026-03-15 11:01:24 +03:00
356aa999af
initial commit
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iec17afe27e51e55d53e09479fcdfd4456a6a6964
2026-03-15 11:01:11 +03:00