aboutsummaryrefslogblamecommitdiff
path: root/src/main.rs
blob: 3289c468bc2d0e93e3ce63deb6badf2219f41cc7 (plain) (tree)
1
2
3
4
5
6




                    
         







                                  
                                                                              

                                                                                                    

                                                                               



                                                                        
#[macro_use]
extern crate anyhow;

mod consul;
mod proxy_config;
mod acme;

use log::*;

#[tokio::main]
async fn main() {
	pretty_env_logger::init();
	info!("Starting Tricot");

	let consul = consul::Consul::new("http://10.42.0.21:8500", "tricot/");
	let mut rx_proxy_config = proxy_config::spawn_proxy_config_task(consul.clone(), "carcajou");

	tokio::spawn(acme::acme_task(consul.clone(), rx_proxy_config.clone()));

	while rx_proxy_config.changed().await.is_ok() {
		info!("Proxy config: {:#?}", *rx_proxy_config.borrow());
	}
}