mirror of
https://codeberg.org/icewind/haze.git
synced 2026-11-30 04:30:47 +01:00
gate tray behind a (default) feature
This commit is contained in:
parent
388ade7b0b
commit
9401a3dc7e
4 changed files with 8 additions and 1 deletions
|
|
@ -55,10 +55,13 @@ axum = { version = "0.8.9", features = ["macros", "tokio"] }
|
||||||
hyper = "1.11.0"
|
hyper = "1.11.0"
|
||||||
hyper-reverse-proxy = { git = "https://code.betamike.com/micropelago/hyper-reverse-proxy.git", rev = "d5a6f799189360d9449ae47ab3cdde511f02cf39", version = "0.5.2-dev" }
|
hyper-reverse-proxy = { git = "https://code.betamike.com/micropelago/hyper-reverse-proxy.git", rev = "d5a6f799189360d9449ae47ab3cdde511f02cf39", version = "0.5.2-dev" }
|
||||||
hyper-util = "0.1.20"
|
hyper-util = "0.1.20"
|
||||||
ksni = "0.3.6"
|
|
||||||
|
|
||||||
[target.'cfg(target_os = "linux")'.dependencies]
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
ksni = { version = "0.3.6", optional = true }
|
ksni = { version = "0.3.6", optional = true }
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = ["tray"]
|
||||||
|
tray = ["dep:ksni"]
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
lto = true
|
lto = true
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ mod proxy;
|
||||||
mod script;
|
mod script;
|
||||||
mod service;
|
mod service;
|
||||||
mod sources;
|
mod sources;
|
||||||
|
#[cfg(feature = "tray")]
|
||||||
mod tray;
|
mod tray;
|
||||||
|
|
||||||
static FORWARD_ENV: &[&str] = &[
|
static FORWARD_ENV: &[&str] = &[
|
||||||
|
|
|
||||||
|
|
@ -166,11 +166,13 @@ pub async fn proxy(docker: Docker, config: HazeConfig) -> Result<()> {
|
||||||
let docker = Arc::new(docker);
|
let docker = Arc::new(docker);
|
||||||
let shutdown = Arc::new(Notify::new());
|
let shutdown = Arc::new(Notify::new());
|
||||||
|
|
||||||
|
#[cfg(feature = "tray")]
|
||||||
let tray = crate::tray::spawn_tray(docker.clone(), config.clone(), shutdown.clone()).await;
|
let tray = crate::tray::spawn_tray(docker.clone(), config.clone(), shutdown.clone()).await;
|
||||||
|
|
||||||
let instances = ActiveInstances::new(docker, config);
|
let instances = ActiveInstances::new(docker, config);
|
||||||
let result = serve(instances, listen, base_address, acceptor, shutdown).await;
|
let result = serve(instances, listen, base_address, acceptor, shutdown).await;
|
||||||
|
|
||||||
|
#[cfg(feature = "tray")]
|
||||||
if let Some(tray) = tray {
|
if let Some(tray) = tray {
|
||||||
tray.shutdown().await;
|
tray.shutdown().await;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,7 @@ pub trait ServiceTrait {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(not(feature = "tray"), allow(dead_code))]
|
||||||
fn has_web_ui(&self) -> bool {
|
fn has_web_ui(&self) -> bool {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue