Unverified Commit 1c2761e1 authored by Bart Oostveen's avatar Bart Oostveen
Browse files

nixos/tests/matrix-continuwuity: adapt to new oobe

The new out-of-box experience in continuwuity is such that you have to either
create a first (admin) user manually using `conduit --execute "users create
<name>"`, or using the temporary registration token that appears in the logs.
This needs to happen regardless of whether the server is open to registration
or if there is a pre-shared registration token. This commit makes it so that
the initial `alice` user is created in advance by the server itself. This
does not influence the quality of the nixos test in my opinion.
parent b22b6e57
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
{ lib, ... }:
let
  name = "continuwuity";
  user = "alice";
  pass = "my-secret-password";
in
{
  inherit name;
@@ -12,8 +14,7 @@ in
        settings.global = {
          server_name = name;
          address = [ "0.0.0.0" ];
          allow_registration = true;
          yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse = true;
          admin_execute = [ "users create ${user} ${pass}" ];
        };
        extraEnvironment.RUST_BACKTRACE = "yes";
      };
@@ -30,13 +31,10 @@ in

            async def main() -> None:
                # Connect to continuwuity
                client = nio.AsyncClient("http://continuwuity:6167", "alice")

                # Register as user alice
                response = await client.register("alice", "my-secret-password")
                client = nio.AsyncClient("http://continuwuity:6167", "${user}")

                # Log in as user alice
                response = await client.login("my-secret-password")
                response = await client.login("${pass}")

                # Create a new room
                response = await client.room_create(federate=False)