wooly-vault/src/main.rs

32 lines
836 B
Rust
Raw Normal View History

2024-09-06 12:01:48 +02:00
use wooly_vault::challenge::select_and_start;
2024-09-05 17:18:08 +02:00
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()?;
2024-09-06 12:01:48 +02:00
select_and_start(i, conf, v).await?;
2024-09-05 17:18:08 +02:00
Ok(())
}
fn select_challenge() -> anyhow::Result<u16> {
let mut buf: String = String::new();
std::io::stdin().read_line(&mut buf)?;
Ok(buf.trim().parse()?)
2024-09-05 15:49:56 +02:00
}