mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2244eca578 | |||
| 9ceaecbaab | |||
| 1c7dcec592 | |||
| 60dd6baffd | |||
| 99a10998b4 | |||
| 05c6b5df75 | |||
| 74db426c6b | |||
| 344d68dabc | |||
| d3ee9c407a | |||
| da956b1a2a | |||
| 244bf6ed2f | |||
| 52a51f1de0 | |||
| 6e118f445b | |||
| e3cf288f39 | |||
| 6e6c9ae4cb | |||
| 5a2a1b6240 | |||
| fb536ca1ce | |||
| d22d47954f | |||
| d48cc46643 | |||
| 8cf2d175d6 | |||
| 205ac22008 |
@@ -1,3 +1,28 @@
|
|||||||
|
# Continuwuity 0.5.2 (2026-01-09)
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Added support for issuing additional registration tokens, stored in the database, which supplement the existing registration token hardcoded in the config file. These tokens may optionally expire after a certain number of uses or after a certain amount of time has passed. Additionally, the `registration_token_file` configuration option is superseded by this feature and **has been removed**. Use the new `!admin token` command family to manage registration tokens. Contributed by @ginger (#783).
|
||||||
|
- Implemented a configuration defined admin list independent of the admin room. Contributed by @Terryiscool160. (#1253)
|
||||||
|
- Added support for invite and join anti-spam via Draupnir and Meowlnir, similar to that of synapse-http-antispam. Contributed by @nex. (#1263)
|
||||||
|
- Implemented account locking functionality, to complement user suspension. Contributed by @nex. (#1266)
|
||||||
|
- Added admin command to forcefully log out all of a user's existing sessions. Contributed by @nex. (#1271)
|
||||||
|
- Implemented toggling the ability for an account to log in without mutating any of its data. Contributed by @nex. (#1272)
|
||||||
|
- Add support for custom room create event timestamps, to allow generating custom prefixes in hashed room IDs. Contributed by @nex. (#1277)
|
||||||
|
- Certain potentially dangerous admin commands are now restricted to only be usable in the admin room and server console. Contributed by @ginger.
|
||||||
|
|
||||||
|
## Bugfixes
|
||||||
|
|
||||||
|
- Fixed unreliable room summary fetching and improved error messages. Contributed by @nex. (#1257)
|
||||||
|
- Client requested timeout parameter is now applied to e2ee key lookups and claims. Related federation requests are now also concurrent. Contributed by @nex. (#1261)
|
||||||
|
- Fixed the whoami endpoint returning HTTP 404 instead of HTTP 403, which confused some appservices. Contributed by @nex. (#1276)
|
||||||
|
|
||||||
|
## Misc
|
||||||
|
|
||||||
|
- The `console` feature is now enabled by default, allowing the server console to be used for running admin commands directly. To automatically open the console on startup, set the `admin_console_automatic` config option to `true`. Contributed by @ginger.
|
||||||
|
- We now (finally) document our container image mirrors. Contributed by @Jade
|
||||||
|
|
||||||
|
|
||||||
# Continuwuity 0.5.0 (2025-12-30)
|
# Continuwuity 0.5.0 (2025-12-30)
|
||||||
|
|
||||||
**This release contains a CRITICAL vulnerability patch, and you must update as soon as possible**
|
**This release contains a CRITICAL vulnerability patch, and you must update as soon as possible**
|
||||||
|
|||||||
Generated
+25
-25
@@ -940,7 +940,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "conduwuit"
|
name = "conduwuit"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"conduwuit_admin",
|
"conduwuit_admin",
|
||||||
@@ -972,7 +972,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "conduwuit_admin"
|
name = "conduwuit_admin"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"conduwuit_api",
|
"conduwuit_api",
|
||||||
@@ -994,7 +994,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "conduwuit_api"
|
name = "conduwuit_api"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"axum 0.7.9",
|
"axum 0.7.9",
|
||||||
@@ -1027,14 +1027,14 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "conduwuit_build_metadata"
|
name = "conduwuit_build_metadata"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"built",
|
"built",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "conduwuit_core"
|
name = "conduwuit_core"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"argon2",
|
"argon2",
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
@@ -1095,7 +1095,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "conduwuit_database"
|
name = "conduwuit_database"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-channel",
|
"async-channel",
|
||||||
"conduwuit_core",
|
"conduwuit_core",
|
||||||
@@ -1114,7 +1114,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "conduwuit_macros"
|
name = "conduwuit_macros"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itertools 0.14.0",
|
"itertools 0.14.0",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
@@ -1124,7 +1124,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "conduwuit_router"
|
name = "conduwuit_router"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum 0.7.9",
|
"axum 0.7.9",
|
||||||
"axum-client-ip",
|
"axum-client-ip",
|
||||||
@@ -1159,7 +1159,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "conduwuit_service"
|
name = "conduwuit_service"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
@@ -1200,7 +1200,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "conduwuit_web"
|
name = "conduwuit_web"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"askama",
|
"askama",
|
||||||
"axum 0.7.9",
|
"axum 0.7.9",
|
||||||
@@ -1635,7 +1635,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "draupnir-antispam"
|
name = "draupnir-antispam"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=79abd5d331bca596b7f37e367a9f2cebccd9f64d#79abd5d331bca596b7f37e367a9f2cebccd9f64d"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=f9e74cb206cfa45cf5f17d39282253b43a15fcd5#f9e74cb206cfa45cf5f17d39282253b43a15fcd5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ruma-common",
|
"ruma-common",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -2995,7 +2995,7 @@ checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "meowlnir-antispam"
|
name = "meowlnir-antispam"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=79abd5d331bca596b7f37e367a9f2cebccd9f64d#79abd5d331bca596b7f37e367a9f2cebccd9f64d"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=f9e74cb206cfa45cf5f17d39282253b43a15fcd5#f9e74cb206cfa45cf5f17d39282253b43a15fcd5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ruma-common",
|
"ruma-common",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -4085,7 +4085,7 @@ checksum = "88f8660c1ff60292143c98d08fc6e2f654d722db50410e3f3797d40baaf9d8f3"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma"
|
name = "ruma"
|
||||||
version = "0.10.1"
|
version = "0.10.1"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=79abd5d331bca596b7f37e367a9f2cebccd9f64d#79abd5d331bca596b7f37e367a9f2cebccd9f64d"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=f9e74cb206cfa45cf5f17d39282253b43a15fcd5#f9e74cb206cfa45cf5f17d39282253b43a15fcd5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"assign",
|
"assign",
|
||||||
"draupnir-antispam",
|
"draupnir-antispam",
|
||||||
@@ -4107,7 +4107,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-appservice-api"
|
name = "ruma-appservice-api"
|
||||||
version = "0.10.0"
|
version = "0.10.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=79abd5d331bca596b7f37e367a9f2cebccd9f64d#79abd5d331bca596b7f37e367a9f2cebccd9f64d"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=f9e74cb206cfa45cf5f17d39282253b43a15fcd5#f9e74cb206cfa45cf5f17d39282253b43a15fcd5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"ruma-common",
|
"ruma-common",
|
||||||
@@ -4119,7 +4119,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-client-api"
|
name = "ruma-client-api"
|
||||||
version = "0.18.0"
|
version = "0.18.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=79abd5d331bca596b7f37e367a9f2cebccd9f64d#79abd5d331bca596b7f37e367a9f2cebccd9f64d"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=f9e74cb206cfa45cf5f17d39282253b43a15fcd5#f9e74cb206cfa45cf5f17d39282253b43a15fcd5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"as_variant",
|
"as_variant",
|
||||||
"assign",
|
"assign",
|
||||||
@@ -4142,7 +4142,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-common"
|
name = "ruma-common"
|
||||||
version = "0.13.0"
|
version = "0.13.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=79abd5d331bca596b7f37e367a9f2cebccd9f64d#79abd5d331bca596b7f37e367a9f2cebccd9f64d"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=f9e74cb206cfa45cf5f17d39282253b43a15fcd5#f9e74cb206cfa45cf5f17d39282253b43a15fcd5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"as_variant",
|
"as_variant",
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
@@ -4174,7 +4174,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-events"
|
name = "ruma-events"
|
||||||
version = "0.28.1"
|
version = "0.28.1"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=79abd5d331bca596b7f37e367a9f2cebccd9f64d#79abd5d331bca596b7f37e367a9f2cebccd9f64d"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=f9e74cb206cfa45cf5f17d39282253b43a15fcd5#f9e74cb206cfa45cf5f17d39282253b43a15fcd5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"as_variant",
|
"as_variant",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
@@ -4199,7 +4199,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-federation-api"
|
name = "ruma-federation-api"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=79abd5d331bca596b7f37e367a9f2cebccd9f64d#79abd5d331bca596b7f37e367a9f2cebccd9f64d"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=f9e74cb206cfa45cf5f17d39282253b43a15fcd5#f9e74cb206cfa45cf5f17d39282253b43a15fcd5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"headers",
|
"headers",
|
||||||
@@ -4221,7 +4221,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-identifiers-validation"
|
name = "ruma-identifiers-validation"
|
||||||
version = "0.9.5"
|
version = "0.9.5"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=79abd5d331bca596b7f37e367a9f2cebccd9f64d#79abd5d331bca596b7f37e367a9f2cebccd9f64d"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=f9e74cb206cfa45cf5f17d39282253b43a15fcd5#f9e74cb206cfa45cf5f17d39282253b43a15fcd5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"thiserror 2.0.17",
|
"thiserror 2.0.17",
|
||||||
@@ -4230,7 +4230,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-identity-service-api"
|
name = "ruma-identity-service-api"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=79abd5d331bca596b7f37e367a9f2cebccd9f64d#79abd5d331bca596b7f37e367a9f2cebccd9f64d"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=f9e74cb206cfa45cf5f17d39282253b43a15fcd5#f9e74cb206cfa45cf5f17d39282253b43a15fcd5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"ruma-common",
|
"ruma-common",
|
||||||
@@ -4240,7 +4240,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-macros"
|
name = "ruma-macros"
|
||||||
version = "0.13.0"
|
version = "0.13.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=79abd5d331bca596b7f37e367a9f2cebccd9f64d#79abd5d331bca596b7f37e367a9f2cebccd9f64d"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=f9e74cb206cfa45cf5f17d39282253b43a15fcd5#f9e74cb206cfa45cf5f17d39282253b43a15fcd5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"proc-macro-crate",
|
"proc-macro-crate",
|
||||||
@@ -4255,7 +4255,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-push-gateway-api"
|
name = "ruma-push-gateway-api"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=79abd5d331bca596b7f37e367a9f2cebccd9f64d#79abd5d331bca596b7f37e367a9f2cebccd9f64d"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=f9e74cb206cfa45cf5f17d39282253b43a15fcd5#f9e74cb206cfa45cf5f17d39282253b43a15fcd5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"ruma-common",
|
"ruma-common",
|
||||||
@@ -4267,7 +4267,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-signatures"
|
name = "ruma-signatures"
|
||||||
version = "0.15.0"
|
version = "0.15.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=79abd5d331bca596b7f37e367a9f2cebccd9f64d#79abd5d331bca596b7f37e367a9f2cebccd9f64d"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=f9e74cb206cfa45cf5f17d39282253b43a15fcd5#f9e74cb206cfa45cf5f17d39282253b43a15fcd5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"ed25519-dalek",
|
"ed25519-dalek",
|
||||||
@@ -6228,7 +6228,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "xtask"
|
name = "xtask"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -6237,7 +6237,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "xtask-generate-commands"
|
name = "xtask-generate-commands"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap-markdown",
|
"clap-markdown",
|
||||||
"clap_builder",
|
"clap_builder",
|
||||||
|
|||||||
+6
-13
@@ -1,27 +1,18 @@
|
|||||||
#cargo-features = ["profile-rustflags"]
|
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
members = ["src/*", "xtask/*"]
|
members = ["src/*", "xtask/*"]
|
||||||
default-members = ["src/*"]
|
default-members = ["src/*"]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
authors = [
|
authors = ["Continuwuity Team and contributors <team@continuwuity.org>"]
|
||||||
"June Clementine Strawberry <june@girlboss.ceo>",
|
description = "A Matrix homeserver written in Rust, the official continuation of the conduwuit homeserver."
|
||||||
"strawberry <strawberry@puppygock.gay>", # woof
|
|
||||||
"Jason Volk <jason@zemos.net>",
|
|
||||||
]
|
|
||||||
categories = ["network-programming"]
|
|
||||||
description = "a very cool Matrix chat homeserver written in Rust"
|
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
homepage = "https://continuwuity.org/"
|
homepage = "https://continuwuity.org/"
|
||||||
keywords = ["chat", "matrix", "networking", "server", "uwu"]
|
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
# See also `rust-toolchain.toml`
|
# See also `rust-toolchain.toml`
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
repository = "https://forgejo.ellis.link/continuwuation/continuwuity"
|
repository = "https://forgejo.ellis.link/continuwuation/continuwuity"
|
||||||
rust-version = "1.86.0"
|
version = "0.5.2"
|
||||||
version = "0.5.1"
|
|
||||||
|
|
||||||
[workspace.metadata.crane]
|
[workspace.metadata.crane]
|
||||||
name = "conduwuit"
|
name = "conduwuit"
|
||||||
@@ -351,7 +342,7 @@ version = "0.1.2"
|
|||||||
# Used for matrix spec type definitions and helpers
|
# Used for matrix spec type definitions and helpers
|
||||||
[workspace.dependencies.ruma]
|
[workspace.dependencies.ruma]
|
||||||
git = "https://forgejo.ellis.link/continuwuation/ruwuma"
|
git = "https://forgejo.ellis.link/continuwuation/ruwuma"
|
||||||
rev = "79abd5d331bca596b7f37e367a9f2cebccd9f64d"
|
rev = "f9e74cb206cfa45cf5f17d39282253b43a15fcd5"
|
||||||
features = [
|
features = [
|
||||||
"compat",
|
"compat",
|
||||||
"rand",
|
"rand",
|
||||||
@@ -848,6 +839,8 @@ unknown_lints = "allow"
|
|||||||
|
|
||||||
###################
|
###################
|
||||||
cargo = { level = "warn", priority = -1 }
|
cargo = { level = "warn", priority = -1 }
|
||||||
|
# Nobody except for us should be consuming these crates, they don't need metadata
|
||||||
|
cargo_common_metadata = { level = "allow" }
|
||||||
|
|
||||||
## some sadness
|
## some sadness
|
||||||
multiple_crate_versions = { level = "allow", priority = 1 }
|
multiple_crate_versions = { level = "allow", priority = 1 }
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
The `console` feature is now enabled by default, allowing the server console to be used for running admin commands directly.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Certain potentially dangerous admin commands are now restricted to only be usable in the admin room and server console.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Implemented a configuration defined admin list independent of the admin room. (@Terryiscool160).
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fixed unreliable room summary fetching and improved error messages. Contributed by @nex.
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Client requested timeout parameter is now applied to e2ee key lookups and claims. Related federation requests are now
|
|
||||||
also concurrent. Contributed by @nex.
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Added support for invite and join anti-spam via Draupnir and Meowlnir, similar to that of synapse-http-antispam.
|
|
||||||
Contributed by @nex.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Implemented account locking functionality, to complement user suspension. Contributed by @nex.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Added admin command to forcefully log out all of a user's existing sessions. Contributed by @nex.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Implemented toggling the ability for an account to log in without mutating any of its data. Contributed by @nex.
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Improve timeout-related code for federation and URL previews. Contributed by @Jade
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Improve the display of nested configuration with the `!admin server show-config` command. Contributed by @Jade
|
||||||
@@ -1 +0,0 @@
|
|||||||
Added support for issuing additional registration tokens, stored in the database, which supplement the existing registration token hardcoded in the config file. These tokens may optionally expire after a certain number of uses or after a certain amount of time has passed. Additionally, the `registration_token_file` configuration option is superseded by this feature and **has been removed**.
|
|
||||||
+19
-6
@@ -340,7 +340,9 @@
|
|||||||
# this to be high to account for extremely large room joins, slow
|
# this to be high to account for extremely large room joins, slow
|
||||||
# homeservers, your own resources etc.
|
# homeservers, your own resources etc.
|
||||||
#
|
#
|
||||||
#federation_timeout = 300
|
# Joins have 6x the timeout.
|
||||||
|
#
|
||||||
|
#federation_timeout = 60
|
||||||
|
|
||||||
# MSC4284 Policy server request timeout (seconds). Generally policy
|
# MSC4284 Policy server request timeout (seconds). Generally policy
|
||||||
# servers should respond near instantly, however may slow down under
|
# servers should respond near instantly, however may slow down under
|
||||||
@@ -389,7 +391,15 @@
|
|||||||
#
|
#
|
||||||
#appservice_idle_timeout = 300
|
#appservice_idle_timeout = 300
|
||||||
|
|
||||||
# Notification gateway pusher idle connection pool timeout.
|
# Notification gateway pusher request connection timeout (seconds).
|
||||||
|
#
|
||||||
|
#pusher_conn_timeout = 15
|
||||||
|
|
||||||
|
# Notification gateway pusher total request timeout (seconds).
|
||||||
|
#
|
||||||
|
#pusher_timeout = 60
|
||||||
|
|
||||||
|
# Notification gateway pusher idle connection pool timeout (seconds).
|
||||||
#
|
#
|
||||||
#pusher_idle_timeout = 15
|
#pusher_idle_timeout = 15
|
||||||
|
|
||||||
@@ -1446,6 +1456,11 @@
|
|||||||
#
|
#
|
||||||
#url_preview_max_spider_size = 256000
|
#url_preview_max_spider_size = 256000
|
||||||
|
|
||||||
|
# Total request timeout for URL previews (seconds). This includes
|
||||||
|
# connection, request, and response body reading time.
|
||||||
|
#
|
||||||
|
#url_preview_timeout = 120
|
||||||
|
|
||||||
# Option to decide whether you would like to run the domain allowlist
|
# Option to decide whether you would like to run the domain allowlist
|
||||||
# checks (contains and explicit) on the root domain or not. Does not apply
|
# checks (contains and explicit) on the root domain or not. Does not apply
|
||||||
# to URL contains allowlist. Defaults to false.
|
# to URL contains allowlist. Defaults to false.
|
||||||
@@ -1744,10 +1759,6 @@
|
|||||||
#
|
#
|
||||||
#config_reload_signal = true
|
#config_reload_signal = true
|
||||||
|
|
||||||
# This item is undocumented. Please contribute documentation for it.
|
|
||||||
#
|
|
||||||
#ldap = false
|
|
||||||
|
|
||||||
[global.tls]
|
[global.tls]
|
||||||
|
|
||||||
# Path to a valid TLS certificate file.
|
# Path to a valid TLS certificate file.
|
||||||
@@ -1915,6 +1926,8 @@
|
|||||||
#
|
#
|
||||||
#admin_filter = ""
|
#admin_filter = ""
|
||||||
|
|
||||||
|
[global.antispam]
|
||||||
|
|
||||||
[global.antispam.meowlnir]
|
[global.antispam.meowlnir]
|
||||||
|
|
||||||
# The base URL on which to contact Meowlnir (before /_meowlnir/antispam).
|
# The base URL on which to contact Meowlnir (before /_meowlnir/antispam).
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -13,8 +13,8 @@ OCI images for Continuwuity are available in the registries listed below.
|
|||||||
| --------------- | --------------------------------------------------------------- | -----------------------|
|
| --------------- | --------------------------------------------------------------- | -----------------------|
|
||||||
| Forgejo Registry| [forgejo.ellis.link/continuwuation/continuwuity:latest](https://forgejo.ellis.link/continuwuation/-/packages/container/continuwuity/latest) | Latest tagged image. |
|
| Forgejo Registry| [forgejo.ellis.link/continuwuation/continuwuity:latest](https://forgejo.ellis.link/continuwuation/-/packages/container/continuwuity/latest) | Latest tagged image. |
|
||||||
| Forgejo Registry| [forgejo.ellis.link/continuwuation/continuwuity:main](https://forgejo.ellis.link/continuwuation/-/packages/container/continuwuity/main) | Main branch image. |
|
| Forgejo Registry| [forgejo.ellis.link/continuwuation/continuwuity:main](https://forgejo.ellis.link/continuwuation/-/packages/container/continuwuity/main) | Main branch image. |
|
||||||
| Forgejo Registry| [forgejo.ellis.link/continuwuation/continuwuity:latest-maxperf](https://forgejo.ellis.link/continuwuation/-/packages/container/continuwuity/latest-maxperf) | Performance optimised version. |
|
| Forgejo Registry| [forgejo.ellis.link/continuwuation/continuwuity:latest-maxperf](https://forgejo.ellis.link/continuwuation/-/packages/container/continuwuity/latest-maxperf) | [Performance optimised version.](./generic.mdx#performance-optimised-builds) |
|
||||||
| Forgejo Registry| [forgejo.ellis.link/continuwuation/continuwuity:main-maxperf](https://forgejo.ellis.link/continuwuation/-/packages/container/continuwuity/main-maxperf) | Performance optimised version. |
|
| Forgejo Registry| [forgejo.ellis.link/continuwuation/continuwuity:main-maxperf](https://forgejo.ellis.link/continuwuation/-/packages/container/continuwuity/main-maxperf) | [Performance optimised version.](./generic.mdx#performance-optimised-builds) |
|
||||||
|
|
||||||
Use
|
Use
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ This document contains the help content for the `continuwuity` command-line prog
|
|||||||
|
|
||||||
## `continuwuity`
|
## `continuwuity`
|
||||||
|
|
||||||
a very cool Matrix chat homeserver written in Rust
|
A Matrix homeserver written in Rust, the official continuation of the conduwuit homeserver.
|
||||||
|
|
||||||
**Usage:** `continuwuity [OPTIONS]`
|
**Usage:** `continuwuity [OPTIONS]`
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
Name: continuwuity
|
Name: continuwuity
|
||||||
Version: {{{ git_repo_version }}}
|
Version: {{{ git_repo_version }}}
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: Very cool Matrix chat homeserver written in Rust
|
Summary: A Matrix homeserver written in Rust.
|
||||||
|
|
||||||
License: Apache-2.0 AND MIT
|
License: Apache-2.0 AND MIT
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ Requires: glibc
|
|||||||
Requires: libstdc++
|
Requires: libstdc++
|
||||||
|
|
||||||
%global _description %{expand:
|
%global _description %{expand:
|
||||||
A cool hard fork of Conduit, a Matrix homeserver written in Rust}
|
A Matrix homeserver written in Rust, the official continuation of the conduwuit homeserver.}
|
||||||
|
|
||||||
%description %{_description}
|
%description %{_description}
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,8 @@
|
|||||||
tag-message = "chore: Release v{{version}}"
|
tag-message = "chore: Release v{{version}}"
|
||||||
|
tag-prefix = ""
|
||||||
|
shared-version = true
|
||||||
|
|
||||||
|
publish = false
|
||||||
|
|
||||||
|
sign-commit = true
|
||||||
|
sign-tag = true
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "conduwuit_admin"
|
name = "conduwuit_admin"
|
||||||
categories.workspace = true
|
|
||||||
description.workspace = true
|
description.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
keywords.workspace = true
|
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
readme.workspace = true
|
readme.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "conduwuit_api"
|
name = "conduwuit_api"
|
||||||
categories.workspace = true
|
|
||||||
description.workspace = true
|
description.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
keywords.workspace = true
|
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
readme.workspace = true
|
readme.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -724,7 +724,7 @@ pub(crate) async fn change_password_route(
|
|||||||
Ok(change_password::v3::Response {})
|
Ok(change_password::v3::Response {})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// # `GET _matrix/client/r0/account/whoami`
|
/// # `GET /_matrix/client/v3/account/whoami`
|
||||||
///
|
///
|
||||||
/// Get `user_id` of the sender user.
|
/// Get `user_id` of the sender user.
|
||||||
///
|
///
|
||||||
@@ -733,11 +733,17 @@ pub(crate) async fn whoami_route(
|
|||||||
State(services): State<crate::State>,
|
State(services): State<crate::State>,
|
||||||
body: Ruma<whoami::v3::Request>,
|
body: Ruma<whoami::v3::Request>,
|
||||||
) -> Result<whoami::v3::Response> {
|
) -> Result<whoami::v3::Response> {
|
||||||
|
let is_guest = services
|
||||||
|
.users
|
||||||
|
.is_deactivated(body.sender_user())
|
||||||
|
.await
|
||||||
|
.map_err(|_| {
|
||||||
|
err!(Request(Forbidden("Application service has not registered this user.")))
|
||||||
|
})? && body.appservice_info.is_none();
|
||||||
Ok(whoami::v3::Response {
|
Ok(whoami::v3::Response {
|
||||||
user_id: body.sender_user().to_owned(),
|
user_id: body.sender_user().to_owned(),
|
||||||
device_id: body.sender_device.clone(),
|
device_id: body.sender_device.clone(),
|
||||||
is_guest: services.users.is_deactivated(body.sender_user()).await?
|
is_guest,
|
||||||
&& body.appservice_info.is_none(),
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ use conduwuit::{
|
|||||||
};
|
};
|
||||||
use futures::FutureExt;
|
use futures::FutureExt;
|
||||||
use ruma::{
|
use ruma::{
|
||||||
OwnedServerName, RoomId, UserId,
|
RoomId, UserId,
|
||||||
api::{client::membership::invite_user, federation::membership::create_invite},
|
api::{client::membership::invite_user, federation::membership::create_invite},
|
||||||
events::{
|
events::{
|
||||||
invite_permission_config::FilterLevel,
|
invite_permission_config::FilterLevel,
|
||||||
@@ -203,19 +203,10 @@ pub(crate) async fn invite_helper(
|
|||||||
))));
|
))));
|
||||||
}
|
}
|
||||||
|
|
||||||
let origin: OwnedServerName = serde_json::from_value(serde_json::to_value(
|
|
||||||
value
|
|
||||||
.get("origin")
|
|
||||||
.ok_or_else(|| err!(Request(BadJson("Event missing origin field."))))?,
|
|
||||||
)?)
|
|
||||||
.map_err(|e| {
|
|
||||||
err!(Request(BadJson(warn!("Origin field in event is not a valid server name: {e}"))))
|
|
||||||
})?;
|
|
||||||
|
|
||||||
let pdu_id = services
|
let pdu_id = services
|
||||||
.rooms
|
.rooms
|
||||||
.event_handler
|
.event_handler
|
||||||
.handle_incoming_pdu(&origin, room_id, &event_id, value, true)
|
.handle_incoming_pdu(recipient_user.server_name(), room_id, &event_id, value, true)
|
||||||
.boxed()
|
.boxed()
|
||||||
.await?
|
.await?
|
||||||
.ok_or_else(|| {
|
.ok_or_else(|| {
|
||||||
|
|||||||
@@ -238,6 +238,7 @@ pub(crate) async fn create_room_route(
|
|||||||
event_type: TimelineEventType::RoomCreate,
|
event_type: TimelineEventType::RoomCreate,
|
||||||
content: to_raw_value(&create_content)?,
|
content: to_raw_value(&create_content)?,
|
||||||
state_key: Some(StateKey::new()),
|
state_key: Some(StateKey::new()),
|
||||||
|
timestamp: body.origin_server_ts,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
sender_user,
|
sender_user,
|
||||||
@@ -256,6 +257,14 @@ pub(crate) async fn create_room_route(
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
drop(state_lock);
|
drop(state_lock);
|
||||||
|
if let Some(expected_room_id) = body.room_id.as_ref() {
|
||||||
|
if expected_room_id.as_str() != room_id.as_str() {
|
||||||
|
return Err!(Request(InvalidParam(
|
||||||
|
"Custom room ID {expected_room_id} does not match the generated room ID \
|
||||||
|
{room_id}.",
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
}
|
||||||
debug!("Room created with ID {room_id}");
|
debug!("Room created with ID {room_id}");
|
||||||
let state_lock = services.rooms.state.mutex.lock(&room_id).await;
|
let state_lock = services.rooms.state.mutex.lock(&room_id).await;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "conduwuit_build_metadata"
|
name = "conduwuit_build_metadata"
|
||||||
categories.workspace = true
|
|
||||||
description.workspace = true
|
description.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
keywords.workspace = true
|
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
readme.workspace = true
|
readme.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "conduwuit_core"
|
name = "conduwuit_core"
|
||||||
categories.workspace = true
|
|
||||||
description.workspace = true
|
description.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
keywords.workspace = true
|
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
readme.workspace = true
|
readme.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
+41
-9
@@ -53,8 +53,7 @@ use crate::{Result, err, error::Error, utils::sys};
|
|||||||
### For more information, see:
|
### For more information, see:
|
||||||
### https://continuwuity.org/configuration.html
|
### https://continuwuity.org/configuration.html
|
||||||
"#,
|
"#,
|
||||||
ignore = "config_paths catchall well_known tls blurhashing \
|
ignore = "config_paths catchall"
|
||||||
allow_invalid_tls_certificates_yes_i_know_what_the_fuck_i_am_doing_with_this_and_i_know_this_is_insecure antispam"
|
|
||||||
)]
|
)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
// Paths to config file(s). Not supposed to be set manually in the config file,
|
// Paths to config file(s). Not supposed to be set manually in the config file,
|
||||||
@@ -105,7 +104,7 @@ pub struct Config {
|
|||||||
#[serde(default = "default_port")]
|
#[serde(default = "default_port")]
|
||||||
port: ListeningPort,
|
port: ListeningPort,
|
||||||
|
|
||||||
// external structure; separate section
|
/// display: nested
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub tls: TlsConfig,
|
pub tls: TlsConfig,
|
||||||
|
|
||||||
@@ -435,7 +434,9 @@ pub struct Config {
|
|||||||
/// this to be high to account for extremely large room joins, slow
|
/// this to be high to account for extremely large room joins, slow
|
||||||
/// homeservers, your own resources etc.
|
/// homeservers, your own resources etc.
|
||||||
///
|
///
|
||||||
/// default: 300
|
/// Joins have 6x the timeout.
|
||||||
|
///
|
||||||
|
/// default: 60
|
||||||
#[serde(default = "default_federation_timeout")]
|
#[serde(default = "default_federation_timeout")]
|
||||||
pub federation_timeout: u64,
|
pub federation_timeout: u64,
|
||||||
|
|
||||||
@@ -501,7 +502,19 @@ pub struct Config {
|
|||||||
#[serde(default = "default_appservice_idle_timeout")]
|
#[serde(default = "default_appservice_idle_timeout")]
|
||||||
pub appservice_idle_timeout: u64,
|
pub appservice_idle_timeout: u64,
|
||||||
|
|
||||||
/// Notification gateway pusher idle connection pool timeout.
|
/// Notification gateway pusher request connection timeout (seconds).
|
||||||
|
///
|
||||||
|
/// default: 15
|
||||||
|
#[serde(default = "default_pusher_conn_timeout")]
|
||||||
|
pub pusher_conn_timeout: u64,
|
||||||
|
|
||||||
|
/// Notification gateway pusher total request timeout (seconds).
|
||||||
|
///
|
||||||
|
/// default: 60
|
||||||
|
#[serde(default = "default_pusher_timeout")]
|
||||||
|
pub pusher_timeout: u64,
|
||||||
|
|
||||||
|
/// Notification gateway pusher idle connection pool timeout (seconds).
|
||||||
///
|
///
|
||||||
/// default: 15
|
/// default: 15
|
||||||
#[serde(default = "default_pusher_idle_timeout")]
|
#[serde(default = "default_pusher_idle_timeout")]
|
||||||
@@ -710,7 +723,7 @@ pub struct Config {
|
|||||||
#[serde(default = "default_default_room_version")]
|
#[serde(default = "default_default_room_version")]
|
||||||
pub default_room_version: RoomVersionId,
|
pub default_room_version: RoomVersionId,
|
||||||
|
|
||||||
// external structure; separate section
|
/// display: nested
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub well_known: WellKnownConfig,
|
pub well_known: WellKnownConfig,
|
||||||
|
|
||||||
@@ -1663,6 +1676,13 @@ pub struct Config {
|
|||||||
#[serde(default = "default_url_preview_max_spider_size")]
|
#[serde(default = "default_url_preview_max_spider_size")]
|
||||||
pub url_preview_max_spider_size: usize,
|
pub url_preview_max_spider_size: usize,
|
||||||
|
|
||||||
|
/// Total request timeout for URL previews (seconds). This includes
|
||||||
|
/// connection, request, and response body reading time.
|
||||||
|
///
|
||||||
|
/// default: 120
|
||||||
|
#[serde(default = "default_url_preview_timeout")]
|
||||||
|
pub url_preview_timeout: u64,
|
||||||
|
|
||||||
/// Option to decide whether you would like to run the domain allowlist
|
/// Option to decide whether you would like to run the domain allowlist
|
||||||
/// checks (contains and explicit) on the root domain or not. Does not apply
|
/// checks (contains and explicit) on the root domain or not. Does not apply
|
||||||
/// to URL contains allowlist. Defaults to false.
|
/// to URL contains allowlist. Defaults to false.
|
||||||
@@ -2009,19 +2029,22 @@ pub struct Config {
|
|||||||
/// etc. This is a hidden argument that should NOT be used in production as
|
/// etc. This is a hidden argument that should NOT be used in production as
|
||||||
/// it is highly insecure and I will personally yell at you if I catch you
|
/// it is highly insecure and I will personally yell at you if I catch you
|
||||||
/// using this.
|
/// using this.
|
||||||
|
///
|
||||||
|
/// display: hidden
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub allow_invalid_tls_certificates_yes_i_know_what_the_fuck_i_am_doing_with_this_and_i_know_this_is_insecure:
|
pub allow_invalid_tls_certificates_yes_i_know_what_the_fuck_i_am_doing_with_this_and_i_know_this_is_insecure:
|
||||||
bool,
|
bool,
|
||||||
|
|
||||||
// external structure; separate section
|
/// display: nested
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub ldap: LdapConfig,
|
pub ldap: LdapConfig,
|
||||||
|
|
||||||
/// Configuration for antispam support
|
/// Configuration for antispam support
|
||||||
|
/// display: nested
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub antispam: Option<Antispam>,
|
pub antispam: Option<Antispam>,
|
||||||
|
|
||||||
// external structure; separate section
|
/// display: nested
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub blurhashing: BlurhashConfig,
|
pub blurhashing: BlurhashConfig,
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
@@ -2238,8 +2261,11 @@ struct ListeningAddr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize)]
|
#[derive(Clone, Debug, Deserialize)]
|
||||||
|
#[config_example_generator(filename = "conduwuit-example.toml", section = "global.antispam")]
|
||||||
pub struct Antispam {
|
pub struct Antispam {
|
||||||
|
/// display: nested
|
||||||
pub meowlnir: Option<MeowlnirConfig>,
|
pub meowlnir: Option<MeowlnirConfig>,
|
||||||
|
/// display: nested
|
||||||
pub draupnir: Option<DraupnirConfig>,
|
pub draupnir: Option<DraupnirConfig>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2455,7 +2481,7 @@ fn default_well_known_timeout() -> u64 { 10 }
|
|||||||
|
|
||||||
fn default_federation_conn_timeout() -> u64 { 10 }
|
fn default_federation_conn_timeout() -> u64 { 10 }
|
||||||
|
|
||||||
fn default_federation_timeout() -> u64 { 25 }
|
fn default_federation_timeout() -> u64 { 60 }
|
||||||
|
|
||||||
fn default_policy_server_request_timeout() -> u64 { 10 }
|
fn default_policy_server_request_timeout() -> u64 { 10 }
|
||||||
|
|
||||||
@@ -2473,6 +2499,10 @@ fn default_appservice_timeout() -> u64 { 35 }
|
|||||||
|
|
||||||
fn default_appservice_idle_timeout() -> u64 { 300 }
|
fn default_appservice_idle_timeout() -> u64 { 300 }
|
||||||
|
|
||||||
|
fn default_pusher_conn_timeout() -> u64 { 15 }
|
||||||
|
|
||||||
|
fn default_pusher_timeout() -> u64 { 60 }
|
||||||
|
|
||||||
fn default_pusher_idle_timeout() -> u64 { 15 }
|
fn default_pusher_idle_timeout() -> u64 { 15 }
|
||||||
|
|
||||||
fn default_max_fetch_prev_events() -> u16 { 192_u16 }
|
fn default_max_fetch_prev_events() -> u16 { 192_u16 }
|
||||||
@@ -2600,6 +2630,8 @@ fn default_url_preview_max_spider_size() -> usize {
|
|||||||
256_000 // 256KB
|
256_000 // 256KB
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn default_url_preview_timeout() -> u64 { 120 }
|
||||||
|
|
||||||
fn default_new_user_displayname_suffix() -> String { "🏳️⚧️".to_owned() }
|
fn default_new_user_displayname_suffix() -> String { "🏳️⚧️".to_owned() }
|
||||||
|
|
||||||
fn default_sentry_endpoint() -> Option<Url> { None }
|
fn default_sentry_endpoint() -> Option<Url> { None }
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "conduwuit_database"
|
name = "conduwuit_database"
|
||||||
categories.workspace = true
|
|
||||||
description.workspace = true
|
description.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
keywords.workspace = true
|
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
readme.workspace = true
|
readme.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "conduwuit_macros"
|
name = "conduwuit_macros"
|
||||||
categories.workspace = true
|
|
||||||
description.workspace = true
|
description.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
keywords.workspace = true
|
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
readme.workspace = true
|
readme.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
+69
-35
@@ -78,6 +78,8 @@ fn generate_example(input: &ItemStruct, args: &[Meta], write: bool) -> Result<To
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mut summary: Vec<TokenStream2> = Vec::new();
|
let mut summary: Vec<TokenStream2> = Vec::new();
|
||||||
|
let mut nested_displays: Vec<TokenStream2> = Vec::new();
|
||||||
|
|
||||||
if let Fields::Named(FieldsNamed { named, .. }) = &input.fields {
|
if let Fields::Named(FieldsNamed { named, .. }) = &input.fields {
|
||||||
for field in named {
|
for field in named {
|
||||||
let Some(ident) = &field.ident else {
|
let Some(ident) = &field.ident else {
|
||||||
@@ -92,35 +94,6 @@ fn generate_example(input: &ItemStruct, args: &[Meta], write: bool) -> Result<To
|
|||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
let doc = get_doc_comment(field)
|
|
||||||
.unwrap_or_else(|| undocumented.into())
|
|
||||||
.trim_end()
|
|
||||||
.to_owned();
|
|
||||||
|
|
||||||
let doc = if doc.ends_with('#') {
|
|
||||||
format!("{doc}\n")
|
|
||||||
} else {
|
|
||||||
format!("{doc}\n#\n")
|
|
||||||
};
|
|
||||||
|
|
||||||
let default = get_doc_comment_line(field, "default")
|
|
||||||
.or_else(|| get_default(field))
|
|
||||||
.unwrap_or_default();
|
|
||||||
|
|
||||||
let default = if !default.is_empty() {
|
|
||||||
format!(" {default}")
|
|
||||||
} else {
|
|
||||||
default
|
|
||||||
};
|
|
||||||
|
|
||||||
if let Some(file) = file.as_mut() {
|
|
||||||
file.write_fmt(format_args!("\n{doc}"))
|
|
||||||
.expect("written to config file");
|
|
||||||
|
|
||||||
file.write_fmt(format_args!("#{ident} ={default}\n"))
|
|
||||||
.expect("written to config file");
|
|
||||||
}
|
|
||||||
|
|
||||||
let display = get_doc_comment_line(field, "display");
|
let display = get_doc_comment_line(field, "display");
|
||||||
let display_directive = |key| {
|
let display_directive = |key| {
|
||||||
display
|
display
|
||||||
@@ -129,17 +102,77 @@ fn generate_example(input: &ItemStruct, args: &[Meta], write: bool) -> Result<To
|
|||||||
.flat_map(|display| display.split(' '))
|
.flat_map(|display| display.split(' '))
|
||||||
.any(|directive| directive == key)
|
.any(|directive| directive == key)
|
||||||
};
|
};
|
||||||
|
let is_nested = display_directive("nested");
|
||||||
|
let is_hidden = display_directive("hidden");
|
||||||
|
|
||||||
if !display_directive("hidden") {
|
// Only generate config file entries for non-nested, visible types
|
||||||
let value = if display_directive("sensitive") {
|
if !is_nested && !is_hidden {
|
||||||
quote! { "***********" }
|
let doc = get_doc_comment(field)
|
||||||
|
.unwrap_or_else(|| undocumented.into())
|
||||||
|
.trim_end()
|
||||||
|
.to_owned();
|
||||||
|
|
||||||
|
let doc = if doc.ends_with('#') {
|
||||||
|
format!("{doc}\n")
|
||||||
} else {
|
} else {
|
||||||
quote! { format_args!("{:?}", self.#ident) }
|
format!("{doc}\n#\n")
|
||||||
};
|
};
|
||||||
|
|
||||||
let name = ident.to_string();
|
let default = get_doc_comment_line(field, "default")
|
||||||
|
.or_else(|| get_default(field))
|
||||||
|
.unwrap_or_default();
|
||||||
|
|
||||||
|
let default = if !default.is_empty() {
|
||||||
|
format!(" {default}")
|
||||||
|
} else {
|
||||||
|
default
|
||||||
|
};
|
||||||
|
|
||||||
|
if let Some(file) = file.as_mut() {
|
||||||
|
file.write_fmt(format_args!("\n{doc}"))
|
||||||
|
.expect("written to config file");
|
||||||
|
|
||||||
|
file.write_fmt(format_args!("#{ident} ={default}\n"))
|
||||||
|
.expect("written to config file");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generate Display implementation for all fields
|
||||||
|
let name = ident.to_string();
|
||||||
|
|
||||||
|
if display_directive("sensitive") {
|
||||||
summary.push(quote! {
|
summary.push(quote! {
|
||||||
writeln!(out, "| {} | {} |", #name, #value)?;
|
writeln!(out, "| {} | {} |", #name, "***********")?;
|
||||||
|
});
|
||||||
|
} else if is_nested {
|
||||||
|
let is_option = matches!(type_name.as_str(), "Option");
|
||||||
|
if is_option {
|
||||||
|
summary.push(quote! {
|
||||||
|
writeln!(out, "| {} | {} |", #name,
|
||||||
|
if self.#ident.is_some() { "[configured]" } else { "None" })?;
|
||||||
|
});
|
||||||
|
|
||||||
|
nested_displays.push(quote! {
|
||||||
|
if let Some(nested) = &self.#ident {
|
||||||
|
writeln!(out)?;
|
||||||
|
writeln!(out, "## {}", #name)?;
|
||||||
|
write!(out, "{}", nested)?;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
summary.push(quote! {
|
||||||
|
writeln!(out, "| {} | [configured] |", #name)?;
|
||||||
|
});
|
||||||
|
|
||||||
|
nested_displays.push(quote! {
|
||||||
|
writeln!(out)?;
|
||||||
|
writeln!(out, "## {}", #name)?;
|
||||||
|
write!(out, "{}", &self.#ident)?;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
summary.push(quote! {
|
||||||
|
writeln!(out, "| {} | {:?} |", #name, self.#ident)?;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -159,6 +192,7 @@ fn generate_example(input: &ItemStruct, args: &[Meta], write: bool) -> Result<To
|
|||||||
writeln!(out, "| name | value |")?;
|
writeln!(out, "| name | value |")?;
|
||||||
writeln!(out, "| :--- | :--- |")?;
|
writeln!(out, "| :--- | :--- |")?;
|
||||||
#( #summary )*
|
#( #summary )*
|
||||||
|
#( #nested_displays )*
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-6
@@ -2,15 +2,12 @@
|
|||||||
name = "conduwuit"
|
name = "conduwuit"
|
||||||
default-run = "conduwuit"
|
default-run = "conduwuit"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
categories.workspace = true
|
|
||||||
description.workspace = true
|
description.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
keywords.workspace = true
|
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
readme.workspace = true
|
readme.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
rust-version.workspace = true
|
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
metadata.crane.workspace = true
|
metadata.crane.workspace = true
|
||||||
|
|
||||||
@@ -23,14 +20,13 @@ crate-type = [
|
|||||||
|
|
||||||
[package.metadata.deb]
|
[package.metadata.deb]
|
||||||
name = "continuwuity"
|
name = "continuwuity"
|
||||||
maintainer = "continuwuity developers <contact@continuwuity.org>"
|
maintainer = "Continuwuity Team and contributors <team@continuwuity.org>"
|
||||||
copyright = "2024, continuwuity developers"
|
|
||||||
license-file = ["../../LICENSE", "3"]
|
license-file = ["../../LICENSE", "3"]
|
||||||
depends = "$auto, ca-certificates"
|
depends = "$auto, ca-certificates"
|
||||||
breaks = ["conduwuit (<<0.5.0)"]
|
breaks = ["conduwuit (<<0.5.0)"]
|
||||||
replaces = ["conduwuit (<<0.5.0)"]
|
replaces = ["conduwuit (<<0.5.0)"]
|
||||||
extended-description = """\
|
extended-description = """\
|
||||||
a cool hard fork of Conduit, a Matrix homeserver written in Rust"""
|
A Matrix homeserver written in Rust, the official continuation of the conduwuit homeserver."""
|
||||||
section = "net"
|
section = "net"
|
||||||
priority = "optional"
|
priority = "optional"
|
||||||
conf-files = ["/etc/conduwuit/conduwuit.toml"]
|
conf-files = ["/etc/conduwuit/conduwuit.toml"]
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "conduwuit_router"
|
name = "conduwuit_router"
|
||||||
categories.workspace = true
|
|
||||||
description.workspace = true
|
description.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
keywords.workspace = true
|
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
readme.workspace = true
|
readme.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "conduwuit_service"
|
name = "conduwuit_service"
|
||||||
categories.workspace = true
|
|
||||||
description.workspace = true
|
description.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
keywords.workspace = true
|
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
readme.workspace = true
|
readme.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ impl crate::Service for Service {
|
|||||||
})?
|
})?
|
||||||
.local_address(url_preview_bind_addr)
|
.local_address(url_preview_bind_addr)
|
||||||
.dns_resolver(resolver.resolver.clone())
|
.dns_resolver(resolver.resolver.clone())
|
||||||
|
.timeout(Duration::from_secs(config.url_preview_timeout))
|
||||||
.redirect(redirect::Policy::limited(3))
|
.redirect(redirect::Policy::limited(3))
|
||||||
.build()?,
|
.build()?,
|
||||||
|
|
||||||
@@ -68,6 +69,11 @@ impl crate::Service for Service {
|
|||||||
.dns_resolver(resolver.resolver.hooked.clone())
|
.dns_resolver(resolver.resolver.hooked.clone())
|
||||||
.connect_timeout(Duration::from_secs(config.federation_conn_timeout))
|
.connect_timeout(Duration::from_secs(config.federation_conn_timeout))
|
||||||
.read_timeout(Duration::from_secs(config.federation_timeout))
|
.read_timeout(Duration::from_secs(config.federation_timeout))
|
||||||
|
.timeout(Duration::from_secs(
|
||||||
|
config
|
||||||
|
.federation_timeout
|
||||||
|
.saturating_add(config.federation_conn_timeout),
|
||||||
|
))
|
||||||
.pool_max_idle_per_host(config.federation_idle_per_host.into())
|
.pool_max_idle_per_host(config.federation_idle_per_host.into())
|
||||||
.pool_idle_timeout(Duration::from_secs(config.federation_idle_timeout))
|
.pool_idle_timeout(Duration::from_secs(config.federation_idle_timeout))
|
||||||
.redirect(redirect::Policy::limited(3))
|
.redirect(redirect::Policy::limited(3))
|
||||||
@@ -76,7 +82,13 @@ impl crate::Service for Service {
|
|||||||
synapse: base(config)?
|
synapse: base(config)?
|
||||||
.dns_resolver(resolver.resolver.hooked.clone())
|
.dns_resolver(resolver.resolver.hooked.clone())
|
||||||
.connect_timeout(Duration::from_secs(config.federation_conn_timeout))
|
.connect_timeout(Duration::from_secs(config.federation_conn_timeout))
|
||||||
.read_timeout(Duration::from_secs(305))
|
.read_timeout(Duration::from_secs(config.federation_timeout.saturating_mul(6)))
|
||||||
|
.timeout(Duration::from_secs(
|
||||||
|
config
|
||||||
|
.federation_timeout
|
||||||
|
.saturating_mul(6)
|
||||||
|
.saturating_add(config.federation_conn_timeout),
|
||||||
|
))
|
||||||
.pool_max_idle_per_host(0)
|
.pool_max_idle_per_host(0)
|
||||||
.redirect(redirect::Policy::limited(3))
|
.redirect(redirect::Policy::limited(3))
|
||||||
.build()?,
|
.build()?,
|
||||||
@@ -103,6 +115,8 @@ impl crate::Service for Service {
|
|||||||
|
|
||||||
pusher: base(config)?
|
pusher: base(config)?
|
||||||
.dns_resolver(resolver.resolver.clone())
|
.dns_resolver(resolver.resolver.clone())
|
||||||
|
.connect_timeout(Duration::from_secs(config.pusher_conn_timeout))
|
||||||
|
.timeout(Duration::from_secs(config.pusher_timeout))
|
||||||
.pool_max_idle_per_host(1)
|
.pool_max_idle_per_host(1)
|
||||||
.pool_idle_timeout(Duration::from_secs(config.pusher_idle_timeout))
|
.pool_idle_timeout(Duration::from_secs(config.pusher_idle_timeout))
|
||||||
.redirect(redirect::Policy::limited(2))
|
.redirect(redirect::Policy::limited(2))
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ use std::{fmt::Debug, mem};
|
|||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use conduwuit::{
|
use conduwuit::{
|
||||||
Err, Error, Result, debug, debug::INFO_SPAN_LEVEL, debug_error, debug_warn, err,
|
Err, Error, Result, debug, debug::INFO_SPAN_LEVEL, debug_error, debug_warn, err,
|
||||||
error::inspect_debug_log, implement, trace, utils::string::EMPTY,
|
error::inspect_debug_log, implement, trace,
|
||||||
};
|
};
|
||||||
use http::{HeaderValue, header::AUTHORIZATION};
|
use http::{HeaderValue, header::AUTHORIZATION};
|
||||||
use ipaddress::IPAddress;
|
use ipaddress::IPAddress;
|
||||||
@@ -90,7 +90,9 @@ where
|
|||||||
|
|
||||||
debug!(%method, %url, "Sending request");
|
debug!(%method, %url, "Sending request");
|
||||||
match client.execute(request).await {
|
match client.execute(request).await {
|
||||||
| Ok(response) => handle_response::<T>(dest, actual, &method, &url, response).await,
|
| Ok(response) =>
|
||||||
|
self.handle_response::<T>(dest, actual, &method, &url, response)
|
||||||
|
.await,
|
||||||
| Err(error) =>
|
| Err(error) =>
|
||||||
Err(handle_error(actual, &method, &url, error).expect_err("always returns error")),
|
Err(handle_error(actual, &method, &url, error).expect_err("always returns error")),
|
||||||
}
|
}
|
||||||
@@ -119,7 +121,9 @@ fn validate_url(&self, url: &Url) -> Result<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[implement(super::Service)]
|
||||||
async fn handle_response<T>(
|
async fn handle_response<T>(
|
||||||
|
&self,
|
||||||
dest: &ServerName,
|
dest: &ServerName,
|
||||||
actual: &ActualDest,
|
actual: &ActualDest,
|
||||||
method: &Method,
|
method: &Method,
|
||||||
@@ -162,7 +166,6 @@ async fn into_http_response(
|
|||||||
.expect("http::response::Builder is usable"),
|
.expect("http::response::Builder is usable"),
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO: handle timeout
|
|
||||||
trace!("Waiting for response body...");
|
trace!("Waiting for response body...");
|
||||||
let body = response
|
let body = response
|
||||||
.bytes()
|
.bytes()
|
||||||
@@ -286,10 +289,13 @@ where
|
|||||||
T: OutgoingRequest + Send,
|
T: OutgoingRequest + Send,
|
||||||
{
|
{
|
||||||
const VERSIONS: [MatrixVersion; 1] = [MatrixVersion::V1_11];
|
const VERSIONS: [MatrixVersion; 1] = [MatrixVersion::V1_11];
|
||||||
const SATIR: SendAccessToken<'_> = SendAccessToken::IfRequired(EMPTY);
|
|
||||||
|
|
||||||
let http_request = request
|
let http_request = request
|
||||||
.try_into_http_request::<Vec<u8>>(actual.string().as_str(), SATIR, &VERSIONS)
|
.try_into_http_request::<Vec<u8>>(
|
||||||
|
actual.string().as_str(),
|
||||||
|
SendAccessToken::None,
|
||||||
|
&VERSIONS,
|
||||||
|
)
|
||||||
.map_err(|e| err!(BadServerResponse("Invalid destination: {e:?}")))?;
|
.map_err(|e| err!(BadServerResponse("Invalid destination: {e:?}")))?;
|
||||||
|
|
||||||
Ok(http_request)
|
Ok(http_request)
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ impl Service {
|
|||||||
trace!("Push gateway destination: {dest}");
|
trace!("Push gateway destination: {dest}");
|
||||||
|
|
||||||
let http_request = request
|
let http_request = request
|
||||||
.try_into_http_request::<BytesMut>(&dest, SendAccessToken::IfRequired(""), &VERSIONS)
|
.try_into_http_request::<BytesMut>(&dest, SendAccessToken::None, &VERSIONS)
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
err!(BadServerResponse(warn!(
|
err!(BadServerResponse(warn!(
|
||||||
"Failed to find destination {dest} for push gateway: {e}"
|
"Failed to find destination {dest} for push gateway: {e}"
|
||||||
@@ -245,7 +245,7 @@ impl Service {
|
|||||||
.expect("http::response::Builder is usable"),
|
.expect("http::response::Builder is usable"),
|
||||||
);
|
);
|
||||||
|
|
||||||
let body = response.bytes().await?; // TODO: handle timeout
|
let body = response.bytes().await?;
|
||||||
|
|
||||||
if !status.is_success() {
|
if !status.is_success() {
|
||||||
debug_warn!("Push gateway response body: {:?}", string_from_bytes(&body));
|
debug_warn!("Push gateway response body: {:?}", string_from_bytes(&body));
|
||||||
@@ -288,7 +288,7 @@ impl Service {
|
|||||||
let mut notify = None;
|
let mut notify = None;
|
||||||
let mut tweaks = Vec::new();
|
let mut tweaks = Vec::new();
|
||||||
if event.room_id().is_none() {
|
if event.room_id().is_none() {
|
||||||
// TODO(hydra): does this matter?
|
// This only affects v12+ create events
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -131,10 +131,6 @@ pub async fn handle_incoming_pdu<'a>(
|
|||||||
.await?
|
.await?
|
||||||
.origin_server_ts();
|
.origin_server_ts();
|
||||||
|
|
||||||
if incoming_pdu.origin_server_ts() < first_ts_in_room {
|
|
||||||
return Ok(None);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 9. Fetch any missing prev events doing all checks listed here starting at 1.
|
// 9. Fetch any missing prev events doing all checks listed here starting at 1.
|
||||||
// These are timeline events
|
// These are timeline events
|
||||||
let (sorted_prev_events, mut eventid_info) = self
|
let (sorted_prev_events, mut eventid_info) = self
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ use futures::{StreamExt, TryStreamExt, future, future::ready};
|
|||||||
use ruma::{
|
use ruma::{
|
||||||
CanonicalJsonObject, CanonicalJsonValue, OwnedEventId, OwnedRoomId, RoomId, RoomVersionId,
|
CanonicalJsonObject, CanonicalJsonValue, OwnedEventId, OwnedRoomId, RoomId, RoomVersionId,
|
||||||
UserId,
|
UserId,
|
||||||
canonical_json::to_canonical_value,
|
|
||||||
events::{StateEventType, TimelineEventType, room::create::RoomCreateEventContent},
|
events::{StateEventType, TimelineEventType, room::create::RoomCreateEventContent},
|
||||||
uint,
|
uint,
|
||||||
};
|
};
|
||||||
@@ -210,7 +209,7 @@ pub async fn create_hash_and_sign_event(
|
|||||||
} else {
|
} else {
|
||||||
Some(to_raw_value(&unsigned)?)
|
Some(to_raw_value(&unsigned)?)
|
||||||
},
|
},
|
||||||
hashes: EventHash { sha256: "aaa".to_owned() },
|
hashes: EventHash { sha256: String::new() },
|
||||||
signatures: None,
|
signatures: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -269,12 +268,6 @@ pub async fn create_hash_and_sign_event(
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
pdu_json.insert(
|
|
||||||
"origin".to_owned(),
|
|
||||||
to_canonical_value(self.services.globals.server_name())
|
|
||||||
.expect("server name is a valid CanonicalJsonValue"),
|
|
||||||
);
|
|
||||||
|
|
||||||
trace!("hashing and signing event {}", pdu.event_id);
|
trace!("hashing and signing event {}", pdu.event_id);
|
||||||
if let Err(e) = self
|
if let Err(e) = self
|
||||||
.services
|
.services
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
use std::{fmt::Debug, mem};
|
use std::{fmt::Debug, mem};
|
||||||
|
|
||||||
use bytes::BytesMut;
|
use bytes::BytesMut;
|
||||||
use conduwuit::{Err, Result, debug_error, err, trace, utils, warn};
|
use conduwuit::{Err, Result, debug_error, err, implement, trace, utils, warn};
|
||||||
use reqwest::Client;
|
|
||||||
use ruma::api::{
|
use ruma::api::{
|
||||||
IncomingResponse, MatrixVersion, OutgoingRequest, SendAccessToken, appservice::Registration,
|
IncomingResponse, MatrixVersion, OutgoingRequest, SendAccessToken, appservice::Registration,
|
||||||
};
|
};
|
||||||
@@ -11,8 +10,9 @@ use ruma::api::{
|
|||||||
///
|
///
|
||||||
/// Only returns Ok(None) if there is no url specified in the appservice
|
/// Only returns Ok(None) if there is no url specified in the appservice
|
||||||
/// registration file
|
/// registration file
|
||||||
pub(crate) async fn send_request<T>(
|
#[implement(super::Service)]
|
||||||
client: &Client,
|
pub async fn send_appservice_request<T>(
|
||||||
|
&self,
|
||||||
registration: Registration,
|
registration: Registration,
|
||||||
request: T,
|
request: T,
|
||||||
) -> Result<Option<T::IncomingResponse>>
|
) -> Result<Option<T::IncomingResponse>>
|
||||||
@@ -35,7 +35,7 @@ where
|
|||||||
let mut http_request = request
|
let mut http_request = request
|
||||||
.try_into_http_request::<BytesMut>(
|
.try_into_http_request::<BytesMut>(
|
||||||
&dest,
|
&dest,
|
||||||
SendAccessToken::IfRequired(hs_token),
|
SendAccessToken::Appservice(hs_token),
|
||||||
&VERSIONS,
|
&VERSIONS,
|
||||||
)
|
)
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
@@ -58,6 +58,8 @@ where
|
|||||||
|
|
||||||
let reqwest_request = reqwest::Request::try_from(http_request)?;
|
let reqwest_request = reqwest::Request::try_from(http_request)?;
|
||||||
|
|
||||||
|
let client = &self.services.client.appservice;
|
||||||
|
|
||||||
let mut response = client.execute(reqwest_request).await.map_err(|e| {
|
let mut response = client.execute(reqwest_request).await.map_err(|e| {
|
||||||
warn!("Could not send request to appservice \"{}\" at {dest}: {e:?}", registration.id);
|
warn!("Could not send request to appservice \"{}\" at {dest}: {e:?}", registration.id);
|
||||||
e
|
e
|
||||||
@@ -75,7 +77,7 @@ where
|
|||||||
.expect("http::response::Builder is usable"),
|
.expect("http::response::Builder is usable"),
|
||||||
);
|
);
|
||||||
|
|
||||||
let body = response.bytes().await?; // TODO: handle timeout
|
let body = response.bytes().await?;
|
||||||
|
|
||||||
if !status.is_success() {
|
if !status.is_success() {
|
||||||
debug_error!("Appservice response bytes: {:?}", utils::string_from_bytes(&body));
|
debug_error!("Appservice response bytes: {:?}", utils::string_from_bytes(&body));
|
||||||
|
|||||||
@@ -19,10 +19,7 @@ use conduwuit::{
|
|||||||
warn,
|
warn,
|
||||||
};
|
};
|
||||||
use futures::{FutureExt, Stream, StreamExt};
|
use futures::{FutureExt, Stream, StreamExt};
|
||||||
use ruma::{
|
use ruma::{RoomId, ServerName, UserId, api::OutgoingRequest};
|
||||||
RoomId, ServerName, UserId,
|
|
||||||
api::{OutgoingRequest, appservice::Registration},
|
|
||||||
};
|
|
||||||
use tokio::{task, task::JoinSet};
|
use tokio::{task, task::JoinSet};
|
||||||
|
|
||||||
use self::data::Data;
|
use self::data::Data;
|
||||||
@@ -319,22 +316,6 @@ impl Service {
|
|||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sends a request to an appservice
|
|
||||||
///
|
|
||||||
/// Only returns None if there is no url specified in the appservice
|
|
||||||
/// registration file
|
|
||||||
pub async fn send_appservice_request<T>(
|
|
||||||
&self,
|
|
||||||
registration: Registration,
|
|
||||||
request: T,
|
|
||||||
) -> Result<Option<T::IncomingResponse>>
|
|
||||||
where
|
|
||||||
T: OutgoingRequest + Debug + Send,
|
|
||||||
{
|
|
||||||
let client = &self.services.client.appservice;
|
|
||||||
appservice::send_request(client, registration, request).await
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Clean up queued sending event data
|
/// Clean up queued sending event data
|
||||||
///
|
///
|
||||||
/// Used after we remove an appservice registration or a user deletes a push
|
/// Used after we remove an appservice registration or a user deletes a push
|
||||||
|
|||||||
@@ -50,9 +50,7 @@ use ruma::{
|
|||||||
};
|
};
|
||||||
use serde_json::value::{RawValue as RawJsonValue, to_raw_value};
|
use serde_json::value::{RawValue as RawJsonValue, to_raw_value};
|
||||||
|
|
||||||
use super::{
|
use super::{Destination, EduBuf, EduVec, Msg, SendingEvent, Service, data::QueueItem};
|
||||||
Destination, EduBuf, EduVec, Msg, SendingEvent, Service, appservice, data::QueueItem,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
enum TransactionStatus {
|
enum TransactionStatus {
|
||||||
@@ -720,18 +718,18 @@ impl Service {
|
|||||||
|
|
||||||
//debug_assert!(pdu_jsons.len() + edu_jsons.len() > 0, "sending empty
|
//debug_assert!(pdu_jsons.len() + edu_jsons.len() > 0, "sending empty
|
||||||
// transaction");
|
// transaction");
|
||||||
let client = &self.services.client.appservice;
|
|
||||||
match appservice::send_request(
|
match self
|
||||||
client,
|
.send_appservice_request(
|
||||||
appservice,
|
appservice,
|
||||||
ruma::api::appservice::event::push_events::v1::Request {
|
ruma::api::appservice::event::push_events::v1::Request {
|
||||||
events: pdu_jsons,
|
events: pdu_jsons,
|
||||||
txn_id: txn_id.into(),
|
txn_id: txn_id.into(),
|
||||||
ephemeral: edu_jsons,
|
ephemeral: edu_jsons,
|
||||||
to_device: Vec::new(), // TODO
|
to_device: Vec::new(), // TODO
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
| Ok(_) => Ok(Destination::Appservice(id)),
|
| Ok(_) => Ok(Destination::Appservice(id)),
|
||||||
| Err(e) => Err((Destination::Appservice(id), e)),
|
| Err(e) => Err((Destination::Appservice(id), e)),
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "conduwuit_web"
|
name = "conduwuit_web"
|
||||||
categories.workspace = true
|
|
||||||
description.workspace = true
|
description.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
keywords.workspace = true
|
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
readme.workspace = true
|
readme.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "xtask-generate-commands"
|
name = "xtask-generate-commands"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
categories.workspace = true
|
|
||||||
description.workspace = true
|
description.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
keywords.workspace = true
|
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
readme.workspace = true
|
readme.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
rust-version.workspace = true
|
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "xtask"
|
name = "xtask"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
categories.workspace = true
|
|
||||||
description.workspace = true
|
description.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
keywords.workspace = true
|
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
readme.workspace = true
|
readme.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
rust-version.workspace = true
|
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
Reference in New Issue
Block a user