gunk-dev/the-valley

web-push-e2e.nix

source10091af9534amain's published tip history
1.5 KiB
1# The push path end to end, over the shipped binaries: valley-web-publish,
2# valley-web-receive and valley-web as nix/packages.nix builds them, with
3# their wrappers, pinned tools and schemas, the valley CLI as the package
4# ships it (valley-script, unstamped, so no commit alone rebuilds it), and
5# real git. A valley instance grants anyone read of two projects in one
6# group. The publisher uploads them to the receiver, and valley-web serves
7# them at their group URLs, with an alias and a former name redirecting.
8# A pass with a wrong token is refused as unauthenticated, and the edge
9# keeps serving. Withdrawing a project's grant takes it off the edge on
10# the next pass. Both servers restart onto the same content. With the
11# receiver stopped, valley-web keeps serving, a withdrawal's pass fails
12# because its upload cannot connect and changes nothing, and once the
13# receiver is back the next pass takes the project off the edge.
14#
15# It runs in the build sandbox as one user. The split between the
16# receiver's user and valley-web's is held by the receiver module's
17# checks in module-eval and by web-image.
18{
19 pkgs,
20 packages,
21 ...
22}:
23{
24 web-push-e2e = pkgs.runCommand "valley-web-push-e2e" {
25 nativeBuildInputs = [
26 pkgs.git
27 pkgs.cue
28 pkgs.curl
29 pkgs.jq
30 packages.valley-script
31 packages.valley-web-publish
32 packages.valley-web-receive
33 packages.valley-web
34 ];
35 schema = ../../schema/valley.cue;
36 } (builtins.readFile ./web-push-e2e.sh);
37}