2021-12-06 22:08:22 +00:00
|
|
|
#[macro_use]
|
|
|
|
extern crate anyhow;
|
|
|
|
|
|
|
|
mod consul;
|
|
|
|
mod proxy_config;
|
2021-12-06 22:40:41 +00:00
|
|
|
mod acme;
|
2021-12-06 22:08:22 +00:00
|
|
|
|
|
|
|
use log::*;
|
|
|
|
|
|
|
|
#[tokio::main]
|
|
|
|
async fn main() {
|
|
|
|
pretty_env_logger::init();
|
|
|
|
info!("Starting Tricot");
|
|
|
|
|
2021-12-06 22:40:41 +00:00
|
|
|
let consul = consul::Consul::new("http://10.42.0.21:8500", "tricot/");
|
2021-12-06 22:08:22 +00:00
|
|
|
let mut rx_proxy_config = proxy_config::spawn_proxy_config_task(consul.clone(), "carcajou");
|
|
|
|
|
2021-12-06 22:40:41 +00:00
|
|
|
tokio::spawn(acme::acme_task(consul.clone(), rx_proxy_config.clone()));
|
|
|
|
|
2021-12-06 22:08:22 +00:00
|
|
|
while rx_proxy_config.changed().await.is_ok() {
|
|
|
|
info!("Proxy config: {:#?}", *rx_proxy_config.borrow());
|
|
|
|
}
|
|
|
|
}
|