4 pkgs.runCommand "selfSignedCerts" { buildInputs = [ pkgs.openssl ]; } ''
5 openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -nodes -subj '/CN=example.com/CN=uploads.example.com/CN=conference.example.com' -days 36500
7 cp key.pem cert.pem $out
11 pkgs.writeScriptBin "create-prosody-users" ''
12 #!${pkgs.bash}/bin/bash
15 # Creates and set password for the 2 xmpp test users.
17 # Doing that in a bash script instead of doing that in the test
18 # script allow us to easily provision the users when running that
21 prosodyctl register cthon98 example.com nothunter2
22 prosodyctl register azurediamond example.com hunter2
26 pkgs.writeScriptBin "delete-prosody-users" ''
27 #!${pkgs.bash}/bin/bash
30 # Deletes the test users.
32 # Doing that in a bash script instead of doing that in the test
33 # script allow us to easily provision the users when running that
36 prosodyctl deluser cthon98@example.com
37 prosodyctl deluser azurediamond@example.com
40 import ../make-test-python.nix {
51 security.pki.certificateFiles = [ "${cert pkgs}/cert.pem" ];
52 console.keyMap = "fr-bepo";
53 networking.extraHosts = ''
54 ${nodes.server.config.networking.primaryIPAddress} example.com
55 ${nodes.server.config.networking.primaryIPAddress} conference.example.com
56 ${nodes.server.config.networking.primaryIPAddress} uploads.example.com
58 environment.systemPackages = [
59 (pkgs.callPackage ./xmpp-sendmessage.nix { connectTo = "example.com"; })
63 { config, pkgs, ... }:
65 security.pki.certificateFiles = [ "${cert pkgs}/cert.pem" ];
66 console.keyMap = "fr-bepo";
67 networking.extraHosts = ''
68 ${config.networking.primaryIPAddress} example.com
69 ${config.networking.primaryIPAddress} conference.example.com
70 ${config.networking.primaryIPAddress} uploads.example.com
72 networking.firewall.enable = false;
73 environment.systemPackages = [
79 ssl.cert = "${cert pkgs}/cert.pem";
80 ssl.key = "${cert pkgs}/key.pem";
81 virtualHosts.example = {
82 domain = "example.com";
84 ssl.cert = "${cert pkgs}/cert.pem";
85 ssl.key = "${cert pkgs}/key.pem";
89 domain = "conference.example.com";
93 domain = "uploads.example.com";
102 # Check with sqlite storage
104 server.wait_for_unit("prosody.service")
105 server.succeed('prosodyctl status | grep "Prosody is running"')
107 server.succeed("create-prosody-users")
108 client.succeed("send-message")
109 server.succeed("delete-prosody-users")