Files
bichon/crates/admin/src/main.rs
T

56 lines
1.6 KiB
Rust
Raw Normal View History

//
// Copyright (c) 2025-2026 rustmailer.com (https://rustmailer.com)
//
// This file is part of the Bichon Email Archiving Project
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
use console::style;
use dialoguer::{theme::ColorfulTheme, Select};
2026-01-22 13:19:21 +08:00
use crate::{migrate::handle_migration, reset::handle_reset_password};
pub mod migrate;
pub mod reset;
2026-01-22 13:19:21 +08:00
#[tokio::main]
async fn main() {
let theme = ColorfulTheme::default();
println!(
"\n{}\n",
style("BICHON ADMINISTRATIVE TOOL").bold().bright().cyan()
);
let main_options = vec![
"Reset Admin Password",
"Migrate Legacy v0.x Storage to v1.0",
"Exit",
];
2026-01-22 13:19:21 +08:00
let selection = Select::with_theme(&theme)
.with_prompt("Select an operation")
.default(0)
.items(&main_options)
.interact()
.unwrap();
match selection {
0 => handle_reset_password(&theme),
1 => handle_migration(&theme),
_ => {
println!("{}", style("Exiting...").dim());
2026-01-22 13:19:21 +08:00
}
}
}