From e435f7d7b4ad4e4b1d3c21c35df5f41ffd642376 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 26 May 2026 18:01:30 +0530 Subject: Add HTTP health endpoint on /health and /api/mirror-health - New axum-based health server on port 7335 (configurable via health_port) - Reports status, uptime, cycle_count, last_cycle_ok as JSON - Status is 'ok' on startup and after successful cycles, 'degraded' after failures - Config: storage.health_port defaults to 7335 - Spawned alongside daemon loop, independent of mirror cycles --- src/config.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index ceff44d..037deb2 100644 --- a/src/config.rs +++ b/src/config.rs @@ -33,6 +33,12 @@ pub struct StorageConfig { pub mirror_dir: PathBuf, #[serde(default = "default_database")] pub database: PathBuf, + #[serde(default = "default_health_port")] + pub health_port: u16, +} + +fn default_health_port() -> u16 { + 7335 } fn default_mirror_dir() -> PathBuf { -- cgit v1.2.3