From 675cfb964a3dfa1aa3e47a43405f3ecb4506257b Mon Sep 17 00:00:00 2001 From: Logan Devine Date: Thu, 2 Apr 2026 18:57:26 -0700 Subject: [PATCH] feat: add support for MSC4439 PGP key URIs in wk-support This commit introduces support for MSC4439, Encryption Key URIs in `.well-known/matrix/support`. ([MSC](https://github.com/matrix-org/matrix-spec-proposals/pull/4439), [Rendered](https://github.com/thetayloredman/matrix-spec-proposals/blob/msc4439/proposals/4439-support-contact-encryption.md)) via an additional config option. --- Cargo.lock | 28 ++++++++++++++-------------- Cargo.toml | 5 +++-- changelog.d/1609.feature.md | 2 ++ conduwuit-example.toml | 8 ++++++++ src/api/client/well_known.rs | 3 +++ src/core/config/mod.rs | 7 +++++++ 6 files changed, 37 insertions(+), 16 deletions(-) create mode 100644 changelog.d/1609.feature.md diff --git a/Cargo.lock b/Cargo.lock index 80f3e0567..40972ab99 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1291,7 +1291,7 @@ dependencies = [ [[package]] name = "continuwuity-admin-api" version = "0.1.0" -source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=a97b91adcc012ef04991d823b8b5a79c6686ae48#a97b91adcc012ef04991d823b8b5a79c6686ae48" +source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=1415caf8a32af4d943580c5ea4e12be1974593c2#1415caf8a32af4d943580c5ea4e12be1974593c2" dependencies = [ "ruma-common", "serde", @@ -1726,7 +1726,7 @@ dependencies = [ [[package]] name = "draupnir-antispam" version = "0.1.0" -source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=a97b91adcc012ef04991d823b8b5a79c6686ae48#a97b91adcc012ef04991d823b8b5a79c6686ae48" +source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=1415caf8a32af4d943580c5ea4e12be1974593c2#1415caf8a32af4d943580c5ea4e12be1974593c2" dependencies = [ "ruma-common", "serde", @@ -3241,7 +3241,7 @@ dependencies = [ [[package]] name = "meowlnir-antispam" version = "0.1.0" -source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=a97b91adcc012ef04991d823b8b5a79c6686ae48#a97b91adcc012ef04991d823b8b5a79c6686ae48" +source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=1415caf8a32af4d943580c5ea4e12be1974593c2#1415caf8a32af4d943580c5ea4e12be1974593c2" dependencies = [ "ruma-common", "serde", @@ -4545,7 +4545,7 @@ dependencies = [ [[package]] name = "ruma" version = "0.10.1" -source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=a97b91adcc012ef04991d823b8b5a79c6686ae48#a97b91adcc012ef04991d823b8b5a79c6686ae48" +source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=1415caf8a32af4d943580c5ea4e12be1974593c2#1415caf8a32af4d943580c5ea4e12be1974593c2" dependencies = [ "assign", "continuwuity-admin-api", @@ -4568,7 +4568,7 @@ dependencies = [ [[package]] name = "ruma-appservice-api" version = "0.10.0" -source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=a97b91adcc012ef04991d823b8b5a79c6686ae48#a97b91adcc012ef04991d823b8b5a79c6686ae48" +source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=1415caf8a32af4d943580c5ea4e12be1974593c2#1415caf8a32af4d943580c5ea4e12be1974593c2" dependencies = [ "js_int", "ruma-common", @@ -4580,7 +4580,7 @@ dependencies = [ [[package]] name = "ruma-client-api" version = "0.18.0" -source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=a97b91adcc012ef04991d823b8b5a79c6686ae48#a97b91adcc012ef04991d823b8b5a79c6686ae48" +source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=1415caf8a32af4d943580c5ea4e12be1974593c2#1415caf8a32af4d943580c5ea4e12be1974593c2" dependencies = [ "as_variant", "assign", @@ -4603,7 +4603,7 @@ dependencies = [ [[package]] name = "ruma-common" version = "0.13.0" -source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=a97b91adcc012ef04991d823b8b5a79c6686ae48#a97b91adcc012ef04991d823b8b5a79c6686ae48" +source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=1415caf8a32af4d943580c5ea4e12be1974593c2#1415caf8a32af4d943580c5ea4e12be1974593c2" dependencies = [ "as_variant", "base64 0.22.1", @@ -4635,7 +4635,7 @@ dependencies = [ [[package]] name = "ruma-events" version = "0.28.1" -source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=a97b91adcc012ef04991d823b8b5a79c6686ae48#a97b91adcc012ef04991d823b8b5a79c6686ae48" +source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=1415caf8a32af4d943580c5ea4e12be1974593c2#1415caf8a32af4d943580c5ea4e12be1974593c2" dependencies = [ "as_variant", "indexmap", @@ -4660,7 +4660,7 @@ dependencies = [ [[package]] name = "ruma-federation-api" version = "0.9.0" -source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=a97b91adcc012ef04991d823b8b5a79c6686ae48#a97b91adcc012ef04991d823b8b5a79c6686ae48" +source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=1415caf8a32af4d943580c5ea4e12be1974593c2#1415caf8a32af4d943580c5ea4e12be1974593c2" dependencies = [ "bytes", "headers", @@ -4682,7 +4682,7 @@ dependencies = [ [[package]] name = "ruma-identifiers-validation" version = "0.9.5" -source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=a97b91adcc012ef04991d823b8b5a79c6686ae48#a97b91adcc012ef04991d823b8b5a79c6686ae48" +source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=1415caf8a32af4d943580c5ea4e12be1974593c2#1415caf8a32af4d943580c5ea4e12be1974593c2" dependencies = [ "js_int", "thiserror 2.0.18", @@ -4691,7 +4691,7 @@ dependencies = [ [[package]] name = "ruma-identity-service-api" version = "0.9.0" -source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=a97b91adcc012ef04991d823b8b5a79c6686ae48#a97b91adcc012ef04991d823b8b5a79c6686ae48" +source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=1415caf8a32af4d943580c5ea4e12be1974593c2#1415caf8a32af4d943580c5ea4e12be1974593c2" dependencies = [ "js_int", "ruma-common", @@ -4701,7 +4701,7 @@ dependencies = [ [[package]] name = "ruma-macros" version = "0.13.0" -source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=a97b91adcc012ef04991d823b8b5a79c6686ae48#a97b91adcc012ef04991d823b8b5a79c6686ae48" +source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=1415caf8a32af4d943580c5ea4e12be1974593c2#1415caf8a32af4d943580c5ea4e12be1974593c2" dependencies = [ "cfg-if", "proc-macro-crate", @@ -4716,7 +4716,7 @@ dependencies = [ [[package]] name = "ruma-push-gateway-api" version = "0.9.0" -source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=a97b91adcc012ef04991d823b8b5a79c6686ae48#a97b91adcc012ef04991d823b8b5a79c6686ae48" +source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=1415caf8a32af4d943580c5ea4e12be1974593c2#1415caf8a32af4d943580c5ea4e12be1974593c2" dependencies = [ "js_int", "ruma-common", @@ -4728,7 +4728,7 @@ dependencies = [ [[package]] name = "ruma-signatures" version = "0.15.0" -source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=a97b91adcc012ef04991d823b8b5a79c6686ae48#a97b91adcc012ef04991d823b8b5a79c6686ae48" +source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=1415caf8a32af4d943580c5ea4e12be1974593c2#1415caf8a32af4d943580c5ea4e12be1974593c2" dependencies = [ "base64 0.22.1", "ed25519-dalek", diff --git a/Cargo.toml b/Cargo.toml index 50e9c1cab..ead23d099 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -344,7 +344,7 @@ version = "0.1.2" [workspace.dependencies.ruma] git = "https://forgejo.ellis.link/continuwuation/ruwuma" #branch = "conduwuit-changes" -rev = "a97b91adcc012ef04991d823b8b5a79c6686ae48" +rev = "1415caf8a32af4d943580c5ea4e12be1974593c2" features = [ "compat", "rand", @@ -383,7 +383,8 @@ features = [ "unstable-pdu", "unstable-msc4155", "unstable-msc4143", # livekit well_known response - "unstable-msc4284" + "unstable-msc4284", + "unstable-msc4439", # pgp_key in .well_known/matrix/support ] [workspace.dependencies.rust-rocksdb] diff --git a/changelog.d/1609.feature.md b/changelog.d/1609.feature.md new file mode 100644 index 000000000..746be3090 --- /dev/null +++ b/changelog.d/1609.feature.md @@ -0,0 +1,2 @@ +Add new config option for [MSC4439](https://github.com/matrix-org/matrix-spec-proposals/pull/4439) +PGP key URIs. Contributed by LogN. diff --git a/conduwuit-example.toml b/conduwuit-example.toml index 984ed69f7..292256613 100644 --- a/conduwuit-example.toml +++ b/conduwuit-example.toml @@ -1869,6 +1869,14 @@ # #support_mxid = +# PGP key URI for server support contacts, to be served as part of the +# MSC1929 server support endpoint. This uses the unstable prefix from +# [MSC4439]. +# +# [MSC4439]: https://github.com/matrix-org/matrix-spec-proposals/pull/4439 +# +#support_pgp_key = + # **DEPRECATED**: Use `[global.matrix_rtc].foci` instead. # # A list of MatrixRTC foci URLs which will be served as part of the diff --git a/src/api/client/well_known.rs b/src/api/client/well_known.rs index 93babdf1a..85a4e5037 100644 --- a/src/api/client/well_known.rs +++ b/src/api/client/well_known.rs @@ -71,6 +71,7 @@ pub(crate) async fn well_known_support( let email_address = services.config.well_known.support_email.clone(); let matrix_id = services.config.well_known.support_mxid.clone(); + let pgp_key = services.config.well_known.support_pgp_key.clone(); // TODO: support defining multiple contacts in the config let mut contacts: Vec = vec![]; @@ -88,6 +89,7 @@ pub(crate) async fn well_known_support( role: role_value.clone(), email_address: email_address.clone(), matrix_id: matrix_id.clone(), + pgp_key: pgp_key.clone(), }); } @@ -104,6 +106,7 @@ pub(crate) async fn well_known_support( role: role_value.clone(), email_address: None, matrix_id: Some(user_id.to_owned()), + pgp_key: None, }); } } diff --git a/src/core/config/mod.rs b/src/core/config/mod.rs index d0e518037..decaa7716 100644 --- a/src/core/config/mod.rs +++ b/src/core/config/mod.rs @@ -2191,6 +2191,13 @@ pub struct WellKnownConfig { /// listed. pub support_mxid: Option, + /// PGP key URI for server support contacts, to be served as part of the + /// MSC1929 server support endpoint. This uses the unstable prefix from + /// [MSC4439]. + /// + /// [MSC4439]: https://github.com/matrix-org/matrix-spec-proposals/pull/4439 + pub support_pgp_key: Option, + /// **DEPRECATED**: Use `[global.matrix_rtc].foci` instead. /// /// A list of MatrixRTC foci URLs which will be served as part of the