Compare commits

...
Author SHA1 Message Date
Jade Ellis 38fb7897bb chore: Release 2026-11-10 23:23:41 +00:00
stratself ba0ea752a9 docs(generic): Recommend the MTRNord tester 2026-11-10 23:12:53 +00:00
stratself c7c54f880a docs(arch): Link to AUR/archlinuxcn instructions 2026-11-10 23:12:53 +00:00
stratself c65eb6de91 docs(push): Update some things (see commit comments)
* Make "gateway discovery" test from both client and server
* Add docker caveat to locally-hosted push components
* Edit a name to match author
2026-11-10 23:12:53 +00:00
stratself 596f269a90 docs(performance): Update trusted servers tuning info 2026-11-10 23:12:53 +00:00
stratself 49ebbcc63e fix(docs): Don't say "check Maintenance for Maintenance" 2026-11-10 23:12:53 +00:00
stratself 7241150204 docs(arch-linux): Add some wordings
Ideally want the installation commands here, but will leave for a future
commit
2026-11-10 23:12:53 +00:00
stratself c66a863bb2 docs(kubernetes): Small wording improvements and postinstall section 2026-11-10 23:12:53 +00:00
stratself 6dbe40238d docs(nixos): Beautify nix a bit
* Add well-known config example to nixfile
* Add postinstall redirect section
2026-11-10 23:12:53 +00:00
stratself 77bc7476f3 docs(auth): Reword registration defaults 2026-11-10 23:12:53 +00:00
stratself 94270e732c docs(livekit): Address review comments, add note for EC's dev mode 2026-11-10 23:00:08 +00:00
stratself 0bc55cb590 docs(livekit): Use "MatrixRTC" phrasing in lieu of "Element Call"
The calling protocol matters not the client product
2026-11-10 23:00:08 +00:00
stratself 0375643ade docs(livekit): Add stun_servers to TURN instructions too 2026-11-10 23:00:08 +00:00
stratself c67f08a208 docs(livekit): Add appendix sectionon creating livekit tokens via livekit-cli 2026-11-10 23:00:08 +00:00
stratself fb3113ea69 docs(livekit): Add appendix section on calling modes 2026-11-10 23:00:08 +00:00
stratself 6f6fba4310 docs(livekit): Pin token exchange flow link to jwt-svc 0.6.0 2026-11-10 23:00:08 +00:00
stratself 9ace03c107 docs(livekit): Add more relevant MSCs 2026-11-10 23:00:08 +00:00
stratself 304bf69c32 docs(livekit): Add LiveKit advertised IP addresses restrictions 2026-11-10 23:00:08 +00:00
stratself 2173577bac docs(livekit): Update Element Call UI errors 2026-11-10 23:00:08 +00:00
stratself bbf3bd1294 docs(calls): Small fixup of wordings
* Use indirect links and fix them
* Make Livekit's TURN configuration optional
2026-11-10 23:00:08 +00:00
stratself dd11fc5a25 docs(livekit): Remove workaround for non-federating servers
Fixed by #2326
2026-11-10 23:00:08 +00:00
stratself f1798c004a docs(calls): Redirect to support room 2026-11-10 23:00:08 +00:00
Erwan Leboucher b570420b9f fix: preserve predecessors sharing a state-before ID
Signed-off-by: Erwan Leboucher <erwanleboucher@gmail.com>
2026-11-10 23:56:33 +01:00
18 changed files with 534 additions and 84 deletions

No files matched your search

+70
View File
@@ -1,3 +1,73 @@
# Continuwuity v26.11.0-alpha.1 (2026-11-10)
## Features
- Added opt-in OpenTelemetry metrics, exported over OTLP or scraped by Prometheus from `/_continuwuity/metrics`, and a Grafana dashboard. Contributed by @eleboucher. (prometheus-metrics)
- Add support for using custom DNS servers instead of using /etc/resolv.conf. Contributed by @s1lv3r. ([#2056](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2056))
- Continuwuity now supports configuring additional trusted audience values for deployments using OIDC with an IDP that sends them. Contributed by @ginger ([#2226](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2226))
- "!admin users list" now hides deactivated users by default, but can display them with the optional "--show-deactivated" flag. "--hide-suspended" and "--hide-locked" have been added as well, which stop suspended and locked users from being displayed respectively. Contributed by @Clubs. ([#2292](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2292))
- Added support for [MSC4494: Membership-based invite blocking](https://github.com/matrix-org/matrix-spec-proposals/pull/4494) ([#2297](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2297))
- Appservices now receive typing indicators and read receipts. Contributed by @Jade ([#2327](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2327))
- Added support for [MSC4363](https://github.com/matrix-org/matrix-spec-proposals/pull/4363) (OAuth step-up authentication). Contributed by @ginger.
- Added support for [MSC4484](https://github.com/matrix-org/matrix-spec-proposals/pull/4484). Clients which use the built-in Matrix server administration APIs will need to ask for the appropriate scope when signing in with OAuth. Contributed by @ginger.
- Implemented unstable support for [MSC4560] (Stripped state requests over federation). Contributed by @ginger.
[MSC4560]: https://github.com/matrix-org/matrix-spec-proposals/pull/4560
- Profile banners are now treated as images when imported from OIDC claims, like avatars already were.
- The first-run version of the web UI now includes a link to the registration page. Contributed by @ginger
## Bugfixes
- Invitees are now added as room creators when creating a v12+ trusted private chat. Contributed by @ginger. ([#2162](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2162))
- Fixed push gateway URLs containing the configured notification path outside of their suffix. Contributed by @eleboucher. ([#2261](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2261))
- "!admin users change-email" now verifies a user exists before attempting to change their email. Contributed by @Clubs. ([#2298](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2298))
- Fixed URL preview image MIME types and rejected failed downloads. Contributed by @eleboucher. ([#2308](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2308))
- Correctly set RocksDB column options, including enabling block caches. Contributed by @Jade ([#2345](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2345))
- Fix some possible deadlocks/freezes and reduce lock contention (improving performance). Contributed by @Jade ([#2351](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2351))
- Once again fixed how room extremities are handled, fixing a problem that made continuwuity gradually make rooms needlessly complex, which also caused more frequent state resets. ([#2356](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2356))
- The OAuth identity reset page is no longer linked from the account management UI to reduce confusion. Contributed by @ginger. ([#2383](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2383))
- Fixed a worker panic when knocking on a room over federation. Contributed by @eleboucher. ([#2387](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2387))
- Perform more validation on events received during atomic gapfill from remote servers, fixing a panic if bad data was persisted by another server and later lazily fetched by us. ([#2400](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2400))
- Redirect URIs in OAuth clients' metadata are now properly validated to be on a subdomain of the OAuth issuer URL domain. Contributed by @ginger. ([#2421](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2421))
- Fix v12 rooms created by the same user in the same millisecond ending up as the same room. Contributed by @eleboucher. ([#2424](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2424))
- Client-server API endpoints are now properly ratelimited for unauthenticated requests. Contributed by @ginger. ([#2444](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2444))
- Setting a profile key longer than 255 bytes now returns 400 `M_KEY_TOO_LARGE` as required by the spec, instead of 413 `M_TOO_LARGE`. ([#2451](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2451))
- Setting `m.fully_read` via the account data endpoints now returns 405 `M_BAD_JSON` as required by the spec, instead of 400. ([#2451](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2451))
- Appservices masquerading as a device that does not exist now receive 400 `M_UNKNOWN_DEVICE` as required by the spec, instead of 403 `M_FORBIDDEN`. ([#2451](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2451))
- Setting profile data that would make the profile exceed 64 KiB now returns 400 `M_PROFILE_TOO_LARGE` as required by the spec, instead of a 500 error. ([#2451](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2451))
- The `m.forget_forced_upon_leave` capability now reflects the `forget_forced_upon_leave` config option instead of always being advertised as enabled. ([#2452](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2452))
- Fixed push notifications for membership events setting `user_is_target` based on the sender rather than the user being notified. ([#2454](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2454))
- Ensure HTTP clients actually follow the `dns_servers` config option. Contributed by @silversys ([#2460](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2460))
- Reworked event relations to follow the spec more closely. Pagination of `/relations` now returns the correct pages and `next_batch` tokens, recursive relations are returned in the right order without duplicates, and bundled `m.reference` aggregations now include every reference. Contributed by @Henry-Hiles (QuadRadical). ([#2465](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2465))
- Read receipts are now more spec compliant, will work better in threads and are less likely to end up causing loops with other software. Contributed by @Jade ([#2481](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2481))
- Fix gap filling skipping outlier events that are missing their previous events. Contributed by @eleboucher.
- Fix incoming federation events losing state changes when predecessors share the same state-before snapshot. Contributed by @eleboucher.
- Fix new devices sometimes never reaching other users' device lists. Contributed by @eleboucher.
- Fix state resolution applying events out of order, which could undo room joins. Contributed by @eleboucher.
- Fix to-device messages, including room keys, sometimes being lost before delivery. Contributed by @eleboucher.
- For deployments using OIDC with `profile_key_import_mode` set to `on_login`, users' avatars will no longer be clobbered if they didn't change their avatar since their last login.
- Room summary visibility checks are no longer incorrectly applied for remote rooms. Contributed by @ginger.
- The userinfo endpoint is now accessible even if federation is disabled, allowing LiveKit to be used on servers with federation disabled without using the server name whitelist.
- `!admin token issue` can no longer issue registration tokens when `allow_registration` is false. Contributed by @Clubs.
## Improved Documentation
- Add the Authentication section to document available auth methods for Continuwuity. The "delegated authentication" guide has also been migrated to here. Contributed by @stratself. ([#2234](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2234))
- Add a guide for push notifications, detailing how it works, push gateway specifics, troubleshooting common issues, and pointing to external guides for UnifiedPush backends. Contributed by @stratself ([#2244](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2244))
- The deploying page now includes vital general information about installing Continuwuity: release tracks, update steps, and post-installation recommendations. Contributed by @stratself ([#2252](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2252))
- Add some missing instructions on configuring Continuwuity on the RPM page. Users are encouraged to use the [generic deploying docs](https://continuwuity.org/deploying/generic) for the bulk of guidance anyhow. Contributed by @stratself ([#2275](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2275))
- Better, more succinct [introduction page](https://continuwuity.org/introduction.html). Contributed by @stratself ([#2279](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2279))
- Add a section on [troubleshooting Docker issues](https://continuwuity.org/troubleshooting#docker-issues). Contributed by @stratself. ([#2324](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2324))
- Instructions for Authelia added to the [OIDC guide](https://continuwuity.org/authentication/oidc.html). Contributed by @fhoekstra ([#2341](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2341))
- Docker compose examples now use bind mounts by default, instead of Docker volumes, as they are easier to work with esp. for backup/restore. Contributed by @stratself. ([#2353](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2353))
- The documentation now refers to the Continuwuity Docker service as `continuwuity` instead of `homeserver`.
## Misc
- Updated internal Sentry integration setup to the new pattern required by the SDK. #2423
- Upgraded rocksdb from 11.1.1 to 11.12.0 and jemalloc to 5.4.0.
# Continuwuity v26.9.1 (2026-09-28)
## Features
Generated
+14 -12
View File
@@ -865,7 +865,7 @@ dependencies = [
[[package]]
name = "conduwuit"
version = "26.9.1"
version = "26.11.0-alpha.1"
dependencies = [
"clap",
"conduwuit_build_metadata",
@@ -897,7 +897,7 @@ dependencies = [
[[package]]
name = "conduwuit_admin"
version = "26.9.1"
version = "26.11.0-alpha.1"
dependencies = [
"clap",
"conduwuit_api",
@@ -921,7 +921,7 @@ dependencies = [
[[package]]
name = "conduwuit_api"
version = "26.9.1"
version = "26.11.0-alpha.1"
dependencies = [
"axum",
"base64 0.23.1",
@@ -953,7 +953,7 @@ dependencies = [
[[package]]
name = "conduwuit_build_metadata"
version = "26.9.1"
version = "26.11.0-alpha.1"
dependencies = [
"built",
"cargo_metadata",
@@ -961,7 +961,7 @@ dependencies = [
[[package]]
name = "conduwuit_core"
version = "26.9.1"
version = "26.11.0-alpha.1"
dependencies = [
"argon2",
"arrayvec",
@@ -1031,7 +1031,7 @@ dependencies = [
[[package]]
name = "conduwuit_database"
version = "26.9.1"
version = "26.11.0-alpha.1"
dependencies = [
"async-channel",
"conduwuit_core",
@@ -1051,7 +1051,7 @@ dependencies = [
[[package]]
name = "conduwuit_macros"
version = "26.9.1"
version = "26.11.0-alpha.1"
dependencies = [
"itertools 0.15.0",
"proc-macro2",
@@ -1061,7 +1061,7 @@ dependencies = [
[[package]]
name = "conduwuit_router"
version = "26.9.1"
version = "26.11.0-alpha.1"
dependencies = [
"axum",
"axum-server",
@@ -1094,7 +1094,7 @@ dependencies = [
[[package]]
name = "conduwuit_service"
version = "26.9.1"
version = "26.11.0-alpha.1"
dependencies = [
"askama",
"assign",
@@ -1122,6 +1122,7 @@ dependencies = [
"lru-cache",
"nonzero_ext",
"openidconnect",
"opentelemetry",
"p256 0.14.0",
"rand 0.10.3",
"regex",
@@ -1130,6 +1131,7 @@ dependencies = [
"resolvematrix",
"ruma",
"ruminuwuity",
"rustls",
"rustyline-async",
"sd-notify",
"serde",
@@ -1148,7 +1150,7 @@ dependencies = [
[[package]]
name = "conduwuit_web"
version = "26.9.1"
version = "26.11.0-alpha.1"
dependencies = [
"askama",
"async-trait",
@@ -5165,7 +5167,7 @@ dependencies = [
[[package]]
name = "ruminuwuity"
version = "26.9.1"
version = "26.11.0-alpha.1"
dependencies = [
"assign",
"http",
@@ -7349,7 +7351,7 @@ dependencies = [
[[package]]
name = "xtask"
version = "26.9.1"
version = "26.11.0-alpha.1"
dependencies = [
"askama",
"cargo_metadata",
+1 -1
View File
@@ -12,7 +12,7 @@ license = "Apache-2.0"
# See also `rust-toolchain.toml`
readme = "README.md"
repository = "https://forgejo.ellis.link/continuwuation/continuwuity"
version = "26.9.1"
version = "26.11.0-alpha.1"
[workspace.metadata.crane]
name = "conduwuit"
@@ -0,0 +1 @@
Fix incoming federation events losing state changes when predecessors share the same state-before snapshot. Contributed by @eleboucher.
+3 -1
View File
@@ -4,7 +4,7 @@ Continuwuity comes with an internal database for user authentication, which it u
## Registration
Registration is disabled by default. To enable it, set `allow_registration = true` in your config file and use at least one of the registration methods below.
The following registration methods are available for Continuwuity:
| Method | Description | Additional configuration needed |
| ------ | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
@@ -19,6 +19,8 @@ Admin-issued tokens are the recommended registration method. These tokens are we
Other registration methods are meant for **untrusted, public registration**. Care must be taken when allowing these modes of operation.
If you wish to disable registration entirely, set `allow_registration = false` in your config file.
## Email configuration
Continuwuity can be configured to send emails via an SMTP relay of your choice. These are used for verifying user email addresses and sending password reset links to them.
+9 -5
View File
@@ -2,12 +2,16 @@
Matrix supports two types of calls:
- Element Call powered by [MatrixRTC](https://half-shot.github.io/msc-crafter/#msc/4143) and [LiveKit](https://github.com/livekit/livekit)
- Legacy calls, supported by a STUN/TURN server.
- [MatrixRTC][MSC4143] calls, powered by [LiveKit][livekit-server-github] and frontends such as [Element Call][element-call].
- Legacy 1-to-1 calls, supported by a STUN/TURN server.
Both types of calls are supported by different sets of clients, but most clients are moving towards MatrixRTC / Element Call.
[MSC4143]: https://github.com/matrix-org/matrix-spec-proposals/pull/4143
[element-call-github]: https://github.com/element-hq/element-call/
[livekit-server-github]: https://github.com/livekit/livekit
Both types of calls are supported by different sets of clients, but most clients are moving towards MatrixRTC.
For either one to work correctly, you have to do some additional setup:
- For legacy calls to work, you need to set up a TURN/STUN server. [Read the TURN guide for tips on how to set up coturn](./calls/turn.mdx)
- For MatrixRTC / Element Call to work, you have to set up the LiveKit backend. LiveKit also uses TURN/STUN to increase reliability - you can set up its built-in TURN server, or integrate with an existing one. [Read the LiveKit guide](./calls/livekit.mdx)
- For legacy calls to work, you need to set up a TURN/STUN server. [Read the TURN guide for instructions on how to set up coturn](./calls/turn.mdx)
- For MatrixRTC calls to work, you have to set up the LiveKit backend, and optionally configure a TURN server for increased reliability. [Read the LiveKit guide](./calls/livekit.mdx)
+86 -23
View File
@@ -1,13 +1,15 @@
import { Tab, Tabs} from '@rspress/core/theme';
import { Tab, Tabs } from '@rspress/core/theme';
# MatrixRTC/Element Call Setup
# MatrixRTC/LiveKit Setup
This guide assumes that you are using docker compose for deployment.
This guide assumes that you are using `docker compose` for deployment.
:::tip
You can find help setting up MatrixRTC in our dedicated room - [#matrixrtc:continuwuity.org](https://matrix.to/#/%23matrixrtc%3Acontinuwuity.org)
You can find help setting up MatrixRTC in our support room - [`#continuwuity:continuwuity.org`][support-room]
:::
[support-room]: https://matrix.to/#/%23continuwuity:continuwuity.org
## Instructions
### 1. Set up your domain
@@ -58,7 +60,9 @@ services:
- ./livekit.yaml:/etc/livekit.yaml:ro
network_mode: "host" # /!\ LiveKit binds to all addresses by default.
# Make sure port 7880 is blocked by your firewall to prevent access bypassing your reverse proxy
# Alternatively, uncomment the lines below and comment `network_mode: "host"` above to specify port mappings.
# Alternatively, uncomment the lines below and comment out `network_mode: "host"`
# above to use bridge networking and manually specify port mappings.
# ports:
# - "127.0.0.1:7880:7880/tcp"
# - "7881:7881/tcp"
@@ -218,7 +222,9 @@ Start up the services using your usual method - for example `docker compose up -
## Testing
To test that LiveKit is successfully integrated with Continuwuity, you will need to replicate its [Token Exchange Flow](https://github.com/element-hq/lk-jwt-service#%EF%B8%8F-how-it-works--token-exchange-flow). Follow the steps below while checking Docker logs (`docker compose logs --follow`), in order to help [troubleshooting](#troubleshooting) any issues.
To test that LiveKit is successfully integrated with Continuwuity, you will need to replicate its [Token Exchange Flow][token-exchange-flow]. Follow the steps below while checking Docker logs (`docker compose logs --follow`), in order to help [troubleshooting](#troubleshooting) any issues.
[token-exchange-flow]: https://github.com/element-hq/lk-jwt-service/tree/v0.6.0#%EF%B8%8F-how-it-works--token-exchange-flow
First, you will need an access token for your current login session. These can be found in your client's settings or obtained via [this website][starstruck-mxtoken2].
@@ -279,7 +285,7 @@ You can then send this payload to the lk-jwt-service:
curl -X POST -d @payload.json https://livekit.example.com/get_token
```
The lk-jwt-service will, after checking against Continuwuity, answer with a `jwt` token to create a LiveKit media room:
The lk-jwt-service will, after checking against Continuwuity, answer with a `jwt` token to [create a LiveKit media room](#livekit-cli):
```json
{"url":"wss://livekit.example.com","jwt":"a_really_really_long_string"}
@@ -293,13 +299,20 @@ Use this token to test at the [LiveKit Connection Tester][livekit-connection-tes
To debug any issues, you can place a call or redo the Testing instructions, and check the container logs for any specific errors. Use `docker compose logs --follow` to follow these logs in real-time.
Before debugging, ensure the following prerequisites:
- The user has permissions to send call events into the room. See the Appendix section on [call modes](#call-modes) for more details.
- WebRTC is enabled, if using a browser client.
### Common errors in Element Call UI
- `MISSING_MATRIX_RTC_FOCUS`/`MISSING_MATRIX_RTC_TRANSPORT`: LiveKit is missing from Continuwuity's config file
- "Waiting for media" popup always showing for yourself: a LiveKit URL has been configured in Continuwuity, but your client cannot connect to it for some reason
- `OPEN_ID_ERROR`: Your client can reach out to `lk-jwt-service`, but has problems authenticating with it. In this case, check `lk-jwt-service` logs for more details
- `MISSING_MATRIX_RTC_FOCUS`/`MISSING_MATRIX_RTC_TRANSPORT`: the client cannot find a suitable SFU. This is likely due to LiveKit being missing from Continuwuity's config file, and therefore not being exposed properly.
For browser-based clients, you can also inspect connections using DevTools' Networking tab, to see which requests are erroring out.
- `OPEN_ID_ERROR`: Your client can reach out to `lk-jwt-service`, but `lk-jwt-service` has problems authenticating you against Continuwuity. In this case, check `lk-jwt-service` logs for more details. The section below on [Docker loopback networking issues](#docker-loopback-networking-issues) may be of help.
- Calls fail to start with `ServerUnreachable` error: a LiveKit URL has been properly configured and exposed in Continuwuity, but the client cannot connect to it for some reason.
For browser-based clients, you can inspect connections using DevTools' Networking tab, to see which requests are erroring out. You may also want to toggle on Element Call's Developer tab via _Settings > Preferences > Developer mode_ \- various call details and advanced settings can be further tweaked there.
### Docker loopback networking issues
@@ -312,9 +325,9 @@ docker run --rm --net container:lk-jwt-service docker.io/curlimages/curl https:/
To resolve this, follow the steps in [Docker loopback networking issues](../troubleshooting.mdx#docker-loopback-networking-issues) of the Troubleshooting page.
### Incorrect IP address for LiveKit
### Incorrect IP addresses for LiveKit
By default, LiveKit automatically finds its public IP address(es), which can be seen in the "Establishing WebRTC connection" section of the connection test page. If these IPs are incorrect, you may want to hardcode your own IP by doing the following:
By default, LiveKit automatically finds its public IP address(es), which are reflected in the "Establishing WebRTC connection" section of the connection test page. If these IPs are incorrect, you may want to hardcode your own IP by doing the following:
```diff
### in your livekit.yaml ###
@@ -325,20 +338,21 @@ rtc:
+ node_ip: "1.2.3.4"
```
### Workaround for non-federating servers
Run the LiveKit tests again, and the new updated `node_ip` should be included as one of the candidates.
When deploying on servers with federation disabled (`allow_federation = false`), LiveKit will fail as it can't fetch the required [OpenID endpoint](https://spec.matrix.org/v1.17/server-server-api/#get_matrixfederationv1openiduserinfo) via federation paths.
You may further restrict the advertised address to only the `node_ip` with the following configurations:
As a workaround, you can enable federation, but forbid all remote servers via the following config parameters:
```toml
### in your continuwuity.toml file ###
allow_federation = true
forbidden_remote_server_names = [".*"]
```diff
### in your livekit.yaml ###
rtc:
# ... other configs here ...
+ enable_loopback_candidate: false
+ interfaces:
+ includes: []
+ ips:
+ includes: [ "1.2.3.4/32" ]
```
Subscribe to issue [!1440](https://forgejo.ellis.link/continuwuation/continuwuity/issues/1440) for future updates on this matter.
## Related Documentation
Guides:
@@ -359,9 +373,15 @@ Specifications:
- [MSC4143: MatrixRTC \- Real-time communication over Matrix][MSC4143]
- [MSC4195: MatrixRTC Transport using LiveKit Backend][MSC4195]
- [MSC3401: Native Group VoIP Signalling][MSC3401] - state events for legacy calls
- [MSC4075: MatrixRTC invites and notifications][MSC4075] - for ringing users
- [MSC4354: Sticky Events][MSC4354] - for MatrixRTC 2.0 calls
[MSC4143]: https://github.com/matrix-org/matrix-spec-proposals/pull/4143
[MSC4195]: https://github.com/matrix-org/matrix-spec-proposals/pull/4195
[MSC3401]: https://github.com/matrix-org/matrix-spec-proposals/pull/3401
[MSC4075]: https://github.com/matrix-org/matrix-spec-proposals/pull/4075
[MSC4354]: https://github.com/matrix-org/matrix-spec-proposals/pull/4354
Source code:
@@ -381,6 +401,47 @@ Other:
## Appendix
### MatrixRTC calling modes and enabling sticky events {#call-modes}
MatrixRTC currently supports 3 calling modes:
- **Legacy mode** (deprecated): calls are established by sending state events to a room. The call initiator's SFU hosts the entire call for all remote and local participants.
- **Compatibility mode*: same as Legacy mode, but utilizes multiple SFUs between federating servers. Clients publish media streams to their own SFUs, and fetch remote streams from remote SFUs. This is the most commonly used mode nowadays.
- **MatrixRTC 2.0 mode**: also utilizes multiple SFUs, but establishes calls with [sticky events] instead of state events.
To support Legacy and Compatibility mode, ensure that the user is allowed to send the relevant state events. Usually, this means promoting them to a power level of 50 or above. Alternatively, set the power level required to send `org.matrix.msc3401.call.member` events to 0.
To support MatrixRTC 2.0 mode, sticky events has to be enabled on the Matrix server. In Continuwuity, this is as easy as setting `enable_sticky_events = true` in the config file.
### Creating LiveKit tokens via `livekit-cli` {#livekit-cli}
To create room tokens directly without going through `lk-jwt-service`, use the [Livekit CLI tool][livekit-cli].
<Tabs groupId="livekit">
<Tab label="Bare Binary">
First, download the [release tarball][livekit-cli-releases] and extract it. Then:
```sh
./lk --url https://livekit.example.com \
--api-key APIUxUnMnSkuFWV \
--api-secret t93ZVjPeoEdyx7Wbet3kG4L3NGZIZVEFvqe0UuiVc22A \
token create --create --join
```
</Tab>
<Tab label="Docker">
```sh
docker run --rm docker.io/livekit/livekit-cli --url https://livekit.example.com \
--api-key APIUxUnMnSkuFWV \
--api-secret t93ZVjPeoEdyx7Wbet3kG4L3NGZIZVEFvqe0UuiVc22A \
token create --create --join
```
</Tab>
</Tabs>
[livekit-cli]: https://github.com/livekit/livekit-cli
[livekit-cli-releases]: https://github.com/livekit/livekit-cli
### Additional TURN-over-TLS on 443 configuration
Most of the time, LiveKit [**does not need TURN**][sspaeth-matrix-voip-turn] to function. However, there are situations where clients may be unable to use nonstandard ports or UDP connections, such as in highly restrictive networks. In such cases, a TURN-over-TLS server on port 443 could relay traffic for the clients.
@@ -487,6 +548,8 @@ Then configure LiveKit, making sure to replace `COTURN_SECRET` with the one you
### in your livekit.yaml ###
rtc:
# ... other configs here ...
stun_servers:
- coturn.example.com
turn_servers:
- host: coturn.example.com
port: 443
+4 -3
View File
@@ -1,16 +1,17 @@
# Setting up TURN/STUN
[TURN][turn] and [STUN][stun] are used as components in many calling systems. Matrix uses them directly for legacy calls and indirectly for MatrixRTC via Livekit.
[TURN][turn] and [STUN][stun] are used as components in many calling systems. Matrix uses them directly for legacy 1-to-1 calls and indirectly to assist MatrixRTC calls via Livekit.
Continuwuity recommends using [coturn][coturn] as your TURN/STUN server, which is available as a Docker image or a distro package. This guide assumes that you are using docker compose for deployment.
Continuwuity recommends using [coturn][coturn] as your TURN/STUN server, which is available as a Docker image or a distro package. This guide assumes that you are using `docker compose` for deployment.
:::tip
You can find help setting up TURN/STUN in our MatrixRTC room - [#matrixrtc:continuwuity.org](https://matrix.to/#/%23matrixrtc%3Acontinuwuity.org)
You can find help setting up TURN/STUN in our support room - [`#continuwuity:continuwuity.org`][support-room]
:::
[turn]: https://en.wikipedia.org/wiki/Traversal_Using_Relays_around_NAT
[stun]: https://en.wikipedia.org/wiki/STUN
[coturn]: https://github.com/coturn/coturn
[support-room]: https://matrix.to/#/%23continuwuity:continuwuity.org
## Installing coturn
+1 -1
View File
@@ -101,7 +101,7 @@ After Continuwuity is up and running, consider the following:
- See the [**Authentication chapter**](./authentication.mdx) for various ways to access to your homeserver, such as logging in with an external OIDC provider.
- Consult the [**Maintenance**](./maintenance.mdx) page for guidance on maintaining your homeserver.
- Consult the [**Maintenance**](./maintenance.mdx) page for guidance on backups, moderation, and other topics for homeserver management.
- If you want to set up an appservice, take a look at the [**Appservice Guide**](./appservices.mdx).
+8 -2
View File
@@ -2,10 +2,16 @@
Continuwuity is available in the [`archlinuxcn`][archlinuxcn] repository and AUR with the same package name, [`continuwuity`][aur-continuwuity].
The development version is available on the AUR as [`continuwuity-git`][aur-continuwuity-git].
For instructions on adding the archlinuxcn repo to your machine, see the [archlinuxcn README][archlinuxcn-readme] page. For AUR instructions, consult its [entry][aur-archwiki] on the Arch Wiki.
The development version, which tracks latest commits to the main branch, is also available on the AUR as [`continuwuity-git`][aur-continuwuity-git].
[archlinuxcn]: https://www.archlinuxcn.org/
[archlinuxcn-readme]: https://github.com/archlinuxcn/repo#usage
[aur-archwiki]: https://wiki.archlinux.org/title/Arch_User_Repository
[aur-continuwuity]: https://aur.archlinux.org/packages/continuwuity
[aur-continuwuity-git]: https://aur.archlinux.org/packages/continuwuity-git
Simply install the `continuwuity` package. Configure the service in `/etc/conduwuit/conduwuit.toml`, then enable and start the `continuwuity.service`.
Once you're done configuring your repos, simply install the `continuwuity` package with `pacman -S continuwuity`. Consult the [generic deployment instructions](./generic.mdx) for detailed steps, which involves editing `/etc/conduwuit/conduwuit.toml` and setting up a reverse proxy. Finally, enable and start the `continuwuity.service`.
After successfully setting up Continuwuity, navigate to [Post-installation](../deploying.mdx#post-installation) for next steps.
+2 -2
View File
@@ -246,8 +246,8 @@ to the `#admin:example.com` room and be able to [issue admin commands](../refere
To check if your server can communicate with other homeservers,
use an external testing tool:
- [Matrix Connectivity Tester](https://federationtester.mtrnord.blog/)
- [Matrix Federation Tester](https://federationtester.matrix.org/)
- [Matrix Connectivity Tester](https://federationtester.mtrnord.blog/) by MTRNord (recommended, with more tests).
- [Matrix Federation Tester](https://federationtester.matrix.org/) by f0x.
If you can register your account but cannot join federated rooms, check your configuration
and verify that your federation endpoints are opened and forwarded correctly.
+17 -9
View File
@@ -1,11 +1,11 @@
# Continuwuity for Kubernetes
Continuwuity doesn't support horizontal scalability or distributed loading
natively. However, a deployment in Kubernetes is very similar to the docker
setup. This is because Continuwuity can be fully configured using environment
variables. A sample StatefulSet is shared below. The only thing missing is
natively. However, a deployment in Kubernetes is very similar to the [docker setup](./docker.mdx).
This is because Continuwuity can be fully configured using environment
variables. A sample `StatefulSet` is shared below. The only thing missing is
a PVC definition (named `continuwuity-data`) for the volume mounted to
the StatefulSet, an Ingress resources to point your webserver to the
the `StatefulSet`, an Ingress resources to point your webserver to the
Continuwuity Pods, and a Service resource (targeting `app.kubernetes.io/name: continuwuity`)
to glue the Ingress and Pod together.
@@ -103,10 +103,18 @@ spec:
---
Apart from manually configuring the containers,
[a community-maintained Helm Chart is available here to run
conduwuit on Kubernetes](https://gitlab.cronce.io/charts/conduwuit)
## Community maintained Helm Chart
This should be compatible with Continuwuity, but you will need to change the image reference.
Apart from manually configuring the containers, you can consult
a community-maintained Helm Chart for the former `conduwuit` project,
which is available [here][community-helm-chart].
If changes need to be made, please reach out to the maintainer, as this is not maintained or controlled by the Continuwuity maintainers.
[community-helm-chart]: https://gitlab.cronce.io/charts/conduwuit
This should be compatible with Continuwuity, but you will need to switch the image reference.
If changes are needed to be made, please reach out to the maintainer of that repository, as it is not maintained nor controlled by the Continuwuity maintainers.
## Post-installation
After successfully setting up your Continuwuity, navigate to [Post-installation](../deploying.mdx#post-installation) for next steps.
+14 -1
View File
@@ -31,7 +31,14 @@ services.matrix-continuwuity = {
# address and port are handled automatically
# You can add any further configuration here, e.g.
# trusted_servers = [ "matrix.org" ];
# trusted_servers = [ "matrix.org" ];
## (if using well-known delegation)
# well_known = {
# client = "https://matrix.example.com";
# server = "matrix.example.com:443";
# }
};
};
};
@@ -79,3 +86,9 @@ client = "https://matrix.example.com"
You'll need to set up a reverse proxy (like NGINX or Caddy) to expose Continuwuity to the internet. You can configure your reverse proxy using NixOS options (e.g. `services.caddy`).
See the [reverse proxy setup guide](./generic.mdx#setting-up-the-reverse-proxy) for information on correct reverse proxy configuration.
Then, test that your setup works by following these [instructions](./generic.mdx#how-do-i-know-it-works).
## What's next?
Navigate to [Post-installation](../deploying.mdx#post-installation) for next steps.
+15 -19
View File
@@ -82,6 +82,21 @@ Consult these documents for more information on compression tuning and levels:
## Other tweaks
### Tuning your trusted servers
:::important Important: Vet your trusted servers!
Trusted servers are your first point of contact when obtaining public keys from the wider federated network. They could theoretically impersonate other servers and cause significant harm to your deployment. Please thoroughly verify your trusted servers' credibility before adding them to your configuration.
If you need suggestions for trusted servers, ask in the Continuwuity support room.
:::
For performance and reliability, it is recommended to set up 3 to 5 trusted servers for your deployment. Currently, these must all be Synapse servers.
```toml
# Example config, using maintainers' recommended homeservers
trusted_servers = ["codestorm.net","starstruck.systems","unredacted.org","matrix.org"]
```
### Using UNIX sockets
If your homeserver and reverse proxy live on the same machine, you may wish to expose Continuwuity on a UNIX socket instead of a port. This removes TCP overhead between the two programs.
@@ -111,25 +126,6 @@ https://matrix.example.com {
</details>
### Tuning your trusted servers
:::important Important: Vet your trusted servers!
Trusted servers are your first point of contact when obtaining public keys from other servers, and they could theoretically impersonate other servers and cause significant harm to your deployment. Please thoroughly verify your trusted servers' credibility before adding them to your configuration.
If you need suggestions for trusted servers, ask in the Continuwuity main room.
:::
Trusted servers are queried sequentially in the order they are listed. If you have multiple trusted servers configured, put the faster ones first:
```toml
# Example config, using maintainers' recommended homeservers
trusted_servers = ["codestorm.net","starstruck.systems","unredacted.org","matrix.org"]
```
Avoid prioritising `matrix.org` as your primary trusted server, as it tends to be quite slow.
Some users have also reported that increasing `trusted_server_batch_size` helps with faster joins for huge rooms. Start with doubling the default to `2048` until you find a suitable value.
### Enable HTTP/3 on your reverse proxy
Consider enabling the newer **HTTP/3** protocol for inbound connections to Continuwuity. In Caddy HTTP/3 is allowed by default, but you must expose port :443/**udp** on your firewall.
+6 -4
View File
@@ -78,9 +78,9 @@ To debug and test your UnifiedPush installation, use the [UP-Example] app for An
### UnifiedPush and push gateways
The push gateway URL is usually pre-configured by the client app. However, some clients (such as Element X) implement UnifiedPush's [Gateway Discovery] mechanism, and attempt to detect a push gateway _on the same domain as the push provider_, before falling back to a hardcoded one.
Normally, the push gateway URL is pre-configured by the client app. However, some clients (such as Element X) implement UnifiedPush's [Gateway Discovery] mechanism, and attempt to detect a push gateway _on the same domain as the push provider_ to use before falling back to a hardcoded one. Users of these clients can therefore self-host their own push gateway.
Per the [spec][spec-push-gateway-api], these push gateways must be available on the `/_matrix/push/v1/notify` path of said domain. To test that a push gateway is accessible to the homeserver, make a request for it from the homeserver's IP:
Per the [spec][spec-push-gateway-api], these push gateways must be available on the `/_matrix/push/v1/notify` path of said domain. To test that a push gateway is usable, make a request to it from both the homeserver and the client. The returned response should look like the following:
```txt
curl https://push.example.com/_matrix/push/v1/notify
@@ -122,7 +122,7 @@ Community tutorials for selfhosting some of these stacks are listed below. Unles
- Push gateway: [common-proxies]
- Push server: [ejabberd's mod_unified_push]
- Push app: [Conversations] (and forks)
- [Element X push notifications via Conversations][alfredolin-xmpp], by Alfredo Lin.
- [Element X push notifications via Conversations][alfredolin-xmpp], by Alfredolin.
- Push gateway: [common-proxies]
- Push server: [Prosody's mod_unified_push]
- Push app: [Conversations]
@@ -156,6 +156,8 @@ WARN conduwuit_service::pusher: Pusher URL is a forbidden remote address url=htt
To fix this, remove your push gateway or push server's address from `ip_range_denylist`, and restart Continuwuity to apply the changes.
Docker deployments with the push server/gateway on the same host as Continuwuity may run into some further network issues. In this case, consult the [Docker loopback networking issues] section and its workarounds.
### Push notifications not audible/not displaying
This is likely an issue with your account's _push rules_, which determines which events are shown to to the user as notifications. Check these push rules in the client's notifications settings and tweak accordingly. Continuwuity also provides an [`!admin users reset-push-rules`](../reference/admin/users#admin-users-reset-push-rules) command, which restores the rules to the default of notifying for every message.
@@ -175,7 +177,7 @@ If you find spurious log entries like this in your Continuwuity deployment:
WARN push{user_id="@user:example.com" pushkey="very-long-string-of-letters" events=1}:send_push_notice:send_notice:send_request: conduwuit_service::pusher: Could not send request to pusher https//push.example.com: error sending request for url (https://push.example.com/_matrix/push/v1/notify)
```
Then, your server is most likely sending push requests to too many invalid targets. This could be due to one of the following reasons:
Then, your server is sending push requests to too many invalid targets. This could be due to one of the following reasons:
#### Connection issues between the server and the push gateway
+4
View File
@@ -145,3 +145,7 @@ workspace = true
[package.metadata.cargo-shear]
ignored = ["reqwest_0_12"]
[dev-dependencies]
opentelemetry.workspace = true
rustls = { workspace = true, features = ["ring"] }
@@ -15,6 +15,9 @@ use ruma::{OwnedEventId, RoomId, room_version_rules::RoomVersionRules};
use crate::rooms::short::ShortStateHash;
#[cfg(test)]
mod tests;
impl super::Service {
/// Resolves the state before the incoming event.
///
@@ -124,7 +127,7 @@ impl super::Service {
.pdu_shortstatehash(prev_eventid)
.map_ok(move |sstatehash| (sstatehash, prev_event))
})
.try_collect::<HashMap<_, _>>()
.try_collect::<Vec<_>>()
.inspect_err(|e| debug_error!("failed to calculate N-degree short state hashes: {e}"))
.await
else {
@@ -0,0 +1,275 @@
use std::sync::Arc;
use conduwuit::{
Config, PduEvent, Server,
log::{Log, LogLevelReloadHandles},
metrics::Metrics,
};
use futures::StreamExt;
use ruma::{RoomId, RoomVersionId, events::StateEventType};
use serde_json::json;
#[tokio::test]
async fn admitted_joins_do_not_disappear_after_a_merge() {
use conduwuit::matrix::PartialPdu;
use ruma::{
UserId,
events::room::{
join_rules::{JoinRule, RoomJoinRulesEventContent},
member::{MembershipState, RoomMemberEventContent},
},
};
let (services, path) = test_services().await;
let alice = UserId::parse("@alice:test.example").unwrap();
let bob = UserId::parse("@bob:bob.example").unwrap();
let charlie = UserId::parse("@charlie:charlie.example").unwrap();
let dave = UserId::parse("@dave:dave.example").unwrap();
let mut remote_keys = Vec::new();
for user in [&bob, &charlie, &dave] {
let key = ruma::signatures::Ed25519KeyPair::from_der(
&ruma::signatures::Ed25519KeyPair::generate(),
"test".into(),
)
.unwrap();
cache_key(&services, user.server_name(), &key);
remote_keys.push(key);
}
let bootstrap = services
.rooms
.state
.mutex
.lock("!bootstrap:test.example")
.await;
let create_id = services
.rooms
.timeline
.build_and_append_pdu(
PartialPdu {
event_type: "m.room.create".into(),
content: serde_json::value::to_raw_value(&json!({ "room_version": "12" }))
.unwrap(),
state_key: Some("".into()),
..Default::default()
},
&alice,
None,
&bootstrap,
)
.await
.unwrap();
drop(bootstrap);
let room = RoomId::parse(create_id.as_str().replacen('$', "!", 1)).unwrap();
let lock = services.rooms.state.mutex.lock(&room).await;
services
.rooms
.timeline
.build_and_append_pdu(
PartialPdu::state(
alice.to_string(),
&RoomMemberEventContent::new(MembershipState::Join),
),
&alice,
Some(&room),
&lock,
)
.await
.unwrap();
let rules_id = services
.rooms
.timeline
.build_and_append_pdu(
PartialPdu::state("", &RoomJoinRulesEventContent::new(JoinRule::Public)),
&alice,
Some(&room),
&lock,
)
.await
.unwrap();
drop(lock);
let rules = services.rooms.timeline.get_pdu(&rules_id).await.unwrap();
let (dave_join, json) = signed_remote_event(
json!({
"room_id": room, "sender": dave, "type": "m.room.member", "state_key": dave,
"content": { "membership": "join" }, "auth_events": [rules_id], "prev_events": [rules_id],
"depth": rules.depth + ruma::uint!(1), "origin_server_ts": conduwuit::utils::millis_since_unix_epoch(),
}),
dave.server_name(),
&remote_keys[2],
);
assert!(
services
.rooms
.event_handler
.handle_incoming_pdu(dave.server_name(), &room, &dave_join.event_id, json, false)
.await
.unwrap()
.is_some()
);
let mut joins = Vec::new();
for (user, key) in [&bob, &charlie].into_iter().zip(&remote_keys) {
let signed = signed_remote_event(
json!({
"room_id": room, "sender": user, "type": "m.room.member", "state_key": user,
"content": { "membership": "join" }, "auth_events": [rules_id], "prev_events": [dave_join.event_id],
"depth": dave_join.depth + ruma::uint!(1), "origin_server_ts": conduwuit::utils::millis_since_unix_epoch(),
}),
user.server_name(),
key,
);
joins.push(signed);
}
for ((pdu, json), user) in joins.iter().zip([&bob, &charlie]) {
let accepted = services
.rooms
.event_handler
.handle_incoming_pdu(user.server_name(), &room, &pdu.event_id, json.clone(), false)
.await
.unwrap();
assert!(accepted.is_some());
}
let bob_hash = services
.rooms
.state_accessor
.pdu_shortstatehash(&joins[0].0.event_id)
.await
.unwrap();
let charlie_hash = services
.rooms
.state_accessor
.pdu_shortstatehash(&joins[1].0.event_id)
.await
.unwrap();
assert_eq!(bob_hash, charlie_hash);
let (merge, json) = signed_remote_event(
json!({
"room_id": room, "sender": dave, "type": "m.room.message",
"content": { "msgtype": "m.text", "body": "merge" },
"auth_events": [dave_join.event_id],
"prev_events": [joins[0].0.event_id, joins[1].0.event_id],
"depth": joins[0].0.depth + ruma::uint!(1),
"origin_server_ts": conduwuit::utils::millis_since_unix_epoch(),
}),
dave.server_name(),
&remote_keys[2],
);
assert!(
services
.rooms
.event_handler
.handle_incoming_pdu(dave.server_name(), &room, &merge.event_id, json, false)
.await
.unwrap()
.is_some()
);
let mut results = Vec::new();
for ((user, key), (join, _)) in [&bob, &charlie].into_iter().zip(&remote_keys).zip(&joins) {
let membership = services
.rooms
.state_accessor
.room_state_get_content::<RoomMemberEventContent>(
&room,
&StateEventType::RoomMember,
user.as_str(),
)
.await
.unwrap();
assert_eq!(membership.membership, MembershipState::Join);
let prev_events = services
.rooms
.state
.get_forward_extremities(&room)
.collect::<Vec<_>>()
.await;
let depth = services
.rooms
.timeline
.get_pdu(&prev_events[0])
.await
.unwrap()
.depth
+ ruma::uint!(1);
let (message, json) = signed_remote_event(
json!({
"room_id": room, "sender": user, "type": "m.room.message",
"content": { "msgtype": "m.text", "body": format!("message from {user}") },
"auth_events": [join.event_id], "prev_events": prev_events,
"depth": depth, "origin_server_ts": conduwuit::utils::millis_since_unix_epoch(),
}),
user.server_name(),
key,
);
let result = services
.rooms
.event_handler
.handle_incoming_pdu(user.server_name(), &room, &message.event_id, json, false)
.await;
results.push(result.is_ok_and(|pdu| pdu.is_some()));
}
services.stop().await;
drop(services);
std::fs::remove_dir_all(path).unwrap();
assert_eq!(results, [true, true], "both joined users must be able to send messages");
}
async fn test_services() -> (Arc<crate::Services>, std::path::PathBuf) {
let _ = rustls::crypto::ring::default_provider().install_default();
let path = std::env::temp_dir()
.join(format!("continuwuity-shared-state-{:016x}", rand::random::<u64>()));
std::fs::create_dir(&path).unwrap();
let config: Config = serde_json::from_value(json!({
"server_name": "test.example",
"database_path": path,
"db_cache_capacity_mb": 16.0,
"rocksdb_write_buffer_capacity_mb": 4.0,
"allow_local_presence": false
}))
.unwrap();
let runtime = tokio::runtime::Handle::current();
let server = Arc::new(Server::new(
config,
Some(runtime.clone()),
Log {
reload: LogLevelReloadHandles::default(),
capture: Arc::default(),
},
Metrics::new(Some(runtime), opentelemetry::global::meter("test"), None),
));
let services = crate::Services::build(server).await.unwrap();
(services, path)
}
fn cache_key(
services: &crate::Services,
server: &ruma::ServerName,
key: &ruma::signatures::Ed25519KeyPair,
) {
let mut response = ruma::api::federation::discovery::ServerSigningKeys::new(
server.to_owned(),
crate::server_keys::in_one_week(),
);
let id: ruma::OwnedServerSigningKeyId =
format!("ed25519:{}", key.version()).try_into().unwrap();
response.verify_keys.insert(
id.clone(),
ruma::api::federation::discovery::VerifyKey::new(ruma::serde::Base64::new(
key.public_key().to_vec(),
)),
);
services.db["servernamekeyid_response"]
.put((server.as_str(), id.as_str()), database::Json(&response));
}
fn signed_remote_event(
value: serde_json::Value,
server: &ruma::ServerName,
key: &ruma::signatures::Ed25519KeyPair,
) -> (PduEvent, ruma::CanonicalJsonObject) {
let rules = RoomVersionId::V12.rules().unwrap();
let mut value = serde_json::from_value(value).unwrap();
ruma::signatures::hash_and_sign_event(server.as_str(), key, &mut value, &rules.redaction)
.unwrap();
let id = conduwuit::matrix::event::gen_event_id(&value, &rules).unwrap();
let pdu = PduEvent::from_id_val(&id, value.clone()).unwrap();
(pdu, value)
}