mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
Move TURN config to separate config section
This renames: turn_username -> turn.username turn_password -> turn.password turn_uris -> turn.uris turn_secret -> turn.secret turn_ttl -> turn.ttl
This commit is contained in:
parent
e911518aac
commit
79d5d306cc
2 changed files with 28 additions and 18 deletions
|
|
@ -81,15 +81,7 @@ pub(crate) struct Config {
|
|||
#[serde(default)]
|
||||
pub(crate) log_format: LogFormat,
|
||||
#[serde(default)]
|
||||
pub(crate) turn_username: String,
|
||||
#[serde(default)]
|
||||
pub(crate) turn_password: String,
|
||||
#[serde(default = "Vec::new")]
|
||||
pub(crate) turn_uris: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub(crate) turn_secret: String,
|
||||
#[serde(default = "default_turn_ttl")]
|
||||
pub(crate) turn_ttl: u64,
|
||||
pub(crate) turn: TurnConfig,
|
||||
|
||||
pub(crate) emergency_password: Option<String>,
|
||||
}
|
||||
|
|
@ -144,6 +136,28 @@ pub(crate) enum LogFormat {
|
|||
Json,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[serde(default)]
|
||||
pub(crate) struct TurnConfig {
|
||||
pub(crate) username: String,
|
||||
pub(crate) password: String,
|
||||
pub(crate) uris: Vec<String>,
|
||||
pub(crate) secret: String,
|
||||
pub(crate) ttl: u64,
|
||||
}
|
||||
|
||||
impl Default for TurnConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
username: String::new(),
|
||||
password: String::new(),
|
||||
uris: Vec::new(),
|
||||
secret: String::new(),
|
||||
ttl: 60 * 60 * 24,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn false_fn() -> bool {
|
||||
false
|
||||
}
|
||||
|
|
@ -213,10 +227,6 @@ fn default_log() -> EnvFilterClone {
|
|||
.expect("hardcoded env filter should be valid")
|
||||
}
|
||||
|
||||
fn default_turn_ttl() -> u64 {
|
||||
60 * 60 * 24
|
||||
}
|
||||
|
||||
// I know, it's a great name
|
||||
pub(crate) fn default_default_room_version() -> RoomVersionId {
|
||||
RoomVersionId::V10
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue