use serde::Deserialize; use std::path::PathBuf; #[derive(Debug, Clone, Deserialize)] pub struct Config { pub server_directory: PathBuf, pub webui_port: u16, pub max_memory_mb: u32, pub initial_superuser: String, pub initial_superuser_password: String, } impl Config { pub fn load() -> Result { let content = std::fs::read_to_string("config.toml") .map_err(|e| format!("Failed to read config.toml: {e}"))?; let config: Config = toml::from_str(&content).map_err(|e| format!("Failed to parse config.toml: {e}"))?; Ok(config) } }