Commit Graph

150 Commits

Author SHA1 Message Date
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 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 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 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 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 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 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 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 4af2b1b560 updated monitoring.html 2026-02-16 11:44:29 +01:00
admin 717d173408 updated DB query and build instructions 2026-02-16 11:19:18 +01:00
admin b19682a767 fix(monitoring): hostname, tooltip timestamps, default range (v0.5.1)
- Bug 1: Read hostname from /host/etc/hostname instead of os.Hostname()
  which returns the container ID inside Docker. Added volume mount.
- Bug 2: Tooltip callback used parsed.x (category index) instead of
  label (actual timestamp), showing 1970 dates.
- Bug 3+4: Default range changed from 24h to 1h so charts show data
  immediately on new deployments with limited history.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 11:01:08 +01:00
admin b43ccf698a v0.5.1: Monitoring Page Bugfixes 2026-02-16 10:59:16 +01:00
admin 3f30803432 fix(dashboard): use GetFullStatus for backup display after restart
The dashboard was using GetStatus() which returns nil after restart,
showing "Még nem futott" even when backups exist. Now uses
GetFullStatus() with synthesis logic, matching the backups page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 10:20:14 +01:00
admin 3e8baebfa5 v0.5.0: Backup bugfixes + monitoring page with metrics store
- Fix "Helyi mentés" showing "–" after controller restart by synthesizing
  LastBackup from snapshot history and LastDBDump from dump files on disk
- New monitoring page (/monitoring) with system info, metrics charts, and
  container resource overview
- SQLite metrics store (modernc.org/sqlite, pure Go, no CGO) with 60s
  collection interval and 30-day auto-prune
- REST API endpoints: /api/metrics/system, /api/metrics/containers/summary,
  /api/metrics/containers/{name}, /api/metrics/sysinfo
- Chart.js 4.4.7 embedded locally for offline environments
- System info provider reads hostname, OS, kernel, CPU, uptime from /proc
- Docker compose updated with /etc/os-release host mount

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 10:14:46 +01:00
admin 3be989f665 v0.4.7: Protected stack detail pages + backup page caching
Task 1: Protected stacks with .felhom.yml (slug) are now clickable
on both dashboard and stacks pages. "Részletek" button added to
protected stack actions section. Filebrowser .felhom.yml updated
with resources metadata.

Task 2: Backup page now reads from a cached FullBackupStatus that
refreshes every 5 minutes in background + after each backup run.
Page loads instantly instead of blocking on restic/docker subprocesses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 09:02:54 +01:00
admin fd627f3d55 v0.4.6: MariaDB validation fix + dashboard deployed-only + protected stack restart
- Fix ValidateDump() to scan first 10 lines for header (MariaDB 11.4+ sandbox comment)
- Dashboard shows only deployed/protected stacks, heading "Telepített alkalmazások"
- Protected stacks show restart button when operational (both dashboard + stacks page)
- API blocks all actions except restart on protected stacks
- docker-setup.sh creates .felhom.yml for FileBrowser (subdomain: files)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 08:44:34 +01:00
admin 37ff296a0d v0.4.5: Add dedicated Backup page (Biztonsági mentés)
New /backups page with full backup system visibility:
- Status overview cards (local/remote backup, DB count, repo size)
- Schedule section with next-run times and retention policy
- Database table with type, size, validation (table count), status
- Snapshot history table with per-snapshot stats
- Repository info card with paths, integrity status, remote placeholder
- "Mentés most" button with auto-refresh polling
- Empty state when backup not configured

Backend: SnapshotRecord history (ring buffer), DumpValidation,
ListDumpFiles, ListSnapshots, GetFullStatus, restic check tracking.
Server accepts scheduler for next-run time calculation.

Sidebar nav updated with 3rd item, dashboard backup card title clickable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 07:43:24 +01:00
admin d51e67f199 v0.4.1: app filtering + clickable dashboard stat cards
Add filter bar (Mind/Futó/Leállítva/Telepíthető) to Alkalmazások page with
URL-based filter persistence. Dashboard stat cards are now clickable links
that navigate to the filtered stacks view.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 12:19:26 +01:00
admin 1596e86e69 docs: update CONTEXT.md and README.md for v0.4.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 11:20:30 +01:00
admin d32d9fb44b v0.4.0: monitoring & backup — scheduler, CPU/temp metrics, healthchecks, restic backups
Phase 2 (Monitoring & Health):
- Central job scheduler replacing ad-hoc goroutines (internal/scheduler)
- CPU usage collector via /proc/stat background sampling (internal/system/cpu_linux.go)
- Temperature reading from /sys/class/thermal + /host/sys (Docker mount)
- Load average from /proc/loadavg
- Healthchecks.io-compatible HTTP pinger (internal/monitor/pinger.go)
- System health checks: disk, memory, CPU, temp, Docker, protected containers (internal/monitor/healthcheck.go)

Phase 3 (Backups):
- Database auto-discovery via docker ps + docker inspect (internal/backup/dbdump.go)
- Database dumping via docker exec (pg_dump / mariadb-dump) with atomic writes
- Restic backup integration with auto-password generation (internal/backup/restic.go)
- Backup orchestrator: DB dumps + restic snapshots + weekly prune (internal/backup/backup.go)
- Manual backup trigger via dashboard button and POST /api/backup/run

Dashboard UI:
- CPU usage bar with load average display
- Temperature with colored indicator dot
- Backup status card with last run time, DB count, repo stats
- "Mentés most" button for manual backup trigger

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 11:17:10 +01:00
admin 57cacd9233 v0.3.0: structural refactor — go:embed templates, server split, domain rename
- Migrate all 7 HTML templates + CSS from Go string constants to individual
  go:embed files in internal/web/templates/ (templates.go: 2150→35 lines)
- Split server.go into auth.go, handlers.go, funcmap.go (server.go: 540→120 lines)
- Rename controller subdomain from dashboard.* to felhom.* in Traefik labels
- Update documentation (CLAUDE.md, README.md, CONTEXT.md)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 10:38:06 +01:00
admin 59ed4bd1c2 feat: orphan stack detection/deletion, filebrowser infra, setup scripts
- Add orphan detection: stacks not in catalog marked as "Elavult"
- Add DELETE /api/stacks/{name} endpoint with HDD data handling
- Add GET /api/stacks/{name}/hdd-data endpoint
- Add delete confirmation modal with HDD data checkbox (Hungarian UI)
- Add filebrowser to protected stacks list
- Add scripts/hdd-setup.sh and scripts/docker-setup.sh for node setup
- Hide "Frissítés" and "Részletek" buttons for orphaned stacks

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 10:03:10 +01:00
admin 3caceb3b47 remove temporary debug log from LoadMetadata, keep error log
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 20:50:05 +01:00
admin 68c67dafe6 add error logging to LoadMetadata, fix deploy sed command
- Log YAML parse errors in LoadMetadata instead of silently swallowing
- Add debug log for successful metadata loads (tagline, useCases, optConfig counts)
- Fix CLAUDE.md deploy command: use sudo, target only image: line in sed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 20:46:58 +01:00
admin ee2a0307a7 fix: constrain app-info-logo SVG to 80x80 bounds
Add min/max width/height and overflow:hidden to .app-info-logo CSS
to prevent SVG images from ignoring container dimensions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 20:29:56 +01:00
admin 658b995e53 Update documentation for app info pages feature
- CONTEXT.md: session 5 with app detail/info pages + optional config
- README.md: add optional-config API endpoint, update version to 0.2.11
- CLAUDE.md: add app info page patterns to key patterns section

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 20:15:56 +01:00
admin 6080170367 Add app detail/info pages with optional config support
- New route: GET /apps/{slug} renders info page with use cases, setup guide, prerequisites
- New API: POST /api/stacks/{name}/optional-config for updating optional env vars
- New structs: AppInfo, OptionalConfigGroup, OptionalConfigField in metadata.go
- UpdateOptionalConfig saves to app.yaml and restarts deployed stacks with new env vars
- Info page template with hero section, screenshots, info cards, optional config form
- Navigation: stack cards now link to /apps/{slug}, deploy page has "Részletek" link

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 20:12:18 +01:00
admin a8096faf59 added fix for deployment race condition 2026-02-14 19:17:01 +01:00
admin 0be798af5d updated startup monitoring 2026-02-14 18:57:20 +01:00
admin c3b80cffdc bugfix 2026-02-14 18:25:12 +01:00
admin e0e8e88276 GUI updates, live log visibility 2026-02-14 17:55:14 +01:00
admin 9d7a36a143 added more detailed debug logging 2026-02-14 17:33:33 +01:00
admin 85aa518208 updated 2026-02-14 17:13:09 +01:00
admin ee8650a41c implemented git sync for app templates 2026-02-14 13:40:00 +01:00
admin 44a7d0de2c updated memory calculation and logo 2026-02-14 12:41:08 +01:00
admin 6a7737ee1c added mem_request 2026-02-14 12:07:10 +01:00
admin 67ba0fe759 Added memory limits and system info for memory 2026-02-14 11:44:06 +01:00
admin e0e15867e9 added .eu 2026-02-14 11:19:10 +01:00
admin 4a19fda795 added some info 2026-02-14 11:15:53 +01:00
admin 5d9087dc2b added memory and context 2026-02-14 08:00:06 +01:00
admin 4282b8d8cb fixed 2026-02-13 21:33:21 +01:00
admin fd29e602e8 updated 2026-02-13 21:15:00 +01:00
admin bcc7877c41 updates 2026-02-13 20:49:17 +01:00
admin 2ee027fa7e updated readme 2026-02-13 20:03:30 +01:00
admin 599cf56273 added gnupg package to be installed 2026-02-13 19:22:14 +01:00
admin fe10a43d2c updated dockerfile 2026-02-13 19:19:04 +01:00
kisfenyo 223e14ae11 made script executable 2026-02-13 19:12:32 +01:00
admin e9dde0a340 restructured files, and updated for build outside 2026-02-13 19:10:35 +01:00
admin f72bb57eda added controller 2026-02-13 18:54:08 +01:00