Commit graph

21826 commits

Author SHA1 Message Date
Florian Klink
dd3b447428 docs(web): import store configuration/composition document
Put it in Guides, as it provides some examples at the end as well.

Change-Id: Ic5cd78bcda09c3bb82eeaa88ff0c959c4c876bd7
Reviewed-on: https://cl.snix.dev/c/snix/+/30445
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Yureka <snix@yuka.dev>
Tested-by: besadii
2025-05-04 15:24:10 +00:00
Florian Klink
7b329b402c feat(ops/modules/monorepo-gerrit): replicate refs/meta/config
This makes it possible to fetch refs/meta/config from the forgejo
endpoint too. It was possible to fetch it from Gerrit directly before,
so this isn't more or less private than before.

Forgejo doesn't seem to provide an endpoint to link to refs/meta/config,
but it's perfectly fine to view the tree for a given commit from there:

dd5ed6266a

Change-Id: I9bbfb8c5994118e6a205e84d5584cc82a560cc23
Reviewed-on: https://cl.snix.dev/c/snix/+/30444
Reviewed-by: Vova Kryachko <v.kryachko@gmail.com>
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-05-04 15:06:38 +00:00
Florian Klink
dc6af0823c refactor(ops/modules/monorepo-gerrit): stop pushing r/ refs
We stopped using them a while ago, no need to replicate.

Change-Id: I584a584b401ed357eba6d8f2349d2be40684765e
Reviewed-on: https://cl.snix.dev/c/snix/+/30443
Reviewed-by: Vova Kryachko <v.kryachko@gmail.com>
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-05-04 15:06:07 +00:00
Starnick4444
1a84bc0e62 chore(glue): upgrade to 2024 edition
Part of #114
cargo fix wanted to rewrite `if let else` to match statements, but i
reverted them as they dont belong in this cl.
There weren't any warnings about locks (relative drop order changed in
2024)

Change-Id: I9c851ef8e214a481cbe7b4cf9b2634b5d56970d4
Reviewed-on: https://cl.snix.dev/c/snix/+/30369
Autosubmit: Bence Nemes <nemes.bence1@gmail.com>
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Reviewed-by: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-05-04 14:30:34 +00:00
Starnick4444
916988a7a2 chore(castore-http): upgrade to 2024 edition
Part of #114

Change-Id: I083ad939c836736b44b36c38e16a04cbaabe9442
Reviewed-on: https://cl.snix.dev/c/snix/+/30377
Autosubmit: Bence Nemes <nemes.bence1@gmail.com>
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-05-04 14:30:03 +00:00
Florian Klink
b04011dd53 feat(ops/keycloak): use preferred_username claim from Bornhack IdP
Since https://github.com/bornhack/bornhack-website/pull/1838, users can
set their preferred username there, so it can be correctly propagated
to Keycloak.

Change-Id: If492d4b92b420c07b9e1450883ccb30a18802a42
Reviewed-on: https://cl.snix.dev/c/snix/+/30424
Tested-by: besadii
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Autosubmit: Florian Klink <flokli@flokli.de>
2025-05-04 13:32:57 +00:00
Florian Klink
759f15390c feat(nix-compat/nar): add copy functions
This allows piping NAR data through a reader, and writing it back out to
a writer.

It can be used to validate a NAR to be syntactically correct, or to read
exactly to the end of a NAR file if the size is not given externally.

Change-Id: I0fc8d58e68783400d1cfee75c860138915974f3d
Reviewed-on: https://cl.snix.dev/c/snix/+/30423
Tested-by: besadii
Reviewed-by: edef <edef@edef.eu>
Autosubmit: Florian Klink <flokli@flokli.de>
2025-05-04 11:55:49 +00:00
Florian Klink
9caaa09765 refactor(snix/build): use stronger typed BuildResult type
This changes the BuildService trait to return a typed `BuildResult`,
which bundles the refscan info alongside the castore nodes.

The proto type is renamed to BuildResponse, to better map to gRPC
semantics.

In proto land, we don't send the name for outputs anymore, be it the
full path or the last component, as there's never been a guarantee this
is a valid PathComponent. That entry is now required to be anonymous.
The path of an output can be retrieved by looking at the original
BuildRequest.

Change-Id: If5ce3a009cd3dd6bb6505cd51d5f4deda261ea85
Reviewed-on: https://cl.snix.dev/c/snix/+/30387
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Vova Kryachko <v.kryachko@gmail.com>
2025-05-04 01:38:29 +00:00
Florian Klink
48807c90ec fix(ops/gerrit-tvl): query buildkite-status endpoint and re-enable
This points our own gerrit check to the deployed buildkite-api-proxy,
updates the URL and stops sending an outdated token.

Fixes #118.

Change-Id: Ic7ace4d67a6bd05c408ac14fe988ae3fe829a49b
Reviewed-on: https://cl.snix.dev/c/snix/+/30406
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: edef <edef@edef.eu>
2025-05-03 22:49:43 +00:00
Florian Klink
c709d2a5d3 feat(ops/www/cl.snix.dev): deploy buildkite-api-proxy
This deploys buildkite-api-proxy at cl.snix.dev/buildkite-status/.

Part of #118.

Change-Id: Iae927b11acc2163e6edc4ba6e91194e8fa884b0d
Reviewed-on: https://cl.snix.dev/c/snix/+/30405
Reviewed-by: edef <edef@edef.eu>
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
2025-05-03 22:37:12 +00:00
Florian Klink
d85b322c55 feat(ops/gerrit01): provide buildkite-api-proxy-token.age
This is a read-only Buildkite token, it was generated and installed by
flokli@ and has read_builds, read_build_logs, and read_pipelines
permissions.

Part of #118.

Change-Id: I0bbfbab9ad1152ff8e781b7380f44d3cd7245bab
Reviewed-on: https://cl.snix.dev/c/snix/+/30404
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: edef <edef@edef.eu>
2025-05-03 22:36:42 +00:00
Florian Klink
54c313c9b2 feat(ops/buildkite-api-proxy): init
This provides a very simple http server, receiving a git sha1 and
querying the buildkite api for the status - the same that's previously
done by the frontend, but now without exposing the (read-only) token
to users.

We can add caching / rate-limiting if the need arises, for now we
just propagate the `cache-control` headers (which seem to be set at
"cache-control: max-age=0, private, must-revalidate" currently anyways)

Part of #118.

Change-Id: I8989a74cb2b278139d988089ff8d6e59e00969e4
Reviewed-on: https://cl.snix.dev/c/snix/+/30403
Reviewed-by: edef <edef@edef.eu>
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
2025-05-03 22:36:42 +00:00
Florian Klink
ba1e30cfa3 fix(ops/modules/monorepo-gerrit): disable gerrit-tvl for now
Part of #118.

Change-Id: I4da12d18f2638554093cf3ae3bda49a6b523c4f3
Reviewed-on: https://cl.snix.dev/c/snix/+/30388
Reviewed-by: Vova Kryachko <v.kryachko@gmail.com>
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-05-03 19:58:57 +00:00
Starnick4444
bf59803f00 chore(tracing): upgrade to 2024 edition
Part of #114

Change-Id: I07f1c861c110cc2e0a3d8122bb6f240391212698
Reviewed-on: https://cl.snix.dev/c/snix/+/30378
Autosubmit: Bence Nemes <nemes.bence1@gmail.com>
Reviewed-by: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-05-02 22:33:47 +00:00
Starnick4444
950d551fbc chore(serde): upgrade to 2024 edition
Part of #114
Literally nothing changed...

Change-Id: Ide28c82e853d16dd911ce0226ebc2ee0a545d891
Reviewed-on: https://cl.snix.dev/c/snix/+/30379
Reviewed-by: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Autosubmit: Bence Nemes <nemes.bence1@gmail.com>
2025-05-02 21:20:10 +00:00
Florian Klink
54a696bf77 fix(web/about): update nlnet link
The active project is now hosted at
https://nlnet.nl/project/Snix-Store_Builder/.

Change-Id: Ief2735b0a78d3e0fc1379fd00f70f5ab64c2a466
Reviewed-on: https://cl.snix.dev/c/snix/+/30376
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: edef <edef@edef.eu>
2025-05-02 13:41:04 +00:00
Florian Klink
14ad575384 doc(ops/besadii): update docstring
besadii is called as `patchset-created` or `change-merged`, not
`ref-updated`.

Change-Id: I843f2d749ab152fb0061b6a9da44775ed58a9eae
Reviewed-on: https://cl.snix.dev/c/snix/+/30344
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
2025-05-02 01:11:06 +00:00
Florian Klink
cbe13c01a3 feat(web): add nlnet logo
This was long overdue. Thanks NLNET!

Change-Id: I62fb4d3325a8e91cd79ae28fd30edf79a448056b
Reviewed-on: https://cl.snix.dev/c/snix/+/30375
Reviewed-by: edef <edef@edef.eu>
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-05-01 17:53:00 +00:00
edef
bcb8438856 refactor(eval/builtins/intersectAttrs): use cmp for three-way comparison
There is no point in separately checking lt/eq/gt separately when we
always need the full ordering anyway.

Change-Id: I993108029d205ac17f01acdb6dbf9b2f0cd80f28
Reviewed-on: https://cl.snix.dev/c/snix/+/30372
Reviewed-by: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-05-01 16:03:11 +00:00
edef
3d95109328 refactor(eval/builtins/intersectAttrs): use kv iterator instead of unsafe get
We can just iterate key-value pairs for our merge sort, rather than
relying on unsafe to get us the value without costing us a presence
check.

Change-Id: I7145a1b2f33a8510de8d7fbd1a12804517a78042
Reviewed-on: https://cl.snix.dev/c/snix/+/30371
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-05-01 16:03:11 +00:00
edef
94ba112360 docs(snix/eval/intersectAttrs): simplify algorithm description
It's literally just an intersecting merge sort.

Change-Id: Icc59928091c48130a4616476fc103ef33aee21e4
Reviewed-on: https://cl.snix.dev/c/snix/+/30374
Reviewed-by: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-05-01 16:03:11 +00:00
edef
0e32b4d72d feat(tvix/eval/benches): benchmark intersectAttrs
Change-Id: If5da2c4022758900a0d0167835ff7a61613e05a4
Reviewed-on: https://cl.snix.dev/c/snix/+/30373
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-05-01 16:03:11 +00:00
Florian Klink
853754d25f feat(ops/modules/www/git.snix.dev): block AI scrapers
This blocks a bunch of AI scrapers from Forgejo, which seems to be
particularly attractive.

Especially meta-externalagent has been scraping very excessively.

The list comes from https://github.com/ai-robots-txt/ai.robots.txt,
let's see how often this needs updating.

Change-Id: I55ae7c42c6a3eeff6f0457411a8b05d55cb24f65
Reviewed-on: https://cl.snix.dev/c/snix/+/30370
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: edef <edef@edef.eu>
2025-05-01 14:57:44 +00:00
Starnick4444
c501361412 chore(cli): upgrade cli to 2024 edition
Part of #114
cli doesn't contain any unsafe

Change-Id: I65b573be5f9ff5c93b813a930df908d6aea6c799
Reviewed-on: https://cl.snix.dev/c/snix/+/30365
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-05-01 08:01:11 +00:00
Starnick4444
ef53fbfe3f chore(build): upgrade to 2024 edition
Part of #114
doesn't contain any unsafe

Change-Id: Icd1c0609f9a51721bd9a5d717ce71537d0f49702
Reviewed-on: https://cl.snix.dev/c/snix/+/30366
Autosubmit: Bence Nemes <nemes.bence1@gmail.com>
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-05-01 07:39:38 +00:00
Florian Klink
dcadf3cb5b fix(3p/overlays): downgrade hugo
Without this, the website just shows a white page with a "This line is
from …" message. Downgrading hugo to 0.145.0 fixes it.

Change-Id: I5a4e2b5d00d3772580daf8d863375471979a5825
Reviewed-on: https://cl.snix.dev/c/snix/+/30368
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Bence Nemes <nemes.bence1@gmail.com>
Tested-by: besadii
2025-05-01 07:36:08 +00:00
Florian Klink
56c3a5d24d fix(ops/modules/o11y): remove anonymous auth org_name
This doesn't seem to do anything, and logs a warning on startup.

Change-Id: I4d883f2a95d5934bc3dc2998a497f3c2a8ff857d
Reviewed-on: https://cl.snix.dev/c/snix/+/30364
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Ryan Lahfa <masterancpp@gmail.com>
Tested-by: besadii
2025-04-30 20:22:13 +00:00
Florian Klink
5f3fd9385d fix(ops/modules/tempo): drop keepalive from extraConfig
It seems this now gets added automatically, and causes nginx to fail
with an emergency due to the directive being there two times.

Drop one of it, which gets nginx to boot up again.

Change-Id: I0df3c2f7c2cfbe23d717249570d5a4d1a7fe2f2b
Reviewed-on: https://cl.snix.dev/c/snix/+/30363
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Ryan Lahfa <masterancpp@gmail.com>
2025-04-30 20:21:42 +00:00
Florian Klink
ca23b17680 refactor(ops/machines): switch from grafana-agent to alloy
grafana-agent has been removed, but the failing eval was missed due
to #80.

Change-Id: I87cfc71c8c98e27e32f4e95e4d85901195cb5b75
Reviewed-on: https://cl.snix.dev/c/snix/+/30347
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Ryan Lahfa <masterancpp@gmail.com>
Tested-by: besadii
2025-04-30 20:21:42 +00:00
Florian Klink
b2fa87f344 fix(ops/machines/*): fix leftover usages of depot.automatic-gc
This was missed, due to #80.

Change-Id: I3b10fa615c09fdd9887c63c847cfd70f5a80d277
Reviewed-on: https://cl.snix.dev/c/snix/+/30346
Tested-by: besadii
Reviewed-by: Ryan Lahfa <masterancpp@gmail.com>
Autosubmit: Florian Klink <flokli@flokli.de>
2025-04-30 20:20:12 +00:00
Florian Klink
088296c52c refactor(ops/modules/o11y/agent): drop bearerTokenFile option
This option is not used, we can reintroduce it when needed.

Change-Id: Ie0f90ea7fc84f493f0c73de29ddf200c1184cb40
Reviewed-on: https://cl.snix.dev/c/snix/+/30345
Tested-by: besadii
Reviewed-by: Ryan Lahfa <masterancpp@gmail.com>
Autosubmit: Florian Klink <flokli@flokli.de>
2025-04-30 20:20:12 +00:00
edef
ca964623b1 docs(nix-compat): our keys are not all that musical
Change-Id: I93145d983ac897c91e15fded2b1810d0b755967c
Reviewed-on: https://cl.snix.dev/c/snix/+/30340
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-04-30 09:56:29 +00:00
Florian Klink
98703f7a41 chore(snix): configure rustfmt for edition 2024 crates
Add a rustfmt.toml to all the crates that are already migrated to
edition 2024.

Initially proposed in cl/30341.

Fixes #115.

Change-Id: I9f58cd45e38fec3acbb077492d5402e30560996b
Reviewed-on: https://cl.snix.dev/c/snix/+/30343
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Domen Kožar <domen@cachix.org>
2025-04-30 08:44:07 +00:00
Thomas Koch
b39d7abc5a fix(tools/depotfmt.nix): double specification of edition
There already is a rustfmt.toml in the depot root specifying the edition.
Removing the option enables projects in the depot to update to newer
editions independently.

Fixes: https://b.tvl.fyi/issues/442
Change-Id: I15d30f69040a4ec327fd099c508e5c11cec2aecc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/13347
Reviewed-by: thk <thomas@koch.ro>
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Reviewed-on: https://cl.snix.dev/c/snix/+/30342
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Domen Kožar <domen@cachix.org>
2025-04-30 08:42:36 +00:00
Florian Klink
7ffd2ea502 feat(ops/machines/build01): enable automatic GC
Fixes #109.

Change-Id: I8bcf4f9900a34b6d07f1e70ada22de6e398f6203
Reviewed-on: https://cl.snix.dev/c/snix/+/30339
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
2025-04-29 10:06:23 +00:00
Florian Klink
11b1f8b304 chore(ops/modules): drop unused NixOS modules
Change-Id: I043fea952df5498cd3e831b479220b1025a295fa
Reviewed-on: https://cl.snix.dev/c/snix/+/30338
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
2025-04-29 10:05:23 +00:00
Florian Klink
71d7185dcd fix(snix/cli): don't print progress bars all the time
We only really want to report progress when something takes a meaningful
time, and that's only while eval.evaluate is called.

We also don't want to show progress bars when
--dump-bytecode or --trace-runtime is enabled.

Even with the changes in cl/30234 not clobbering progress bars, having
progress bars interleaved with other lines from these observers is not
helpful.

Fixes #84 and #113.

Change-Id: I853d7f69757250afaa38e0b172b0c0186bf655a0
Reviewed-on: https://cl.snix.dev/c/snix/+/30337
Reviewed-by: Florian Klink <flokli@flokli.de>
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Bence Nemes <nemes.bence1@gmail.com>
2025-04-27 12:18:14 +00:00
Florian Klink
09c1e3d25b feat(ops/keycloak): allow log in with Bornhack account
This adds bornhack.dk as an OIDC provider.

We currently do not yet map the `nickname` claim as a username field.

This means users logging in via Bornhack need to choose their username
manually, until https://github.com/bornhack/bornhack-website/issues/1837
is solved.

Change-Id: Ia91594107a0cd1d1e0a2ee7ca48d603a2ac681a5
Reviewed-on: https://cl.snix.dev/c/snix/+/30326
Tested-by: besadii
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Autosubmit: Florian Klink <flokli@flokli.de>
2025-04-26 11:58:25 +00:00
Florian Klink
154f85d3e7 chore(snix/castore-go): use any instead of interface{}
Address a lint.

Change-Id: I72a740943327d50186e0a1d1b9c42a150aa21dd1
Reviewed-on: https://cl.snix.dev/c/snix/+/30336
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
2025-04-24 08:43:13 +00:00
Florian Klink
f630ce9b93 chore(3p/nixpkgs): bump channels (2025-04-21)
* Update Snix' verify-lang-tests to 2.28, as 2.25 has been removed
   from nixpkgs
 * Update snix/cli integration tests, iso_gnome is called iso_graphical
   (again?)
 * Address clippy lints
 * Regenerate go bindings
 * Remove grpc-health-check from our overlay, it's long been merged

Change-Id: I9d33cabdd3e7065a1f28bcccf4f979f08a456f88
Reviewed-on: https://cl.snix.dev/c/snix/+/30333
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-04-24 08:42:42 +00:00
Florian Klink
cade3d989d chore(snix/*-go): regenerate
build-go and store-go currently are skipped from CI until someone finds
time to work on https://git.snix.dev/snix/snix/issues/60.

We can however still regenerate the bindings at least, so do this.

Change-Id: I626da69f26bff24cdf3c01581931045a44635116
Reviewed-on: https://cl.snix.dev/c/snix/+/30335
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
2025-04-24 08:39:42 +00:00
Florian Klink
e2ff3783c9 fix(web): opt out subtree from readTree
We don't want readTree to descent inside web/, especially not in the
node_modules directory that might be present in local checkouts.

Change-Id: Ia1c2147a76f22560947d367f4e94e4c91bb66512
Reviewed-on: https://cl.snix.dev/c/snix/+/30334
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
2025-04-24 08:39:11 +00:00
Florian Klink
048e9da83d docs(castore/why-not-git): update BLAKE3 references
Use the all-caps version, like in other places of the docs.

Change-Id: I74a21f9015ba128456f6ee0b652ad12056b4e88b
Reviewed-on: https://cl.snix.dev/c/snix/+/30329
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
2025-04-18 19:18:12 +00:00
Florian Klink
21b5c8a7b7 fix(web/components/castore/data-model): fix links
Fix the broken link to PathComponent.

Write `[BLAKE3][]` instead of just `[BLAKE3]` to be consistent with
other links.

Change-Id: If8651de9d2401a81e47281216707e442b5ff1932
Reviewed-on: https://cl.snix.dev/c/snix/+/30328
Tested-by: besadii
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Autosubmit: Florian Klink <flokli@flokli.de>
2025-04-18 19:18:12 +00:00
Florian Klink
32ef10a23b docs(snix/castore/path): fix docstring
This returns as a [PathComponent], not as bytes.

Change-Id: Ia6df19be6f3060b28f8be6b74f3f3f443a536f8a
Reviewed-on: https://cl.snix.dev/c/snix/+/30327
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Domen Kožar <domen@cachix.org>
Tested-by: besadii
2025-04-18 18:25:04 +00:00
Florian Klink
c9082a586c docs(web/snix/castore): port "why not git" document
Change-Id: I4ac77f264d2704018cd33dbf80746e82d193686e
Reviewed-on: https://cl.snix.dev/c/snix/+/30315
Reviewed-by: Domen Kožar <domen@cachix.org>
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
2025-04-18 18:05:31 +00:00
Florian Klink
b2d2d622e0 docs(web/snix/castore): port castore data model
Also restructure this, explaining the Rust data types, and then
explaining the differences with the proto implementation, which uses
"entry" since cl/30296.

Change-Id: Ie264ab60998f0d891b4a4ea680a2d9dbe1c5929e
Reviewed-on: https://cl.snix.dev/c/snix/+/30314
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Domen Kožar <domen@cachix.org>
Tested-by: besadii
2025-04-18 18:05:31 +00:00
Florian Klink
d1990c9a93 refactor(snix/castore-http/cli): ask for root directory digest
Restrict the CLI to only root directories, passing the blake3 digest of
the root directory.

Usually we want to serve a directory, and we now have a `snix-castore
ingest` sucommand, and copying the output from that command is much less
effort than constructing a proto message.

More advanced usecases can still use the get_root_node_contents library
function and pass in other nodes.

Change-Id: I66c2c0a15723b43b5b0cffc1c201391df57dd602
Reviewed-on: https://cl.snix.dev/c/snix/+/30321
Reviewed-by: Stefan Junker <mail@stefanjunker.de>
Tested-by: besadii
2025-04-16 12:04:30 +00:00
Florian Klink
fd5f316fb8 feat(snix/castore-http): pass extension to respond_file()
respond_file only uses requested_path to (only) calculate an extension
for mime type guessing, and getting to there is a bit messy.

Use PathComponent::extension to get the extension, and replace
`requested_path: Option<std::path::Path>` with
`extension: Option<&str>`.

Change-Id: I0582a1127f8b505fdf77406fafb3d3b206d694f2
Reviewed-on: https://cl.snix.dev/c/snix/+/30320
Tested-by: besadii
Reviewed-by: Stefan Junker <mail@stefanjunker.de>
2025-04-16 12:04:30 +00:00
Florian Klink
15b1415860 feat(snix/castore/Path): add extension() method
This returns the extension, similar to the method we already have for
PathComponent.

Change-Id: Ia1719951c453c196beb991686dbee23bae1049af
Reviewed-on: https://cl.snix.dev/c/snix/+/30322
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Stefan Junker <mail@stefanjunker.de>
Tested-by: besadii
2025-04-16 12:04:30 +00:00