mirror of
https://codeberg.org/icewind/haze.git
synced 2026-11-30 12:40:48 +01:00
clippy fixes
This commit is contained in:
parent
2de025694f
commit
9343bc9a61
5 changed files with 11 additions and 6 deletions
|
|
@ -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
|
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 = "127.0.0.1:8080" # the port+ip to listen on
|
||||||
# listen = "/var/run/haze/haze.sock" # or a unix socket path
|
# 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
|
### Without a reverse proxy
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ pub async fn clean(docker: &Docker, config: &HazeConfig) -> Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
for cloud in remove {
|
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);
|
eprintln!("Error while removing cloud: {:#}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ use std::convert::TryFrom;
|
||||||
use std::env::home_dir;
|
use std::env::home_dir;
|
||||||
use std::fs::read_to_string;
|
use std::fs::read_to_string;
|
||||||
use std::net::IpAddr;
|
use std::net::IpAddr;
|
||||||
use toml::Value;
|
|
||||||
use toml::map::Map;
|
use toml::map::Map;
|
||||||
|
use toml::Value;
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Default)]
|
#[derive(Debug, Deserialize, Default)]
|
||||||
#[serde(from = "RawHazeConfig")]
|
#[serde(from = "RawHazeConfig")]
|
||||||
|
|
@ -205,10 +205,15 @@ pub struct ProxyConfig {
|
||||||
pub cert: Option<String>,
|
pub cert: Option<String>,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub key: Option<String>,
|
pub key: Option<String>,
|
||||||
#[serde(default)]
|
#[serde(default = "default_tray")]
|
||||||
|
#[cfg_attr(not(feature = "tray"), allow(dead_code))]
|
||||||
pub tray: bool,
|
pub tray: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn default_tray() -> bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
impl ProxyConfig {
|
impl ProxyConfig {
|
||||||
/// Get a public address for a service, either with direct IP or through the proxy
|
/// Get a public address for a service, either with direct IP or through the proxy
|
||||||
pub fn addr(&self, id: &str, ip: IpAddr) -> String {
|
pub fn addr(&self, id: &str, ip: IpAddr) -> String {
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ pub trait ServiceTrait {
|
||||||
|
|
||||||
#[cfg_attr(not(feature = "tray"), allow(dead_code))]
|
#[cfg_attr(not(feature = "tray"), allow(dead_code))]
|
||||||
fn has_web_ui(&self) -> bool {
|
fn has_web_ui(&self) -> bool {
|
||||||
return false;
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn start_message(
|
async fn start_message(
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,7 @@ impl ServiceTrait for LdapAdmin {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn has_web_ui(&self) -> bool {
|
fn has_web_ui(&self) -> bool {
|
||||||
return true;
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn start_message(
|
async fn start_message(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue