From 5506997ca02b090c3fc6e23ea192c225b1b3c147 Mon Sep 17 00:00:00 2001 From: Chris W Jones Date: Wed, 11 Feb 2026 23:28:54 -0500 Subject: [PATCH] feat: Add config option for livekit This adds a new config option under `global.well_known` for livekit server URLs. It also updates the well_known client API endpoint to return this list. Closes #1355 --- conduwuit-example.toml | 13 +++++++++++++ src/api/client/well_known.rs | 1 + src/core/config/mod.rs | 18 +++++++++++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/conduwuit-example.toml b/conduwuit-example.toml index 5aaed400..963d9847 100644 --- a/conduwuit-example.toml +++ b/conduwuit-example.toml @@ -1820,6 +1820,19 @@ # #support_mxid = +# A list of MatrixRTC foci URLs which will be served as part of the +# MSC4143 client endpoint at /.well-known/matrix/client. If you're +# setting up livekit, you'd want something like: +# rtc_focus_server_urls = [ +# { type = "livekit", server_url = "https://livekit.example.com" }, +# ] +# +# To disable, set this to be an empty vector (`[]`). +# +# Defaults to: [] +# +#rtc_focus_server_urls = + [global.blurhashing] # blurhashing x component, 4 is recommended by https://blurha.sh/ diff --git a/src/api/client/well_known.rs b/src/api/client/well_known.rs index ea76b2a4..95bf7c05 100644 --- a/src/api/client/well_known.rs +++ b/src/api/client/well_known.rs @@ -27,6 +27,7 @@ pub(crate) async fn well_known_client( identity_server: None, sliding_sync_proxy: Some(SlidingSyncProxyInfo { url: client_url }), tile_server: None, + rtc_foci: services.config.well_known.rtc_focus_server_urls.clone(), }) } diff --git a/src/core/config/mod.rs b/src/core/config/mod.rs index 13cde3cb..6e052843 100644 --- a/src/core/config/mod.rs +++ b/src/core/config/mod.rs @@ -19,7 +19,7 @@ pub use figment::{Figment, value::Value as FigmentValue}; use regex::RegexSet; use ruma::{ OwnedRoomId, OwnedRoomOrAliasId, OwnedServerName, OwnedUserId, RoomVersionId, - api::client::discovery::discover_support::ContactRole, + api::client::discovery::{discover_homeserver::RtcFocusInfo, discover_support::ContactRole}, }; use serde::{Deserialize, de::IgnoredAny}; use url::Url; @@ -2111,6 +2111,19 @@ pub struct WellKnownConfig { /// If no email or mxid is specified, all of the server's admins will be /// listed. pub support_mxid: Option, + + /// A list of MatrixRTC foci URLs which will be served as part of the + /// MSC4143 client endpoint at /.well-known/matrix/client. If you're + /// setting up livekit, you'd want something like: + /// rtc_focus_server_urls = [ + /// { type = "livekit", server_url = "https://livekit.example.com" }, + /// ] + /// + /// To disable, set this to be an empty vector (`[]`). + /// + /// Defaults to: [] + #[serde(default = "default_rtc_focus_urls")] + pub rtc_focus_server_urls: Vec, } #[derive(Clone, Copy, Debug, Deserialize, Default)] @@ -2608,6 +2621,9 @@ fn default_rocksdb_stats_level() -> u8 { 1 } #[inline] pub fn default_default_room_version() -> RoomVersionId { RoomVersionId::V11 } +#[must_use] +pub fn default_rtc_focus_urls() -> Vec { vec![] } + fn default_ip_range_denylist() -> Vec { vec![ "127.0.0.0/8".to_owned(),