improvement: matrix.org is default trusted server if unspecified

This commit is contained in:
Timo Kösters 2023-08-10 17:45:58 +02:00
parent 606b25b9e7
commit 19bfee1835
No known key found for this signature in database
GPG key ID: 0B25E636FBA7E4CB

View file

@ -65,7 +65,7 @@ pub struct Config {
#[serde(default)]
pub proxy: ProxyConfig,
pub jwt_secret: Option<String>,
#[serde(default = "Vec::new")]
#[serde(default = "default_trusted_servers")]
pub trusted_servers: Vec<OwnedServerName>,
#[serde(default = "default_log")]
pub log: String,
@ -259,6 +259,10 @@ fn default_max_fetch_prev_events() -> u16 {
100_u16
}
fn default_trusted_servers() -> Vec<OwnedServerName> {
vec![OwnedServerName::try_from("matrix.org").unwrap()]
}
fn default_log() -> String {
"warn,state_res=warn,_=off,sled=off".to_owned()
}