Commit Graph
440 Commits
Author SHA1 Message Date
Gmer4Lfe b78fdddb04 fix(watchdogs): Tailscale false positive + system watchdog banner
network_watchdog: Tailscale JSON uses "BackendState": "Running" (with space)
but grep pattern matched "BackendState":"Running" (no space) — always failed.
Switched to grep -qE with \s* to handle both forms.

system_watchdog: add echo banner at run start so its output is visually
separated from docker_watchdog in orchestrator logs. Previously appeared
as a continuation of the docker section since docker_watchdog has a banner
but system_watchdog did not.
2026-05-24 17:11:54 -04:00
Gmer4Lfe 760fb4a3e2 varaverk: monitor tab overhaul — grid layout, dynamic thresholds, new cards
Layout:
- Switch from three flex rows to single CSS grid (repeat(8,1fr)) — eliminates
  gap-count discrepancy between rows; span 1/2/4/8 cards are now pixel-identical
  across all rows regardless of how many cards share the row

New cards:
- Scripts card: last-run status (ok/warn/running/unknown), clickable filter pills,
  7-row scroll, flex:1 matching Power/Parity
- Streams card: live per-second progress counters, color-coded play buttons
  (blue=live, orange=transcoding, green=direct, yellow=paused), server badges
  with counts, left-fill column layout (3 per col)
- Transcode card: NVMe indicator, active session count + scrollable list,
  session rows with server icon + title + type + method

Dynamic thresholds:
- vv_disk_thresholds() reads /boot/config/plugins/dynamix/dynamix.cfg
- Disk utilization bars: green/orange/red based on warning/critical settings
- Temperature colors: hot/max for HDD, hotssd/maxssd for SSD/NVMe
- Thresholds update every poll cycle; changing Unraid settings takes effect automatically

Other:
- SSD path detection uses findmnt FSTYPE to exclude tmpfs/ramfs (fixes RAM
  being reported as SSD transcode target)
- varaverk.css h3: add white-space:normal + overflow:hidden to neutralise
  any Unraid global h3 styles that could force card width
2026-05-24 16:56:50 -04:00
Gmer4Lfe f85493cf35 watchdogs: fix Tailscale error propagation and docker watchdog output order
- network_watchdog: remove ISSUES++ for Tailscale — it's notify-only by
  design, no restart possible; cascading to system watchdog exit 1 was noise
- docker_watchdog: move banner to top of cycle so body errors appear under
  the correct section header, not visually inside Resource Manager output
2026-05-24 16:56:32 -04:00
Gmer4Lfe 359b051e64 varaverk: System card (identity/time/uptime/buttons); merge Fallback+Partner into one card 2026-05-24 12:00:09 -04:00
Gmer4Lfe 725c371f21 varaverk: remove GPU history chart 2026-05-24 11:53:54 -04:00
Gmer4Lfe 6be9873f49 varaverk: fallback and partner cards — 250px min-width, matched flex:1 2026-05-24 11:50:51 -04:00
Gmer4Lfe 36831f0693 Revert "varaverk: top row cards equal width (flex:1 across all five)"
This reverts commit f35a0f2dd4.
2026-05-24 11:49:30 -04:00
Gmer4Lfe f35a0f2dd4 varaverk: top row cards equal width (flex:1 across all five) 2026-05-24 11:48:50 -04:00
Gmer4Lfe cead4eb46f varaverk: redesign Fallback card — host online/offline list, state line, active fallback containers with image 2026-05-24 11:47:08 -04:00
Gmer4Lfe 6bb44cae8b varaverk: Docker memory — use docker stats sum instead of raw cgroup (matches Unraid dashboard) 2026-05-24 11:41:59 -04:00
Gmer4Lfe 9e236e3f52 varaverk: fix Docker memory — use /sys/fs/cgroup/docker/memory.current (Unraid cgv2 path) 2026-05-24 11:39:41 -04:00
Gmer4Lfe c17be8d017 varaverk: add Partner card — known hosts, owner tags, Tailscale online status 2026-05-24 11:36:23 -04:00
Gmer4Lfe cbac3949e0 varaverk: network canvas 100→110px 2026-05-24 11:30:15 -04:00
Gmer4Lfe 3c26f8d767 varaverk: memory top procs — top 3, inline right of total on same line 2026-05-24 11:28:51 -04:00
Gmer4Lfe 397ec405a0 varaverk: memory card — top 5 procs by RSS as horizontal strip under total 2026-05-24 11:25:27 -04:00
Gmer4Lfe 475cb3e75c varaverk: memory card — top 3 usages by size in top-right corner 2026-05-24 11:21:43 -04:00
Gmer4Lfe 2cd0a8e66e varaverk: inline RX/TX legend with speed numbers; drop separate legend row 2026-05-24 11:20:11 -04:00
Gmer4Lfe 50614b9cbe varaverk: network canvas 52→100px 2026-05-24 11:16:49 -04:00
Gmer4Lfe 423a8e3e0a varaverk: CPU canvas 36→60px; add GPU history chart at 60px 2026-05-24 11:15:31 -04:00
Gmer4Lfe 496d70c137 Revert "varaverk: stretch CPU and GPU graphs to card bottom; add GPU history chart"
This reverts commit 660c4762f2.
2026-05-24 11:12:55 -04:00
Gmer4Lfe 660c4762f2 varaverk: stretch CPU and GPU graphs to card bottom; add GPU history chart
- CPU/GPU cards: flex-column so body div takes remaining height
- CPU canvas: flex:1 + min-height:36px instead of fixed 36px
- GPU: add vvGpuHistory + canvas (purple, same style as CPU); canvas flex:1
  stretches to fill whatever space the row's tallest card leaves over
2026-05-24 11:11:04 -04:00
Gmer4Lfe 4a22f3af66 varaverk: fix ext IP and Tailscale IP in network card
- External IP: switch from DDNS domain lookup to curl ifconfig.me with 5-min
  cache; DDNS approach broke because host detection uses HOST1_NAME but conf
  has HOST1, so domain was never resolved
- Tailscale IP: switch from hardcoded tailscale0 iface to `tailscale ip -4`;
  interface name varies (tailscale0, tailscale1) across kernels/installs
2026-05-24 11:07:15 -04:00
Gmer4Lfe b2e937526f varaverk: add media, confform, script API/include files (from previous session)
media.php: Emby/Jellyfin/Plex session poller for Streams card
confform.php: conf file form helpers for Config tab
script.php: per-script run/log API endpoint for Scheduler tab
2026-05-24 10:59:13 -04:00
Gmer4Lfe 279ac156c2 varaverk: fix monitor API — include config.php so vv_conf_vars/detect_host resolve
vv_network_stats() calls vv_conf_vars() and vv_detect_host() which are defined in
config.php. monitor.php had no require for it, causing a PHP fatal error on every
poll → empty JSON → all monitor cards stuck on "Loading...".
2026-05-24 10:55:13 -04:00
Gmer4Lfe ab3e28531e varaverk: monitor overhaul — CPU/memory/network/streams cards; scheduler polish
Monitor tab:
- CPU card: per-core bars (freq-colored), overall usage bar, rolling history chart
- Memory card: breakdown by system/VM/ZFS/Docker/free with progress bars
- Network card: LAN + ext + Tailscale IP display, live RX/TX chart with auto-scale
- Streams card: Emby/Jellyfin/Plex sessions with playback bar and server badges
- GPU card: adds power draw, encode%, decode% meters
- Transcode card: ramdisk vs SSD location pill, session count, flip history
- Canvas chart helpers: vvDrawChart, vvDrawNetChart, vvMeter, vvFmtBps, vvFmtGib

api/monitor.php: adds cpu, mem, net to response payload
2026-05-24 10:52:42 -04:00
Gmer4Lfe f7bef55e51 varaverk: green checkmark feedback on schedule save
- Add .vv-save-check span to each job row (orchestrators + children)
- CSS: fade-in-then-out animation (visible 1.2s, fades over 2s)
- vvFlashSaved(job): triggers the checkmark animation on a specific row
- vvFlashStatus(el, msg, ok): shows timed status text (was called but missing)
- vvSaveJob: now shows per-job checkmark on successful save
- vvSaveAll: shows checkmark on each job as its response arrives, plus
  global "✓ All saved" / "✗ Some failed" status text below the button
2026-05-23 21:07:15 -04:00
Gmer4Lfe 8383306831 varaverk: fix cron format and permissions for dcron
Unraid's system crond is dcron (dillon's cron daemon 4.5), which reads
/etc/cron.d/ for system crontabs WITHOUT a username field, and refuses
to execute files that are group- or world-writable.

vv_cron_rebuild() was writing "SCHED root bash ..." (with username field)
and leaving the file world-writable (666), so dcron silently ignored every
entry. Fixed:
  - Remove CRON_USER from the generated cron line format
  - chmod 0600 the cron file after writing it
2026-05-23 21:03:52 -04:00
Gmer4Lfe 0e13d8772d user_script_plug-in.sh: v2.6 full audit and update
- Remove ARRS FAILED/STALLED RECOVERY as standalone orchestrator — now in
  INTERMEDIATE_MAINTENANCE_SCRIPTS (called every 4 hours by intermediate_sync)
- Remove WEBGUI RESTART standalone block — webgui_watchdog.sh now runs via
  SYSTEM_WATCHDOG_SCRIPTS chain inside system_watchdog.sh (every minute)
- Remove CLEAR LOGS standalone block — now in WEEKLY_MAINTENANCE_SCRIPTS
  (called as part of Sunday weekly_sync_maintenance window)
- Remove SUNDAY MONITOR BLOCK individual cron entries — all monitors now run
  via COFFEE_REPORT_SCRIPTS inside sunday_morning_coffee_report.sh
- Add MONTHLY MAINTENANCE orchestrator block (0 3 * * * — self-gated to monthly)
- Update WATCHDOG ORCHESTRATOR to document SYSTEM_WATCHDOG_SCRIPTS chain
- Update INTERMEDIATE SYNC to document arrs_failed in INTERMEDIATE_MAINTENANCE_SCRIPTS
- Update WEEKLY SYNC to document playback_aware_*.sh in WEEKLY_MAINTENANCE_SCRIPTS
- Fix INITIAL RUN paths: Initial_run/ → Partnership/
- Add individual entries: storage_watchdog, network_watchdog, playback_aware_lidarr/
  radarr/sonarr, mesh_monitor, ramdisk_stop, emby_to_lidarr/radarr/sonarr,
  gitea_ssh_setup, partnership_offboard, partnership_transfer
- Update continuous_scripts_status path to Old_Arch_Still_Works/ with deprecation note
- Rewrite QUICK REFERENCE to match actual current schedule
2026-05-23 20:57:47 -04:00
Gmer4Lfe f6cb861f36 varaverk: suggestions panel color + parser regex fix
- Change suggestion title color from bright green (#6fcf97) to soft grey-blue (#7a9eb5)
- Fix vv_parse_user_script_template() block-detection regex — $ end-anchor
  failed on lines ending with multibyte U+2500 ─ chars; removed anchor so
  parser now returns all 22 blocks from user_script_plug-in.sh
2026-05-23 20:47:20 -04:00
Gmer4Lfe a1745a575b Scheduler UI polish + per-script verbose logging + coffee report as orchestrator
- Cron and Advanced button vertically aligned in their respective rows
- Verbose checkbox next to Log button — saves immediately, persists to schedule.json
- --log flag injected into cron lines, manual Run, and Dry Run when verbose enabled
- Coffee report rewritten as lean orchestrator over COFFEE_REPORT_SCRIPTS array
- COFFEE_REPORT_SCRIPTS added to master.conf (7 Sunday monitor scripts)
- Scheduler Advanced tab auto-discovers children via existing array detection
2026-05-23 20:05:26 -04:00
Gmer4Lfe 97d99f85fb Log panel stretches to match script list height 2026-05-23 18:28:05 -04:00
Gmer4Lfe 7062790d89 Script name: remove underline, bump name to 16px, description to 14px 2026-05-23 18:25:40 -04:00
Gmer4Lfe ab228c9199 Script name color: soft green #6fcf97 2026-05-23 18:24:38 -04:00
Gmer4Lfe ff577ffcf5 Scheduler: bold underlined script name, larger description text 2026-05-23 18:23:14 -04:00
Gmer4Lfe 4a5e1537d1 Fix cron input width — pixel value with flex: 0 0 110px 2026-05-23 18:21:16 -04:00
Gmer4Lfe c40d243d38 Move Run/Dry Run/Log buttons below description line 2026-05-23 18:19:17 -04:00
Gmer4Lfe 91f959dc3a Fix description line truncation — padding-left instead of margin-left 2026-05-23 18:17:16 -04:00
Gmer4Lfe 24d8697858 Fix description parser to skip banner lines; shrink cron input width 2026-05-23 18:14:42 -04:00
Gmer4Lfe 065b29fcc8 Scheduler: inline cron beside name, dynamic description from script headers
Cron input now sits right of the script label in the same row.
Below each row: one-line description pulled live from the script header
(PURPOSE block or first meaningful comment line) — updates whenever
scripts are edited, no plugin changes needed.
2026-05-23 18:11:12 -04:00
Gmer4Lfe fc01268c12 Scheduler: single Save Schedule button at bottom saves all cron entries at once 2026-05-23 18:06:26 -04:00
Gmer4Lfe 477b2041a7 Scheduler: 50/50 split, taller log, auto-load most recent log on page load 2026-05-23 18:02:40 -04:00
Gmer4Lfe 706ef2dd72 Scheduler: two-panel responsive layout with running indicator
Scripts list on left, persistent log panel on right. On screens ≤880px
falls back to stacked single-column. Right panel stays open until page
refresh or another selection. Running dot pulses green on the job row
and in the log header while script executes, clears when log goes stale.
2026-05-23 17:59:51 -04:00
Gmer4Lfe d0b842a489 Add Dry Run button; fix CSRF token on all POST API calls
All fetch() POSTs now send application/x-www-form-urlencoded with the
page-injected csrf_token, satisfying unRAID's auto_prepend CSRF check.
All PHP API handlers switched from php://input JSON to $_POST.

Also adds Dry Run button (orange, between Run and Log) that sets
DRY_RUN=1 in the script environment before executing.
2026-05-23 17:50:47 -04:00
Gmer4Lfe 131d9093b0 Scheduler: Run button, single card-level Save, remove per-row Save
- Run button (blue) fires script immediately, opens log panel;
  stamps log with manual run timestamp before exec
- Save moved to card footer — one button saves all cron expressions
  for the orchestrator and all its children at once
- Toggle still auto-saves immediately on flip (enable/disable is instant)
- Removed onblur from cron inputs — cron only saves on explicit Save
- api/run.php: validates id, appends timestamp, execs script in background
2026-05-23 17:22:52 -04:00
Gmer4Lfe 6050816fe4 Scheduler: card layout, per-job logs, live log panel
- Per-job log files replace single jobs.log: each script writes to
  /var/log/varaverk/<Category>/<script>.log mirroring the job ID
- api/log.php: serves last 200 lines of a job's log file with mtime
  timestamp; supports POST ?clear=1 to truncate
- Scheduler page redesigned as full-width cards (one per orchestrator)
  with Save + Log buttons; Log toggles an inline panel that polls
  every 3 seconds and auto-scrolls — same pattern as unRAID User Scripts
- Children shown under Advanced with identical per-job log panels
- CSS: vv-sched-card, vv-log-panel, vv-log-pre, vv-btn-sm
2026-05-23 17:17:09 -04:00
Gmer4Lfe 1b365d4fb7 Fix conf array parser stopping early at ) in comments
Non-greedy (.*?) stopped at the first ) found, which could be inside
a comment like '# gracefully stop fallback (not caught by ...)'.
Anchoring the closing paren to start-of-line (^\s*\)) ensures it only
matches the array's actual closing paren, not ) inside comment text.
2026-05-23 17:12:58 -04:00
Gmer4Lfe 0197eab7a5 Read scheduler children from master.conf arrays
Orchestrators using dynamic dispatch (array_started, watchdog_orchestrator,
daily/weekly/etc maintenance) iterate \${VARNAME_SCRIPTS[@]} arrays defined
in master.conf. The previous regex only caught static hardcoded paths.

Two-strategy approach, merged and deduped:
1. Static: \$VAR/../Category/script.sh and \$VAR/Category/script.sh patterns
2. Dynamic: detect \${VARNAME[@]} references in the orch, parse that array
   from master.conf — handles inline args and skips commented entries

Changes to master.conf arrays are reflected immediately on next page load.
2026-05-23 17:08:52 -04:00
Gmer4Lfe b00918e080 Fix child script detection in scheduler
Previous regex only matched literal bash/source calls with bare paths.
Orchestrators use shell variables like \$SCRIPT_DIR/../Transcodes/script.sh
and \$SCRIPTS_ROOT/Category/script.sh — the old pattern missed all of these.

New regex captures the Category/script.sh portion from either pattern,
requires at least one subdirectory (excludes load_config.sh and root-level
utilities), and validates each candidate against the filesystem.

transcode_management now correctly shows transcode_cleanup and transcode_manager.
Orchestrators using master.conf config arrays for dynamic dispatch still show
no children — correct, as those lists cannot be statically parsed.
2026-05-23 17:04:36 -04:00
Gmer4Lfe f6f3655810 Rebuild cron on boot via disks_mounted event
/etc/cron.d/varaverk is RAM-based and wiped on every reboot. The
disks_mounted event fires early in boot (before Docker) with /boot
already readable, so schedule.json is available to restore the cron
file automatically without any user action.
2026-05-23 16:58:05 -04:00
Gmer4Lfe d3a5af09d1 Create /var/log/varaverk/ on cron rebuild
/var/log/ is RAM-based on unRAID — wiped on reboot. Creating the log
directory in vv_cron_rebuild() ensures it exists before the first cron
job fires, without needing a separate boot script.
2026-05-23 16:54:51 -04:00