nixosTests/pleroma: fix test

Two issues:

1. We need a subjectAltName on the TLS cert. Stolen from the akkoma
test. <3 illdefined
2. There's a bug in the current toot release wrt. date parsing. It's
been fixed upstream but it's not been released yet. Using the
current toot master for this VM test to work around this.

Note: I warned upstream we'd need a new toot release.

Fixes https://github.com/NixOS/nixpkgs/issues/264951

authored by Félix Baylac Jacqué and committed by Yaya f80b2b51 c16a6fe2

+18 -3
+18 -3
nixos/tests/pleroma.nix
··· 25 25 26 26 import ./make-test-python.nix ({ pkgs, ... }: 27 27 let 28 + # Fix for https://github.com/ihabunek/toot/pull/405. Includes 29 + # https://github.com/ihabunek/toot/pull/405. TOREMOVE when 30 + # toot > 0.38.1 31 + patched-toot = pkgs.toot.overrideAttrs (old: { 32 + version = "unstable-24-09-2023"; 33 + src = pkgs.fetchFromGitHub { 34 + owner = "ihabunek"; 35 + repo = "toot"; 36 + rev = "30857f570d64a26da80d0024227a8259f7cb65b5"; 37 + sha256 = "sha256-BxrI7UY9bfqPzS+VLqCFSmu4PkIkvhntcEeNJb1AzOs="; 38 + }; 39 + }); 28 40 send-toot = pkgs.writeScriptBin "send-toot" '' 29 41 set -eux 30 42 # toot is using the requests library internally. This library ··· 164 176 ''; 165 177 166 178 tls-cert = pkgs.runCommand "selfSignedCerts" { buildInputs = [ pkgs.openssl ]; } '' 167 - openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -nodes -subj '/CN=pleroma.nixos.test' -days 36500 168 179 mkdir -p $out 169 - cp key.pem cert.pem $out 180 + openssl req -x509 \ 181 + -subj '/CN=pleroma.nixos.test/' -days 49710 \ 182 + -addext 'subjectAltName = DNS:pleroma.nixos.test' \ 183 + -keyout "$out/key.pem" -newkey ed25519 \ 184 + -out "$out/cert.pem" -noenc 170 185 ''; 171 186 172 187 hosts = nodes: '' ··· 180 195 security.pki.certificateFiles = [ "${tls-cert}/cert.pem" ]; 181 196 networking.extraHosts = hosts nodes; 182 197 environment.systemPackages = with pkgs; [ 183 - toot 198 + patched-toot 184 199 send-toot 185 200 ]; 186 201 };