Commit Graph

111 Commits

Author SHA1 Message Date
admin 3d598feb34 docs: update CHANGELOG and CONTEXT for v0.11.6 2026-02-17 12:05:55 +01:00
admin 12eaf5b47e feat(v0.11.6): FileBrowser auto-mount sync + UI polish
- Add syncFileBrowserMounts() and generateFileBrowserCompose() to handlers.go
- Call syncFileBrowserMounts() after storage path add (storage init) and remove
- settings.html: red 'Nincs csatolva!' badge → yellow 'Rendszermeghajtón' (badge-warn)
- settings.html: 'Alapértelmezett' button → 'Legyen alapértelmezett' (action clarity)
- storage_init.html: replace disk-usage zone gradient bar with clean progress-bar-task
- style.css: add .badge-warn and .progress-bar-task CSS classes

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 12:04:06 +01:00
admin d42a676522 FileBrowser Auto-Mount on New Storage + UI Polish (3 fixes) 2026-02-17 12:00:27 +01:00
admin f6444945ca docs: update CHANGELOG and CONTEXT for v0.11.4
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 11:41:30 +01:00
admin 2064f32199 fix(storage): fix FormatAndMount for container environment
Bug 1 (sfdisk): Add wipefs before sfdisk; change partition type from
,,,L (unsupported GPT shorthand) to ,, (default Linux GUID); add
--force --wipe always flags to handle existing partition tables.

Bug 2 (mount): Replace fstab-lookup mount with explicit device path:
  mount -t ext4 -o defaults,noatime /host-dev/sdb1 /mnt/hdd_1
Container's /etc/fstab is Docker's auto-generated one, not the host's.

Bug 3 (mount propagation): Change /mnt volume to long-form bind with
propagation: rshared so mounts created inside container propagate to
the host. Requires mount --make-rshared /mnt on host before restart.

Safety: Use req.MountName (ASCII) for ext4 -L label (16-byte limit;
UTF-8 display label stays in settings.json). Add findmnt verification
after mount. Improve progress messages with command details.

Smart partition: In storageInitAPIHandler, if disk already has exactly
1 empty partition (no filesystem), skip wipefs+sfdisk and format the
existing partition directly.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 11:38:52 +01:00
admin 252058aec0 Bugfix — Storage Initialization (FormatAndMount) 2026-02-17 11:35:52 +01:00
admin 4f3401dc4c docs: update CHANGELOG and CONTEXT for v0.11.3
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 11:17:28 +01:00
admin 042486fe14 fix(dockerfile): add fdisk package for sfdisk (partition table writing)
sfdisk is in the fdisk package on Debian bookworm, not util-linux.
util-linux provides lsblk/blkid/mount; fdisk provides sfdisk/fdisk/cfdisk.
Without this, FormatAndMount fails at the partitioning step.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 11:15:39 +01:00
admin ba67d6d4e7 BUGFIX: Missing disk tools (sfdisk, mkfs.ext4, etc.) 2026-02-17 11:14:34 +01:00
admin 3fb9a58cec docs: update CHANGELOG and CONTEXT for v0.11.2
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 11:04:53 +01:00
admin c9de193a9d fix(storage): use /host-dev for block device access inside container
Docker always creates a fresh tmpfs at /dev, silently dropping any
/dev:/dev bind mount. Block devices must be accessed via /host-dev
where the host /dev is actually mounted.

Changes:
- docker-compose.yml: /dev:/dev → /dev:/host-dev:rw
- safety.go: add HostDevPath constant + HostDevicePath() helper
- format_linux.go: all device ops (stat, sfdisk, partprobe, mkfs.ext4,
  blkid) use HostDevicePath() to resolve /dev/sdb → /host-dev/sdb
- safety_linux.go: IsSystemDisk() stats device via /host-dev
- scan_linux.go: enrichWithBlkid() probes each partition individually
  via /host-dev/sdXN instead of batch blkid -o export (which can't
  find devices when /dev is Docker's minimal tmpfs)

Fixes "stat /dev/sdb: no such file or directory" in FormatAndMount.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 10:59:41 +01:00
admin 88776342e8 BUGFIX: /dev/sdb not accessible inside container 2026-02-17 10:56:30 +01:00
admin 39b0202d91 docs: update CHANGELOG and CONTEXT for v0.11.1 storage scan bugfix
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 10:44:33 +01:00
admin ec51ea5ac8 fix(storage): detect system disk via host fstab + enrich FSType via blkid
Bug 1: Inside container, lsblk reports container mount points not host's.
Parse /host-fstab (or /etc/fstab fallback) to find system partitions
(/, /boot, /boot/efi, swap), resolve UUIDs via blkid, and mark parent
disks as system — replaces unreliable mount-point string matching.

Bug 2: lsblk returns null fstype in containers (no udev cache). Run
blkid -o export after lsblk scan and enrich partitions with FSType,
UUID, and Label from direct device probing.

Fixes sda appearing as available disk and "nincs fájlrendszer" showing
for all partitions.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 10:42:50 +01:00
admin 0b23834e3c BUGFIX: Storage Scan — System Disk Detection & FSType in Container 2026-02-17 10:41:05 +01:00
admin 2fb2c6e1ae v0.11.0 — Phase C: Storage Init Wizard, Data Migration & Startup Fix
- Startup ping: fire heartbeat + health + hub report immediately on boot
  (5s delay after scheduler start, instead of waiting 5-15 min for first tick)

- Storage init wizard: new internal/storage/ package with disk scanning
  (lsblk -J), format+mount pipeline (sfdisk → mkfs.ext4 → blkid → fstab →
  mount → chown), safety guards (system disk detection, confirmation "FORMÁZÁS"),
  progress channel, auto-register in settings.json

- Data migration: MigrateAppData() with rsync --info=progress2 progress parsing,
  stop/rsync/update-config/start flow, rollback on failure, old data preserved

- New pages: /settings/storage/init (wizard), /stacks/{name}/migrate (migration)
- New API routes: /api/storage/{scan,init,init/status,migrate,migrate/status}
- Deploy page: storage info section for deployed apps (path, size, free, migrate link)
- Settings page: "Mozgatás" button per app in storage path details
- Container: privileged: true, /dev:/dev, /etc/fstab:/host-fstab, /run/udev:/run/udev:ro
- Dockerfile: add util-linux, e2fsprogs, rsync, parted for disk ops

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 10:27:18 +01:00
admin e7c27364bf Phase C — Storage Initialization, Data Migration & Startup Fixes 2026-02-17 10:10:35 +01:00
admin 69698a89e8 v0.10.0: Phase B — Storage Management UI Polish & Health Severity Fix
- Health severity fix: mount-point check downgraded from issue (FAIL) to warning (WARN)
- All storage health messages translated to Hungarian
- Success flash messages for all storage operations
- Edit storage path labels (inline edit UI + backend)
- App details per storage path on settings page (expandable list with names + sizes)
- Storage badge on stacks page showing which storage each app uses
- Deploy dropdown with free space display and low-space warning (<20%)
- Filesystem & disk info on settings page (ext4/btrfs, device, model via findmnt)
- Backup page storage context with per-app storage label badges

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:48:51 +01:00
admin 61d8451c69 Phase B — Storage Management UI Polish & Health Severity Fix 2026-02-17 09:35:15 +01:00
admin 82ef3b15cf updated .md files 2026-02-17 09:14:15 +01:00
admin aca3b8680a v0.9.0: Storage paths registry, per-app HDD_PATH resolution, storage management UI
- Fix backup toggles not appearing (read each app's own HDD_PATH from app.yaml)
- Storage paths registry in settings.json with auto-discovery from deployed apps
- Settings page "Adattárolók" section with disk usage, add/remove/default/schedulable
- Deploy page path field as dropdown of registered storage paths
- Health check storage monitoring (mount point, disk usage alerts)
- Mount-point validation utilities (Linux syscall + cross-platform stubs)
- Controller docker-compose mount changed to /mnt:/mnt:rw for multi-storage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:04:28 +01:00
admin 465dec443f Phase A — Storage Paths Foundation & Backup Toggle Fix 2026-02-17 08:40:11 +01:00
admin 7d801d1094 Phase 3 complete: per-app backup toggles, restore, storage overview
- Storage overview on backup page (SSD/HDD bars, repo stats)
- Restic password visibility + hub sync for disaster recovery
- App data discovery (HDD bind mounts, Docker volumes)
- Per-app backup toggle checkboxes with settings persistence
- Dynamic backup paths: enabled app HDD data included in restic snapshots
- Limited app restore from snapshots (self-service recovery)
- Snapshots API endpoint for restore dropdown
- Version bump to 0.8.0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 21:29:56 +01:00
admin a3af7c6a2d Phase 3 — Storage Overview & Per-App Backup Toggles 2026-02-16 21:05:51 +01:00
admin 2649297096 Controller v0.7.2: notification preferences sync to hub
- SyncPreferences() method on Notifier: POST to hub /api/v1/preferences
- IsEnabled() getter for hub connectivity check
- settingsNotificationsHandler: sync to hub after local save (3 flash message variants)
- Startup sync: non-blocking goroutine pushes prefs to hub on boot (DB rebuild recovery)
- Updated CONTEXT.md, README.md with v0.7.2 changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 20:18:22 +01:00
admin 8f5962c47d Fix Notification Preferences Sync (Controller → Hub) 2026-02-16 20:11:39 +01:00
admin d1032a3a4f Update CONTEXT.md for session 23 — v0.7.1 Phase 2 summary
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 19:34:24 +01:00
admin 3eee330ed5 Phase 2: monitoring warnings, dashboard alerts & notification system
- Monitoring page: "Távoli monitoring" section showing healthcheck ping UUID
  configuration status (configured/not configured) for each of the 5 pings
- Alert manager: persistent dashboard banners on all pages generated from
  health check results, missing pings, and backup status
- Notification system: controller-side notifier sends events to hub relay,
  with cooldown tracking and event-type filtering
- Notification preferences UI: email, event checkboxes, cooldown settings
  on the settings page with test email functionality
- Settings refactored: shared settingsData() helper, NotificationPrefs
  struct with getter/setter and defaults

New files:
- controller/internal/web/alerts.go (AlertManager)
- controller/internal/notify/notifier.go (hub notification client)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 19:29:45 +01:00
admin ded59b687e 0.7.1 - Phase 2 — Monitoring Warnings, Dashboard Alerts & Notification System 2026-02-16 19:09:43 +01:00
admin d7483a522f Update CONTEXT.md and CLAUDE.md for v0.7.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 17:29:11 +01:00
admin 4053245be8 v0.7.0: Phase 1 — Authentication, Persistence & Settings Page
- New settings.json persistence layer (internal/settings/settings.go)
  - Atomic write (tmp + rename), thread-safe with sync.RWMutex
  - Stores password hash overrides and DB validation cache
  - Auto-creates on first save, graceful handling if missing

- Auth improvements
  - Password resolution priority: settings.json > controller.yaml > none
  - Session duration extended to 7 days (was 24h)
  - ?next= redirect after session expiry (returns to original page)
  - Flash messages on login page (used after password change)
  - Conditional logout link (hidden when auth disabled)
  - Session invalidation on password change

- New Settings page (/settings)
  - Read-only system config display (customer, domain, git, backup, monitoring)
  - Password change form with validation (min 8 chars, match check)
  - Sidebar "Beállítások" item pinned to bottom above version

- DB validation persistence
  - Validation results saved to settings.json after each dump
  - Cached data survives container restarts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 17:26:59 +01:00
admin 0be1f2e547 Phase 1 — Authentication, Persistence & Settings Page 2026-02-16 17:17:42 +01:00
admin af98d4f48f docs: update CONTEXT.md for session 21 — v0.6.3 bug fixes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 16:33:08 +01:00
admin 29be81f1be fix: require_arg for --hdd-path, explicit event in stackAction, title separator, nextPruneLabel Sunday edge case
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 16:28:41 +01:00
admin 7ca52f88a2 Bug fixes from v0.6.2 code scan 2026-02-16 16:26:12 +01:00
admin 4bee8c3526 Create CLAUDE.md + cleanup + statusIcon fix (felhom.eu repo) 2026-02-16 15:49:53 +01:00
admin ec99aad217 Update CONTEXT.md for session 20 — hub bugs + backup validation fix
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 15:08:15 +01:00
admin 9e8b48a32b fix: backup validation display and debug logging
- Add 4-branch template guard to handle zero-value DumpValidation
  (shows "–" instead of misleading "Hiba" when validation never ran)
- Add debug logging to ValidateDump for all code paths
- Add cross-check re-validation in RefreshCache to heal stale
  lastDBDump validation state from disk

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 14:56:34 +01:00
admin f511433754 Hub Dashboard Bugs + Backup Validation Fix 2026-02-16 14:53:35 +01:00
admin 62a185afb8 Update CONTEXT.md and README.md for v0.6.1
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 14:42:00 +01:00
admin ded0cbb842 v0.6.1: Code review bugfixes — 7 correctness/safety/quality fixes
- Fix http.NotFound(w, nil) → pass actual request in handlers
- Fix dashboard running/stopped counts to match displayed stacks
- Fix Secure cookie blocking HTTP login (dynamic based on request)
- Remove misleading subtle.ConstantTimeCompare in session check
- Fix cleanupSessions goroutine leak (proper ticker + done channel)
- Add http.MaxBytesReader (1MB) to API POST endpoints
- Cache time.LoadLocation("Europe/Budapest") in template funcmap

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 14:40:13 +01:00
admin 104c97040c Code Review Bugfixes (v0.6.1) 2026-02-16 14:35:16 +01:00
admin 59b239739e added csss ignore 2026-02-16 13:28:03 +01:00
admin 8a1b9e57ae docs: update CONTEXT.md and README for v0.6.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 13:25:05 +01:00
admin 97074e7a0c v0.6.0: healthcheck + hub reporting implementation
- Add heartbeat ping (every 5 min, controller alive signal)
- Add backup integrity check (weekly restic check, Sunday 04:00)
- Add Heartbeat + BackupIntegrity fields to PingUUIDsConfig
- Add HubConfig for central hub reporting
- Add report package (types, builder, pusher) for hub push
- Wire hub reporting into scheduler (configurable interval)
- Update controller.yaml.example with new monitoring + hub sections
- Add monitoring/DEPRECATED.md for legacy bash scripts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 13:19:08 +01:00
admin 94efc39c34 v0.6.0: Healthcheck Implementation + Central Push + Multi-Customer Dashboard 2026-02-16 13:05:01 +01:00
admin 34ddea2af3 update CONTEXT.md for v0.5.4 session
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 12:06:29 +01:00
admin c1dda1aec6 v0.5.4: monitoring page frontend fixes
- Fix tooltip "Invalid Date" by using raw.x with parsed.x fallback
- Fix chart x-axis bounds by including initial min/max in chartOpts
- Fix sysinfo alignment with fixed 2-column grid and consistent styling
- Fix chart overflow on mobile with min-width:0 and overflow:hidden
- Remove redundant <style> block from monitoring.html (moved to style.css)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 12:04:02 +01:00
admin 71da2938a5 v0.5.4: Monitoring Page Frontend Fixes 2026-02-16 12:02:20 +01:00
admin 4af2b1b560 updated monitoring.html 2026-02-16 11:44:29 +01:00