Rename crates.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-04-22 01:41:02 +00:00
parent 0024354345
commit 9b658d86b2
316 changed files with 1590 additions and 1593 deletions

477
Cargo.lock generated
View File

@@ -723,244 +723,6 @@ dependencies = [
"crossbeam-utils",
]
[[package]]
name = "conduwuit"
version = "1.0.0"
dependencies = [
"clap",
"conduwuit_admin",
"conduwuit_api",
"conduwuit_core",
"conduwuit_database",
"conduwuit_router",
"conduwuit_service",
"console-subscriber",
"const-str",
"hardened_malloc-rs",
"log",
"opentelemetry",
"opentelemetry-jaeger",
"opentelemetry_sdk",
"sentry",
"sentry-tower",
"sentry-tracing",
"tokio",
"tokio-metrics",
"tracing",
"tracing-flame",
"tracing-opentelemetry",
"tracing-subscriber",
]
[[package]]
name = "conduwuit_admin"
version = "1.0.0"
dependencies = [
"clap",
"conduwuit_api",
"conduwuit_core",
"conduwuit_database",
"conduwuit_macros",
"conduwuit_service",
"const-str",
"futures",
"log",
"ruma",
"serde_json",
"serde_yaml",
"tokio",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "conduwuit_api"
version = "1.0.0"
dependencies = [
"async-trait",
"axum",
"axum-client-ip",
"axum-extra",
"base64 0.22.1",
"bytes",
"conduwuit_core",
"conduwuit_service",
"const-str",
"futures",
"hmac",
"http",
"http-body-util",
"hyper",
"ipaddress",
"itertools 0.14.0",
"log",
"rand 0.8.5",
"reqwest",
"ruma",
"serde",
"serde_html_form",
"serde_json",
"sha1",
"tokio",
"tracing",
]
[[package]]
name = "conduwuit_core"
version = "1.0.0"
dependencies = [
"argon2",
"arrayvec",
"axum",
"axum-extra",
"bytes",
"bytesize",
"cargo_toml",
"checked_ops",
"chrono",
"clap",
"conduwuit_macros",
"const-str",
"core_affinity",
"ctor",
"cyborgtime",
"either",
"figment",
"futures",
"hardened_malloc-rs",
"http",
"http-body-util",
"ipaddress",
"itertools 0.14.0",
"libc",
"libloading",
"log",
"maplit",
"nix",
"num-traits",
"rand 0.8.5",
"regex",
"reqwest",
"ring",
"ruma",
"sanitize-filename",
"serde",
"serde_json",
"serde_regex",
"serde_yaml",
"smallstr",
"smallvec",
"thiserror 2.0.12",
"tikv-jemalloc-ctl",
"tikv-jemalloc-sys",
"tikv-jemallocator",
"tokio",
"tokio-metrics",
"toml",
"tracing",
"tracing-core",
"tracing-subscriber",
"url",
]
[[package]]
name = "conduwuit_database"
version = "1.0.0"
dependencies = [
"async-channel",
"conduwuit_core",
"const-str",
"futures",
"log",
"minicbor",
"minicbor-serde",
"rust-rocksdb",
"serde",
"serde_json",
"tokio",
"tracing",
]
[[package]]
name = "conduwuit_macros"
version = "1.0.0"
dependencies = [
"itertools 0.14.0",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "conduwuit_router"
version = "1.0.0"
dependencies = [
"axum",
"axum-client-ip",
"axum-server",
"axum-server-dual-protocol",
"bytes",
"conduwuit_admin",
"conduwuit_api",
"conduwuit_core",
"conduwuit_service",
"const-str",
"futures",
"http",
"http-body-util",
"hyper",
"hyper-util",
"log",
"ruma",
"rustls",
"sd-notify",
"sentry",
"sentry-tower",
"sentry-tracing",
"serde_json",
"tokio",
"tower 0.5.2",
"tower-http",
"tracing",
]
[[package]]
name = "conduwuit_service"
version = "1.0.0"
dependencies = [
"async-trait",
"base64 0.22.1",
"blurhash",
"bytes",
"conduwuit_core",
"conduwuit_database",
"const-str",
"either",
"futures",
"hickory-resolver 0.25.1",
"http",
"image",
"ipaddress",
"itertools 0.14.0",
"log",
"loole",
"lru-cache",
"rand 0.8.5",
"regex",
"reqwest",
"ruma",
"rustyline-async",
"serde",
"serde_json",
"serde_yaml",
"sha2",
"termimad",
"tokio",
"tracing",
"url",
"webpage",
]
[[package]]
name = "console-api"
version = "0.8.1"
@@ -5066,6 +4828,245 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]]
name = "tuwunel"
version = "1.0.0"
dependencies = [
"clap",
"console-subscriber",
"const-str",
"hardened_malloc-rs",
"log",
"opentelemetry",
"opentelemetry-jaeger",
"opentelemetry_sdk",
"sentry",
"sentry-tower",
"sentry-tracing",
"tokio",
"tokio-metrics",
"tracing",
"tracing-flame",
"tracing-opentelemetry",
"tracing-subscriber",
"tuwunel_admin",
"tuwunel_api",
"tuwunel_core",
"tuwunel_database",
"tuwunel_macros",
"tuwunel_router",
"tuwunel_service",
]
[[package]]
name = "tuwunel_admin"
version = "1.0.0"
dependencies = [
"clap",
"const-str",
"futures",
"log",
"ruma",
"serde_json",
"serde_yaml",
"tokio",
"tracing",
"tracing-subscriber",
"tuwunel_api",
"tuwunel_core",
"tuwunel_database",
"tuwunel_macros",
"tuwunel_service",
]
[[package]]
name = "tuwunel_api"
version = "1.0.0"
dependencies = [
"async-trait",
"axum",
"axum-client-ip",
"axum-extra",
"base64 0.22.1",
"bytes",
"const-str",
"futures",
"hmac",
"http",
"http-body-util",
"hyper",
"ipaddress",
"itertools 0.14.0",
"log",
"rand 0.8.5",
"reqwest",
"ruma",
"serde",
"serde_html_form",
"serde_json",
"sha1",
"tokio",
"tracing",
"tuwunel_core",
"tuwunel_service",
]
[[package]]
name = "tuwunel_core"
version = "1.0.0"
dependencies = [
"argon2",
"arrayvec",
"axum",
"axum-extra",
"bytes",
"bytesize",
"cargo_toml",
"checked_ops",
"chrono",
"clap",
"const-str",
"core_affinity",
"ctor",
"cyborgtime",
"either",
"figment",
"futures",
"hardened_malloc-rs",
"http",
"http-body-util",
"ipaddress",
"itertools 0.14.0",
"libc",
"libloading",
"log",
"maplit",
"nix",
"num-traits",
"rand 0.8.5",
"regex",
"reqwest",
"ring",
"ruma",
"sanitize-filename",
"serde",
"serde_json",
"serde_regex",
"serde_yaml",
"smallstr",
"smallvec",
"thiserror 2.0.12",
"tikv-jemalloc-ctl",
"tikv-jemalloc-sys",
"tikv-jemallocator",
"tokio",
"tokio-metrics",
"toml",
"tracing",
"tracing-core",
"tracing-subscriber",
"tuwunel_macros",
"url",
]
[[package]]
name = "tuwunel_database"
version = "1.0.0"
dependencies = [
"async-channel",
"const-str",
"futures",
"log",
"minicbor",
"minicbor-serde",
"rust-rocksdb",
"serde",
"serde_json",
"tokio",
"tracing",
"tuwunel_core",
]
[[package]]
name = "tuwunel_macros"
version = "1.0.0"
dependencies = [
"itertools 0.14.0",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "tuwunel_router"
version = "1.0.0"
dependencies = [
"axum",
"axum-client-ip",
"axum-server",
"axum-server-dual-protocol",
"bytes",
"const-str",
"futures",
"http",
"http-body-util",
"hyper",
"hyper-util",
"log",
"ruma",
"rustls",
"sd-notify",
"sentry",
"sentry-tower",
"sentry-tracing",
"serde_json",
"tokio",
"tower 0.5.2",
"tower-http",
"tracing",
"tuwunel_admin",
"tuwunel_api",
"tuwunel_core",
"tuwunel_service",
]
[[package]]
name = "tuwunel_service"
version = "1.0.0"
dependencies = [
"async-trait",
"base64 0.22.1",
"blurhash",
"bytes",
"const-str",
"either",
"futures",
"hickory-resolver 0.25.1",
"http",
"image",
"ipaddress",
"itertools 0.14.0",
"log",
"loole",
"lru-cache",
"rand 0.8.5",
"regex",
"reqwest",
"ruma",
"rustyline-async",
"serde",
"serde_json",
"serde_yaml",
"sha2",
"termimad",
"tokio",
"tracing",
"tuwunel_core",
"tuwunel_database",
"url",
"webpage",
]
[[package]]
name = "typenum"
version = "1.18.0"

View File

@@ -435,6 +435,9 @@ default-features = false
features = [
"extra-traits",
"full",
"parsing",
"proc-macro",
"printing",
]
[workspace.dependencies.termimad]
@@ -604,38 +607,38 @@ rev = "200e958941d522a70c5877e3d846f55b5586c68d"
# Our crates
#
[workspace.dependencies.conduwuit-router]
package = "conduwuit_router"
[workspace.dependencies.tuwunel-router]
package = "tuwunel_router"
path = "src/router"
default-features = false
[workspace.dependencies.conduwuit-admin]
package = "conduwuit_admin"
[workspace.dependencies.tuwunel-admin]
package = "tuwunel_admin"
path = "src/admin"
default-features = false
[workspace.dependencies.conduwuit-api]
package = "conduwuit_api"
[workspace.dependencies.tuwunel-api]
package = "tuwunel_api"
path = "src/api"
default-features = false
[workspace.dependencies.conduwuit-service]
package = "conduwuit_service"
[workspace.dependencies.tuwunel-service]
package = "tuwunel_service"
path = "src/service"
default-features = false
[workspace.dependencies.conduwuit-database]
package = "conduwuit_database"
[workspace.dependencies.tuwunel-database]
package = "tuwunel_database"
path = "src/database"
default-features = false
[workspace.dependencies.conduwuit-core]
package = "conduwuit_core"
[workspace.dependencies.tuwunel-core]
package = "tuwunel_core"
path = "src/core"
default-features = false
[workspace.dependencies.conduwuit-macros]
package = "conduwuit_macros"
[workspace.dependencies.tuwunel-macros]
package = "tuwunel_macros"
path = "src/macros"
default-features = false
@@ -694,7 +697,7 @@ codegen-units = 32
# '-Clink-arg=-Wl,--no-gc-sections',
#]
[profile.release-max-perf.package.conduwuit_macros]
[profile.release-max-perf.package.tuwunel_macros]
inherits = "release-max-perf.build-override"
#rustflags = [
# '-Crelocation-model=pic',
@@ -728,7 +731,7 @@ panic = "unwind"
debug-assertions = true
incremental = true
#rustflags = [
# '--cfg', 'conduwuit_mods',
# '--cfg', 'tuwunel_mods',
# '-Ztime-passes',
# '-Zmir-opt-level=0',
# '-Zvalidate-mir=false',
@@ -745,11 +748,11 @@ incremental = true
# '-Clink-arg=-Wl,-z,lazy',
#]
[profile.dev.package.conduwuit_core]
[profile.dev.package.tuwunel_core]
inherits = "dev"
incremental = false
#rustflags = [
# '--cfg', 'conduwuit_mods',
# '--cfg', 'tuwunel_mods',
# '-Ztime-passes',
# '-Zmir-opt-level=0',
# '-Ztls-model=initial-exec',
@@ -766,10 +769,10 @@ incremental = false
# '-Clink-arg=-Wl,-z,nodelete',
#]
[profile.dev.package.conduwuit]
[profile.dev.package.tuwunel]
inherits = "dev"
#rustflags = [
# '--cfg', 'conduwuit_mods',
# '--cfg', 'tuwunel_mods',
# '-Ztime-passes',
# '-Zmir-opt-level=0',
# '-Zvalidate-mir=false',
@@ -791,7 +794,7 @@ incremental = false
codegen-units = 1
opt-level = 'z'
#rustflags = [
# '--cfg', 'conduwuit_mods',
# '--cfg', 'tuwunel_mods',
# '-Ztls-model=global-dynamic',
# '-Cprefer-dynamic=true',
# '-Zstaticlib-prefer-dynamic=true',
@@ -992,5 +995,5 @@ suspicious = { level = "warn", priority = -1 }
## some sadness
let_underscore_future = { level = "allow", priority = 1 }
# rust doesnt understand conduwuit's custom log macros
# rust doesnt understand tuwunel's custom log macros
literal_string_with_formatting_args = { level = "allow", priority = 1 }

View File

@@ -8,13 +8,13 @@ type-complexity-threshold = 250 # reduce me to ~200
large-error-threshold = 256 # TODO reduce me ALARA
disallowed-macros = [
{ path = "log::error", reason = "use conduwuit_core::error" },
{ path = "log::warn", reason = "use conduwuit_core::warn" },
{ path = "log::info", reason = "use conduwuit_core::info" },
{ path = "log::debug", reason = "use conduwuit_core::debug" },
{ path = "log::trace", reason = "use conduwuit_core::trace" },
{ path = "log::error", reason = "use tuwunel_core::error" },
{ path = "log::warn", reason = "use tuwunel_core::warn" },
{ path = "log::info", reason = "use tuwunel_core::info" },
{ path = "log::debug", reason = "use tuwunel_core::debug" },
{ path = "log::trace", reason = "use tuwunel_core::trace" },
]
disallowed-methods = [
{ path = "tokio::spawn", reason = "use and pass conduuwit_core::server::Server::runtime() to spawn from" },
{ path = "tokio::spawn", reason = "use and pass tuwunel_core::server::Server::runtime() to spawn from" },
]

View File

@@ -1,5 +1,5 @@
[package]
name = "conduwuit_admin"
name = "tuwunel_admin"
categories.workspace = true
description.workspace = true
edition.workspace = true
@@ -18,68 +18,68 @@ crate-type = [
[features]
brotli_compression = [
"conduwuit-api/brotli_compression",
"conduwuit-core/brotli_compression",
"conduwuit-service/brotli_compression",
"tuwunel-api/brotli_compression",
"tuwunel-core/brotli_compression",
"tuwunel-service/brotli_compression",
]
gzip_compression = [
"conduwuit-api/gzip_compression",
"conduwuit-core/gzip_compression",
"conduwuit-service/gzip_compression",
"tuwunel-api/gzip_compression",
"tuwunel-core/gzip_compression",
"tuwunel-service/gzip_compression",
]
io_uring = [
"conduwuit-api/io_uring",
"conduwuit-database/io_uring",
"conduwuit-service/io_uring",
"tuwunel-api/io_uring",
"tuwunel-database/io_uring",
"tuwunel-service/io_uring",
]
jemalloc = [
"conduwuit-api/jemalloc",
"conduwuit-core/jemalloc",
"conduwuit-database/jemalloc",
"conduwuit-service/jemalloc",
"tuwunel-api/jemalloc",
"tuwunel-core/jemalloc",
"tuwunel-database/jemalloc",
"tuwunel-service/jemalloc",
]
jemalloc_conf = [
"conduwuit-api/jemalloc_conf",
"conduwuit-core/jemalloc_conf",
"conduwuit-database/jemalloc_conf",
"conduwuit-service/jemalloc_conf",
"tuwunel-api/jemalloc_conf",
"tuwunel-core/jemalloc_conf",
"tuwunel-database/jemalloc_conf",
"tuwunel-service/jemalloc_conf",
]
jemalloc_prof = [
"conduwuit-api/jemalloc_prof",
"conduwuit-core/jemalloc_prof",
"conduwuit-database/jemalloc_prof",
"conduwuit-service/jemalloc_prof",
"tuwunel-api/jemalloc_prof",
"tuwunel-core/jemalloc_prof",
"tuwunel-database/jemalloc_prof",
"tuwunel-service/jemalloc_prof",
]
jemalloc_stats = [
"conduwuit-api/jemalloc_stats",
"conduwuit-core/jemalloc_stats",
"conduwuit-database/jemalloc_stats",
"conduwuit-service/jemalloc_stats",
"tuwunel-api/jemalloc_stats",
"tuwunel-core/jemalloc_stats",
"tuwunel-database/jemalloc_stats",
"tuwunel-service/jemalloc_stats",
]
release_max_log_level = [
"conduwuit-api/release_max_log_level",
"conduwuit-core/release_max_log_level",
"conduwuit-database/release_max_log_level",
"conduwuit-service/release_max_log_level",
"tuwunel-api/release_max_log_level",
"tuwunel-core/release_max_log_level",
"tuwunel-database/release_max_log_level",
"tuwunel-service/release_max_log_level",
"tracing/max_level_trace",
"tracing/release_max_level_info",
"log/max_level_trace",
"log/release_max_level_info",
]
zstd_compression = [
"conduwuit-api/zstd_compression",
"conduwuit-core/zstd_compression",
"conduwuit-database/zstd_compression",
"conduwuit-service/zstd_compression",
"tuwunel-api/zstd_compression",
"tuwunel-core/zstd_compression",
"tuwunel-database/zstd_compression",
"tuwunel-service/zstd_compression",
]
[dependencies]
clap.workspace = true
conduwuit-api.workspace = true
conduwuit-core.workspace = true
conduwuit-database.workspace = true
conduwuit-macros.workspace = true
conduwuit-service.workspace = true
tuwunel-api.workspace = true
tuwunel-core.workspace = true
tuwunel-database.workspace = true
tuwunel-macros.workspace = true
tuwunel-service.workspace = true
const-str.workspace = true
futures.workspace = true
log.workspace = true

View File

@@ -1,5 +1,5 @@
use clap::Parser;
use conduwuit::Result;
use tuwunel_core::Result;
use crate::{
appservice, appservice::AppserviceCommand, check, check::CheckCommand, context::Context,
@@ -9,7 +9,7 @@ use crate::{
};
#[derive(Debug, Parser)]
#[command(name = "conduwuit", version = conduwuit::version())]
#[command(name = "tuwunel", version = tuwunel_core::version())]
pub(super) enum AdminCommand {
#[command(subcommand)]
/// - Commands for managing appservices

View File

@@ -1,5 +1,5 @@
use conduwuit::{Err, Result, checked};
use futures::{FutureExt, StreamExt, TryFutureExt};
use tuwunel_core::{Err, Result, checked};
use crate::admin_command;

View File

@@ -1,7 +1,7 @@
mod commands;
use clap::Subcommand;
use conduwuit::Result;
use tuwunel_core::Result;
use crate::admin_command_dispatch;

View File

@@ -1,6 +1,6 @@
use conduwuit::Result;
use conduwuit_macros::implement;
use futures::StreamExt;
use tuwunel_core::Result;
use tuwunel_macros::implement;
use crate::Context;

View File

@@ -1,7 +1,7 @@
mod commands;
use clap::Subcommand;
use conduwuit::Result;
use tuwunel_core::Result;
use crate::admin_command_dispatch;

View File

@@ -1,13 +1,13 @@
use std::{fmt, time::SystemTime};
use conduwuit::Result;
use conduwuit_service::Services;
use futures::{
Future, FutureExt, TryFutureExt,
io::{AsyncWriteExt, BufWriter},
lock::Mutex,
};
use ruma::EventId;
use tuwunel_core::Result;
use tuwunel_service::Services;
pub(crate) struct Context<'a> {
pub(crate) services: &'a Services,

View File

@@ -5,7 +5,14 @@ use std::{
time::{Instant, SystemTime},
};
use conduwuit::{
use futures::{FutureExt, StreamExt, TryStreamExt};
use ruma::{
CanonicalJsonObject, CanonicalJsonValue, EventId, OwnedEventId, OwnedRoomId,
OwnedRoomOrAliasId, OwnedServerName, RoomId, RoomVersionId,
api::federation::event::get_room_state,
};
use tracing_subscriber::EnvFilter;
use tuwunel_core::{
Err, Result, debug_error, err, info,
matrix::pdu::{PduEvent, PduId, RawPduId},
trace, utils,
@@ -15,17 +22,10 @@ use conduwuit::{
},
warn,
};
use futures::{FutureExt, StreamExt, TryStreamExt};
use ruma::{
CanonicalJsonObject, CanonicalJsonValue, EventId, OwnedEventId, OwnedRoomId,
OwnedRoomOrAliasId, OwnedServerName, RoomId, RoomVersionId,
api::federation::event::get_room_state,
};
use service::rooms::{
use tuwunel_service::rooms::{
short::{ShortEventId, ShortRoomId},
state_compressor::HashSetCompressStateEvent,
};
use tracing_subscriber::EnvFilter;
use crate::admin_command;
@@ -764,7 +764,7 @@ pub(super) async fn memory_stats(&self, opts: Option<String>) -> Result {
})
.collect();
let stats = conduwuit::alloc::memory_stats(&opts).unwrap_or_default();
let stats = tuwunel_core::alloc::memory_stats(&opts).unwrap_or_default();
self.write_str("```\n").await?;
self.write_str(&stats).await?;
@@ -902,7 +902,7 @@ pub(super) async fn database_files(&self, map: Option<String>, level: Option<i32
#[admin_command]
pub(super) async fn trim_memory(&self) -> Result {
conduwuit::alloc::trim(None)?;
tuwunel_core::alloc::trim(None)?;
writeln!(self, "done").await
}

View File

@@ -2,9 +2,9 @@ mod commands;
pub(crate) mod tester;
use clap::Subcommand;
use conduwuit::Result;
use ruma::{OwnedEventId, OwnedRoomId, OwnedRoomOrAliasId, OwnedServerName};
use service::rooms::short::{ShortEventId, ShortRoomId};
use tuwunel_core::Result;
use tuwunel_service::rooms::short::{ShortEventId, ShortRoomId};
use self::tester::TesterCommand;
use crate::admin_command_dispatch;
@@ -32,13 +32,13 @@ pub(super) enum DebugCommand {
/// the command.
ParsePdu,
/// - Retrieve and print a PDU by EventID from the conduwuit database
/// - Retrieve and print a PDU by EventID from the tuwunel database
GetPdu {
/// An event ID (a $ followed by the base64 reference hash)
event_id: OwnedEventId,
},
/// - Retrieve and print a PDU by PduId from the conduwuit database
/// - Retrieve and print a PDU by PduId from the tuwunel database
GetShortPdu {
/// Shortroomid integer
shortroomid: ShortRoomId,
@@ -179,7 +179,7 @@ pub(super) enum DebugCommand {
server_name: OwnedServerName,
},
/// - Runs a server name through conduwuit's true destination resolution
/// - Runs a server name through tuwunel's true destination resolution
/// process
///
/// Useful for debugging well-known issues

View File

@@ -1,4 +1,4 @@
use conduwuit::{Err, Result};
use tuwunel_core::{Err, Result};
use crate::{admin_command, admin_command_dispatch};

View File

@@ -1,8 +1,8 @@
use std::fmt::Write;
use conduwuit::{Err, Result};
use futures::StreamExt;
use ruma::{OwnedRoomId, OwnedServerName, OwnedUserId};
use tuwunel_core::{Err, Result};
use crate::{admin_command, get_room_info};

View File

@@ -1,8 +1,8 @@
mod commands;
use clap::Subcommand;
use conduwuit::Result;
use ruma::{OwnedRoomId, OwnedServerName, OwnedUserId};
use tuwunel_core::Result;
use crate::admin_command_dispatch;

View File

@@ -1,11 +1,11 @@
use std::time::Duration;
use conduwuit::{
use ruma::{Mxc, OwnedEventId, OwnedMxcUri, OwnedServerName};
use tuwunel_core::{
Err, Result, debug, debug_info, debug_warn, error, info, trace,
utils::time::parse_timepoint_ago, warn,
};
use conduwuit_service::media::Dim;
use ruma::{Mxc, OwnedEventId, OwnedMxcUri, OwnedServerName};
use tuwunel_service::media::Dim;
use crate::{admin_command, utils::parse_local_user_id};

View File

@@ -2,8 +2,8 @@
mod commands;
use clap::Subcommand;
use conduwuit::Result;
use ruma::{OwnedEventId, OwnedMxcUri, OwnedServerName};
use tuwunel_core::Result;
use crate::admin_command_dispatch;

View File

@@ -19,22 +19,18 @@ pub(crate) mod room;
pub(crate) mod server;
pub(crate) mod user;
extern crate conduwuit_api as api;
extern crate conduwuit_core as conduwuit;
extern crate conduwuit_service as service;
pub(crate) use conduwuit_macros::{admin_command, admin_command_dispatch};
pub(crate) use tuwunel_macros::{admin_command, admin_command_dispatch};
pub(crate) use crate::{context::Context, utils::get_room_info};
pub(crate) const PAGE_SIZE: usize = 100;
conduwuit::mod_ctor! {}
conduwuit::mod_dtor! {}
conduwuit::rustc_flags_capture! {}
tuwunel_core::mod_ctor! {}
tuwunel_core::mod_dtor! {}
tuwunel_core::rustc_flags_capture! {}
/// Install the admin command processor
pub async fn init(admin_service: &service::admin::Service) {
pub async fn init(admin_service: &tuwunel_service::admin::Service) {
_ = admin_service
.complete
.write()
@@ -48,7 +44,7 @@ pub async fn init(admin_service: &service::admin::Service) {
}
/// Uninstall the admin command handler
pub async fn fini(admin_service: &service::admin::Service) {
pub async fn fini(admin_service: &tuwunel_service::admin::Service) {
_ = admin_service.handle.write().await.take();
_ = admin_service
.complete

View File

@@ -7,7 +7,17 @@ use std::{
};
use clap::{CommandFactory, Parser};
use conduwuit::{
use futures::{AsyncWriteExt, future::FutureExt, io::BufWriter};
use ruma::{
EventId,
events::{
relation::InReplyTo,
room::message::{Relation::Reply, RoomMessageEventContent},
},
};
use tracing::Level;
use tracing_subscriber::{EnvFilter, filter::LevelFilter};
use tuwunel_core::{
Error, Result, debug, error,
log::{
capture,
@@ -18,20 +28,10 @@ use conduwuit::{
utils::string::{collect_stream, common_prefix},
warn,
};
use futures::{AsyncWriteExt, future::FutureExt, io::BufWriter};
use ruma::{
EventId,
events::{
relation::InReplyTo,
room::message::{Relation::Reply, RoomMessageEventContent},
},
};
use service::{
use tuwunel_service::{
Services,
admin::{CommandInput, CommandOutput, ProcessorFuture, ProcessorResult},
};
use tracing::Level;
use tracing_subscriber::{EnvFilter, filter::LevelFilter};
use crate::{admin, admin::AdminCommand, context::Context};
@@ -94,7 +94,8 @@ async fn process_command(services: Arc<Services>, input: &CommandInput) -> Proce
#[allow(clippy::result_large_err)]
fn handle_panic(error: &Error, command: &CommandInput) -> ProcessorResult {
let link =
"Please submit a [bug report](https://github.com/girlbossceo/conduwuit/issues/new). 🥺";
"Please submit a [bug report](https://github.com/matrix-construct/tuwunel/issues/new). \
🥺";
let msg = format!("Panic occurred while processing command:\n```\n{error:#?}\n```\n{link}");
let content = RoomMessageEventContent::notice_markdown(msg);
error!("Panic while processing command: {error:?}");

View File

@@ -1,7 +1,7 @@
use clap::Subcommand;
use conduwuit::Result;
use futures::StreamExt;
use ruma::{OwnedRoomId, OwnedUserId};
use tuwunel_core::Result;
use crate::{admin_command, admin_command_dispatch};

View File

@@ -1,6 +1,6 @@
use clap::Subcommand;
use conduwuit::Result;
use futures::TryStreamExt;
use tuwunel_core::Result;
use crate::Context;

View File

@@ -1,6 +1,6 @@
use clap::Subcommand;
use conduwuit::Result;
use ruma::OwnedServerName;
use tuwunel_core::Result;
use crate::Context;

View File

@@ -13,7 +13,7 @@ mod short;
mod users;
use clap::Subcommand;
use conduwuit::Result;
use tuwunel_core::Result;
use self::{
account_data::AccountDataCommand, appservice::AppserviceCommand, globals::GlobalsCommand,

View File

@@ -1,7 +1,7 @@
use clap::Subcommand;
use conduwuit::Result;
use futures::StreamExt;
use ruma::OwnedUserId;
use tuwunel_core::Result;
use crate::Context;

View File

@@ -1,6 +1,6 @@
use clap::Subcommand;
use conduwuit::Result;
use ruma::OwnedUserId;
use tuwunel_core::Result;
use crate::Context;

View File

@@ -1,17 +1,17 @@
use std::{borrow::Cow, collections::BTreeMap, ops::Deref, sync::Arc};
use clap::Subcommand;
use conduwuit::{
use futures::{FutureExt, Stream, StreamExt, TryStreamExt};
use tokio::time::Instant;
use tuwunel_core::{
Err, Result, apply, at, is_zero,
utils::{
stream::{IterStream, ReadyExt, TryIgnore, TryParallelExt},
string::EMPTY,
},
};
use conduwuit_database::Map;
use conduwuit_service::Services;
use futures::{FutureExt, Stream, StreamExt, TryStreamExt};
use tokio::time::Instant;
use tuwunel_database::Map;
use tuwunel_service::Services;
use crate::{admin_command, admin_command_dispatch};
@@ -170,7 +170,7 @@ pub(super) async fn compact(
parallelism: Option<usize>,
exhaustive: bool,
) -> Result {
use conduwuit_database::compact::Options;
use tuwunel_database::compact::Options;
let default_all_maps: Option<_> = map.is_none().then(|| {
self.services

View File

@@ -1,7 +1,7 @@
use clap::Subcommand;
use conduwuit::{Result, utils::time};
use futures::StreamExt;
use ruma::OwnedServerName;
use tuwunel_core::{Result, utils::time};
use crate::{admin_command, admin_command_dispatch};
@@ -22,7 +22,7 @@ pub(crate) enum ResolverCommand {
#[admin_command]
async fn destinations_cache(&self, server_name: Option<OwnedServerName>) -> Result {
use service::resolver::cache::CachedDest;
use tuwunel_service::resolver::cache::CachedDest;
writeln!(self, "| Server Name | Destination | Hostname | Expires |").await?;
writeln!(self, "| ----------- | ----------- | -------- | ------- |").await?;
@@ -46,7 +46,7 @@ async fn destinations_cache(&self, server_name: Option<OwnedServerName>) -> Resu
#[admin_command]
async fn overrides_cache(&self, server_name: Option<String>) -> Result {
use service::resolver::cache::CachedOverride;
use tuwunel_service::resolver::cache::CachedOverride;
writeln!(self, "| Server Name | IP | Port | Expires | Overriding |").await?;
writeln!(self, "| ----------- | --- | ----:| ------- | ---------- |").await?;

View File

@@ -1,7 +1,7 @@
use clap::Subcommand;
use conduwuit::Result;
use futures::StreamExt;
use ruma::{OwnedRoomAliasId, OwnedRoomId};
use tuwunel_core::Result;
use crate::Context;

View File

@@ -1,7 +1,7 @@
use clap::Subcommand;
use conduwuit::Result;
use futures::StreamExt;
use ruma::{OwnedRoomId, OwnedServerName, OwnedUserId};
use tuwunel_core::Result;
use crate::Context;

View File

@@ -1,7 +1,7 @@
use clap::Subcommand;
use conduwuit::{PduCount, Result, utils::stream::TryTools};
use futures::TryStreamExt;
use ruma::OwnedRoomOrAliasId;
use tuwunel_core::{PduCount, Result, utils::stream::TryTools};
use crate::{admin_command, admin_command_dispatch};

View File

@@ -1,8 +1,8 @@
use clap::Subcommand;
use conduwuit::{Err, Result};
use futures::StreamExt;
use ruma::{OwnedServerName, OwnedUserId};
use service::sending::Destination;
use tuwunel_core::{Err, Result};
use tuwunel_service::sending::Destination;
use crate::Context;

View File

@@ -1,6 +1,6 @@
use clap::Subcommand;
use conduwuit::Result;
use ruma::{OwnedEventId, OwnedRoomOrAliasId};
use tuwunel_core::Result;
use crate::{admin_command, admin_command_dispatch};

View File

@@ -1,7 +1,7 @@
use clap::Subcommand;
use conduwuit::Result;
use futures::stream::StreamExt;
use ruma::{OwnedDeviceId, OwnedRoomId, OwnedUserId};
use tuwunel_core::Result;
use crate::{admin_command, admin_command_dispatch};

View File

@@ -1,9 +1,9 @@
use std::fmt::Write;
use clap::Subcommand;
use conduwuit::{Err, Result};
use futures::StreamExt;
use ruma::{OwnedRoomAliasId, OwnedRoomId};
use tuwunel_core::{Err, Result};
use crate::Context;

View File

@@ -1,6 +1,6 @@
use conduwuit::{Err, Result};
use futures::StreamExt;
use ruma::OwnedRoomId;
use tuwunel_core::{Err, Result};
use crate::{PAGE_SIZE, admin_command, get_room_info};

View File

@@ -1,7 +1,7 @@
use clap::Subcommand;
use conduwuit::{Err, Result};
use futures::StreamExt;
use ruma::OwnedRoomId;
use tuwunel_core::{Err, Result};
use crate::{Context, PAGE_SIZE, get_room_info};

View File

@@ -1,7 +1,7 @@
use clap::Subcommand;
use conduwuit::{Err, Result, utils::ReadyExt};
use futures::StreamExt;
use ruma::OwnedRoomId;
use tuwunel_core::{Err, Result, utils::ReadyExt};
use crate::{admin_command, admin_command_dispatch};

View File

@@ -5,8 +5,8 @@ mod info;
mod moderation;
use clap::Subcommand;
use conduwuit::Result;
use ruma::OwnedRoomId;
use tuwunel_core::Result;
use self::{
alias::RoomAliasCommand, directory::RoomDirectoryCommand, info::RoomInfoCommand,

View File

@@ -1,12 +1,12 @@
use api::client::leave_room;
use clap::Subcommand;
use conduwuit::{
use futures::StreamExt;
use ruma::{OwnedRoomId, OwnedRoomOrAliasId, RoomAliasId, RoomId, RoomOrAliasId};
use tuwunel_api::client::leave_room;
use tuwunel_core::{
Err, Result, debug,
utils::{IterStream, ReadyExt},
warn,
};
use futures::StreamExt;
use ruma::{OwnedRoomId, OwnedRoomOrAliasId, RoomAliasId, RoomId, RoomOrAliasId};
use crate::{admin_command, admin_command_dispatch, get_room_info};

View File

@@ -1,11 +1,11 @@
use std::{fmt::Write, path::PathBuf, sync::Arc};
use conduwuit::{
use futures::TryStreamExt;
use tuwunel_core::{
Err, Result, info,
utils::{stream::IterStream, time},
warn,
};
use futures::TryStreamExt;
use crate::admin_command;
@@ -68,8 +68,8 @@ pub(super) async fn list_features(&self, available: bool, enabled: bool, comma:
pub(super) async fn memory_usage(&self) -> Result {
let services_usage = self.services.memory_usage().await?;
let database_usage = self.services.db.db.memory_usage()?;
let allocator_usage =
conduwuit::alloc::memory_usage().map_or(String::new(), |s| format!("\nAllocator:\n{s}"));
let allocator_usage = tuwunel_core::alloc::memory_usage()
.map_or(String::new(), |s| format!("\nAllocator:\n{s}"));
self.write_str(&format!(
"Services:\n{services_usage}\nDatabase:\n{database_usage}{allocator_usage}",
@@ -131,7 +131,7 @@ pub(super) async fn reload_mods(&self) -> Result {
#[admin_command]
#[cfg(unix)]
pub(super) async fn restart(&self, force: bool) -> Result {
use conduwuit::utils::sys::current_exe_deleted;
use tuwunel_core::utils::sys::current_exe_deleted;
if !force && current_exe_deleted() {
return Err!(

View File

@@ -3,7 +3,7 @@ mod commands;
use std::path::PathBuf;
use clap::Subcommand;
use conduwuit::Result;
use tuwunel_core::Result;
use crate::admin_command_dispatch;
@@ -36,7 +36,7 @@ pub(super) enum ServerCommand {
/// - Print database memory usage statistics
MemoryUsage,
/// - Clears all of Conduwuit's caches
/// - Clears all of Tuwunel's caches
ClearCaches,
/// - Performs an online backup of the database (only available for RocksDB

View File

@@ -1,13 +1,5 @@
use std::{collections::BTreeMap, fmt::Write as _};
use api::client::{full_user_deactivate, join_room_by_id_helper, leave_room};
use conduwuit::{
Err, Result, debug, debug_warn, error, info, is_equal_to,
matrix::pdu::PduBuilder,
utils::{self, ReadyExt},
warn,
};
use conduwuit_api::client::{leave_all_rooms, update_avatar_url, update_displayname};
use futures::StreamExt;
use ruma::{
OwnedEventId, OwnedRoomId, OwnedRoomOrAliasId, OwnedUserId, UserId,
@@ -20,6 +12,16 @@ use ruma::{
tag::{TagEvent, TagEventContent, TagInfo},
},
};
use tuwunel_api::client::{
full_user_deactivate, join_room_by_id_helper, leave_all_rooms, leave_room, update_avatar_url,
update_displayname,
};
use tuwunel_core::{
Err, Result, debug, debug_warn, error, info, is_equal_to,
matrix::pdu::PduBuilder,
utils::{self, ReadyExt},
warn,
};
use crate::{
admin_command, get_room_info,

View File

@@ -1,8 +1,8 @@
mod commands;
use clap::Subcommand;
use conduwuit::Result;
use ruma::{OwnedEventId, OwnedRoomId, OwnedRoomOrAliasId};
use tuwunel_core::Result;
use crate::admin_command_dispatch;

View File

@@ -1,8 +1,8 @@
#![allow(dead_code)]
use conduwuit_core::{Err, Result, err};
use ruma::{OwnedRoomId, OwnedUserId, RoomId, UserId};
use service::Services;
use tuwunel_core::{Err, Result, err};
use tuwunel_service::Services;
pub(crate) fn escape_html(s: &str) -> String {
s.replace('&', "&amp;")

View File

@@ -1,5 +1,5 @@
[package]
name = "conduwuit_api"
name = "tuwunel_api"
categories.workspace = true
description.workspace = true
edition.workspace = true
@@ -18,48 +18,48 @@ crate-type = [
[features]
brotli_compression = [
"conduwuit-core/brotli_compression",
"conduwuit-service/brotli_compression",
"tuwunel-core/brotli_compression",
"tuwunel-service/brotli_compression",
"reqwest/brotli",
]
element_hacks = [
"conduwuit-service/element_hacks",
"tuwunel-service/element_hacks",
]
gzip_compression = [
"conduwuit-core/gzip_compression",
"conduwuit-service/gzip_compression",
"tuwunel-core/gzip_compression",
"tuwunel-service/gzip_compression",
"reqwest/gzip",
]
io_uring = [
"conduwuit-service/io_uring",
"tuwunel-service/io_uring",
]
jemalloc = [
"conduwuit-core/jemalloc",
"conduwuit-service/jemalloc",
"tuwunel-core/jemalloc",
"tuwunel-service/jemalloc",
]
jemalloc_conf = [
"conduwuit-core/jemalloc_conf",
"conduwuit-service/jemalloc_conf",
"tuwunel-core/jemalloc_conf",
"tuwunel-service/jemalloc_conf",
]
jemalloc_prof = [
"conduwuit-core/jemalloc_prof",
"conduwuit-service/jemalloc_prof",
"tuwunel-core/jemalloc_prof",
"tuwunel-service/jemalloc_prof",
]
jemalloc_stats = [
"conduwuit-core/jemalloc_stats",
"conduwuit-service/jemalloc_stats",
"tuwunel-core/jemalloc_stats",
"tuwunel-service/jemalloc_stats",
]
release_max_log_level = [
"conduwuit-core/release_max_log_level",
"conduwuit-service/release_max_log_level",
"tuwunel-core/release_max_log_level",
"tuwunel-service/release_max_log_level",
"log/max_level_trace",
"log/release_max_level_info",
"tracing/max_level_trace",
"tracing/release_max_level_info",
]
zstd_compression = [
"conduwuit-core/zstd_compression",
"conduwuit-service/zstd_compression",
"tuwunel-core/zstd_compression",
"tuwunel-service/zstd_compression",
"reqwest/zstd",
]
@@ -70,8 +70,8 @@ axum-extra.workspace = true
axum.workspace = true
base64.workspace = true
bytes.workspace = true
conduwuit-core.workspace = true
conduwuit-service.workspace = true
tuwunel-core.workspace = true
tuwunel-service.workspace = true
const-str.workspace = true
futures.workspace = true
hmac.workspace = true

View File

@@ -2,14 +2,6 @@ use std::fmt::Write;
use axum::extract::State;
use axum_client_ip::InsecureClientIp;
use conduwuit::{
Err, Error, Result, debug_info, err, error, info, is_equal_to,
matrix::pdu::PduBuilder,
utils,
utils::{ReadyExt, stream::BroadbandExt},
warn,
};
use conduwuit_service::Services;
use futures::{FutureExt, StreamExt};
use register::RegistrationKind;
use ruma::{
@@ -33,6 +25,14 @@ use ruma::{
},
push,
};
use tuwunel_core::{
Err, Error, Result, debug_info, err, error, info, is_equal_to,
matrix::pdu::PduBuilder,
utils,
utils::{ReadyExt, stream::BroadbandExt},
warn,
};
use tuwunel_service::Services;
use super::{DEVICE_ID_LENGTH, SESSION_ID_LENGTH, TOKEN_LENGTH, join_room_by_id_helper};
use crate::Ruma;

View File

@@ -1,6 +1,4 @@
use axum::extract::State;
use conduwuit::{Err, Result, err};
use conduwuit_service::Services;
use ruma::{
RoomId, UserId,
api::client::config::{
@@ -15,6 +13,8 @@ use ruma::{
};
use serde::Deserialize;
use serde_json::{json, value::RawValue as RawJsonValue};
use tuwunel_core::{Err, Result, err};
use tuwunel_service::Services;
use crate::Ruma;

View File

@@ -1,12 +1,12 @@
use axum::extract::State;
use conduwuit::{Err, Result, debug};
use conduwuit_service::Services;
use futures::StreamExt;
use rand::seq::SliceRandom;
use ruma::{
OwnedServerName, RoomAliasId, RoomId,
api::client::alias::{create_alias, delete_alias, get_alias},
};
use tuwunel_core::{Err, Result, debug};
use tuwunel_service::Services;
use crate::Ruma;

View File

@@ -1,6 +1,6 @@
use axum::extract::State;
use conduwuit::{Err, Result, err};
use ruma::api::{appservice::ping, client::appservice::request_ping};
use tuwunel_core::{Err, Result, err};
use crate::Ruma;

View File

@@ -1,7 +1,6 @@
use std::cmp::Ordering;
use axum::extract::State;
use conduwuit::{Err, Result, err};
use ruma::{
UInt,
api::client::backup::{
@@ -12,6 +11,7 @@ use ruma::{
update_backup_version,
},
};
use tuwunel_core::{Err, Result, err};
use crate::Ruma;

View File

@@ -1,7 +1,6 @@
use std::collections::BTreeMap;
use axum::extract::State;
use conduwuit::{Result, Server};
use ruma::{
RoomVersionId,
api::client::discovery::get_capabilities::{
@@ -10,6 +9,7 @@ use ruma::{
},
};
use serde_json::json;
use tuwunel_core::{Result, Server};
use crate::Ruma;

View File

@@ -1,5 +1,10 @@
use axum::extract::State;
use conduwuit::{
use futures::{
FutureExt, StreamExt, TryFutureExt, TryStreamExt,
future::{OptionFuture, join, join3, try_join3},
};
use ruma::{OwnedEventId, UserId, api::client::context::get_context, events::StateEventType};
use tuwunel_core::{
Err, Result, at, debug_warn, err,
matrix::pdu::PduEvent,
ref_at,
@@ -9,12 +14,7 @@ use conduwuit::{
stream::{BroadbandExt, ReadyExt, TryIgnore, WidebandExt},
},
};
use conduwuit_service::rooms::{lazy_loading, lazy_loading::Options, short::ShortStateKey};
use futures::{
FutureExt, StreamExt, TryFutureExt, TryStreamExt,
future::{OptionFuture, join, join3, try_join3},
};
use ruma::{OwnedEventId, UserId, api::client::context::get_context, events::StateEventType};
use tuwunel_service::rooms::{lazy_loading, lazy_loading::Options, short::ShortStateKey};
use crate::{
Ruma,

View File

@@ -1,6 +1,5 @@
use axum::extract::State;
use axum_client_ip::InsecureClientIp;
use conduwuit::{Err, Error, Result, debug, err, utils};
use futures::StreamExt;
use ruma::{
MilliSecondsSinceUnixEpoch, OwnedDeviceId,
@@ -10,6 +9,7 @@ use ruma::{
uiaa::{AuthFlow, AuthType, UiaaInfo},
},
};
use tuwunel_core::{Err, Error, Result, debug, err, utils};
use super::SESSION_ID_LENGTH;
use crate::{Ruma, client::DEVICE_ID_LENGTH};

View File

@@ -1,15 +1,5 @@
use axum::extract::State;
use axum_client_ip::InsecureClientIp;
use conduwuit::{
Err, Result, err, info,
utils::{
TryFutureExtExt,
math::Expected,
result::FlatOk,
stream::{ReadyExt, WidebandExt},
},
};
use conduwuit_service::Services;
use futures::{
FutureExt, StreamExt, TryFutureExt,
future::{join, join4, join5},
@@ -36,6 +26,16 @@ use ruma::{
},
uint,
};
use tuwunel_core::{
Err, Result, err, info,
utils::{
TryFutureExtExt,
math::Expected,
result::FlatOk,
stream::{ReadyExt, WidebandExt},
},
};
use tuwunel_service::Services;
use crate::Ruma;

View File

@@ -1,6 +1,6 @@
use axum::extract::State;
use conduwuit::{Result, err};
use ruma::api::client::filter::{create_filter, get_filter};
use tuwunel_core::{Result, err};
use crate::Ruma;

View File

@@ -1,8 +1,6 @@
use std::collections::{BTreeMap, HashMap, HashSet};
use axum::extract::State;
use conduwuit::{Err, Error, Result, debug, debug_warn, err, result::NotFound, utils};
use conduwuit_service::{Services, users::parse_master_key};
use futures::{StreamExt, stream::FuturesUnordered};
use ruma::{
OneTimeKeyAlgorithm, OwnedDeviceId, OwnedUserId, UserId,
@@ -22,6 +20,8 @@ use ruma::{
serde::Raw,
};
use serde_json::json;
use tuwunel_core::{Err, Error, Result, debug, debug_warn, err, result::NotFound, utils};
use tuwunel_service::{Services, users::parse_master_key};
use super::SESSION_ID_LENGTH;
use crate::Ruma;

View File

@@ -2,14 +2,6 @@ use std::time::Duration;
use axum::extract::State;
use axum_client_ip::InsecureClientIp;
use conduwuit::{
Err, Result, err,
utils::{self, content_disposition::make_content_disposition, math::ruma_from_usize},
};
use conduwuit_service::{
Services,
media::{CACHE_CONTROL_IMMUTABLE, CORP_CROSS_ORIGIN, Dim, FileMeta, MXC_LENGTH},
};
use reqwest::Url;
use ruma::{
Mxc, UserId,
@@ -21,6 +13,14 @@ use ruma::{
media::create_content,
},
};
use tuwunel_core::{
Err, Result, err,
utils::{self, content_disposition::make_content_disposition, math::ruma_from_usize},
};
use tuwunel_service::{
Services,
media::{CACHE_CONTROL_IMMUTABLE, CORP_CROSS_ORIGIN, Dim, FileMeta, MXC_LENGTH},
};
use crate::Ruma;

View File

@@ -2,11 +2,6 @@
use axum::extract::State;
use axum_client_ip::InsecureClientIp;
use conduwuit::{
Err, Result, err,
utils::{content_disposition::make_content_disposition, math::ruma_from_usize},
};
use conduwuit_service::media::{CACHE_CONTROL_IMMUTABLE, CORP_CROSS_ORIGIN, Dim, FileMeta};
use reqwest::Url;
use ruma::{
Mxc,
@@ -15,6 +10,11 @@ use ruma::{
get_media_config, get_media_preview,
},
};
use tuwunel_core::{
Err, Result, err,
utils::{content_disposition::make_content_disposition, math::ruma_from_usize},
};
use tuwunel_service::media::{CACHE_CONTROL_IMMUTABLE, CORP_CROSS_ORIGIN, Dim, FileMeta};
use crate::{Ruma, RumaResponse, client::create_content_route};

View File

@@ -8,31 +8,6 @@ use std::{
use axum::extract::State;
use axum_client_ip::InsecureClientIp;
use conduwuit::{
Err, Result, at, debug, debug_error, debug_info, debug_warn, err, error, info, is_matching,
matrix::{
StateKey,
pdu::{PduBuilder, PduEvent, gen_event_id, gen_event_id_canonical_json},
state_res,
},
result::{FlatOk, NotFound},
trace,
utils::{
self, FutureBoolExt,
future::ReadyEqExt,
shuffle,
stream::{BroadbandExt, IterStream, ReadyExt},
},
warn,
};
use conduwuit_service::{
Services,
appservice::RegistrationInfo,
rooms::{
state::RoomMutexGuard,
state_compressor::{CompressedState, HashSetCompressStateEvent},
},
};
use futures::{FutureExt, StreamExt, TryFutureExt, join, pin_mut};
use ruma::{
CanonicalJsonObject, CanonicalJsonValue, OwnedEventId, OwnedRoomId, OwnedServerName,
@@ -60,6 +35,31 @@ use ruma::{
},
},
};
use tuwunel_core::{
Err, Result, at, debug, debug_error, debug_info, debug_warn, err, error, info, is_matching,
matrix::{
StateKey,
pdu::{PduBuilder, PduEvent, gen_event_id, gen_event_id_canonical_json},
state_res,
},
result::{FlatOk, NotFound},
trace,
utils::{
self, FutureBoolExt,
future::ReadyEqExt,
shuffle,
stream::{BroadbandExt, IterStream, ReadyExt},
},
warn,
};
use tuwunel_service::{
Services,
appservice::RegistrationInfo,
rooms::{
state::RoomMutexGuard,
state_compressor::{CompressedState, HashSetCompressStateEvent},
},
};
use crate::{Ruma, client::full_user_deactivate};

View File

@@ -1,5 +1,15 @@
use axum::extract::State;
use conduwuit::{
use futures::{FutureExt, StreamExt, TryFutureExt, future::OptionFuture, pin_mut};
use ruma::{
RoomId, UserId,
api::{
Direction,
client::{filter::RoomEventFilter, message::get_message_events},
},
events::{AnyStateEvent, StateEventType, TimelineEventType, TimelineEventType::*},
serde::Raw,
};
use tuwunel_core::{
Err, Result, at,
matrix::{
Event,
@@ -11,7 +21,7 @@ use conduwuit::{
stream::{BroadbandExt, TryIgnore, WidebandExt},
},
};
use conduwuit_service::{
use tuwunel_service::{
Services,
rooms::{
lazy_loading,
@@ -19,16 +29,6 @@ use conduwuit_service::{
timeline::PdusIterItem,
},
};
use futures::{FutureExt, StreamExt, TryFutureExt, future::OptionFuture, pin_mut};
use ruma::{
RoomId, UserId,
api::{
Direction,
client::{filter::RoomEventFilter, message::get_message_events},
},
events::{AnyStateEvent, StateEventType, TimelineEventType, TimelineEventType::*},
serde::Raw,
};
use crate::Ruma;
@@ -296,7 +296,7 @@ pub(crate) fn event_filter(item: PdusIterItem, filter: &RoomEventFilter) -> Opti
pdu.matches(filter).then_some(item)
}
#[cfg_attr(debug_assertions, conduwuit::ctor)]
#[cfg_attr(debug_assertions, tuwunel_core::ctor)]
fn _is_sorted() {
debug_assert!(
IGNORED_MESSAGE_TYPES.is_sorted(),

View File

@@ -90,4 +90,4 @@ const DEVICE_ID_LENGTH: usize = 10;
const TOKEN_LENGTH: usize = 32;
/// generated user session ID length
const SESSION_ID_LENGTH: usize = service::uiaa::SESSION_ID_LENGTH;
const SESSION_ID_LENGTH: usize = tuwunel_service::uiaa::SESSION_ID_LENGTH;

View File

@@ -1,11 +1,11 @@
use std::time::Duration;
use axum::extract::State;
use conduwuit::{Error, Result, utils};
use ruma::{
api::client::{account, error::ErrorKind},
authentication::TokenType,
};
use tuwunel_core::{Error, Result, utils};
use super::TOKEN_LENGTH;
use crate::Ruma;

View File

@@ -1,8 +1,8 @@
use std::time::Duration;
use axum::extract::State;
use conduwuit::{Err, Result};
use ruma::api::client::presence::{get_presence, set_presence};
use tuwunel_core::{Err, Result};
use crate::Ruma;

View File

@@ -1,13 +1,6 @@
use std::collections::BTreeMap;
use axum::extract::State;
use conduwuit::{
Err, Error, Result,
matrix::pdu::PduBuilder,
utils::{IterStream, stream::TryIgnore},
warn,
};
use conduwuit_service::Services;
use futures::{StreamExt, TryStreamExt, future::join3};
use ruma::{
OwnedMxcUri, OwnedRoomId, UserId,
@@ -23,6 +16,13 @@ use ruma::{
events::room::member::{MembershipState, RoomMemberEventContent},
presence::PresenceState,
};
use tuwunel_core::{
Err, Error, Result,
matrix::pdu::PduBuilder,
utils::{IterStream, stream::TryIgnore},
warn,
};
use tuwunel_service::Services;
use crate::Ruma;

View File

@@ -1,6 +1,4 @@
use axum::extract::State;
use conduwuit::{Err, Error, Result, err};
use conduwuit_service::Services;
use ruma::{
CanonicalJsonObject, CanonicalJsonValue,
api::client::{
@@ -20,6 +18,8 @@ use ruma::{
RemovePushRuleError, Ruleset,
},
};
use tuwunel_core::{Err, Error, Result, err};
use tuwunel_service::Services;
use crate::Ruma;

View File

@@ -1,7 +1,6 @@
use std::collections::BTreeMap;
use axum::extract::State;
use conduwuit::{Err, PduCount, Result, err};
use ruma::{
MilliSecondsSinceUnixEpoch,
api::client::{read_marker::set_read_marker, receipt::create_receipt},
@@ -10,6 +9,7 @@ use ruma::{
receipt::{ReceiptThread, ReceiptType},
},
};
use tuwunel_core::{Err, PduCount, Result, err};
use crate::Ruma;

View File

@@ -1,8 +1,8 @@
use axum::extract::State;
use conduwuit::{Result, matrix::pdu::PduBuilder};
use ruma::{
api::client::redact::redact_event, events::room::redaction::RoomRedactionEventContent,
};
use tuwunel_core::{Result, matrix::pdu::PduBuilder};
use crate::Ruma;

View File

@@ -1,10 +1,4 @@
use axum::extract::State;
use conduwuit::{
Result, at,
matrix::pdu::PduCount,
utils::{IterStream, ReadyExt, result::FlatOk, stream::WidebandExt},
};
use conduwuit_service::{Services, rooms::timeline::PdusIterItem};
use futures::StreamExt;
use ruma::{
EventId, RoomId, UInt, UserId,
@@ -17,6 +11,12 @@ use ruma::{
},
events::{TimelineEventType, relation::RelationType},
};
use tuwunel_core::{
Result, at,
matrix::pdu::PduCount,
utils::{IterStream, ReadyExt, result::FlatOk, stream::WidebandExt},
};
use tuwunel_service::{Services, rooms::timeline::PdusIterItem};
use crate::Ruma;

View File

@@ -2,8 +2,6 @@ use std::time::Duration;
use axum::extract::State;
use axum_client_ip::InsecureClientIp;
use conduwuit::{Err, Error, Result, debug_info, info, matrix::pdu::PduEvent, utils::ReadyExt};
use conduwuit_service::Services;
use rand::Rng;
use ruma::{
EventId, RoomId, UserId,
@@ -15,6 +13,10 @@ use ruma::{
int,
};
use tokio::time::sleep;
use tuwunel_core::{
Err, Error, Result, debug_info, info, matrix::pdu::PduEvent, utils::ReadyExt,
};
use tuwunel_service::Services;
use crate::Ruma;

View File

@@ -1,7 +1,7 @@
use axum::extract::State;
use conduwuit::{Error, Result};
use futures::StreamExt;
use ruma::api::client::{error::ErrorKind, room::aliases};
use tuwunel_core::{Error, Result};
use crate::Ruma;

View File

@@ -1,12 +1,6 @@
use std::collections::BTreeMap;
use axum::extract::State;
use conduwuit::{
Err, Error, Result, debug_info, debug_warn, err, error, info,
matrix::{StateKey, pdu::PduBuilder},
warn,
};
use conduwuit_service::{Services, appservice::RegistrationInfo};
use futures::FutureExt;
use ruma::{
CanonicalJsonObject, Int, OwnedRoomAliasId, OwnedRoomId, OwnedUserId, RoomId, RoomVersionId,
@@ -32,6 +26,12 @@ use ruma::{
serde::{JsonObject, Raw},
};
use serde_json::{json, value::to_raw_value};
use tuwunel_core::{
Err, Error, Result, debug_info, debug_warn, err, error, info,
matrix::{StateKey, pdu::PduBuilder},
warn,
};
use tuwunel_service::{Services, appservice::RegistrationInfo};
use crate::{Ruma, client::invite_helper};

View File

@@ -1,7 +1,7 @@
use axum::extract::State;
use conduwuit::{Err, Event, Result, err};
use futures::{FutureExt, TryFutureExt, future::try_join};
use ruma::api::client::room::get_room_event;
use tuwunel_core::{Err, Event, Result, err};
use crate::{Ruma, client::is_ignored_pdu};

View File

@@ -1,10 +1,10 @@
use axum::extract::State;
use conduwuit::{
use futures::TryStreamExt;
use ruma::api::client::room::initial_sync::v3::{PaginationChunk, Request, Response};
use tuwunel_core::{
Err, PduEvent, Result, at,
utils::{BoolExt, stream::TryTools},
};
use futures::TryStreamExt;
use ruma::api::client::room::initial_sync::v3::{PaginationChunk, Request, Response};
use crate::Ruma;

View File

@@ -1,9 +1,5 @@
use axum::extract::State;
use axum_client_ip::InsecureClientIp;
use conduwuit::{
Err, Result, debug_warn, trace,
utils::{IterStream, future::TryExtExt},
};
use futures::{
FutureExt, StreamExt,
future::{OptionFuture, join3},
@@ -18,7 +14,11 @@ use ruma::{
events::room::member::MembershipState,
space::SpaceRoomJoinRule::{self, *},
};
use service::Services;
use tuwunel_core::{
Err, Result, debug_warn, trace,
utils::{IterStream, future::TryExtExt},
};
use tuwunel_service::Services;
use crate::{Ruma, RumaResponse};

View File

@@ -1,10 +1,6 @@
use std::cmp::max;
use axum::extract::State;
use conduwuit::{
Error, Result, err, info,
matrix::{StateKey, pdu::PduBuilder},
};
use futures::StreamExt;
use ruma::{
CanonicalJsonObject, RoomId, RoomVersionId,
@@ -20,6 +16,10 @@ use ruma::{
int,
};
use serde_json::{json, value::to_raw_value};
use tuwunel_core::{
Error, Result, err, info,
matrix::{StateKey, pdu::PduBuilder},
};
use crate::Ruma;

View File

@@ -1,13 +1,6 @@
use std::collections::BTreeMap;
use axum::extract::State;
use conduwuit::{
Err, Result, at, is_true,
matrix::pdu::PduEvent,
result::FlatOk,
utils::{IterStream, stream::ReadyExt},
};
use conduwuit_service::{Services, rooms::search::RoomQuery};
use futures::{FutureExt, StreamExt, TryFutureExt, TryStreamExt, future::OptionFuture};
use ruma::{
OwnedRoomId, RoomId, UInt, UserId,
@@ -19,6 +12,13 @@ use ruma::{
serde::Raw,
};
use search_events::v3::{Request, Response};
use tuwunel_core::{
Err, Result, at, is_true,
matrix::pdu::PduEvent,
result::FlatOk,
utils::{IterStream, stream::ReadyExt},
};
use tuwunel_service::{Services, rooms::search::RoomQuery};
use crate::Ruma;

View File

@@ -1,9 +1,9 @@
use std::collections::BTreeMap;
use axum::extract::State;
use conduwuit::{Err, Result, err, matrix::pdu::PduBuilder, utils};
use ruma::{api::client::message::send_message_event, events::MessageLikeEventType};
use serde_json::from_str;
use tuwunel_core::{Err, Result, err, matrix::pdu::PduBuilder, utils};
use crate::Ruma;

View File

@@ -2,11 +2,6 @@ use std::time::Duration;
use axum::extract::State;
use axum_client_ip::InsecureClientIp;
use conduwuit::{
Err, Error, Result, debug, err, info, utils,
utils::{ReadyExt, hash},
};
use conduwuit_service::uiaa::SESSION_ID_LENGTH;
use futures::StreamExt;
use ruma::{
UserId,
@@ -26,6 +21,11 @@ use ruma::{
uiaa,
},
};
use tuwunel_core::{
Err, Error, Result, debug, err, info, utils,
utils::{ReadyExt, hash},
};
use tuwunel_service::uiaa::SESSION_ID_LENGTH;
use super::{DEVICE_ID_LENGTH, TOKEN_LENGTH};
use crate::Ruma;

View File

@@ -4,20 +4,20 @@ use std::{
};
use axum::extract::State;
use conduwuit::{
use futures::{StreamExt, TryFutureExt, future::OptionFuture};
use ruma::{
OwnedRoomId, OwnedServerName, RoomId, UInt, UserId, api::client::space::get_hierarchy,
};
use tuwunel_core::{
Err, Result,
utils::{future::TryExtExt, stream::IterStream},
};
use conduwuit_service::{
use tuwunel_service::{
Services,
rooms::spaces::{
PaginationToken, SummaryAccessibility, get_parent_children_via, summary_to_chunk,
},
};
use futures::{StreamExt, TryFutureExt, future::OptionFuture};
use ruma::{
OwnedRoomId, OwnedServerName, RoomId, UInt, UserId, api::client::space::get_hierarchy,
};
use crate::Ruma;

View File

@@ -1,10 +1,4 @@
use axum::extract::State;
use conduwuit::{
Err, Result, err,
matrix::pdu::{PduBuilder, PduEvent},
utils::BoolExt,
};
use conduwuit_service::Services;
use futures::TryStreamExt;
use ruma::{
OwnedEventId, RoomId, UserId,
@@ -21,6 +15,12 @@ use ruma::{
},
serde::Raw,
};
use tuwunel_core::{
Err, Result, err,
matrix::pdu::{PduBuilder, PduEvent},
utils::BoolExt,
};
use tuwunel_service::Services;
use crate::{Ruma, RumaResponse};

View File

@@ -2,12 +2,6 @@ mod v3;
mod v4;
mod v5;
use conduwuit::{
Error, PduCount, Result,
matrix::pdu::PduEvent,
utils::stream::{BroadbandExt, ReadyExt, TryIgnore},
};
use conduwuit_service::Services;
use futures::{StreamExt, pin_mut};
use ruma::{
RoomId, UserId,
@@ -15,6 +9,12 @@ use ruma::{
self, Beacon, CallInvite, PollStart, RoomEncrypted, RoomMessage, Sticker,
},
};
use tuwunel_core::{
Error, PduCount, Result,
matrix::pdu::PduEvent,
utils::stream::{BroadbandExt, ReadyExt, TryIgnore},
};
use tuwunel_service::Services;
pub(crate) use self::{
v3::sync_events_route, v4::sync_events_v4_route, v5::sync_events_v5_route,

View File

@@ -5,30 +5,6 @@ use std::{
};
use axum::extract::State;
use conduwuit::{
Result, at, err, error, extract_variant, is_equal_to,
matrix::{
Event,
pdu::{EventHash, PduCount, PduEvent},
},
pair_of, ref_at,
result::FlatOk,
utils::{
self, BoolExt, FutureBoolExt, IterStream, ReadyExt, TryFutureExtExt,
future::{OptionStream, ReadyEqExt},
math::ruma_from_u64,
stream::{BroadbandExt, Tools, TryExpect, WidebandExt},
},
warn,
};
use conduwuit_service::{
Services,
rooms::{
lazy_loading,
lazy_loading::{Options, Witness},
short::ShortStateHash,
},
};
use futures::{
FutureExt, StreamExt, TryFutureExt, TryStreamExt,
future::{OptionFuture, join, join3, join4, join5, try_join, try_join4},
@@ -57,7 +33,30 @@ use ruma::{
serde::Raw,
uint,
};
use service::rooms::short::{ShortEventId, ShortStateKey};
use tuwunel_core::{
Result, at, err, error, extract_variant, is_equal_to,
matrix::{
Event,
pdu::{EventHash, PduCount, PduEvent},
},
pair_of, ref_at,
result::FlatOk,
utils::{
self, BoolExt, FutureBoolExt, IterStream, ReadyExt, TryFutureExtExt,
future::{OptionStream, ReadyEqExt},
math::ruma_from_u64,
stream::{BroadbandExt, Tools, TryExpect, WidebandExt},
},
warn,
};
use tuwunel_service::{
Services,
rooms::{
lazy_loading,
lazy_loading::{Options, Witness},
short::{ShortEventId, ShortStateHash, ShortStateKey},
},
};
use super::{load_timeline, share_encrypted_room};
use crate::{Ruma, RumaResponse, client::ignored_filter};

View File

@@ -5,20 +5,6 @@ use std::{
};
use axum::extract::State;
use conduwuit::{
Err, Error, PduCount, PduEvent, Result, debug, error, extract_variant,
matrix::TypeStateKey,
utils::{
BoolExt, IterStream, ReadyExt, TryFutureExtExt,
math::{ruma_from_usize, usize_from_ruma, usize_from_u64_truncated},
},
warn,
};
use conduwuit_service::{
Services,
rooms::read_receipt::pack_receipts,
sync::{into_db_key, into_snake_key},
};
use futures::{FutureExt, StreamExt, TryFutureExt};
use ruma::{
MilliSecondsSinceUnixEpoch, OwnedEventId, OwnedRoomId, RoomId, UInt, UserId,
@@ -35,6 +21,20 @@ use ruma::{
serde::Raw,
uint,
};
use tuwunel_core::{
Err, Error, PduCount, PduEvent, Result, debug, error, extract_variant,
matrix::TypeStateKey,
utils::{
BoolExt, IterStream, ReadyExt, TryFutureExtExt,
math::{ruma_from_usize, usize_from_ruma, usize_from_u64_truncated},
},
warn,
};
use tuwunel_service::{
Services,
rooms::read_receipt::pack_receipts,
sync::{into_db_key, into_snake_key},
};
use super::{load_timeline, share_encrypted_room};
use crate::{

View File

@@ -6,21 +6,6 @@ use std::{
};
use axum::extract::State;
use conduwuit::{
Err, Error, Result, error, extract_variant, is_equal_to,
matrix::{
TypeStateKey,
pdu::{PduCount, PduEvent},
},
trace,
utils::{
BoolExt, FutureBoolExt, IterStream, ReadyExt, TryFutureExtExt,
future::ReadyEqExt,
math::{ruma_from_usize, usize_from_ruma},
},
warn,
};
use conduwuit_service::{Services, rooms::read_receipt::pack_receipts, sync::into_snake_key};
use futures::{
FutureExt, Stream, StreamExt, TryFutureExt,
future::{OptionFuture, join3, try_join4},
@@ -37,6 +22,21 @@ use ruma::{
serde::Raw,
uint,
};
use tuwunel_core::{
Err, Error, Result, error, extract_variant, is_equal_to,
matrix::{
TypeStateKey,
pdu::{PduCount, PduEvent},
},
trace,
utils::{
BoolExt, FutureBoolExt, IterStream, ReadyExt, TryFutureExtExt,
future::ReadyEqExt,
math::{ruma_from_usize, usize_from_ruma},
},
warn,
};
use tuwunel_service::{Services, rooms::read_receipt::pack_receipts, sync::into_snake_key};
use super::share_encrypted_room;
use crate::{

View File

@@ -1,7 +1,6 @@
use std::collections::BTreeMap;
use axum::extract::State;
use conduwuit::Result;
use ruma::{
api::client::tag::{create_tag, delete_tag, get_tags},
events::{
@@ -9,6 +8,7 @@ use ruma::{
tag::{TagEvent, TagEventContent},
},
};
use tuwunel_core::Result;
use crate::Ruma;

View File

@@ -1,7 +1,7 @@
use std::collections::BTreeMap;
use conduwuit::Result;
use ruma::api::client::thirdparty::get_protocols;
use tuwunel_core::Result;
use crate::{Ruma, RumaResponse};

View File

@@ -1,10 +1,10 @@
use axum::extract::State;
use conduwuit::{
use futures::StreamExt;
use ruma::{api::client::threads::get_threads, uint};
use tuwunel_core::{
Result, at,
matrix::pdu::{PduCount, PduEvent},
};
use futures::StreamExt;
use ruma::{api::client::threads::get_threads, uint};
use crate::Ruma;

View File

@@ -1,8 +1,6 @@
use std::collections::BTreeMap;
use axum::extract::State;
use conduwuit::{Error, Result};
use conduwuit_service::sending::EduBuf;
use futures::StreamExt;
use ruma::{
api::{
@@ -11,6 +9,8 @@ use ruma::{
},
to_device::DeviceIdOrAllDevices,
};
use tuwunel_core::{Error, Result};
use tuwunel_service::sending::EduBuf;
use crate::Ruma;

View File

@@ -1,6 +1,6 @@
use axum::extract::State;
use conduwuit::{Err, Result, utils, utils::math::Tried};
use ruma::api::client::typing::create_typing_event;
use tuwunel_core::{Err, Result, utils, utils::math::Tried};
use crate::Ruma;

View File

@@ -2,7 +2,6 @@ use std::collections::BTreeMap;
use axum::extract::State;
use axum_client_ip::InsecureClientIp;
use conduwuit::{Err, Error, Result};
use futures::StreamExt;
use ruma::{
OwnedRoomId,
@@ -19,6 +18,7 @@ use ruma::{
},
presence::PresenceState,
};
use tuwunel_core::{Err, Error, Result};
use super::{update_avatar_url, update_displayname};
use crate::Ruma;

View File

@@ -1,9 +1,9 @@
use std::collections::BTreeMap;
use axum::{Json, extract::State, response::IntoResponse};
use conduwuit::Result;
use futures::StreamExt;
use ruma::api::client::discovery::get_supported_versions;
use tuwunel_core::Result;
use crate::Ruma;
@@ -60,23 +60,23 @@ pub(crate) async fn get_supported_versions_route(
Ok(resp)
}
/// # `GET /_conduwuit/server_version`
/// # `GET /_tuwunel/server_version`
///
/// Conduwuit-specific API to get the server version, results akin to
/// Tuwunel-specific API to get the server version, results akin to
/// `/_matrix/federation/v1/version`
pub(crate) async fn conduwuit_server_version() -> Result<impl IntoResponse> {
pub(crate) async fn tuwunel_server_version() -> Result<impl IntoResponse> {
Ok(Json(serde_json::json!({
"name": conduwuit::version::name(),
"version": conduwuit::version::version(),
"name": tuwunel_core::version::name(),
"version": tuwunel_core::version::version(),
})))
}
/// # `GET /_conduwuit/local_user_count`
/// # `GET /_tuwunel/local_user_count`
///
/// conduwuit-specific API to return the amount of users registered on this
/// Tuwunel-specific API to return the amount of users registered on this
/// homeserver. Endpoint is disabled if federation is disabled for privacy. This
/// only includes active users (not deactivated, no guests, etc)
pub(crate) async fn conduwuit_local_user_count(
pub(crate) async fn tuwunel_local_user_count(
State(services): State<crate::State>,
) -> Result<impl IntoResponse> {
let user_count = services.users.list_local_users().count().await;

View File

@@ -1,16 +1,16 @@
use axum::extract::State;
use conduwuit::{
use futures::{FutureExt, StreamExt, pin_mut};
use ruma::{
api::client::user_directory::search_users::{self},
events::room::join_rules::JoinRule,
};
use tuwunel_core::{
Result,
utils::{
future::BoolExt,
stream::{BroadbandExt, ReadyExt},
},
};
use futures::{FutureExt, StreamExt, pin_mut};
use ruma::{
api::client::user_directory::search_users::{self},
events::room::join_rules::JoinRule,
};
use crate::Ruma;

View File

@@ -2,10 +2,10 @@ use std::time::{Duration, SystemTime};
use axum::extract::State;
use base64::{Engine as _, engine::general_purpose};
use conduwuit::{Err, Result, utils};
use hmac::{Hmac, Mac};
use ruma::{SecondsSinceUnixEpoch, UserId, api::client::voip::get_turn_server_info};
use sha1::Sha1;
use tuwunel_core::{Err, Result, utils};
use crate::Ruma;

View File

@@ -1,5 +1,4 @@
use axum::{Json, extract::State, response::IntoResponse};
use conduwuit::{Error, Result};
use ruma::api::client::{
discovery::{
discover_homeserver::{self, HomeserverInfo, SlidingSyncProxyInfo},
@@ -7,6 +6,7 @@ use ruma::api::client::{
},
error::ErrorKind,
};
use tuwunel_core::{Error, Result};
use crate::Ruma;
@@ -94,6 +94,6 @@ pub(crate) async fn syncv3_client_server_json(
Ok(Json(serde_json::json!({
"server": server_url,
"version": conduwuit::version(),
"version": tuwunel_core::version(),
})))
}

View File

@@ -5,10 +5,7 @@ pub mod client;
pub mod router;
pub mod server;
extern crate conduwuit_core as conduwuit;
extern crate conduwuit_service as service;
pub(crate) use self::router::{Ruma, RumaResponse, State};
conduwuit::mod_ctor! {}
conduwuit::mod_dtor! {}
tuwunel_core::mod_ctor! {}
tuwunel_core::mod_dtor! {}

View File

@@ -12,8 +12,8 @@ use axum::{
response::{IntoResponse, Redirect},
routing::{any, get, post},
};
use conduwuit::{Server, err};
use http::{Uri, uri};
use tuwunel_core::{Server, err};
use self::handler::RouterExt;
pub(super) use self::{args::Args as Ruma, response::RumaResponse, state::State};
@@ -185,7 +185,7 @@ pub fn build(router: Router<State>, server: &Server) -> Router<State> {
)
.ruma_route(&client::well_known_support)
.ruma_route(&client::well_known_client)
.route("/_conduwuit/server_version", get(client::conduwuit_server_version))
.route("/_tuwunel/server_version", get(client::tuwunel_server_version))
.ruma_route(&client::room_initial_sync_route)
.route("/client/server.json", get(client::syncv3_client_server_json));
@@ -225,13 +225,13 @@ pub fn build(router: Router<State>, server: &Server) -> Router<State> {
.ruma_route(&server::well_known_server)
.ruma_route(&server::get_content_route)
.ruma_route(&server::get_content_thumbnail_route)
.route("/_conduwuit/local_user_count", get(client::conduwuit_local_user_count));
.route("/_tuwunel/local_user_count", get(client::tuwunel_local_user_count));
} else {
router = router
.route("/_matrix/federation/*path", any(federation_disabled))
.route("/.well-known/matrix/server", any(federation_disabled))
.route("/_matrix/key/*path", any(federation_disabled))
.route("/_conduwuit/local_user_count", any(federation_disabled));
.route("/_tuwunel/local_user_count", any(federation_disabled));
}
if config.allow_legacy_media {

View File

@@ -3,15 +3,15 @@ use std::{mem, ops::Deref};
use async_trait::async_trait;
use axum::{body::Body, extract::FromRequest};
use bytes::{BufMut, Bytes, BytesMut};
use conduwuit::{Error, Result, debug, debug_warn, err, trace, utils::string::EMPTY};
use ruma::{
CanonicalJsonObject, CanonicalJsonValue, DeviceId, OwnedDeviceId, OwnedServerName,
OwnedUserId, ServerName, UserId, api::IncomingRequest,
};
use service::Services;
use tuwunel_core::{Error, Result, debug, debug_warn, err, trace, utils::string::EMPTY};
use tuwunel_service::{Services, appservice::RegistrationInfo};
use super::{auth, auth::Auth, request, request::Request};
use crate::{State, service::appservice::RegistrationInfo};
use crate::State;
/// Extractor for Ruma request structs
pub(crate) struct Args<T> {

View File

@@ -4,7 +4,6 @@ use axum_extra::{
headers::{Authorization, authorization::Bearer},
typed_header::TypedHeaderRejectionReason,
};
use conduwuit::{Err, Error, Result, debug_error, err, warn};
use ruma::{
CanonicalJsonObject, CanonicalJsonValue, OwnedDeviceId, OwnedServerName, OwnedUserId, UserId,
api::{
@@ -20,13 +19,14 @@ use ruma::{
federation::{authentication::XMatrix, openid::get_openid_userinfo},
},
};
use service::{
use tuwunel_core::{Err, Error, Result, debug_error, err, warn};
use tuwunel_service::{
Services,
appservice::RegistrationInfo,
server_keys::{PubKeyMap, PubKeys},
};
use super::request::Request;
use crate::service::appservice::RegistrationInfo;
enum Token {
Appservice(Box<RegistrationInfo>),

View File

@@ -4,10 +4,10 @@ use axum::{
response::IntoResponse,
routing::{MethodFilter, on},
};
use conduwuit::Result;
use futures::{Future, TryFutureExt};
use http::Method;
use ruma::api::IncomingRequest;
use tuwunel_core::Result;
use super::{Ruma, RumaResponse, State};

View File

@@ -2,10 +2,10 @@ use std::str;
use axum::{RequestExt, RequestPartsExt, extract::Path};
use bytes::Bytes;
use conduwuit::{Result, err};
use http::request::Parts;
use serde::Deserialize;
use service::Services;
use tuwunel_core::{Result, err};
use tuwunel_service::Services;
#[derive(Deserialize)]
pub(super) struct QueryParams {

Some files were not shown because too many files have changed in this diff Show More