From 62c4fa876d4c50517a2611252b5f795633848750 Mon Sep 17 00:00:00 2001 From: soryu Date: Sun, 11 Jan 2026 04:29:32 +0000 Subject: Default makima daemon to use production URI --- makima/daemon/src/config.rs | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'makima/daemon/src') diff --git a/makima/daemon/src/config.rs b/makima/daemon/src/config.rs index 28c7fea..94d1e8a 100644 --- a/makima/daemon/src/config.rs +++ b/makima/daemon/src/config.rs @@ -9,6 +9,7 @@ use std::path::PathBuf; #[derive(Debug, Clone, Deserialize)] pub struct DaemonConfig { /// Server connection settings. + #[serde(default)] pub server: ServerConfig, /// Worktree settings. @@ -34,9 +35,11 @@ pub struct DaemonConfig { /// Server connection configuration. #[derive(Debug, Clone, Deserialize)] +#[serde(default)] pub struct ServerConfig { /// WebSocket URL of makima server (e.g., ws://localhost:8080 or wss://makima.example.com). - #[serde(default)] + /// Defaults to wss://api.makima.jp. + #[serde(default = "default_server_url")] pub url: String, /// API key for authentication. @@ -64,6 +67,22 @@ fn default_reconnect_interval() -> u64 { 5 } +fn default_server_url() -> String { + "wss://api.makima.jp".to_string() +} + +impl Default for ServerConfig { + fn default() -> Self { + Self { + url: default_server_url(), + api_key: String::new(), + heartbeat_interval_secs: default_heartbeat_interval(), + reconnect_interval_secs: default_reconnect_interval(), + max_reconnect_attempts: 0, + } + } +} + /// Worktree configuration for task isolation. #[derive(Debug, Clone, Deserialize)] #[serde(default)] @@ -413,11 +432,6 @@ impl DaemonConfig { /// Validate that required configuration fields are set. pub fn validate(&self) -> Result<(), config::ConfigError> { - if self.server.url.is_empty() { - return Err(config::ConfigError::Message( - "server.url is required. Set via config file, MAKIMA_DAEMON_SERVER_URL, or --server-url".to_string() - )); - } if self.server.api_key.is_empty() { return Err(config::ConfigError::Message( "API key is required. Set via MAKIMA_API_KEY, config file, or --api-key".to_string() -- cgit v1.2.3