Home / Input Output / spongix
May 30, 10-11 PM (0)
May 30, 11-12 AM (0)
May 31, 12-1 AM (0)
May 31, 1-2 AM (0)
May 31, 2-3 AM (0)
May 31, 3-4 AM (0)
May 31, 4-5 AM (0)
May 31, 5-6 AM (0)
May 31, 6-7 AM (0)
May 31, 7-8 AM (0)
May 31, 8-9 AM (0)
May 31, 9-10 AM (0)
May 31, 10-11 AM (0)
May 31, 11-12 PM (0)
May 31, 12-1 PM (0)
May 31, 1-2 PM (0)
May 31, 2-3 PM (0)
May 31, 3-4 PM (0)
May 31, 4-5 PM (0)
May 31, 5-6 PM (0)
May 31, 6-7 PM (0)
May 31, 7-8 PM (0)
May 31, 8-9 PM (0)
May 31, 9-10 PM (0)
May 31, 10-11 PM (0)
May 31, 11-12 AM (0)
Jun 01, 12-1 AM (0)
Jun 01, 1-2 AM (0)
Jun 01, 2-3 AM (0)
Jun 01, 3-4 AM (0)
Jun 01, 4-5 AM (0)
Jun 01, 5-6 AM (0)
Jun 01, 6-7 AM (0)
Jun 01, 7-8 AM (0)
Jun 01, 8-9 AM (0)
Jun 01, 9-10 AM (0)
Jun 01, 10-11 AM (0)
Jun 01, 11-12 PM (0)
Jun 01, 12-1 PM (0)
Jun 01, 1-2 PM (0)
Jun 01, 2-3 PM (0)
Jun 01, 3-4 PM (0)
Jun 01, 4-5 PM (0)
Jun 01, 5-6 PM (0)
Jun 01, 6-7 PM (0)
Jun 01, 7-8 PM (0)
Jun 01, 8-9 PM (0)
Jun 01, 9-10 PM (0)
Jun 01, 10-11 PM (0)
Jun 01, 11-12 AM (0)
Jun 02, 12-1 AM (0)
Jun 02, 1-2 AM (0)
Jun 02, 2-3 AM (0)
Jun 02, 3-4 AM (0)
Jun 02, 4-5 AM (0)
Jun 02, 5-6 AM (0)
Jun 02, 6-7 AM (0)
Jun 02, 7-8 AM (0)
Jun 02, 8-9 AM (0)
Jun 02, 9-10 AM (0)
Jun 02, 10-11 AM (0)
Jun 02, 11-12 PM (0)
Jun 02, 12-1 PM (0)
Jun 02, 1-2 PM (0)
Jun 02, 2-3 PM (0)
Jun 02, 3-4 PM (0)
Jun 02, 4-5 PM (0)
Jun 02, 5-6 PM (0)
Jun 02, 6-7 PM (0)
Jun 02, 7-8 PM (0)
Jun 02, 8-9 PM (0)
Jun 02, 9-10 PM (0)
Jun 02, 10-11 PM (0)
Jun 02, 11-12 AM (0)
Jun 03, 12-1 AM (0)
Jun 03, 1-2 AM (0)
Jun 03, 2-3 AM (0)
Jun 03, 3-4 AM (0)
Jun 03, 4-5 AM (0)
Jun 03, 5-6 AM (0)
Jun 03, 6-7 AM (0)
Jun 03, 7-8 AM (0)
Jun 03, 8-9 AM (0)
Jun 03, 9-10 AM (0)
Jun 03, 10-11 AM (0)
Jun 03, 11-12 PM (0)
Jun 03, 12-1 PM (0)
Jun 03, 1-2 PM (0)
Jun 03, 2-3 PM (0)
Jun 03, 3-4 PM (0)
Jun 03, 4-5 PM (0)
Jun 03, 5-6 PM (0)
Jun 03, 6-7 PM (0)
Jun 03, 7-8 PM (0)
Jun 03, 8-9 PM (0)
Jun 03, 9-10 PM (0)
Jun 03, 10-11 PM (0)
Jun 03, 11-12 AM (0)
Jun 04, 12-1 AM (0)
Jun 04, 1-2 AM (0)
Jun 04, 2-3 AM (0)
Jun 04, 3-4 AM (0)
Jun 04, 4-5 AM (0)
Jun 04, 5-6 AM (0)
Jun 04, 6-7 AM (0)
Jun 04, 7-8 AM (0)
Jun 04, 8-9 AM (0)
Jun 04, 9-10 AM (0)
Jun 04, 10-11 AM (0)
Jun 04, 11-12 PM (0)
Jun 04, 12-1 PM (0)
Jun 04, 1-2 PM (0)
Jun 04, 2-3 PM (0)
Jun 04, 3-4 PM (0)
Jun 04, 4-5 PM (0)
Jun 04, 5-6 PM (0)
Jun 04, 6-7 PM (0)
Jun 04, 7-8 PM (0)
Jun 04, 8-9 PM (0)
Jun 04, 9-10 PM (0)
Jun 04, 10-11 PM (0)
Jun 04, 11-12 AM (0)
Jun 05, 12-1 AM (0)
Jun 05, 1-2 AM (0)
Jun 05, 2-3 AM (0)
Jun 05, 3-4 AM (0)
Jun 05, 4-5 AM (0)
Jun 05, 5-6 AM (0)
Jun 05, 6-7 AM (0)
Jun 05, 7-8 AM (0)
Jun 05, 8-9 AM (0)
Jun 05, 9-10 AM (0)
Jun 05, 10-11 AM (1)
Jun 05, 11-12 PM (0)
Jun 05, 12-1 PM (4)
Jun 05, 1-2 PM (0)
Jun 05, 2-3 PM (0)
Jun 05, 3-4 PM (0)
Jun 05, 4-5 PM (0)
Jun 05, 5-6 PM (0)
Jun 05, 6-7 PM (0)
Jun 05, 7-8 PM (0)
Jun 05, 8-9 PM (0)
Jun 05, 9-10 PM (0)
Jun 05, 10-11 PM (0)
Jun 05, 11-12 AM (0)
Jun 06, 12-1 AM (0)
Jun 06, 1-2 AM (0)
Jun 06, 2-3 AM (0)
Jun 06, 3-4 AM (0)
Jun 06, 4-5 AM (0)
Jun 06, 5-6 AM (0)
Jun 06, 6-7 AM (0)
Jun 06, 7-8 AM (0)
Jun 06, 8-9 AM (0)
Jun 06, 9-10 AM (0)
Jun 06, 10-11 AM (0)
Jun 06, 11-12 PM (0)
Jun 06, 12-1 PM (0)
Jun 06, 1-2 PM (0)
Jun 06, 2-3 PM (0)
Jun 06, 3-4 PM (0)
Jun 06, 4-5 PM (0)
Jun 06, 5-6 PM (0)
Jun 06, 6-7 PM (0)
Jun 06, 7-8 PM (0)
Jun 06, 8-9 PM (0)
Jun 06, 9-10 PM (0)
Jun 06, 10-11 PM (0)
5 commits this week May 30, 2026 - Jun 06, 2026
style: apply nixos-26.05 treefmt (alejandra + gofmt)
The treefmt flake check (gofmt + alejandra) gates `nix flake check`. Under the 26.05 toolchain it reports three files: symlink.nix (alejandra reformats the target-switch interpolation block adjacent to the new -lc line), and main.go + registry_test.go (pre-existing gofmt drift — struct-field alignment and a trailing newline — already present at HEAD and unrelated to the upgrade, but required for the treefmt gate to pass). Pure formatting, no behavior change.
fix: stop upstream HEAD from poisoning the shared connection pool; repair e2e test
httpHeadClient and httpGetClient both use http.DefaultTransport, sharing its connection pool. nix-serve in 26.05 returns a body on HEAD responses (an HTTP violation); Go pools that connection without draining the body, and the next GET reuses it and reads the leftover narinfo body as the status line ("malformed HTTP status code /nix/store/..."). Add headUpstream(), which sets Close: true on upstream HEADs so their connections are never pooled. Kept on DefaultTransport so apitest mocks (which patch DefaultTransport) still intercept.

e2e-test.nix: (1) push via compression=none — spongix only accepts uncompressed NARs and newer Nix compresses uploads by default; (2) Test 4 asserted a 302 redirect, but narinfos have been proxied (200) since d0a3a4f (2026-02-14) so the proxy can rewrite Compression — assert 200 + X-Cache MISS then HIT, with condition-based waiting instead of a fixed sleep.
chore: migrate dev shell from insecure minio to garage
nixos-26.05 marks minio as insecure (unauth-write CVEs) and abandoned upstream, which broke `nix develop`. minio/minio-client were only used by scripts/run.sh for local S3 simulation, not by the build or tests (the Go code uses the minio-go client library, unaffected).

Replace them with garage in the dev shell. scripts/run.sh was also stale (old CLI flags, no server start); rewrite it to bootstrap a single-node garage S3 and run spongix against it via the current --config JSON interface (store_type s3, signed narinfos). Also fix `nix key generate-secret` to pass --key-name, now required in 26.05.
fix: support Zig 0.16 and bump nixpkgs to nixos-26.05
Zig 0.16 (shipped in nixos-26.05) completed the Io/"Writergate" overhaul: std.os.argv and the cross-platform std.posix.{write,symlink,exit} wrappers were removed, breaking the symlink helper build (only std.os.argv appeared in the error; the posix wrappers fail next).

Rewrite cmd/symlink/main.zig for 0.16: argv now arrives via std.process.Init.Minimal; use raw std.os.linux syscalls on Linux (keeps the ~9 KiB static, libc-free binary) and std.c on macOS, behind a comptime split. symlink.nix links libc only on darwin, where std.c needs it; Linux stays libc-free.
refactor: extract narinfo wire-serving into pkg/narinfox
Introduce pkg/narinfox with Open(io.Reader, Signer) -> *Document, the
single gateway every stored/served narinfo passes through. Open parses
once, normalizes Compression/URL to the Spongix wire form, appends the
configured signer's signature when absent, and projects the indexing
keys (NarHash52, StorePathHash, References) from that same parse via
Document.Metadata().

This replaces router.go's rewriteNarinfo plus the parseNarinfoNarHash52,
parseNarinfoStorePathHash, parseNarinfoReferences, and narinfoField
helpers, which re-scanned the bytes once per field. The proxyNarinfo,
largeHeadAndGet, and insert call sites now do one parse and drop their
intermediate io.ReadAll buffers.

main.go holds a narinfox.Signer (nil when no key is configured) instead
of a raw *signature.SecretKey; NewSigner(nil) returns nil so callers
need no guard. Parse-helper tests move into the package; compression_test
keeps a test-only field scanner for asserting raw HTTP response bytes.

Delete the unused cmd/sign standalone signing tool.