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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user