wooly-vault/src/main.rs

31 lines
714 B
Rust

use anyhow::Result;
use clap::Parser;
use libpt::log::{debug, info};
use wooly_vault::start_all;
use wooly_vault::{config::Config, vault::Vault};
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<()> {
let conf = Config::parse();
let _logger = libpt::log::Logger::builder()
.set_level(conf.verbosity.level())
.display_time(false)
.log_to_file(true)
.log_dir("./log".into())
.build()?;
debug!("logger active");
info!("Configuration: {conf:?}");
let secret = Config::secret()?;
let v = Vault::new(&secret);
start_all(conf, v).await?;
loop {
tokio::time::sleep(tokio::time::Duration::from_secs(5)).await
}
}