Loading nixos/tests/all-tests.nix +1 −0 Original line number Diff line number Diff line Loading @@ -929,6 +929,7 @@ in { sourcehut = handleTest ./sourcehut {}; spacecookie = handleTest ./spacecookie.nix {}; spark = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./spark {}; spiped = runTest ./spiped.nix; sqlite3-to-mysql = handleTest ./sqlite3-to-mysql.nix {}; sslh = handleTest ./sslh.nix {}; ssh-agent-auth = handleTest ./ssh-agent-auth.nix {}; Loading nixos/tests/spiped.nix 0 → 100644 +73 −0 Original line number Diff line number Diff line { pkgs, ... }: let key = pkgs.runCommand "key" { } "${pkgs.openssl}/bin/openssl rand 32 > $out"; in { name = "spiped"; meta = with pkgs.lib.maintainers; { maintainers = [ tomfitzhenry ]; }; nodes = { server = { pkgs, lib, ... }: { services.caddy = { enable = true; settings = { apps.http.servers.default = { listen = [ ":80" ]; routes = [ { handle = [ { body = "hello world"; handler = "static_response"; status_code = 200; } ]; } ]; }; }; }; systemd.services."spiped@server" = { wantedBy = [ "multi-user.target" ]; overrideStrategy = "asDropin"; }; systemd.services."spiped@client" = { wantedBy = [ "multi-user.target" ]; overrideStrategy = "asDropin"; }; services.spiped = { enable = true; config = { server = { source = "localhost:8080"; target = "localhost:80"; keyfile = key; decrypt = true; }; client = { source = "localhost:8081"; target = "localhost:8080"; keyfile = key; encrypt = true; }; }; }; }; }; testScript = { nodes, ... }: '' server.wait_for_unit("caddy") server.wait_for_open_port(80) server.wait_for_open_port(8080) server.wait_for_open_port(8081) server.succeed("curl http://localhost:8081 | grep hello") ''; } pkgs/tools/networking/spiped/default.nix +3 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ fetchurl, openssl, coreutils, nixosTests, }: stdenv.mkDerivation rec { Loading Loading @@ -34,6 +35,8 @@ stdenv.mkDerivation rec { runHook postInstall ''; passthru.tests.spiped = nixosTests.spiped; meta = { description = "Utility for secure encrypted channels between sockets"; homepage = "https://www.tarsnap.com/spiped.html"; Loading Loading
nixos/tests/all-tests.nix +1 −0 Original line number Diff line number Diff line Loading @@ -929,6 +929,7 @@ in { sourcehut = handleTest ./sourcehut {}; spacecookie = handleTest ./spacecookie.nix {}; spark = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./spark {}; spiped = runTest ./spiped.nix; sqlite3-to-mysql = handleTest ./sqlite3-to-mysql.nix {}; sslh = handleTest ./sslh.nix {}; ssh-agent-auth = handleTest ./ssh-agent-auth.nix {}; Loading
nixos/tests/spiped.nix 0 → 100644 +73 −0 Original line number Diff line number Diff line { pkgs, ... }: let key = pkgs.runCommand "key" { } "${pkgs.openssl}/bin/openssl rand 32 > $out"; in { name = "spiped"; meta = with pkgs.lib.maintainers; { maintainers = [ tomfitzhenry ]; }; nodes = { server = { pkgs, lib, ... }: { services.caddy = { enable = true; settings = { apps.http.servers.default = { listen = [ ":80" ]; routes = [ { handle = [ { body = "hello world"; handler = "static_response"; status_code = 200; } ]; } ]; }; }; }; systemd.services."spiped@server" = { wantedBy = [ "multi-user.target" ]; overrideStrategy = "asDropin"; }; systemd.services."spiped@client" = { wantedBy = [ "multi-user.target" ]; overrideStrategy = "asDropin"; }; services.spiped = { enable = true; config = { server = { source = "localhost:8080"; target = "localhost:80"; keyfile = key; decrypt = true; }; client = { source = "localhost:8081"; target = "localhost:8080"; keyfile = key; encrypt = true; }; }; }; }; }; testScript = { nodes, ... }: '' server.wait_for_unit("caddy") server.wait_for_open_port(80) server.wait_for_open_port(8080) server.wait_for_open_port(8081) server.succeed("curl http://localhost:8081 | grep hello") ''; }
pkgs/tools/networking/spiped/default.nix +3 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ fetchurl, openssl, coreutils, nixosTests, }: stdenv.mkDerivation rec { Loading Loading @@ -34,6 +35,8 @@ stdenv.mkDerivation rec { runHook postInstall ''; passthru.tests.spiped = nixosTests.spiped; meta = { description = "Utility for secure encrypted channels between sockets"; homepage = "https://www.tarsnap.com/spiped.html"; Loading