diff --git a/TASK.md b/TASK.md index 40e13ab..e23de9b 100644 --- a/TASK.md +++ b/TASK.md @@ -1,843 +1,866 @@ -# TASK: Storage Namespace (`felhom-data/`) + Test Node Wipe Script (v0.26.0) +# TASK: App Telemetry & Analytics -**Controller:** v0.25.0 → v0.26.0 +**Controller:** v0.27.3 → v0.28.0 +**Hub:** v0.3.8 → v0.4.0 ## Overview -All felhom-managed data on external drives moves under a `felhom-data/` subdirectory, cleanly separating our data from user files. Plus a wipe script for repeatable testing. - -**Key design principle:** `HDD_PATH` env var stays as the mount point (e.g., `/mnt/hdd_1`). The `felhom-data` segment is embedded in path helpers and compose templates, not in `HDD_PATH`. +Add per-app (per-stack) memory/CPU telemetry and container log error scanning to the controller's report push cycle, then build fleet-wide analytics dashboard pages in the hub. --- -## Phase 1: Path Helpers (`internal/backup/paths.go`) +## Spec Issues Found (corrections already applied in this plan) -This is the foundation. All other changes depend on this. - -### File: `controller/internal/backup/paths.go` - -**Add constant at top of file (after imports):** -```go -// FelhomDataDir is the namespace directory on storage drives for all felhom-managed data. -const FelhomDataDir = "felhom-data" -``` - -**Update 8 functions** to include `FelhomDataDir` in the path. Each function gets `FelhomDataDir` inserted between `drivePath` and the next segment: - -| Function | Current first segment | New first segment | -|----------|----------------------|-------------------| -| `PrimaryBackupPath` | `"backups"` | `FelhomDataDir, "backups"` | -| `PrimaryResticRepoPath` | `"backups"` | `FelhomDataDir, "backups"` | -| `AppDBDumpPath` | `"backups"` | `FelhomDataDir, "backups"` | -| `SecondaryBackupPath` | `"backups"` | `FelhomDataDir, "backups"` | -| `AppSecondaryRsyncPath` | `"backups"` | `FelhomDataDir, "backups"` | -| `SecondaryResticRepoPath` | `"backups"` | `FelhomDataDir, "backups"` | -| `SecondaryInfraPath` | `"backups"` | `FelhomDataDir, "backups"` | -| `AppDataDir` | `"appdata"` | `FelhomDataDir, "appdata"` | - -**DO NOT change `InfraBackupDir`** — it stays at drive root (DR scanner needs it). - -Example transformation for each function — replace: -```go -return filepath.Join(drivePath, "backups", "primary") -``` -with: -```go -return filepath.Join(drivePath, FelhomDataDir, "backups", "primary") -``` - -And for `AppDataDir` replace: -```go -return filepath.Join(drivePath, "appdata", stackName) -``` -with: -```go -return filepath.Join(drivePath, FelhomDataDir, "appdata", stackName) -``` +1. **Wrong column name in metrics DB**: Spec uses `memory_bytes` — actual column is `mem_usage_mb` (already in MB). No byte→MB conversion needed. +2. **`ts` column is INTEGER (Unix timestamp)**, not datetime — WHERE clauses must use `unix()`. +3. **`metricsStore` already passed to `BuildReport()`** — no main.go wiring change needed for that dependency. +4. **Chart.js is NOT in the hub** — needs to be added (copy from controller's `internal/web/static/chart.min.js`). +5. **Hub nav is header-based**, not sidebar — add "Alkalmazások" to the header `