Commit Graph
100 Commits
Author SHA1 Message Date
Gmer4Lfe 127b070f7b Verbose logging: add config dump log() calls to Monitors, Media, Tools, Rsync, Fallback 2026-06-04 21:37:53 -04:00
Gmer4Lfe 369a9e6c19 Platform adapter: rename System_Essentials, add Plugin/unraid/adapter.sh, wire call sites
- Rename unRAID_Essentials/ → System_Essentials/ (git detects as rename)
- Add Plugin/unraid/adapter.sh: 13 platform_*() functions providing OS-agnostic API
  for storage health, service management, mover, user scripts, notifications,
  disk temps, and platform command validation
- Update load_config.sh: detect PLATFORM (unraid/truenas/unknown), export SCRIPTS_DIR,
  auto-source Plugin/$PLATFORM/adapter.sh after common.sh
- Wire all call sites: replace direct rc.d, pgrep/pkill, var.ini, dynamix.cfg,
  disks.ini, and validate_unraid_cmd calls with platform_*() functions across
  watchdogs, orchestrators, and System_Essentials scripts
- Update all documentation: rename refs, update webgui escalation logic,
  add platform adapter section to Plugin README, update main README with
  portability vision and corrected self-healing stack description
2026-06-04 18:14:34 -04:00
Gmer4Lfe b5d33cd6a5 Bash common.sh: consolidate docker_cmd/retry_docker/verify_running/emby_api, fix tailscale dups
common.sh gains:
- docker_cmd() + verify_running() + retry_docker() — removed from all 3 Docker_Essentials
  scripts where they were byte-for-byte duplicates
- emby_api(endpoint, [timeout=30]) — removed from 6 Media/Tools scripts that each defined
  their own _emby_api() with the same curl/parse/error pattern; call sites renamed emby_api
- format_duration() extended with days/hours branch (was capped at minutes+seconds)
- notify() comment: scripts do not need to preflight the notify script via validate_unraid_cmd

Tailscale deduplication:
- arr_sync.sh: _resolve_node_ip() and inline block in _delete_remote_item() both replaced
  with resolve_tailscale_ip() from common.sh
- git_pull_execute.sh: inline tailscale ip -4 replaced with resolve_tailscale_ip() (adds
  the tailscale status fallback that was missing)
2026-06-04 17:00:50 -04:00
Gmer4Lfe 0bcb773332 Cache: warm at array start, extend stale tolerance to 5 min, fix last uptime copy
- ARRAY_START_SCRIPTS: add api_cache_writer.sh so monitor/arrs cache is populated
  immediately on array start (/tmp is tmpfs — cleared on reboot, so first-boot
  load was hitting live API for up to 60 seconds until the cron fired)
- api/monitor.php + arrs.php: raise cache TTL from 90s to 300s — stale-but-instant
  beats a 6-second live API wait if the writer is momentarily behind
- include/unraid_api.php: replace last inline uptime formatter with vv_format_uptime()
2026-06-04 16:46:50 -04:00
Gmer4Lfe ce0b3fb74b PHP app layer: consolidate common functions, fix critical bugs, standardize patterns
Consolidations (config.php gains 5 shared utilities):
- vv_format_uptime() replaces 4 inline uptime-formatting blocks
- vv_parse_conf_scalar() replaces vv_arr_scalar/vv_wd_scalar/vv_fb_scalar/vv_media_conf_scalar
- vv_known_hosts() replaces vv_arr_known_hosts/vv_fb_known_hosts + inline parser in watchdog
- vv_parse_kv_db() replaces inline key=value parsing in snapshot and monitor
- vv_local_ip() replaces duplicate in docker_folders.php and inline in docker.php
All module-level function names kept as thin aliases so call sites unchanged.

Critical bug fixes:
- api/system.php: added require_once config.php and POST-only guard (no auth on shutdown)
- api/movescript.php + reorderarray.php: use vv_write_conf_raw (atomic) + vv_push_master_conf
- api/snapshot.php: share /tmp/vv_cpu_stat.json with vv_cpu_per_core() instead of own state file

Correctness:
- vv_cpu_per_core() and vv_network_stats(): atomic tmp+rename for state files (concurrent poll safety)
- ext_ip curl cache moved from /tmp/vv_ext_ip.cache to vv_cache_read/write (canonical cache dir)
- monitor_remote.php + board.php + snapshot.php: all use vv_cache_read/write instead of ad-hoc /tmp files

HTTP method guards added to write-only APIs that were missing them:
- api/scheduler.php, conf_toggle.php, flag_toggle.php
2026-06-04 16:44:16 -04:00
Gmer4Lfe 6aaf04e25b Monitor: 1-second CPU/mem/net updates via fast endpoint
Split slow cached monitor endpoint from the live stats. monitor_fast.php
reads /proc/stat, /proc/meminfo, ZFS arcstats, and /proc/net/dev directly
— no cache wrapper, 87ms response. Docker/vm/swap pulled from last full
cache so mem card stays complete. Full monitor poll stays at 2s for
everything else (GPU, containers, storage, etc).
2026-06-04 16:29:45 -04:00
Gmer4Lfe b7894681e6 API key: use space separator, fix error-capture bug; add conf_sync and missing files from dev
unRAID API rejects underscores and hyphens in key names — only letters, numbers,
and spaces allowed. Varaverk_HOST1 / Varaverk_Gmer4Lfe both fail; now uses
"Varaverk <hostname>" (space). Also adds monitor_remote.php, conf_populate.sh,
and conf_sync.sh from dev branch that were missing from production.
2026-06-04 16:17:47 -04:00
Gmer4Lfe a41adfe020 API keys: Varaverk_HOST1 registered on all machines, keys in host*.conf, cross-host GraphQL direct access 2026-06-03 18:39:19 -04:00
Gmer4Lfe 7178be73a5 API keys: Varaverk_HOST1/HOST2 named keys, cross-host SSH setup, keys in master.conf for direct GraphQL access 2026-06-03 18:34:19 -04:00
Gmer4Lfe a55a3afad5 Remote cache: extend to monitor stats; vv_local_host_stats(), 2h bg refresh covers monitor+arrs pages 2026-06-03 18:20:55 -04:00
Gmer4Lfe 2223cf80f7 Arrs: remote host cards via SSH cache, vv_arrs_local_node(), 2h refresh schedule 2026-06-03 18:16:56 -04:00
Gmer4Lfe 6c0164713b arrs: auto-fit cards to span page evenly 2026-06-03 18:04:46 -04:00
Gmer4Lfe 13ed584d73 arrs: move settings into vv_arrs_all() so cache writer includes them 2026-06-03 18:03:40 -04:00
Gmer4Lfe 6104cde755 Arrs page overhaul: big stats, disk bars, queue badges, health strips, settings card 2026-06-03 17:55:04 -04:00
Gmer4Lfe 7d8499686a Settings: add Notifications card and Unraid API Key card 2026-06-03 17:49:22 -04:00
Gmer4Lfe 3cdb65cf8e storage_migrate: also update DATA_DIR and STATE_DIR in master.conf 2026-06-03 17:44:47 -04:00
Gmer4Lfe 0cb429222a Add storage mode migration: internal NVMe vs USB flash, Settings tab, fix hardcoded /boot/ paths 2026-06-03 17:40:35 -04:00
Gmer4Lfe e9ea67ec14 rsync window cards: edit/add/remove scripts and sync shares with browse and profile picker 2026-06-03 16:43:32 -04:00
Gmer4Lfe cb1c5d33cb rsync window cards: expand to show orch scripts and sync shares, drop toggle 2026-06-03 16:28:19 -04:00
Gmer4Lfe abb4968487 rsync page: window cards expand on click to show per-window enable toggle 2026-06-03 16:24:24 -04:00
Gmer4Lfe 65075ed599 Add file-based API cache — monitor and arrs pages now serve from /tmp/vv_cache instead of making live HTTP calls on every page load 2026-06-03 16:15:35 -04:00
Gmer4Lfe 9655a30d25 rsync page: cap recent runs height at 200px, invisible scrollbar 2026-06-03 16:06:34 -04:00
Gmer4Lfe de6fcc3997 Add Rsync page, upgrade monitor rsync card, partnership overhaul, API key periodic check, docker watchdog manual-stop detection 2026-06-03 15:58:50 -04:00
Gmer4Lfe 8be54ab5ee Fix play state sync, add manual stop detection, minor bug fixes
play_state_sync: fix TVDB episode lookup for Jellyfin 10.x — AnyProviderIdEquals
returns the entire library for TVDB queries; switch to season+episode search with
ProviderIds.Tvdb validation to find the correct episode. Also fix pkey extraction
that was pulling s7e2 instead of the TVDB ID from tvdb:ep:5618559:s7e2.

docker_watchdog: add automatic manual-stop detection — containers stopped cleanly
(exit 0/143) are tracked in docker_watchdog_manual_stop.db and skipped until
restarted, removing the need to add manually-stopped containers to the exclusion
list. Auto-clears when the container is seen running again.

docker_daily_restart: remove bare `local` declarations outside a function that
were printing an error for every container restarted.
2026-06-02 17:55:26 -04:00
Gmer4Lfe 1a8d40d631 unraid_api_key_renew: always sync registry key to conf
Previously exited early when key was found in registry without checking
if the conf matched. After a reboot or key rotation the registry holds
the current key but the conf could have a stale value causing API auth
failures on every boot.

Now compares registry key to conf value and syncs if they differ.
2026-06-01 21:28:09 -04:00
Gmer4Lfe 3e71c314d7 Add Rsync card to monitor page Row 3 (before GPU)
New span-1 card shows global RSYNC_ENABLED gate, per-window badges (C/D/I/W),
active profile names + elapsed time from lock files, and last-sync timestamp
per orchestrator window from script log files.

GPU shrunk from span 2 to span 1 to make room. Row 3 is now:
Rsync(1) | GPU(1) | Transcode(2) | Streams(4)
2026-06-01 21:10:44 -04:00
Gmer4Lfe 08fc551d9f Add verbose log() coverage across all watchdog scripts
docker_watchdog: config dump at startup (thresholds/limits), skip list shown when active, per-container healthy log for Tier1 required + mem/CPU monitored containers
stability_watchdog: config dump with all tier thresholds, log() on pass for rootfs/log/tmp/load/zombies/NIC checks (previously silent on clean)
resource_watchdog: config dump with all pressure thresholds and container lists, log normal pressure state with live RAM/load values
system_watchdog: per-script timing on each child script run
network_watchdog: config dump (internet URL, DDNS domain/container, NPM URL, strike limit)
storage_watchdog: config dump (growth threshold, log max, paths, suppress ceilings)
webgui_watchdog: log nginx worker and php-fpm worker counts on healthy check
2026-06-01 20:56:46 -04:00
Gmer4LfeandClaude Sonnet 4.6 bc70ebe5ee Add verbose log() coverage across Docker_Essentials, unRAID_Essentials, Transcodes, and Orchestrators
- Config/threshold dumps at startup in every script (retry counts, timeouts, sizes, thresholds)
- Per-item detail in verbose: container images, timing per container/share/job, image ID diffs
- Orchestrators: watchdog cycle now logs array state, grace state, per-script timing; transcode_management shows ramdisk state before each cycle; critical_sync logs share list and maintenance scripts; coffee report logs server state at run time
- Summary counts replaced with names in verbose where previously only counts were shown

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 20:51:34 -04:00
Gmer4Lfe 8f696d85f7 output: Tools — success status and safety-check lines visible 2026-06-01 20:30:05 -04:00
Gmer4Lfe e18ee9fcf0 output: Monitors — weekly_health_digest non-send day now visible 2026-06-01 20:29:03 -04:00
Gmer4Lfe b316e1b49f output: Media — success status visible, not-configured and disabled exits now echo 2026-06-01 20:28:27 -04:00
Gmer4Lfe 74dff404b8 output: docker_container_stop — success status line visible (was log-only) 2026-06-01 20:26:32 -04:00
Gmer4Lfe d8c456a8c9 output: unRAID_Essentials — array-start scripts now show already-correct status instead of silence 2026-06-01 20:25:35 -04:00
Gmer4Lfe 9f82eb5678 output: orchestrators — array-not-started and monthly gate-not-met now echo instead of silent log 2026-06-01 20:24:46 -04:00
Gmer4Lfe 5e89f334bb output: watchdog visibility — parity/grace/disabled exits now echo, docker_watchdog container count, api_key_renew status always visible 2026-06-01 20:22:52 -04:00
Gmer4Lfe f8325a7067 rename: fix remaining failover refs in fallback.sh, fallback_test.sh, array_started.sh, user_script_plug-in.sh 2026-06-01 20:05:02 -04:00
Gmer4Lfe cb7d7a688d rename: failover → fallback throughout codebase — this system is Fallback, state is FALLBACK; preserve conventional failover comparisons 2026-06-01 20:04:17 -04:00
Gmer4Lfe 65f6bd7b8a fix: fallback.sh — last User Scripts Abort ref → fallback.sh --stop 2026-06-01 20:00:22 -04:00
Gmer4Lfe 60535ba842 fix: README — Arbiter → Varaverk scheduler, At Startup of Array → event hook, every minute → every 15 minutes 2026-06-01 19:58:01 -04:00
Gmer4Lfe e0ae80d2ea fix: remove all User Scripts dependencies — Varaverk plugin handles everything via event hooks, no User Scripts needed 2026-06-01 19:57:21 -04:00
Gmer4Lfe 98d2e6efa4 fix: remaining stale refs — boot drive path in Plugin Manual, array_started.sh typos in fallback and ramdisk_setup 2026-06-01 19:51:40 -04:00
Gmer4Lfe 4effb55756 docs: fix root Manual, README, User_Script_Plug-in — boot drive paths, 15min watchdog, scheduler setup replaces User Scripts section 2026-06-01 19:50:31 -04:00
Gmer4Lfe d22b18bf9f docs: fix stale refs in unRAID_Essentials Manual, Rsync Manual, fallback_state_reset — 15min watchdog, boot drive paths, drop User Scripts setup instructions 2026-06-01 19:44:41 -04:00
Gmer4Lfe bc81e5a9e0 fix: fallback.sh — array_start.sh → array_started.sh typo 2026-06-01 19:41:55 -04:00
Gmer4Lfe 492f268b10 docs: Docker_Essentials — every minute → every 15 minutes in watchdog refs 2026-06-01 19:41:27 -04:00
Gmer4Lfe 68323f9c4a docs: fix orchestrators README and script headers — 15min schedule, cron model, array_started continuous list, remove media_management ghost entry, full schedule 2026-06-01 19:39:39 -04:00
Gmer4Lfe 4b28529736 docs: fix watchdog README and Manual — 15min schedule, dead vars, renamed vars, abort defaults, removed Required containers from stability tier 2026-06-01 19:33:49 -04:00
Gmer4Lfe d3454a3dab docs: update watchdog headers — single-pass cron model, correct caller refs, stability vs system watchdog 2026-06-01 19:31:16 -04:00
Gmer4Lfe ee26eebc6b feat: unraid_api_key_renew — check-first idempotent renewal, wired to array_start and watchdog 2026-06-01 19:15:37 -04:00
Gmer4Lfe ec2073346e fix: gitignore *.db at repo root — prevent git clean wiping runtime state files 2026-06-01 19:07:01 -04:00
Gmer4Lfe 4ade80d9cb fix: gitignore schedule.json and docker_folders.json — wiped by git clean on every pull 2026-06-01 19:02:55 -04:00
Gmer4LfeandClaude Sonnet 4.6 63b1f0a76c feat: cumulative pulled/pushed GB totals in pools and array card headers
disk_io now returns {tr, tw} cumulative GB alongside {r, w} rates.
A centered span in each card h3 shows ↓total ↑total (since last boot),
updating each poll. Helpers updated for the new object format.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 22:40:56 -04:00
Gmer4LfeandClaude Sonnet 4.6 e9b9d1b5da ui: pools card — live summary header matching array card style
Shows N/total ok · X% used · max Y° · ↓read ↑write in the Pools
card title, using SSD thresholds for temp coloring.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 22:37:30 -04:00
Gmer4LfeandClaude Sonnet 4.6 a8c5b2af29 ui: array card — 2 columns at ≤1024px, 3+ at full width
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 22:35:06 -04:00
Gmer4LfeandClaude Sonnet 4.6 212b61ce15 feat: live disk I/O rates on array and pools cards
Adds vv_disk_io_rates() — snapshots /proc/diskstats each poll and
computes per-device MB/s. Exposed as disk_io in the monitor API.

JS:
- Per-disk rows: ↓read ↑write inline next to disk name (green/amber, hidden when idle)
- Pool rows: aggregate pool I/O next to pool name
- Array header: total array I/O in the subtitle line

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 22:31:19 -04:00
Gmer4LfeandClaude Sonnet 4.6 3e9c7b4921 ui: streams header — left/right groups span full card width
Server badges + media type anchor to the left; device/res/codec anchor
to the right via justify-content:space-between. Right group still
disappears at ≤1024px (now a single display:none on .vv-stream-right).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 22:23:14 -04:00
Gmer4LfeandClaude Sonnet 4.6 3e89997ab5 ui: transcode sessions — all items in 2-col layout, hidden scroll beyond 2 rows
Removes the 4-item cap and +N more label. All sessions go into balanced
columns; the container max-height clips to 2 rows with a hidden scrollbar.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 22:18:49 -04:00
Gmer4LfeandClaude Sonnet 4.6 67e274fd4e ui: transcode active sessions — static 2×2 balanced grid, no scroll
Splits up to 4 sessions into two balanced columns (ceil/floor split),
separated by a subtle divider. A '+N more' line appears beyond 4.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 22:16:46 -04:00
Gmer4LfeandClaude Sonnet 4.6 55e817d234 ui: show last cleanup freed amounts on transcode Ramdisk/NVMe tags
Parses the last 'Ramdisk freed' and 'SSD freed' values from the transcode
management log and displays them as small ↓XMB annotations inside each tag.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 22:15:13 -04:00
Gmer4LfeandClaude Sonnet 4.6 3b645b2108 ui: transcode active sessions — 2-row visible window, scroll on 3rd+
Reduced max-height from 57px to 44px (2 × 22px rows) so the container
cleanly shows two entries at a time and scrolls when a third appears.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 22:11:01 -04:00
Gmer4LfeandClaude Sonnet 4.6 279e6be282 ui: hide device/resolution/codec chip groups at ≤1024px
Wraps each group (separator + chips) in a display:contents span so it
flows naturally at full width and collapses cleanly at the 1024px breakpoint,
leaving server badges and media type visible at intermediate sizes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 22:06:21 -04:00
Gmer4LfeandClaude Sonnet 4.6 52cc6b4721 ui: add media type chip group to streams header (Movies/Shows/Music/Live)
Purple-accented chips, ordered Movies → Shows → Music → Live, with
per-index shade variation matching the other chip groups.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 22:02:59 -04:00
Gmer4LfeandClaude Sonnet 4.6 f0f136f28a fix: hide scrollbars on all nested scrollable divs in monitor cards
Global webkit rule now covers all descendants, not just direct children.
Inline scrollbar-width:none added to the three inner overflow-y:auto divs
(transcode sessions, GPU processes, scripts list) so Firefox hides them too.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 22:00:50 -04:00
Gmer4LfeandClaude Sonnet 4.6 0319b13304 ui: color-coded chip groups in streams header with per-chip shade variation
Device chips: blue, resolution chips: teal, codec chips: amber.
Alternating bg shades within each group to visually separate chips.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 21:59:16 -04:00
Gmer4LfeandClaude Sonnet 4.6 89df1a98db ui: show resolution and codec counts in streams header
Adds height/codec fields to both Emby/Jellyfin and Plex session data,
then surfaces them as chip groups (· 2 4K  3 1080p · 4 H.264  2 HEVC)
in the streams card header alongside the existing device type bar.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 21:52:31 -04:00
Gmer4LfeandClaude Sonnet 4.6 bea7b6b045 ui: show active device type counts in streams header
Parses each session's client string (e.g. "Emby for Roku / Bedroom TV")
into a device category using priority-ordered regex matching:
Android TV, Fire TV, Apple TV, Android, iOS, Roku, LG, Samsung,
Google TV, Kodi, Browser, Desktop.

Counts are grouped and sorted by frequency, displayed as compact chips
to the right of the server badges:
  Emby 7  Jellyfin 2  ·  3 Android  2 Roku  1 Fire TV  1 iOS

Unknown client strings are silently skipped (not shown as "Other").

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 21:41:14 -04:00
Gmer4LfeandClaude Sonnet 4.6 586c7c36c1 ui: Find & Replace, multi-line comments, indent guides, font size
Find & Replace (Ctrl+H):
- Two-row find bar: expand › arrow shows replace row (VS Code pattern)
- Replace button (Enter): replaces current match, advances to next
- Replace All: replaces all occurrences, shows count
- Find input searches live; replace row preserved across open/close

Multi-line comment toggle (Ctrl+/):
- With multi-line selection: checks if ALL lines are commented
  → if all commented, uncomments all; otherwise comments all
- Empty lines in selection are skipped
- After toggle: block stays selected (same as VS Code)
- Single-line behavior unchanged

Indent guides:
- CSS repeating-linear-gradient on #vv-editor-inner: 1px guide every 2ch
- First guide at indent level 1 (col 2); then 4, 6, 8... matching 2-space indents
- Shows through the transparent overlay; scales automatically with font size
- Very subtle (0.045 opacity) — visible but not distracting

Font size A− / A+ in status bar (9–22px):
- Persisted to localStorage, restored on every editor open
- Updates textarea, overlay, gutter, and cur-line height together
- All scroll calculations use vvLH() (fontSizePx × 1.5) instead of
  hardcoded 18 — find nav, goto, select-next-occurrence all correct at
  any font size

Also: fixed duplicate id="vv-find-close" in goto bar (now .vv-find-x class)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 21:20:46 -04:00
Gmer4LfeandClaude Sonnet 4.6 beac98427d ui: editor QoL — line ops, auto-close, goto, smart home, Ctrl+D
Line operations:
- Alt+↑/↓   — move current line up / down (swaps with adjacent line)
- Alt+Shift+↓/↑ — duplicate line below / above
- Ctrl+Shift+K  — delete current line
- Ctrl+L        — select entire current line (including newline)

Auto-close brackets and quotes:
- ( [ { " ' ` — inserts matching close, cursor placed inside
- Wrap selection — if text is selected, typing an opener wraps it
- Skip-over — typing a close char when it's already next → jumps past it
- Smart backspace — deletes BOTH chars when cursor sits between a matched pair
- Guards: skip ' auto-close after word chars (contractions); skip auto-close
  when next char is a word char (prevents disrupting existing text)

Navigation:
- Ctrl+G — Go to Line bar (pre-filled with current line, shows "of N")
- Smart Home — first press → first non-whitespace; second → col 0
- Ctrl+D — first press: select word at cursor; subsequent: cycle through
  all occurrences (wraps around), integrates with word highlight overlay

Keyboard shortcuts panel:
- Added "Editor Keyboard Shortcuts" section to the How do I use this panel

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 21:02:56 -04:00
Gmer4LfeandClaude Sonnet 4.6 1ea3f595cc ui: custom undo/redo stack for editor — up to 200 steps
Native browser undo breaks when ta.value is set programmatically (tab,
enter, ctrl+/) — replaced with a custom snapshot-based undo system.

Stack behaviour:
- oninput → debounced capture (600ms) — groups rapid typing into chunks
- Tab / Enter / Ctrl+/ → immediate capture BEFORE edit, then capture AFTER
  (each programmatic edit gets its own undo step)
- Content load → vvUndoCaptureInitial() seeds the stack with a clean baseline
- Max 200 history entries (VV_UNDO_MAX); old entries dropped from front

Keyboard: Ctrl/Cmd+Z = undo, Ctrl/Cmd+Y or Ctrl/Cmd+Shift+Z = redo
(both handled in vvEditorKeydown before any other key processing)

Buttons: ↩ Undo / ↪ Redo appear in toolbar beside Cancel/Save when editor
is open; disabled state with 0.28 opacity when no steps available; Undo
button shows step count "↩ Undo 5" so you can see how deep the history is

Cleanup: vvEditorReset() calls vvUndoReset() so stack is cleared on every
editor open/close — fresh baseline each time

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 20:54:42 -04:00
Gmer4LfeandClaude Sonnet 4.6 4722382d49 fix: prevent orchestrator lock from blocking 45min on daemon restart
Two root causes of the May 31 19:30 hang (orchestrator stuck for 45min):

1. /etc/rc.d/rc.docker restart had no timeout — on a host with many
   containers, stopping them all before daemon restart can take 30+
   minutes. Added timeout 180 so it's bounded.

2. WATCHDOG_DAEMON_RESTART_WAIT=900 (15min sleep after restart) —
   unnecessary. The daemon itself comes up in seconds; containers are
   handled by subsequent docker_watchdog cycles. Reduced to 90s in
   master.conf, cutting worst-case orchestrator block from 45min to ~5min.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 20:31:20 -04:00
Gmer4LfeandClaude Sonnet 4.6 a250d590ca ui: premium editor overhaul — selection, word highlight, find, status bar
Selection:
- ::selection fix: text selection now visible (bright blue) even when
  textarea color is transparent — the #1 complaint
- Overlay background changed transparent → #vv-editor-inner provides bg,
  allowing #vv-cur-line to show through

Current line highlight:
- #vv-cur-line div positioned absolutely behind overlay, tracks cursor
  line on every keyup/mouseup/click/scroll
- Gutter: current line number highlighted in bright white + bold

Word/variable occurrence highlight:
- Click or position cursor on any identifier → all occurrences highlighted
  in yellow throughout the overlay (whole-word, case-sensitive)
- Select a word → same treatment for the selection text
- Clears when cursor moves off the word or find bar opens

Find in file (Ctrl+F):
- Find bar slides in above editor, pre-filled with selected word
- Highlights all matches orange, current match in bright amber
- ↑/↓ buttons + Enter/Shift+Enter to navigate between matches
- Live match count "N / M"
- Red border + "no matches" feedback when term not found
- Escape or × closes, returns focus to editor

Status bar:
- Persistent bar below editor: Ln N, Col N | selection info | language
- Shows "Bash" or "Bash / Config" depending on file type
- Hides when editor is not open

Visual polish:
- Editor wrap: unified border + border-radius 4px 4px 0 0, overflow:hidden
  clips gutter and inner to rounded corners as one block
- Status bar border-radius 0 0 4px 4px — completes the block
- Gutter: 46px (was 42) — room for 3-digit line numbers
- Slim 8px scrollbar with styled track and hover state
- vvEditorReset() clears all editor state on open/close

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 20:16:26 -04:00
Gmer4LfeandClaude Sonnet 4.6 753f99ac0c ui: editor-like QoL — selection highlight, drag feedback, keyboard nav
Selection / highlight:
- .vv-row-selected: blue tint + left accent bar (was barely-visible gray)
- .vv-sb-selected: same treatment, consistent across both panels
- .vv-df-active (containers): match new selection style
- .vv-job-row + .vv-sb-row: smooth transition on state changes
- .vv-orch-row: hover feedback + pointer cursor (was no visual response)

Drag and drop:
- .vv-drag-ghost: adds dashed ring so source item stays visible while dragging
- .vv-drop-line: blue glow to match selection accent (was flat green)
- All drop targets: unified blue theme (.vv-children, .vv-folder-children)
- .vv-library-zone drop target: improved red with inset glow
- .vv-drag-handle:active: grabbing cursor state
- document.body.vv-is-dragging: cursor:grabbing on entire page during drag
  (added to all three drag start handlers + failsafe document dragend)

Keyboard navigation (scheduler):
- ↑/↓: navigate between top-level orchestrator cards
- Home/End: jump to first/last card
- Escape: close right panel, return to suggestions
- /: focus log search when log panel is open
- All shortcuts suppressed when focus is in any input/textarea/select

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 20:03:27 -04:00
Gmer4LfeandClaude Sonnet 4.6 a943a5c294 fix: rename System Watchdog → Stability Watchdog in labels and output
The stability_watchdog.sh script was being called "System Watchdog"
everywhere, conflicting with system_watchdog.sh (which orchestrates
storage/webgui/network sub-watchdogs). Fixes:

- --status header: "SYSTEM WATCHDOG STATUS" → "STABILITY WATCHDOG STATUS"
- reboot banner: "SYSTEM WATCHDOG — REBOOT TRIGGERED" → "STABILITY WATCHDOG"
- Interval line: replace undefined SYSTEM_WATCHDOG_INTERVAL variable
  with hardcoded "60s (cron — every minute)"
- --status check toggles: remove containers= (dead config — container
  check was removed from stability_watchdog in a prior refactor)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 19:52:12 -04:00
Gmer4LfeandClaude Sonnet 4.6 b093cae70d schema: re-introspect Unraid API against 7.3
7.3 findings (all existing queries confirmed working — no breaking changes):
- ArrayParity/ArrayCache no longer exist as named types; everything is ArrayDisk
- InfoOs gained: kernel, arch, fqdn, build, codename, platform, serial, uefi
- InfoCpu gained: manufacturer, model, speed, speedmin/max, processors, socket, topology
- ArrayDisk gained: idx, numReads/Writes/Errors, warning/critical temps, color, fsType
- MemoryUtilization gained: free, active, buffcache, swapFree, percentSwapTotal

Changes:
- Add kernel to master GQL query (useful for display)
- Update schema comments to reflect 7.3 reality
- Remove ArrayParity/ArrayCache from api_test.php introspection (now null types)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 19:34:36 -04:00
Gmer4LfeandClaude Sonnet 4.6 4187d52bac fix: watchdog hardening for Unraid 7.3 + Docker 29.x
- Remove dead DOCKER_TIMEOUT=10 from stability_watchdog (daemon check
  is delegated to docker_watchdog; variable was never used post-refactor)
- Fix parity check detection: parity-date.txt is gone in Unraid 7.3;
  now reads mdResync from var.ini (non-zero = check/sync in progress),
  with parity-date.txt fallback for older versions
- Same is_parity_running() fix in docker_watchdog
- DOCKER_TIMEOUT in docker_watchdog now reads WATCHDOG_DAEMON_TIMEOUT
  from master.conf (default 20s) instead of hardcoded 15s
- WATCHDOG_DAEMON_RESTART_WAIT now reads from master.conf
  (default 900s/15min) instead of hardcoded 30s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 19:13:54 -04:00
Gmer4LfeandClaude Sonnet 4.6 46b27f609a safeguard: check Docker/VM Manager enabled before acting
common.sh: add is_docker_enabled() and is_vm_manager_enabled() helpers
reading /boot/config/docker.cfg and /boot/config/domain.cfg.

docker_watchdog: exit cleanly if Docker not enabled in Unraid settings.
stability_watchdog: skip Docker daemon check and Docker container stop
if Docker not enabled; skip virsh VM shutdown if VM Manager not enabled.
server_reboot: skip VM shutdown and libvirt stop if VM Manager not enabled.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 15:18:58 -04:00
Gmer4LfeandClaude Sonnet 4.6 fdba23c32d fix: use rebuild_container instead of docker restart after image pulls
docker restart uses the image ID baked in at container creation — it never
picks up a new digest. rebuild_container reads the stored Unraid XML template,
stops the old container, recreates it with the new image, then handles the
old image cleanup. This is what the Unraid UI 'Apply Update' button does.

docker_update.sh: add rebuild section after pull loop for DAILY containers.
docker_update_remaining.sh: replace retry_docker docker restart with rebuild_container.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 15:09:55 -04:00
Gmer4LfeandClaude Sonnet 4.6 55a38b6b74 fix: prune dangling images after docker_update.sh pulls
docker_update_remaining.sh already pruned; docker_update.sh (daily)
did not — orphaned images accumulated with every daily update run.
Same prune pattern as docker_update_remaining.sh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 14:59:57 -04:00
Gmer4LfeandClaude Sonnet 4.6 44f33da454 fix: set vm.overcommit_memory=1 at array start for Redis
Redis warns and can fail background saves without this. Applied via
inotify_tuning.sh which already handles kernel parameter tuning at
array start. Resets on each reboot — reapplied automatically.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 14:55:25 -04:00
Gmer4LfeandClaude Sonnet 4.6 070f9caf7f rename: SYS_WATCHDOG_FAILED_FILE → DOCKER_WATCHDOG_FAILED_FILE
Skip list belongs to docker_watchdog, not stability_watchdog (legacy
naming from when docker+system were the only two watchdogs). Rename
variable and physical file system_watchdog_failed.db →
docker_watchdog_failed.db across all files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 14:51:37 -04:00
Gmer4LfeandClaude Sonnet 4.6 9d6772fbd6 fix: correct state file ownership and function naming across watchdogs
stability_watchdog: remove SYS_WATCHDOG_FAILED_FILE from state file
touch list — skip list is owned by docker_watchdog, not stability.

docker_watchdog: rename check_system_watchdog_state →
check_resource_watchdog_state (reads RW_STATE_FILE from resource_watchdog,
not SYS_WATCHDOG_STATE_FILE from stability_watchdog). Update all comments
and state file docs to reflect correct ownership.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 14:46:18 -04:00
Gmer4LfeandClaude Sonnet 4.6 cce6fc5b65 fix: clear daemon_confirmed_down unconditionally when daemon healthy
Previously only cleared inside the strikes>0 block. After a reboot,
strikes reset to 0 but the flag persists on flash — daemon could be
healthy but flag stays true, causing stability_watchdog to keep striking.

Now cleared on every healthy docker info check regardless of strike count.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 14:40:08 -04:00
Gmer4LfeandClaude Sonnet 4.6 f6fb3add77 refactor: delegate Docker daemon escalation from stability to docker_watchdog
docker_watchdog now writes daemon_confirmed_down=true to its state file
when restart is attempted and daemon is still unresponsive. Clears the
flag on recovery.

stability_watchdog removes the duplicate CRITICAL daemon check (which
bypassed all strikes, all abort conditions, and had its own rc.docker
restart). Replaced with a standard strike check reading the
daemon_confirmed_down flag from docker_watchdog's state file.

Result: docker_watchdog owns all daemon restart logic. stability_watchdog
escalates to reboot only after N consecutive strike cycles confirming the
daemon is truly unrecoverable — same pattern as all other standard checks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 14:38:03 -04:00
Gmer4LfeandClaude Sonnet 4.6 9c68429e25 fix: remove container check from stability_watchdog, add USB boot warning
stability_watchdog: container health is owned by docker_watchdog — rebooting
when docker_watchdog skip-lists a container creates a reboot loop. Removed
SYS_WATCHDOG_CHECK_CONTAINERS check entirely. docker_watchdog handles
strikes, restart attempts, skip-listing, and notifications.

varaverk.plg: warn on USB/removable boot device at install time. Plugin is
designed for internal NVMe/SSD boot. Warning is non-blocking but clear.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 14:30:48 -04:00
Gmer4LfeandClaude Sonnet 4.6 b9b1d20499 safeguard: skip watchdog cycle if array not started
Exits cleanly before startup grace check if /mnt/user is not mounted
as shfs. Prevents watchdogs running against Docker/storage that isn't
available, and blocks false-positive reboots when array is stopped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 14:14:00 -04:00
Gmer4LfeandClaude Sonnet 4.6 cbf8593225 docs: remove bind-propagation=shared, document runc v1.3.5 crash
runc v1.3.5 (Docker 29.x / Unraid 7.3+) crashes on bind-propagation=shared
with any container — not GPU-specific. Ramdisk tmpfs is already MS_SHARED
at kernel level; propagation is automatic and the option is unnecessary.

- Remove bind-propagation=shared from all example Extra Parameters
- Update "Why shared Is Required" → "Mount Propagation — Unraid 7.3+"
- Update GPU troubleshooting section to cover the general runc crash
- Verify commands updated (no longer checking for Propagation: shared)
- Historical notes preserved explaining why it existed before

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 14:08:17 -04:00
Gmer4LfeandClaude Sonnet 4.6 cd2fd1af70 fix: remove bind-propagation=shared from mount instructions
runc v1.3.5 (Docker 29.x / Unraid 7.3+) rejects bind-propagation=shared
on symlink sources with: open /proc/self/mountinfo: no such file or directory.
The ramdisk tmpfs is already MS_SHARED at the kernel level — propagation is
inherited automatically and does not need to be specified in Docker.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 13:56:59 -04:00
Gmer4LfeandClaude Sonnet 4.6 e0fdaa1868 fix: set upstream tracking branch in bootstrap after clone
git pull would fail on first run after install without tracking info.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 13:52:41 -04:00
Gmer4LfeandClaude Sonnet 4.6 765442c25d fix: update all script paths in user_script_plug-in.sh to plugin flash dir
228 path references updated from /mnt/user/appdata/Varaverk/ to
/boot/config/plugins/varaverk/. PATHS header block updated to match.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 13:51:07 -04:00
Gmer4LfeandClaude Sonnet 4.6 da699b54fa req: internal NVMe boot required, all paths consolidated on flash
Plugin folder /boot/config/plugins/varaverk is the single home for
scripts, data, and state. Available at boot before array mounts.
USB boot is not a supported configuration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 13:38:52 -04:00
Gmer4LfeandClaude Sonnet 4.6 5234b79210 fix: revert public defaults to appdata, flash paths are user-local only
Bootstrap varaverk.cfg default and conf template default back to
/mnt/user/appdata/Varaverk — safe for USB boot users. Flash paths
(/boot/config/plugins/varaverk) are set in the user's gitignored
personal configs and don't affect public installs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 13:36:06 -04:00
Gmer4LfeandClaude Sonnet 4.6 ad1890109a build: bump version 2026.05.31, update sha256 for local txz
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 13:33:59 -04:00
Gmer4LfeandClaude Sonnet 4.6 fb0530deba Consolidate all paths to plugin flash dir, fix watchdog 7.3 triggers
- Move SCRIPTS_DIR/DATA_DIR/STATE_DIR from appdata to /boot/config/plugins/varaverk
- All state files now in STATE_DIR (no more /tmp or /boot/config root writes)
- Bootstrap: Gitea-first clone with GitHub fallback, no array dependency
- varaverk.cfg seeded with Gitea connection settings
- .gitignore: add State_Files/, varaverk.cfg, varaverk-*.txz
- Partnership/transcode/fallback scripts use STATE_DIR variables
- PHP config.php: DATA_DIR/STATE_DIR constants, VV_SETUP_STATE_FILE dynamic
- deploy.sh PROD_ROOT updated to plugin flash dir

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 13:30:20 -04:00
Gmer4Lfe 9191a54637 Fix ssh_setup.sh: HOST_CONF path missing Configurations/ subdirectory
Was looking for host1.conf at SCRIPTS_ROOT/host1.conf instead of
SCRIPTS_ROOT/Configurations/host1.conf — causing the 'host1.conf not found'
warning and leaving HOST1_SSH_KEY unwritten after key generation.
2026-05-30 21:31:46 -04:00
Gmer4Lfe 2989cefb79 Redesign Cancel/Delete Keys in Partnership Actions
onboard_cancel.sh:
- --direction=h1 (default): remove HOST1's key from HOST2 + delete local pair
- --direction=h2: remove HOST2's key from HOST1's authorized_keys (by hostname match)
- --direction=both: both directions (used by Cancel button at phase 1)

pages/partnership.php:
- Cancel button: phase 1 only, runs --direction=both (full undo)
- Delete Keys (🗑): available at all phases, expands inline panel showing
  HOST1→HOST2 and HOST2→HOST1 as separate removal buttons with descriptions
- _vvDeleteKeys toggle state persists across polls alongside _vvOnboarding
- vvPtShowDeleteKeys / vvPtHideDeleteKeys top-level toggle fns
- vvPtDeleteH1 / vvPtDeleteH2 targeted removal fns
2026-05-30 21:29:20 -04:00
Gmer4Lfe 1956b6b068 Fix: local keyword outside function in --local-only block
flag_key was declared with 'local' at script top level, which is only
valid inside bash functions. This left flag_key empty, writing '=true'
(malformed) to setup.db instead of 'HOST1_LOCAL_DONE=true'.
Changed to a plain variable assignment.
2026-05-30 21:20:56 -04:00
Gmer4Lfe 5bd8d13e66 Terminal link: use window.location.hostname (local IP) not Tailscale 2026-05-30 21:16:07 -04:00
Gmer4Lfe e449e1f954 Partnership Actions: full redesign with stepped onboard cards
- Single '▶ Onboard' button per unprovisioned remote → expands that card
  to show Step 1 (terminal link + click-to-copy command) and Step 2 (Push Conf)
- Onboard state persists across 10s poll re-renders via top-level _vvOnboarding map
  and _vvPtReload hook set by the IIFE
- Phase 1 complete: amber 'SSH ready' pill + Tailscale IP + Phase 2 manual button
- Phase 2 complete: green 'Active' pill + date + IP + uptime + unRAID version + state
- Compact compact '○ Not provisioned' + Reset button when not in onboard mode
- Removed vvPtPhase1 (replaced by vvPtStartOnboard toggle)
- vvPtStartOnboard / vvPtEndOnboard are top-level functions
2026-05-30 21:13:31 -04:00
Gmer4Lfe 4449bfc646 Partnership phase 0: terminal link + clickable command block
At phase 0, show below the buttons:
- 'Open Terminal' link using HOST1's Tailscale IP (/webterminal/ttyd/)
- Clickable command code block (click to copy) with the Phase 1 script path
- Note that tab auto-updates on next poll when the script completes

Tailscale IP comes from selfNode.ts_ip already in the API response.
2026-05-30 21:02:27 -04:00
Gmer4Lfe 95fd38799d Phase 1: resilient SSH handling + Push Conf button
partnership_onboard.sh (--phase1-only):
- Test if SSH already works first (BatchMode) — skip ssh-copy-id if yes
- If ssh-copy-id fails (no TTY in background): soft-fail, generate key locally,
  print pubkey for manual install, write HOST2_KEY_READY=true, run local setup
- Only skip conf push if SSH truly unavailable; otherwise proceeds normally
- Exit 0 with clear manual-step instructions instead of hard failure

include/partnership.php:
- Read HOST2_KEY_READY from setup.db; expose as key_ready on remote nodes

pages/partnership.php:
- Node card: amber "Key generated · install on HOST2 then Push Conf" badge
  when key_ready=true and phase=0
- "Push Conf (key installed)" button appears when key_ready=true — runs
  --phase1-only --skip-ssh (assumes user manually did ssh-copy-id)
- vvPtPushConf() top-level function
2026-05-30 20:27:30 -04:00