feat: add user management handlers (SQLite-based)
- Add CreateUserRequest, UpdateUserRequest, ChangePasswordRequest - Implement list_users_handler, create_user_handler - Implement delete_user_handler, update_user_handler - Implement change_password_handler - All handlers use SQLite (data/auth.sqlite) - No PostgreSQL dependency - Routes: /api/v2/admin/users/* - Integrated from M5Max48 into M4Mini architecture - Fix duplicate dependencies in Cargo.toml - Resolve merge conflicts in web.rs and Cargo.lock
This commit is contained in:
@@ -9,14 +9,16 @@ pub enum WebCommand {
|
||||
port: u16,
|
||||
#[arg(short, long)]
|
||||
file: Option<String>,
|
||||
#[arg(short = 'H', long, help = "User home directory for data storage (default: current user's home)")]
|
||||
home: Option<PathBuf>,
|
||||
},
|
||||
}
|
||||
|
||||
pub async fn handle_web_command(cmd: WebCommand) -> anyhow::Result<()> {
|
||||
match cmd {
|
||||
WebCommand::Start { port, file } => {
|
||||
let home = dirs::home_dir()
|
||||
.ok_or_else(|| anyhow::anyhow!("Cannot determine home directory"))?;
|
||||
WebCommand::Start { port, file, home } => {
|
||||
let home = home.unwrap_or_else(|| dirs::home_dir().unwrap_or_else(|| PathBuf::from(".")));
|
||||
log::info!("Using home directory: {}", home.display());
|
||||
crate::server::run(port, file, home).await?;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user