public IP address autodiscovery #20

Merged
lx merged 10 commits from stun into main 2023-04-21 09:56:22 +00:00
2 changed files with 0 additions and 8 deletions
Showing only changes of commit 21ab77b828 - Show all commits

View file

@ -68,12 +68,10 @@ impl ConfigOpts {
let base: ConfigOptsBase = envy::prefixed("DIPLONAT_").from_iter(iter.clone())?; let base: ConfigOptsBase = envy::prefixed("DIPLONAT_").from_iter(iter.clone())?;
let consul: ConfigOptsConsul = let consul: ConfigOptsConsul =
envy::prefixed("DIPLONAT_CONSUL_").from_iter(iter.clone())?; envy::prefixed("DIPLONAT_CONSUL_").from_iter(iter.clone())?;
let acme: ConfigOptsAcme = envy::prefixed("DIPLONAT_ACME_").from_iter(iter.clone())?;
RuntimeConfig::new(Self { RuntimeConfig::new(Self {
base: base, base: base,
consul: consul, consul: consul,
acme: acme,
}) })
} }
} }

View file

@ -53,7 +53,6 @@ fn ok_from_iter_minimal_valid_options() {
let opts = minimal_valid_options(); let opts = minimal_valid_options();
let rt_config = ConfigOpts::from_iter(opts.clone()).unwrap(); let rt_config = ConfigOpts::from_iter(opts.clone()).unwrap();
assert!(rt_config.acme.is_none());
assert_eq!( assert_eq!(
&rt_config.consul.node_name, &rt_config.consul.node_name,
opts.get(&"DIPLONAT_CONSUL_NODE_NAME".to_string()).unwrap() opts.get(&"DIPLONAT_CONSUL_NODE_NAME".to_string()).unwrap()
@ -101,11 +100,6 @@ fn ok_from_iter_all_valid_options() {
.into(), .into(),
); );
assert!(rt_config.acme.is_some());
assert_eq!(
&rt_config.acme.unwrap().email,
opts.get(&"DIPLONAT_ACME_EMAIL".to_string()).unwrap()
);
assert_eq!( assert_eq!(
&rt_config.consul.node_name, &rt_config.consul.node_name,
opts.get(&"DIPLONAT_CONSUL_NODE_NAME".to_string()).unwrap() opts.get(&"DIPLONAT_CONSUL_NODE_NAME".to_string()).unwrap()