1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-06-03 17:14:08 +02:00

more office wip, only wss proxy missing it seems

This commit is contained in:
Robin Appelman 2023-02-13 17:37:38 +01:00
commit 2a7f4de2b7
11 changed files with 186 additions and 110 deletions

View file

@ -1,3 +1,4 @@
use crate::service::ServiceTrait;
use crate::{Cloud, HazeConfig};
use crate::{Result, Service};
use bollard::Docker;
@ -63,6 +64,20 @@ impl ActiveInstances {
.next()?;
let ip = push.get_ip(&self.docker, &cloud.id).await.ok()?;
SocketAddr::new(ip, 7867)
} else if let Some(name) = name.strip_suffix("-office") {
let cloud = Cloud::get_by_filter(&self.docker, Some(name.into()), &self.config)
.await
.ok()?;
let office = cloud
.services
.iter()
.filter_map(|service| match service {
Service::Office(office) => Some(office),
_ => None,
})
.next()?;
let ip = office.get_ip(&self.docker, &cloud.id).await.ok()?;
SocketAddr::new(ip, 9980)
} else {
SocketAddr::new(
Cloud::get_by_filter(&self.docker, Some(name.into()), &self.config)