diff options
author | Alex Auvolat <alex@adnab.me> | 2023-04-05 09:50:26 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-04-05 09:50:26 +0200 |
commit | 71bfd5be2d7c90ecee19b2a736e793d9a432d1c8 (patch) | |
tree | 5a9f9a6dc25d78072b89ccecd9986e1fbb53d242 /src/config/runtime.rs | |
parent | c356c4d1c471acd9d2f7e1dcfd3a432442177b48 (diff) | |
download | diplonat-71bfd5be2d7c90ecee19b2a736e793d9a432d1c8.tar.gz diplonat-71bfd5be2d7c90ecee19b2a736e793d9a432d1c8.zip |
Remove ACME config, not used as we are doing ACME in Tricot now
Diffstat (limited to 'src/config/runtime.rs')
-rw-r--r-- | src/config/runtime.rs | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/src/config/runtime.rs b/src/config/runtime.rs index d1a3f89..8084439 100644 --- a/src/config/runtime.rs +++ b/src/config/runtime.rs @@ -5,7 +5,7 @@ use std::time::Duration; use anyhow::{anyhow, bail, Context, Result}; -use crate::config::{ConfigOpts, ConfigOptsAcme, ConfigOptsBase, ConfigOptsConsul}; +use crate::config::{ConfigOpts, ConfigOptsBase, ConfigOptsConsul}; // This code is inspired by the Trunk crate (https://github.com/thedodd/trunk) @@ -13,11 +13,6 @@ use crate::config::{ConfigOpts, ConfigOptsAcme, ConfigOptsBase, ConfigOptsConsul // RuntimeConfig. We apply default values and business logic. #[derive(Debug)] -pub struct RuntimeConfigAcme { - pub email: String, -} - -#[derive(Debug)] pub struct RuntimeConfigConsul { pub node_name: String, pub url: String, @@ -46,7 +41,6 @@ pub struct RuntimeConfigStun { #[derive(Debug)] pub struct RuntimeConfig { - pub acme: Option<RuntimeConfigAcme>, pub consul: RuntimeConfigConsul, pub firewall: RuntimeConfigFirewall, pub igd: Option<RuntimeConfigIgd>, @@ -55,7 +49,6 @@ pub struct RuntimeConfig { impl RuntimeConfig { pub fn new(opts: ConfigOpts) -> Result<Self> { - let acme = RuntimeConfigAcme::new(opts.acme)?; let consul = RuntimeConfigConsul::new(opts.consul)?; let firewall = RuntimeConfigFirewall::new(&opts.base)?; let igd = match opts.base.ipv6_only { @@ -65,7 +58,6 @@ impl RuntimeConfig { let stun = RuntimeConfigStun::new(&opts.base)?; Ok(Self { - acme, consul, firewall, igd, @@ -74,20 +66,6 @@ impl RuntimeConfig { } } -impl RuntimeConfigAcme { - pub fn new(opts: ConfigOptsAcme) -> Result<Option<Self>> { - if !opts.enable { - return Ok(None); - } - - let email = opts.email.expect( - "'DIPLONAT_ACME_EMAIL' environment variable is required if 'DIPLONAT_ACME_ENABLE' == 'true'", - ); - - Ok(Some(Self { email })) - } -} - impl RuntimeConfigConsul { pub(super) fn new(opts: ConfigOptsConsul) -> Result<Self> { let node_name = opts |