Add local SQLite database and sync with Uptime Kuma
All checks were successful
Build and Push Container / build (push) Successful in 1m4s

Features:
- SQLite database to track monitors and hosts locally
- Uses Uptime Kuma tags to mark monitors as managed by Kuma Strapper
- Sync on startup, before each scan, and on-demand via API
- Shows existing monitors when re-scanning a host

New files:
- backend/services/database.py - SQLite database service
- backend/services/sync.py - Sync service for Uptime Kuma reconciliation

API endpoints:
- POST /api/sync - Full sync with Uptime Kuma
- POST /api/sync/host/<hostname> - Sync specific host
- GET /api/hosts - List tracked hosts
- GET /api/hosts/<hostname>/monitors - Get monitors for host
- GET /api/monitors/tracked - Get all tracked monitors

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Debian
2026-01-06 09:10:26 +00:00
parent a65997a391
commit 1fd29e449f
11 changed files with 1044 additions and 47 deletions

View File

@@ -73,6 +73,7 @@ class Config:
uptime_kuma_api_key: str
claude_api_key: str
dev_mode: bool = False
database_path: str = "/app/data/kuma_strapper.db"
@classmethod
def from_env(cls) -> "Config":
@@ -91,6 +92,7 @@ class Config:
uptime_kuma_api_key=resolve_secret("UPTIME_KUMA_API_KEY", ""),
claude_api_key=resolve_secret("CLAUDE_API_KEY", ""),
dev_mode=os.environ.get("DEV_MODE", "false").lower() == "true",
database_path=os.environ.get("DATABASE_PATH", "/app/data/kuma_strapper.db"),
)
def validate(self) -> list[str]: