diff --git a/checks/flake-module.nix b/checks/flake-module.nix index b792a1f9..b0a2eb4e 100644 --- a/checks/flake-module.nix +++ b/checks/flake-module.nix @@ -27,6 +27,7 @@ secrets = import ./secrets nixosTestArgs; container = import ./container nixosTestArgs; deltachat = import ./deltachat nixosTestArgs; + matrix-synapse = import ./matrix-synapse nixosTestArgs; zt-tcp-relay = import ./zt-tcp-relay nixosTestArgs; borgbackup = import ./borgbackup nixosTestArgs; syncthing = import ./syncthing nixosTestArgs; diff --git a/checks/matrix-synapse/default.nix b/checks/matrix-synapse/default.nix new file mode 100644 index 00000000..ec43209c --- /dev/null +++ b/checks/matrix-synapse/default.nix @@ -0,0 +1,37 @@ +(import ../lib/container-test.nix) ( + { pkgs, ... }: + { + name = "matrix-synapse"; + + nodes.machine = + { self, lib, ... }: + { + imports = [ + self.clanModules.matrix-synapse + self.nixosModules.clanCore + { + clanCore.machineName = "machine"; + clanCore.clanDir = ./.; + clan.matrix-synapse = { + enable = true; + domain = "clan.test"; + }; + } + { + # secret override + clanCore.secrets.matrix-synapse.secrets.synapse-registration_shared_secret.path = "${./synapse-registration_shared_secret}"; + services.nginx.virtualHosts."matrix.clan.test" = { + enableACME = lib.mkForce false; + forceSSL = lib.mkForce false; + }; + } + ]; + }; + testScript = '' + start_all() + machine.wait_for_unit("matrix-synapse") + machine.succeed("${pkgs.netcat}/bin/nc -z -v ::1 8008") + machine.succeed("${pkgs.curl}/bin/curl -Ssf -L http://localhost/_matrix/static/ -H 'Host: matrix.clan.test'") + ''; + } +) diff --git a/checks/matrix-synapse/synapse-registration_shared_secret b/checks/matrix-synapse/synapse-registration_shared_secret new file mode 100644 index 00000000..82a3b081 --- /dev/null +++ b/checks/matrix-synapse/synapse-registration_shared_secret @@ -0,0 +1 @@ +registration_shared_secret: supersecret