feat: private livekit nodes
This commit is contained in:
@@ -188,7 +188,11 @@ pub struct LiveKitNode {
|
|||||||
pub lat: f64,
|
pub lat: f64,
|
||||||
pub lon: f64,
|
pub lon: f64,
|
||||||
pub key: String,
|
pub key: String,
|
||||||
pub secret: String
|
pub secret: String,
|
||||||
|
|
||||||
|
// whether to hide the node in the nodes list
|
||||||
|
#[serde(default)]
|
||||||
|
pub private: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
|
|||||||
@@ -115,15 +115,18 @@ pub async fn root() -> Result<Json<RevoltConfig>> {
|
|||||||
},
|
},
|
||||||
livekit: VoiceFeature {
|
livekit: VoiceFeature {
|
||||||
enabled: !config.hosts.livekit.is_empty(),
|
enabled: !config.hosts.livekit.is_empty(),
|
||||||
nodes: config.api.livekit.nodes.iter().map(|(name, value)| {
|
nodes: config.api.livekit.nodes
|
||||||
VoiceNode {
|
.iter()
|
||||||
name: name.clone(),
|
.filter(|(_, node)| !node.private)
|
||||||
lat: value.lat,
|
.map(|(name, value)| {
|
||||||
lon: value.lon,
|
VoiceNode {
|
||||||
public_url: config.hosts.livekit.get(name).expect("Missing corresponding host for voice node").clone()
|
name: name.clone(),
|
||||||
}
|
lat: value.lat,
|
||||||
})
|
lon: value.lon,
|
||||||
.collect()
|
public_url: config.hosts.livekit.get(name).expect("Missing corresponding host for voice node").clone()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.collect()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ws: config.hosts.events,
|
ws: config.hosts.events,
|
||||||
|
|||||||
Reference in New Issue
Block a user