mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-03 09:04:12 +02:00
more office wip, only wss proxy missing it seems
This commit is contained in:
parent
7910b9d034
commit
2a7f4de2b7
11 changed files with 186 additions and 110 deletions
28
src/cloud.rs
28
src/cloud.rs
|
|
@ -78,10 +78,6 @@ impl CloudOptions {
|
|||
app_packages: app_package,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn with_php(self, php: PhpVersion) -> Self {
|
||||
CloudOptions { php, ..self }
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
@ -392,13 +388,7 @@ impl Cloud {
|
|||
}
|
||||
});
|
||||
|
||||
let clean_id = id.strip_prefix("haze-").unwrap_or(&id);
|
||||
|
||||
let address = match (&config.proxy.address, config.proxy.https) {
|
||||
(public, true) if !public.is_empty() => format!("https://{clean_id}.{public}"),
|
||||
(public, false) if !public.is_empty() => format!("http://{clean_id}.{public}"),
|
||||
_ => format!("http://{ip}"),
|
||||
};
|
||||
let address = config.proxy.addr(&id, ip);
|
||||
|
||||
Ok(Cloud {
|
||||
id,
|
||||
|
|
@ -543,18 +533,10 @@ impl Cloud {
|
|||
== 1;
|
||||
|
||||
let ip = network_info.ip_address.as_ref()?.parse().ok();
|
||||
|
||||
let clean_id = id.strip_prefix("haze-").unwrap_or(&id);
|
||||
|
||||
let address = match (&config.proxy.address, config.proxy.https, ip) {
|
||||
(public, true, Some(_)) if !public.is_empty() => {
|
||||
format!("https://{clean_id}.{public}")
|
||||
}
|
||||
(public, false, Some(_)) if !public.is_empty() => {
|
||||
format!("http://{clean_id}.{public}")
|
||||
}
|
||||
(_, _, Some(ip)) => format!("http://{ip}"),
|
||||
_ => "Not running".into(),
|
||||
let address = if let Some(ip) = ip {
|
||||
config.proxy.addr(&id, ip)
|
||||
} else {
|
||||
"Not running".into()
|
||||
};
|
||||
|
||||
service_ids.push(id.clone());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue