@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use conduwuit::{Err, Result, checked};
|
||||
use futures::{FutureExt, StreamExt, TryFutureExt};
|
||||
use tuwunel_core::{Err, Result, checked};
|
||||
|
||||
use crate::admin_command;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
mod commands;
|
||||
|
||||
use clap::Subcommand;
|
||||
use conduwuit::Result;
|
||||
use tuwunel_core::Result;
|
||||
|
||||
use crate::admin_command_dispatch;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
mod commands;
|
||||
|
||||
use clap::Subcommand;
|
||||
use conduwuit::Result;
|
||||
use tuwunel_core::Result;
|
||||
|
||||
use crate::admin_command_dispatch;
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use conduwuit::{Err, Result};
|
||||
use tuwunel_core::{Err, Result};
|
||||
|
||||
use crate::{admin_command, admin_command_dispatch};
|
||||
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:?}");
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use clap::Subcommand;
|
||||
use conduwuit::Result;
|
||||
use futures::TryStreamExt;
|
||||
use tuwunel_core::Result;
|
||||
|
||||
use crate::Context;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use clap::Subcommand;
|
||||
use conduwuit::Result;
|
||||
use ruma::OwnedServerName;
|
||||
use tuwunel_core::Result;
|
||||
|
||||
use crate::Context;
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use clap::Subcommand;
|
||||
use conduwuit::Result;
|
||||
use futures::StreamExt;
|
||||
use ruma::OwnedUserId;
|
||||
use tuwunel_core::Result;
|
||||
|
||||
use crate::Context;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use clap::Subcommand;
|
||||
use conduwuit::Result;
|
||||
use ruma::OwnedUserId;
|
||||
use tuwunel_core::Result;
|
||||
|
||||
use crate::Context;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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?;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use clap::Subcommand;
|
||||
use conduwuit::Result;
|
||||
use futures::StreamExt;
|
||||
use ruma::{OwnedRoomAliasId, OwnedRoomId};
|
||||
use tuwunel_core::Result;
|
||||
|
||||
use crate::Context;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -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!(
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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('&', "&")
|
||||
|
||||
Reference in New Issue
Block a user