feat: federation disabled by default

It can be enable in the Rocket.toml config or using ROCKET_FEDERATION_ENABLED=true
This commit is contained in:
Timo Kösters 2020-10-06 21:04:51 +02:00
parent c15ae3c126
commit 6afc4c9b3e
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
5 changed files with 50 additions and 1 deletions

View file

@ -14,6 +14,7 @@ pub struct Globals {
max_request_size: u32,
registration_disabled: bool,
encryption_disabled: bool,
federation_enabled: bool,
}
impl Globals {
@ -69,6 +70,7 @@ impl Globals {
.map_err(|_| Error::BadConfig("Invalid max_request_size."))?,
registration_disabled: config.get_bool("registration_disabled").unwrap_or(false),
encryption_disabled: config.get_bool("encryption_disabled").unwrap_or(false),
federation_enabled: config.get_bool("federation_enabled").unwrap_or(false),
})
}
@ -114,4 +116,8 @@ impl Globals {
pub fn encryption_disabled(&self) -> bool {
self.encryption_disabled
}
pub fn federation_enabled(&self) -> bool {
self.federation_enabled
}
}