aboutsummaryrefslogtreecommitdiff
path: root/src/cert_store.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cert_store.rs')
-rw-r--r--src/cert_store.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cert_store.rs b/src/cert_store.rs
index 4cc2fc0..2834795 100644
--- a/src/cert_store.rs
+++ b/src/cert_store.rs
@@ -18,18 +18,20 @@ use crate::proxy_config::*;
pub struct CertStore {
consul: Consul,
+ letsencrypt_email: String,
certs: RwLock<HashMap<String, Arc<Cert>>>,
self_signed_certs: RwLock<HashMap<String, Arc<Cert>>>,
rx_proxy_config: watch::Receiver<Arc<ProxyConfig>>,
}
impl CertStore {
- pub fn new(consul: Consul, rx_proxy_config: watch::Receiver<Arc<ProxyConfig>>) -> Arc<Self> {
+ pub fn new(consul: Consul, rx_proxy_config: watch::Receiver<Arc<ProxyConfig>>, letsencrypt_email: String) -> Arc<Self> {
Arc::new(Self {
consul,
certs: RwLock::new(HashMap::new()),
self_signed_certs: RwLock::new(HashMap::new()),
rx_proxy_config,
+ letsencrypt_email,
})
}
@@ -157,7 +159,7 @@ impl CertStore {
// ---- Do let's encrypt stuff ----
let dir = Directory::from_url(DirectoryUrl::LetsEncrypt)?;
- let contact = vec!["mailto:alex@adnab.me".to_string()];
+ let contact = vec![format!("mailto:{}", self.letsencrypt_email)];
let acc =
if let Some(acc_privkey) = self.consul.kv_get("letsencrypt_account_key.pem").await? {