Add show-config admin room command

This commit is contained in:
Andrej Kacian 2022-02-06 20:23:22 +01:00
parent 237645e975
commit 196c83939c
3 changed files with 100 additions and 1 deletions

View file

@ -259,6 +259,9 @@ enum AdminCommand {
/// Print database memory usage statistics
DatabaseMemoryUsage,
/// Show configuration values
ShowConfig,
}
fn process_admin_command(
@ -428,6 +431,10 @@ fn process_admin_command(
e
)),
},
AdminCommand::ShowConfig => {
// Construct and send the response
RoomMessageEventContent::text_plain(format!("{}", db.globals.config))
}
};
Ok(reply_message_content)

View file

@ -35,7 +35,7 @@ pub struct Globals {
pub actual_destination_cache: Arc<RwLock<WellKnownMap>>, // actual_destination, host
pub tls_name_override: Arc<RwLock<TlsNameMap>>,
pub(super) globals: Arc<dyn Tree>,
config: Config,
pub config: Config,
keypair: Arc<ruma::signatures::Ed25519KeyPair>,
dns_resolver: TokioAsyncResolver,
jwt_decoding_key: Option<jsonwebtoken::DecodingKey<'static>>,