Compare commits

..
7 changed files with 102 additions and 134 deletions

No files matched your search

@@ -54,7 +54,7 @@ runs:
run: mv /tmp/binaries/sbin/conduwuit /tmp/binaries/conduwuit${{ inputs.cpu_suffix }}-${{ inputs.slug }}${{ inputs.artifact_suffix }} run: mv /tmp/binaries/sbin/conduwuit /tmp/binaries/conduwuit${{ inputs.cpu_suffix }}-${{ inputs.slug }}${{ inputs.artifact_suffix }}
- name: Upload binary artifact - name: Upload binary artifact
uses: forgejo/upload-artifact@v3 uses: forgejo/upload-artifact@v4
with: with:
name: conduwuit${{ inputs.cpu_suffix }}-${{ inputs.slug }}${{ inputs.artifact_suffix }} name: conduwuit${{ inputs.cpu_suffix }}-${{ inputs.slug }}${{ inputs.artifact_suffix }}
path: /tmp/binaries/conduwuit${{ inputs.cpu_suffix }}-${{ inputs.slug }}${{ inputs.artifact_suffix }} path: /tmp/binaries/conduwuit${{ inputs.cpu_suffix }}-${{ inputs.slug }}${{ inputs.artifact_suffix }}
@@ -62,7 +62,7 @@ runs:
- name: Upload digest - name: Upload digest
if: ${{ env.BUILTIN_REGISTRY_ENABLED == 'true' }} if: ${{ env.BUILTIN_REGISTRY_ENABLED == 'true' }}
uses: forgejo/upload-artifact@v3 uses: forgejo/upload-artifact@v4
with: with:
name: digests${{ inputs.digest_suffix }}-${{ inputs.slug }}${{ inputs.cpu_suffix }} name: digests${{ inputs.digest_suffix }}-${{ inputs.slug }}${{ inputs.cpu_suffix }}
path: /tmp/digests/* path: /tmp/digests/*
+1 -1
View File
@@ -126,7 +126,7 @@ jobs:
[ -f /etc/conduwuit/conduwuit.toml ] && echo "✅ Config file installed" [ -f /etc/conduwuit/conduwuit.toml ] && echo "✅ Config file installed"
- name: Upload deb artifact - name: Upload deb artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v5
with: with:
name: continuwuity-${{ steps.debian-version.outputs.distribution }} name: continuwuity-${{ steps.debian-version.outputs.distribution }}
path: ${{ steps.cargo-deb.outputs.path }} path: ${{ steps.cargo-deb.outputs.path }}
+2 -2
View File
@@ -238,13 +238,13 @@ jobs:
cp $BIN_RPM upload-bin/ cp $BIN_RPM upload-bin/
- name: Upload binary RPM - name: Upload binary RPM
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v5
with: with:
name: continuwuity name: continuwuity
path: upload-bin/ path: upload-bin/
- name: Upload debug RPM artifact - name: Upload debug RPM artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v5
with: with:
name: continuwuity-debug name: continuwuity-debug
path: artifacts/*debuginfo*.rpm path: artifacts/*debuginfo*.rpm
+1 -1
View File
@@ -109,7 +109,7 @@ jobs:
cat ./element-web/webapp/config.json cat ./element-web/webapp/config.json
- name: 📤 Upload Artifact - name: 📤 Upload Artifact
uses: forgejo/upload-artifact@v3 uses: forgejo/upload-artifact@v4
with: with:
name: element-web name: element-web
path: ./element-web/webapp/ path: ./element-web/webapp/
+2 -5
View File
@@ -586,13 +586,10 @@
#allow_unstable_room_versions = true #allow_unstable_room_versions = true
# Default room version continuwuity will create rooms with. # Default room version continuwuity will create rooms with.
# Note that this has to be a string since the room version is a string
# rather than an integer. Forgetting the quotes will make the server fail
# to start!
# #
# Per spec, room version "11" is the default. # Per spec, room version 11 is the default.
# #
#default_room_version = "11" #default_room_version = 11
# Enable OpenTelemetry OTLP tracing export. This replaces the deprecated # Enable OpenTelemetry OTLP tracing export. This replaces the deprecated
# Jaeger exporter. Traces will be sent via OTLP to a collector (such as # Jaeger exporter. Traces will be sent via OTLP to a collector (such as
+92 -118
View File
@@ -6,69 +6,6 @@
pkgs, pkgs,
... ...
}: }:
let
baseTestScript =
pkgs.writers.writePython3Bin "do_test" { libraries = [ pkgs.python3Packages.matrix-nio ]; }
''
import asyncio
import nio
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")
# Log in as user alice
response = await client.login("my-secret-password")
# Create a new room
response = await client.room_create(federate=False)
print("Matrix room create response:", response)
assert isinstance(response, nio.RoomCreateResponse)
room_id = response.room_id
# Join the room
response = await client.join(room_id)
print("Matrix join response:", response)
assert isinstance(response, nio.JoinResponse)
# Send a message to the room
response = await client.room_send(
room_id=room_id,
message_type="m.room.message",
content={
"msgtype": "m.text",
"body": "Hello continuwuity!"
}
)
print("Matrix room send response:", response)
assert isinstance(response, nio.RoomSendResponse)
# Sync responses
response = await client.sync(timeout=30000)
print("Matrix sync response:", response)
assert isinstance(response, nio.SyncResponse)
# Check the message was received by continuwuity
last_message = response.rooms.join[room_id].timeline.events[-1].body
assert last_message == "Hello continuwuity!"
# Leave the room
response = await client.room_leave(room_id)
print("Matrix room leave response:", response)
assert isinstance(response, nio.RoomLeaveResponse)
# Close the client
await client.close()
if __name__ == "__main__":
asyncio.run(main())
'';
in
{ {
# run some nixos tests as checks # run some nixos tests as checks
checks = lib.pipe self'.packages [ checks = lib.pipe self'.packages [
@@ -81,69 +18,106 @@
# this test was initially yoinked from # this test was initially yoinked from
# #
# https://github.com/NixOS/nixpkgs/blob/960ce26339661b1b69c6f12b9063ca51b688615f/nixos/tests/matrix/continuwuity.nix # https://github.com/NixOS/nixpkgs/blob/960ce26339661b1b69c6f12b9063ca51b688615f/nixos/tests/matrix/continuwuity.nix
(builtins.concatMap ( (builtins.map (name: {
name: name = "test-${name}";
builtins.map value = pkgs.testers.runNixOSTest {
( inherit name;
{ config, suffix }:
{
name = "test-${name}-${suffix}";
value = pkgs.testers.runNixOSTest {
inherit name;
nodes = { nodes = {
continuwuity = { continuwuity = {
services.matrix-continuwuity = { services.matrix-continuwuity = {
enable = true; enable = true;
package = self'.packages.${name}; package = self'.packages.${name};
settings = config; settings.global = {
extraEnvironment.RUST_BACKTRACE = "yes";
};
networking.firewall.allowedTCPPorts = [ 6167 ];
};
client.environment.systemPackages = [ baseTestScript ];
};
testScript = ''
start_all()
with subtest("start continuwuity"):
continuwuity.wait_for_unit("continuwuity.service")
continuwuity.wait_for_open_port(6167)
with subtest("ensure messages can be exchanged"):
client.succeed("${lib.getExe baseTestScript} >&2")
'';
};
}
)
[
{
suffix = "base";
config = {
global = {
server_name = name; server_name = name;
address = [ "0.0.0.0" ]; address = [ "0.0.0.0" ];
allow_registration = true; allow_registration = true;
yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse = true; yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse = true;
}; };
extraEnvironment.RUST_BACKTRACE = "yes";
}; };
} networking.firewall.allowedTCPPorts = [ 6167 ];
{ };
suffix = "with-room-version"; client =
config = { { pkgs, ... }:
global = { {
server_name = name; environment.systemPackages = [
address = [ "0.0.0.0" ]; (pkgs.writers.writePython3Bin "do_test" { libraries = [ pkgs.python3Packages.matrix-nio ]; } ''
allow_registration = true; import asyncio
yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse = true; import nio
default_room_version = "12";
};
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")
# Log in as user alice
response = await client.login("my-secret-password")
# Create a new room
response = await client.room_create(federate=False)
print("Matrix room create response:", response)
assert isinstance(response, nio.RoomCreateResponse)
room_id = response.room_id
# Join the room
response = await client.join(room_id)
print("Matrix join response:", response)
assert isinstance(response, nio.JoinResponse)
# Send a message to the room
response = await client.room_send(
room_id=room_id,
message_type="m.room.message",
content={
"msgtype": "m.text",
"body": "Hello continuwuity!"
}
)
print("Matrix room send response:", response)
assert isinstance(response, nio.RoomSendResponse)
# Sync responses
response = await client.sync(timeout=30000)
print("Matrix sync response:", response)
assert isinstance(response, nio.SyncResponse)
# Check the message was received by continuwuity
last_message = response.rooms.join[room_id].timeline.events[-1].body
assert last_message == "Hello continuwuity!"
# Leave the room
response = await client.room_leave(room_id)
print("Matrix room leave response:", response)
assert isinstance(response, nio.RoomLeaveResponse)
# Close the client
await client.close()
if __name__ == "__main__":
asyncio.run(main())
'')
];
}; };
} };
]
)) testScript = ''
start_all()
with subtest("start continuwuity"):
continuwuity.wait_for_unit("continuwuity.service")
continuwuity.wait_for_open_port(6167)
with subtest("ensure messages can be exchanged"):
client.succeed("do_test >&2")
'';
};
}))
builtins.listToAttrs builtins.listToAttrs
]; ];
}; };
+2 -5
View File
@@ -703,13 +703,10 @@ pub struct Config {
pub allow_unstable_room_versions: bool, pub allow_unstable_room_versions: bool,
/// Default room version continuwuity will create rooms with. /// Default room version continuwuity will create rooms with.
/// Note that this has to be a string since the room version is a string
/// rather than an integer. Forgetting the quotes will make the server fail
/// to start!
/// ///
/// Per spec, room version "11" is the default. /// Per spec, room version 11 is the default.
/// ///
/// default: "11" /// default: 11
#[serde(default = "default_default_room_version")] #[serde(default = "default_default_room_version")]
pub default_room_version: RoomVersionId, pub default_room_version: RoomVersionId,