aboutsummaryrefslogtreecommitdiff
path: root/src/cert_store.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-12-07 14:28:29 +0100
committerAlex Auvolat <alex@adnab.me>2022-12-07 14:28:29 +0100
commitfad172e54af7a4d043410fe6cdc1f8b6112e9c0f (patch)
treee2b4a63a43d19161fb36b625e6e24af37e1f709b /src/cert_store.rs
parent752593e2747f64a8f14de3484ab085ed5f65cd40 (diff)
downloadtricot-fad172e54af7a4d043410fe6cdc1f8b6112e9c0f.tar.gz
tricot-fad172e54af7a4d043410fe6cdc1f8b6112e9c0f.zip
Externalise Consul module to df-consul crate
Diffstat (limited to 'src/cert_store.rs')
-rw-r--r--src/cert_store.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cert_store.rs b/src/cert_store.rs
index 97fbf32..2d3fb90 100644
--- a/src/cert_store.rs
+++ b/src/cert_store.rs
@@ -20,6 +20,7 @@ use crate::proxy_config::*;
pub struct CertStore {
consul: Consul,
+ node_name: String,
letsencrypt_email: String,
certs: RwLock<HashMap<String, Arc<Cert>>>,
self_signed_certs: RwLock<HashMap<String, Arc<Cert>>>,
@@ -30,6 +31,7 @@ pub struct CertStore {
impl CertStore {
pub fn new(
consul: Consul,
+ node_name: String,
rx_proxy_config: watch::Receiver<Arc<ProxyConfig>>,
letsencrypt_email: String,
exit_on_err: impl Fn(anyhow::Error) + Send + 'static,
@@ -38,6 +40,7 @@ impl CertStore {
let cert_store = Arc::new(Self {
consul,
+ node_name,
certs: RwLock::new(HashMap::new()),
self_signed_certs: RwLock::new(HashMap::new()),
rx_proxy_config,
@@ -190,7 +193,7 @@ impl CertStore {
// that delay expires
let lock_path = format!("renew_lock/{}", domain);
- let lock_name = format!("tricot/renew:{}@{}", domain, self.consul.local_node.clone());
+ let lock_name = format!("tricot/renew:{}@{}", domain, self.node_name);
let session = self
.consul
.create_session(&ConsulSessionRequest {