From 0a3d1e36967e6e75564e1e4f07388470cc6ad98d Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sun, 12 May 2024 02:21:30 +0200 Subject: [PATCH] overlays/nginx-test just start replacing shit, we're not even testing the actual config now This sucks nginx should make a proper validation tool that doesnt do DNS request on every hostname mentioned in the config file. Not to mention trying to actually listen on the ip-address and port Why?? Why is TEST failing because it can't bind to the SAME address nginx is probably in production listening on already?? --- overlays/nginx-test.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/overlays/nginx-test.nix b/overlays/nginx-test.nix index 9d1b465e..409cdd0a 100644 --- a/overlays/nginx-test.nix +++ b/overlays/nginx-test.nix @@ -1,5 +1,6 @@ acme-certs: final: prev: let + problematicHosts = [ "matrix.pvv.ntnu.no" "tom.pvv.ntnu.no" ]; lib = final.lib; crt = "${final.path}/nixos/tests/common/acme/server/acme.test.cert.pem"; key = "${final.path}/nixos/tests/common/acme/server/acme.test.key.pem"; @@ -9,7 +10,10 @@ acme-certs: final: prev: nginxConfig = prev.writers.writeNginxConfig name text; nativeBuildInputs = [ final.bubblewrap ]; } '' - ln -s "$nginxConfig" "$out" + cat "$nginxConfig" > "$out" + substituteInPlace "$out" ${lib.concatMapStrings (host: "--replace ${host} \"localhost\" ") problematicHosts} + substituteInPlace "$out" --replace ":443" ":4443" + substituteInPlace "$out" --replace ":80" ":8808" set +o pipefail bwrap \ --ro-bind "${crt}" "/etc/certs/nginx.crt" \