use anyhow::anyhow; use wooly_vault::challenge::c1::C1; use wooly_vault::challenge::Challenge; use wooly_vault::vault::{Config, Vault}; #[tokio::main(flavor = "current_thread")] async fn main() -> anyhow::Result<()> { let _logger = libpt::log::Logger::builder() .set_level(libpt::log::Level::TRACE) .display_time(false) .build()?; println!("Input the secret and press enter"); let mut buf: String = String::new(); std::io::stdin().read_line(&mut buf)?; let secret = buf.trim(); let conf = Config::default(); let v = Vault::new(secret); println!("What challenge to serve?"); let i = select_challenge()?; match i { 1 => { C1::new(conf, v).serve().await?; } _ => return Err(anyhow!("no challenge with index {i} does currently exist")), } Ok(()) } fn select_challenge() -> anyhow::Result { let mut buf: String = String::new(); std::io::stdin().read_line(&mut buf)?; Ok(buf.trim().parse()?) }