feat(conf): gva can now be enabled with one unique env var
This commit is contained in:
parent
4ee272b85d
commit
d62d222034
1 changed files with 9 additions and 4 deletions
|
@ -41,6 +41,7 @@ pub struct GvaConf {
|
||||||
pub remote_path: Option<String>,
|
pub remote_path: Option<String>,
|
||||||
pub remote_subscriptions_path: Option<String>,
|
pub remote_subscriptions_path: Option<String>,
|
||||||
pub remote_tls: Option<bool>,
|
pub remote_tls: Option<bool>,
|
||||||
|
#[serde(default = "whitelist_default")]
|
||||||
pub whitelist: Vec<IpAddr>,
|
pub whitelist: Vec<IpAddr>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,6 +65,13 @@ fn subscriptions_path_default() -> String {
|
||||||
"gva-sub".to_owned()
|
"gva-sub".to_owned()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn whitelist_default() -> Vec<IpAddr> {
|
||||||
|
vec![
|
||||||
|
IpAddr::V4(Ipv4Addr::LOCALHOST),
|
||||||
|
IpAddr::V6(Ipv6Addr::LOCALHOST),
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
impl Default for GvaConf {
|
impl Default for GvaConf {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
GvaConf {
|
GvaConf {
|
||||||
|
@ -78,10 +86,7 @@ impl Default for GvaConf {
|
||||||
remote_path: None,
|
remote_path: None,
|
||||||
remote_subscriptions_path: None,
|
remote_subscriptions_path: None,
|
||||||
remote_tls: None,
|
remote_tls: None,
|
||||||
whitelist: vec![
|
whitelist: whitelist_default(),
|
||||||
IpAddr::V4(Ipv4Addr::LOCALHOST),
|
|
||||||
IpAddr::V6(Ipv6Addr::LOCALHOST),
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue