forked from jmug/stoatchat
feat: private livekit nodes
This commit is contained in:
@@ -188,7 +188,11 @@ pub struct LiveKitNode {
|
||||
pub lat: f64,
|
||||
pub lon: f64,
|
||||
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)]
|
||||
|
||||
@@ -115,15 +115,18 @@ pub async fn root() -> Result<Json<RevoltConfig>> {
|
||||
},
|
||||
livekit: VoiceFeature {
|
||||
enabled: !config.hosts.livekit.is_empty(),
|
||||
nodes: config.api.livekit.nodes.iter().map(|(name, value)| {
|
||||
VoiceNode {
|
||||
name: name.clone(),
|
||||
lat: value.lat,
|
||||
lon: value.lon,
|
||||
public_url: config.hosts.livekit.get(name).expect("Missing corresponding host for voice node").clone()
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
nodes: config.api.livekit.nodes
|
||||
.iter()
|
||||
.filter(|(_, node)| !node.private)
|
||||
.map(|(name, value)| {
|
||||
VoiceNode {
|
||||
name: name.clone(),
|
||||
lat: value.lat,
|
||||
lon: value.lon,
|
||||
public_url: config.hosts.livekit.get(name).expect("Missing corresponding host for voice node").clone()
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
},
|
||||
},
|
||||
ws: config.hosts.events,
|
||||
|
||||
Reference in New Issue
Block a user