commit
ba5122823c
@ -0,0 +1,90 @@ |
||||
import ./make-test-python.nix ({lib, pkgs, ...}: |
||||
let |
||||
hosts = '' |
||||
192.168.2.101 acme.test |
||||
''; |
||||
|
||||
in |
||||
{ |
||||
name = "nginx-http3"; |
||||
meta.maintainers = with pkgs.lib.maintainers; [ izorkin ]; |
||||
|
||||
nodes = { |
||||
server = { pkgs, ... }: { |
||||
networking = { |
||||
interfaces.eth1 = { |
||||
ipv4.addresses = [ |
||||
{ address = "192.168.2.101"; prefixLength = 24; } |
||||
]; |
||||
}; |
||||
extraHosts = hosts; |
||||
firewall.allowedTCPPorts = [ 443 ]; |
||||
firewall.allowedUDPPorts = [ 443 ]; |
||||
}; |
||||
|
||||
security.pki.certificates = [ |
||||
(builtins.readFile ./common/acme/server/ca.cert.pem) |
||||
]; |
||||
|
||||
services.nginx = { |
||||
enable = true; |
||||
package = pkgs.nginxQuic; |
||||
|
||||
virtualHosts."acme.test" = { |
||||
onlySSL = true; |
||||
sslCertificate = ./common/acme/server/acme.test.cert.pem; |
||||
sslCertificateKey = ./common/acme/server/acme.test.key.pem; |
||||
http2 = true; |
||||
http3 = true; |
||||
reuseport = true; |
||||
root = lib.mkForce (pkgs.runCommandLocal "testdir2" {} '' |
||||
mkdir "$out" |
||||
cat > "$out/index.html" <<EOF |
||||
<html><body>Hello World!</body></html> |
||||
EOF |
||||
cat > "$out/example.txt" <<EOF |
||||
Check http3 protocol. |
||||
EOF |
||||
''); |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
client = { pkgs, ... }: { |
||||
environment.systemPackages = [ pkgs.curlHTTP3 ]; |
||||
networking = { |
||||
interfaces.eth1 = { |
||||
ipv4.addresses = [ |
||||
{ address = "192.168.2.201"; prefixLength = 24; } |
||||
]; |
||||
}; |
||||
extraHosts = hosts; |
||||
}; |
||||
|
||||
security.pki.certificates = [ |
||||
(builtins.readFile ./common/acme/server/ca.cert.pem) |
||||
]; |
||||
}; |
||||
}; |
||||
|
||||
testScript = '' |
||||
start_all() |
||||
|
||||
# Check http connections |
||||
client.succeed("curl --verbose --http3 https://acme.test | grep 'Hello World!'") |
||||
|
||||
# Check downloadings |
||||
client.succeed("curl --verbose --http3 https://acme.test/example.txt --output /tmp/example.txt") |
||||
client.succeed("cat /tmp/example.txt | grep 'Check http3 protocol.'") |
||||
|
||||
# Check header reading |
||||
client.succeed("curl --verbose --http3 --head https://acme.test | grep 'content-type'") |
||||
|
||||
# Check change User-Agent |
||||
client.succeed("curl --verbose --http3 --user-agent 'Curl test 3.0' https://acme.test") |
||||
server.succeed("cat /var/log/nginx/access.log | grep 'Curl test 3.0'") |
||||
|
||||
server.shutdown() |
||||
client.shutdown() |
||||
''; |
||||
}) |
@ -0,0 +1,20 @@ |
||||
{ buildPecl, zlib, lib }: |
||||
|
||||
buildPecl { |
||||
pname = "grpc"; |
||||
|
||||
version = "1.45.0"; |
||||
sha256 = "sha256-SPnECBZ80sXfXYiVJjGfOsSxZBBZnasO9pPu9Q5klIg"; |
||||
|
||||
doCheck = true; |
||||
checkTarget = "test"; |
||||
|
||||
nativeBuildInputs = [ zlib ]; |
||||
|
||||
meta = with lib; { |
||||
description = "A high performance, open source, general RPC framework that puts mobile and HTTP/2 first."; |
||||
license = licenses.asl20; |
||||
homepage = "https://github.com/grpc/grpc/tree/master/src/php/ext/grpc"; |
||||
maintainers = teams.php.members; |
||||
}; |
||||
} |
@ -1,33 +1,38 @@ |
||||
{ lib, stdenv, fetchFromGitHub, glib, pkg-config, scons }: |
||||
{ fetchFromGitLab |
||||
, glib |
||||
, lib |
||||
, pkg-config |
||||
, scons |
||||
, stdenv |
||||
}: |
||||
|
||||
stdenv.mkDerivation { |
||||
stdenv.mkDerivation rec { |
||||
pname = "hammer"; |
||||
version = "e7aa734"; |
||||
version = "nightly_20220416"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "UpstandingHackers"; |
||||
src = fetchFromGitLab { |
||||
domain = "gitlab.special-circumstanc.es"; |
||||
owner = "hammer"; |
||||
repo = "hammer"; |
||||
rev = "47f34b81e4de834fd3537dd71928c4f3cdb7f533"; |
||||
sha256 = "sha256-aNSmbSgcABF9T1HoFhCnkmON4hY2MtUs7dW38+HigAY="; |
||||
rev = version; |
||||
sha256 = "sha256-xMZhUnycGeHkNZfHQ2d9mETti8HwGHZNskFqh9f0810="; |
||||
}; |
||||
|
||||
nativeBuildInputs = [ pkg-config scons ]; |
||||
buildInputs = [ glib ]; |
||||
|
||||
strictDeps = true; |
||||
|
||||
meta = with lib; { |
||||
description = "A bit-oriented parser combinator library"; |
||||
longDescription = '' |
||||
Hammer is a parsing library. Like many modern parsing libraries, |
||||
it provides a parser combinator interface for writing grammars |
||||
as inline domain-specific languages, but Hammer also provides a |
||||
variety of parsing backends. It's also bit-oriented rather than |
||||
character-oriented, making it ideal for parsing binary data such |
||||
as images, network packets, audio, and executables. |
||||
Hammer is a parsing library. Like many modern parsing libraries, it |
||||
provides a parser combinator interface for writing grammars as inline |
||||
domain-specific languages, but Hammer also provides a variety of parsing |
||||
backends. It's also bit-oriented rather than character-oriented, making it |
||||
ideal for parsing binary data such as images, network packets, audio, and |
||||
executables. |
||||
''; |
||||
homepage = "https://github.com/UpstandingHackers/hammer"; |
||||
homepage = "https://gitlab.special-circumstanc.es/hammer/hammer"; |
||||
license = licenses.gpl2; |
||||
platforms = platforms.linux; |
||||
maintainers = with maintainers; [ azahi ]; |
||||
}; |
||||
} |
||||
|
Loading…
Reference in new issue