aboutsummaryrefslogtreecommitdiff
path: root/src/main.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/main.rs
parent752593e2747f64a8f14de3484ab085ed5f65cd40 (diff)
downloadtricot-fad172e54af7a4d043410fe6cdc1f8b6112e9c0f.tar.gz
tricot-fad172e54af7a4d043410fe6cdc1f8b6112e9c0f.zip
Externalise Consul module to df-consul crate
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 79c4a9b..c97bddf 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -13,7 +13,6 @@ use tokio::sync::watch;
mod cert;
mod cert_store;
-mod consul;
mod http;
mod https;
mod metrics;
@@ -21,6 +20,7 @@ mod proxy_config;
mod reverse_proxy;
mod tls_util;
+pub use df_consul as consul;
use proxy_config::ProxyConfig;
#[cfg(feature = "dhat-heap")]
@@ -139,13 +139,17 @@ async fn main() {
client_key: opt.consul_client_key.clone(),
};
- let consul = consul::Consul::new(consul_config, &opt.consul_kv_prefix, &opt.node_name)
+ let consul = consul::Consul::new(consul_config, &opt.consul_kv_prefix)
.expect("Error creating Consul client");
- let rx_proxy_config =
- proxy_config::spawn_proxy_config_task(consul.clone(), exit_signal.clone());
+ let rx_proxy_config = proxy_config::spawn_proxy_config_task(
+ consul.clone(),
+ opt.node_name.clone(),
+ exit_signal.clone(),
+ );
let cert_store = cert_store::CertStore::new(
consul.clone(),
+ opt.node_name.clone(),
rx_proxy_config.clone(),
opt.letsencrypt_email.clone(),
exit_on_err.clone(),