diff --git a/book/src/proxy/README.md b/book/src/proxy/README.md index 5bf0b5e..3a76f48 100644 --- a/book/src/proxy/README.md +++ b/book/src/proxy/README.md @@ -27,7 +27,7 @@ Add the following configuration to the `haze.toml` configuration file: address = "haze.example.com" # the base domain for the proxy to use listen = "127.0.0.1:8080" # the port+ip to listen on # listen = "/var/run/haze/haze.sock" # or a unix socket path -# tray = true # show a system tray item, defaults to false +# tray = false # show a system tray item, enabled by default ``` ### Without a reverse proxy diff --git a/src/clean.rs b/src/clean.rs index 81cbc7b..d5abd1c 100644 --- a/src/clean.rs +++ b/src/clean.rs @@ -19,7 +19,7 @@ pub async fn clean(docker: &Docker, config: &HazeConfig) -> Result<()> { } for cloud in remove { - if let Err(e) = cloud.destroy(&docker, &config).await { + if let Err(e) = cloud.destroy(docker, config).await { eprintln!("Error while removing cloud: {:#}", e); } } diff --git a/src/config.rs b/src/config.rs index fc7dac5..0059575 100644 --- a/src/config.rs +++ b/src/config.rs @@ -7,8 +7,8 @@ use std::convert::TryFrom; use std::env::home_dir; use std::fs::read_to_string; use std::net::IpAddr; -use toml::Value; use toml::map::Map; +use toml::Value; #[derive(Debug, Deserialize, Default)] #[serde(from = "RawHazeConfig")] @@ -205,10 +205,15 @@ pub struct ProxyConfig { pub cert: Option, #[serde(default)] pub key: Option, - #[serde(default)] + #[serde(default = "default_tray")] + #[cfg_attr(not(feature = "tray"), allow(dead_code))] pub tray: bool, } +fn default_tray() -> bool { + true +} + impl ProxyConfig { /// Get a public address for a service, either with direct IP or through the proxy pub fn addr(&self, id: &str, ip: IpAddr) -> String { diff --git a/src/service.rs b/src/service.rs index f844dd2..06109d6 100644 --- a/src/service.rs +++ b/src/service.rs @@ -91,7 +91,7 @@ pub trait ServiceTrait { #[cfg_attr(not(feature = "tray"), allow(dead_code))] fn has_web_ui(&self) -> bool { - return false; + false } async fn start_message( diff --git a/src/service/ldap.rs b/src/service/ldap.rs index af1ce02..41ed47f 100644 --- a/src/service/ldap.rs +++ b/src/service/ldap.rs @@ -196,7 +196,7 @@ impl ServiceTrait for LdapAdmin { } fn has_web_ui(&self) -> bool { - return true; + true } async fn start_message(