Remove hardcoded defaults and migrate dashboard config to NixOS

- Remove all unused configuration options from dashboard config module
- Eliminate hardcoded defaults - dashboard now requires config file like agent
- Keep only actually used config: zmq.subscriber_ports and hosts.predefined_hosts
- Remove unused get_host_metrics function from metric store
- Clean up missing module imports (hosts, utils)
- Make dashboard fail fast if no configuration provided
- Align dashboard config approach with agent configuration pattern
This commit is contained in:
2025-10-21 21:54:23 +02:00
parent a6d2a2f086
commit 3d2b37b26c
5 changed files with 12 additions and 142 deletions

View File

@@ -28,11 +28,14 @@ impl Dashboard {
pub async fn new(config_path: Option<String>, headless: bool) -> Result<Self> {
info!("Initializing dashboard");
// Load configuration
let config = if let Some(path) = config_path {
DashboardConfig::load_from_file(&path)?
} else {
DashboardConfig::default()
// Load configuration - config file is required
let config = match config_path {
Some(path) => DashboardConfig::load_from_file(&path)?,
None => {
error!("Configuration file is required. Use --config to specify path.");
error!("Dashboard configuration must be provided - no hardcoded defaults allowed.");
return Err(anyhow::anyhow!("Missing required configuration file"));
}
};
// Initialize ZMQ consumer