diff options
| author | soryu <soryu@soryu.co> | 2026-01-11 04:29:32 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-01-11 04:29:32 +0000 |
| commit | 62c4fa876d4c50517a2611252b5f795633848750 (patch) | |
| tree | c1152150dcc32068793cb844c906a2b547c49d8a | |
| parent | 353918e05fb6455600fa2b15b44b2e8fea647760 (diff) | |
| download | soryu-62c4fa876d4c50517a2611252b5f795633848750.tar.gz soryu-62c4fa876d4c50517a2611252b5f795633848750.zip | |
Default makima daemon to use production URI
| -rw-r--r-- | makima/daemon/src/config.rs | 26 |
1 files changed, 20 insertions, 6 deletions
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() |
