Commit Graph

189 Commits

Author SHA1 Message Date
admin bdbe170a54 feat: storage watchdog — USB disconnect detection, auto-stop, safe eject, auto-reconnect (v0.17.0)
New storage watchdog monitors registered storage paths every 5s. On disconnect
(3 consecutive probe failures), auto-stops affected apps, lazy-unmounts stale
VFS entries, fires alerts/notifications/hub report. On reconnect (UUID detected),
auto-remounts via fstab, cleans stale restic locks, offers app restart.

Safe disconnect UI for USB drives: confirmation dialog, stop apps, sync, unmount.
Disconnected state visible across all pages (dashboard, settings, backups, monitoring)
with hatched red bars and badges. Backup guards skip disconnected drives.

22 files changed (1 new: monitor/watchdog.go), ~1500 lines added.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 19:42:26 +01:00
admin 276be5a88e docs: update CHANGELOG.md and CONTEXT.md for v0.16.1 + hub v0.1.8
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 18:29:41 +01:00
admin 80f5cbaa28 fix: move selfupdate routes before hasSuffix stack cases in router
The selfupdate routes were placed after the generic hasSuffix(path, "/update")
stack case, which was catching /selfupdate/update before the specific case
could match it. Moving the selfupdate cases to before all hasSuffix-based
cases fixes the routing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 18:20:52 +01:00
admin 2687506b08 feat: add controller_url to hub reports (v0.16.1)
Controller now includes its external URL in periodic hub reports so the
hub can trigger self-updates remotely via the /api/selfupdate/update endpoint.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 18:16:32 +01:00
admin 1a1ccd85ee updated version number 2026-02-19 18:07:20 +01:00
admin 8562b2af02 Hub Update Trigger + Controller URL Reporting 2026-02-19 18:06:40 +01:00
admin c9a88afcef feat: add controller self-update mechanism (v0.16.0)
New selfupdate package: version parsing, audit state file, updater with
Gitea registry V2 check, docker pull + compose rewrite + compose up flow.

- API: /api/selfupdate/{status,check,update} with session+bearer auth
- UI: Settings "Verzió és frissítés" card with check/install buttons + JS polling
- Scheduler: periodic check (6h default) + optional daily auto-update
- Notifications: success/failure on post-update startup verification
- Alert: info banner when update available
- docker-compose.yml: add directory bind mount for compose file access

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 17:33:40 +01:00
admin 1a58797dc8 0.16.0 — Controller Self-Update 2026-02-19 17:18:31 +01:00
admin 4923afa6a7 v0.15.7: Fix backup page storage display & rename system drive label
- Add StorageBars to backupsHandler so all registered storage paths appear
- Update backups.html to use StorageBars loop (replacing single HDDConfigured block)
- Rename "SSD (/)" → "Rendszer (/)" on backup, monitoring, and dashboard pages

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 16:04:36 +01:00
admin dc00fc1e26 updated version 2026-02-19 16:01:54 +01:00
admin 44bb0e8e90 v0.15.7 - Fix backup page storage display & rename system drive label 2026-02-19 16:01:11 +01:00
admin d9552097a9 Add CHANGELOG entry for v0.15.6 bug hunt fixes 2026-02-19 14:08:52 +01:00
admin 75ea9d73f0 Fix bugs from BUGHUNT.md: restore race conditions, infra backup, DR wiring, docker-setup.sh, restore.html 2026-02-19 14:06:42 +01:00
admin cdaa137118 docker-setup.sh v5.0: Config wizard, controller deployment, FileBrowser rewrite
Complete TASK.md implementation:
- §1: Version bump to 5.0.0, updated banner and header comment
- §3+§4: Remove --cf-tunnel-token and --hdd-path CLI options (deprecated)
- §5: Rewrite install_filebrowser() with auto drive discovery from /mnt/
- §6: New install_controller() deploys felhom-controller with compose
- §7: Interactive run_config_wizard() generates controller.yaml
- §9: install_cloudflare_tunnel() reads from wizard variable
- §10: New execution order: infra → wizard → tunnel → filebrowser → controller
- §11: Fix print_summary() — controller URL, hub status, fix CUSTOMER_ID bug
- §12: Update print_help() for new workflow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 13:33:39 +01:00
admin 6713df2186 v0.15.5: Disaster recovery — Hub-based infra backup, auto-mount, restore UI
Complete DR implementation (TASK2.md Phases 1-4):
- Hub infra-backup push/pull endpoints (controller.yaml, disk layout, stacks)
- Fresh-deployment detection pulls config from Hub, auto-mounts drives by UUID
- Full-page restore UI with drive status, app table, sequential restore
- docker-setup.sh shows DR instructions when customer_id is configured

New files: disk_layout.go, restore_scan.go, restore_app_linux.go,
restore_drives_linux.go, infra_backup.go, infra_pull.go,
handler_restore.go, restore.html

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 13:16:46 +01:00
admin 5d993b66a2 Major rewrite of scripts/docker-setup.sh (v5.0) 2026-02-19 11:12:39 +01:00
admin 00c668fc92 v0.15.5: Fix startup hub report — Push() returns real errors, startup retries 3x with 15s delay 2026-02-19 10:08:43 +01:00
admin 925711e44e Fix startup hub report — Push() silently swallows errors (v0.15.5) 2026-02-19 10:05:14 +01:00
admin f54d1a23de v0.15.4: Hub disabled notification, PushOnce, ReportingDisabled field 2026-02-19 09:45:40 +01:00
admin d2587ae27c Fix hub report (v0.15.4) 2026-02-19 09:39:29 +01:00
admin 215ba8a83d v0.15.3: Show all storage paths on dashboard/monitoring + fix hub report 2026-02-19 09:06:59 +01:00
admin 426eaca04d Show all storage paths on dashboard + fix hub report (v0.15.3) 2026-02-19 09:04:17 +01:00
admin d372454c18 v0.15.2: Fix snapshot stats and DB validation loss on restart 2026-02-19 08:45:37 +01:00
admin ea7105d468 Fix data loss on container restart (v0.15.2) 2026-02-19 08:41:59 +01:00
admin 2befa6877b v0.15.1: Backup page Részletek overhaul with per-drive tier sections
Replace Tároló section with collapsible Részletek containing 3 tiers:
- Tier 1: per-drive restic repo stats with storage labels
- Tier 2: cross-drive items grouped by destination, split by method
- Tier 3: remote backup placeholder
Restore UI now shows tier + drive labels in snapshot dropdown.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 08:23:33 +01:00
admin 0c0cacbe7c fix: handle oversized lines in DB dump validation
Replace bufio.Scanner with bufio.Reader.ReadLine() which gracefully
skips lines exceeding the buffer (isPrefix=true) instead of failing.
Fixes validation of Immich's PostgreSQL dump which contains COPY lines
with binary-encoded image data exceeding the 256KB scanner limit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 07:58:31 +01:00
admin debab0f38b fix: mount config.yaml at correct path for FileBrowser Quantum
FileBrowser reads config.yaml from its working directory
(/home/filebrowser/), not from the data subdirectory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 22:21:48 +01:00
admin b06e9bb368 fix: persist FileBrowser database + sync on manual storage add
- Add server.database to generated config.yaml pointing to the
  persistent data volume. Previously the database was at
  /home/filebrowser/database.db (outside the volume) and was lost
  on every container recreation.
- Call syncFileBrowserMounts after manual storage path add, so newly
  registered drives (like sys_drive) also appear in FileBrowser.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 22:19:26 +01:00
admin 91c12c4b8b feat: sync FileBrowser config on startup
Ensures config.yaml and docker-compose.yml are regenerated on
controller startup, so new drives added while the controller was
down still get their FileBrowser sources configured.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 21:56:14 +01:00
admin b88c9c76e6 feat: auto-configure FileBrowser sidebar with per-drive sources
Generate config.yaml with a separate source per registered storage path.
Each source uses the drive's label as its display name, making it appear
automatically in FileBrowser's sidebar. The config.yaml is bind-mounted
into the container (read-only) alongside the data volume.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 21:53:30 +01:00
admin 30110d3fca fix: show error for duplicate folder name + add client-side validation
CreateDirectory now returns an error when the folder already exists
instead of silently succeeding. JS validates folder name format
(alphanumeric + underscore, max 32 chars) before sending the request.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 21:37:54 +01:00
admin 6b7ca566df fix: clean up stale raw mounts before scanning in attach wizard
After an interrupted attach wizard, the raw mount stays behind,
causing the device to appear as "mounted" in scan results. Now the
scan button calls cancel first, which unmounts any stale raw mounts
that have no bind mount in fstab.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 21:30:32 +01:00
admin 5b7f261ba6 docs: add attach existing drive wizard to README
Document the new v0.15.0 attach wizard: bind-mount approach,
API endpoints, file tree, and roadmap entry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 21:22:29 +01:00
admin 1d394e32ad fix: fstab write fails on bind-mounted /host-fstab (EBUSY)
rename() fails with EBUSY on Docker bind-mounted files. Add safeWriteFile()
helper that tries atomic rename first, falls back to direct write. Fixes
both init wizard and attach wizard fstab operations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 21:19:30 +01:00
admin 98834dd7e8 v0.15.0: Attach existing drive wizard (bind mount, no format)
New Settings wizard to attach drives with existing filesystems without
formatting. Mounts partition at staging path, lets user browse and pick
a subfolder, then bind-mounts it at /mnt/<name> with fstab entries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 21:12:02 +01:00
admin e54e097d02 chore: update CHANGELOG for v0.14.2 2026-02-18 19:47:49 +01:00
admin 70d503a902 fix(backup): 4 bug fixes from v0.14.1 code review (v0.14.2)
Bug 1 (HIGH): add --exclude _* to rsync --delete so _db/ and _config/
  directories are never deleted between backup runs (crossdrive.go)

Bug 2 (MEDIUM): refactor RunDBDumps/RunBackup/RunFullBackup to use
  acquireRunning/releaseRunning helpers; extract runDBDumpsInternal and
  runBackupInternal so all three public entry points set m.running and
  RunFullBackup no longer deadlocks calling the public methods (backup.go)

Bug 3 (MEDIUM): log [WARN] when GetDiskUsage returns nil in
  ValidateDestination instead of silently skipping space checks (crossdrive.go)

Bug 4 (MEDIUM): add [WARN] on empty SystemDataPath in NewManager; add
  [ERROR] in GetAppDrivePath; guard DumpStackDB against empty/relative paths
  (backup.go)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-18 19:46:16 +01:00
admin 54dc74a525 Bug Fixes from v0.12.4–v0.13.1 Code Review 2026-02-18 19:40:50 +01:00
admin fcd20eb524 Update README.md for v0.14.1: auto Tier 2 + infra backup docs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 19:14:03 +01:00
admin f7518c0529 v0.14.1: Auto Tier 2 for small apps + infra config in cross-drive backup
- Auto-enable daily rsync Tier 2 for apps without HDD mounts when ≥2
  storage paths exist (AutoEnableSmallApps)
- Sync infrastructure config (stacks dir + controller.yaml) to all
  secondary destinations via _infra/ directory (syncInfraConfig)
- Include infra paths in cross-drive restic snapshots
- Add SecondaryInfraPath() helper to paths.go

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 19:11:57 +01:00
admin 0e13d42ccd Update README.md for v0.14.0 architecture
- Per-drive backup architecture (restic repos, DB dumps, path helpers)
- Updated Tier 1/2 sections with new drive layout diagrams
- Updated controller.yaml example (system_data_path, no global paths)
- Updated repo layout (add paths.go), build examples, roadmap
- Removed all v0.12.x references

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 18:53:15 +01:00
admin 563c9515d9 v0.14.0: Per-drive backup architecture + storage path overhaul
Major refactor of backup and storage paths:

- Per-drive restic repos at <drive>/backups/primary/restic/
- Per-app DB dumps at <drive>/backups/primary/<app>/db-dumps/
- Remove global BackupDir, DBDumpDir, ResticRepo config fields
- Add SystemDataPath config (fallback for apps without HDD)
- New backup/paths.go with pure path computation helpers
- Add GetStackHDDPath to StackDataProvider interface
- Restic methods now accept repoPath as parameter
- Cross-drive backup uses new secondary path structure
- Rename storage/ to appdata/ in scripts and compose templates
- Update protected HDD paths (storage → appdata + backups)
- Simplify backup UI (remove global path displays)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 18:47:39 +01:00
admin 05f6095e6b v0.13.1: UI polish fixes round 2 (4 fixes)
- Fix 1: deploy-cross-drive card uses correct CSS vars (--bg-secondary, --border-color)
- Fix 2: Auto-generated env values — badge inline with label, remove copy buttons, muted readonly inputs
- Fix 3: Snapshot table shows 0 instead of n/a; remove unused .col-na CSS
- Fix 4: Disk warnings moved inline under storage bars (Inline alert field, GetInlineAlerts, inline-warning CSS)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-18 16:09:56 +01:00
admin e247fdf54c v0.13.1 UI Polish Fixes (Round 2) 2026-02-18 16:04:12 +01:00
admin 90826dec7a v0.13.0: UI polish fixes (8 improvements)
- Fix 1: Dashboard backup card border (verified already correct)
- Fix 2: Show auto-generated env values on deploy page with copy/reveal
- Fix 3: Temperature value pill for better visibility on dashboard
- Fix 4: Rework dashboard backup section (remove manual trigger, add Tier 2 summary)
- Fix 5: Scope HDD warning banner to dashboard and monitoring pages only
- Fix 6: Move Tárhely section up in monitoring page
- Fix 7: Snapshot table clarity (HOZZÁADOTT header, n/a instead of -)
- Fix 8: Restructure Tároló section into tiered storage view

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-18 13:30:21 +01:00
admin 6bfdd88d10 v0.13.0 UI Polish Fixes 2026-02-18 13:14:49 +01:00
admin 3f2557fe26 v0.12.9: Tier 2 for all apps + status dot update
- Tier 2 cross-drive backup now configurable for all apps (not just HDD apps)
- Non-HDD apps (Mealie, Gokapi) can back up config + DB to secondary drive
- Status dot: removed "auto" gray — all apps start yellow, green = 2+ tiers OK
- Backup page: Tier 2 row always shown, Tier 3 placeholder added
- Deploy page: cross-drive config visible for all deployed apps
- Meta badges: non-HDD apps show "Konfig" or "Konfig + DB" instead of "Auto"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-18 12:11:27 +01:00
admin f9c0338894 Tier 2 for All Apps + Status Dot Update (v0.12.9) 2026-02-18 12:07:34 +01:00
admin 4a9aea647b v0.12.8: complete cross-drive backup + per-tier UI
- Cross-drive now copies DB dumps (_db/) and config (_config/) alongside user data
- restic cross-drive includes config dir + full DB dump dir
- UI: per-tier rows (1. mentés / 2. mentés) instead of per-layer (DB/Konfig/Data)
- UI: BackupContents label shows what each tier protects (DB + Konfig + Adatok)
- UI: rsync backups show browsable indicator (📁)
- Cleanup: removed unused filterSnapshotsByPaths + pathCovers from router.go

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-18 11:37:48 +01:00
admin b65ab612f0 Complete Cross-Drive Backup + Per-Tier UI (v0.12.8) 2026-02-18 11:32:11 +01:00