Skip to main content

tuwunel_admin/appservice/
show_config.rs

1use tuwunel_core::{Result, err};
2
3use crate::admin_command;
4
5#[admin_command]
6pub(super) async fn appservice_show_config(&self, appservice_identifier: String) -> Result {
7	let config = self
8		.services
9		.appservice
10		.get_registration(&appservice_identifier)
11		.await
12		.ok_or(err!("Appservice does not exist."))?;
13
14	let config_str = serde_yaml::to_string(&config)?;
15
16	write!(self, "Config for {appservice_identifier}:\n\n```yaml\n{config_str}\n```").await
17}