Fix dead/incorrect vars in Plugin/ found during full codebase audit

- WEBGUI_PHP_WAIT was referenced by webgui_watchdog.sh but never defined
  in master.conf, always silently falling back to a hardcoded default
- arrs.php/confform.php still pointed at Media/ for arr cleanup/discovery
  scripts moved to Arrs_Stack/ in b4bc926 — broke the Arrs page's stats
  and the per-script settings editor for those scripts
- docker_folders.php read directly from the optional folder.view3 plugin's
  file instead of Varaverk's own docker_folders.json (the primary store
  since the Docker tab got its own config) — left the Monitor page's
  Docker Folders widget empty on any host without folder.view3 installed
- vv_wd_remote_data() read remote watchdog state files from hardcoded
  /tmp or /boot/config paths instead of the remote's actual STATE_DIR
  (which resolves dynamically and can differ under flash mode) — remote
  node's Watchdog panel was always empty; same wrong path also used for
  two local reads (system_watchdog_oom.db, watchdog_appdata_growth.db)
- rsync.php referenced a {HOST}_MONTHLY_SYNC_SHARES conf var that never
  existed (monthly_maintenance.sh has no rsync section) — nulled out to
  match the existing pattern used for the fallback window
- vv_arr_node_names() did a pointless identity array_map
- vv_dk_webui() had its own duplicate local-IP resolution instead of
  using vv_local_ip(), despite config.php's comment claiming that exact
  duplication was already consolidated
This commit is contained in:
Gmer4Lfe
2026-07-04 23:00:26 -04:00
parent 0581c7b2f4
commit f7fa75fdfb
9 changed files with 46 additions and 41 deletions
+9 -9
View File
@@ -14,7 +14,7 @@ function vv_arr_known_hosts(): array {
}
function vv_arr_node_names(): array {
return array_map(fn($name) => $name, vv_arr_known_hosts());
return vv_arr_known_hosts();
}
// ── Discovery ─────────────────────────────────────────────────────────────────
@@ -123,9 +123,9 @@ function vv_fetch_arr_live(array $arr): array {
// ── Log stats ─────────────────────────────────────────────────────────────────
function vv_arr_cleanup_stats(string $type): array {
$slugs = ['sonarr' => 'Media/sonarr_cleanup',
'radarr' => 'Media/radarr_cleanup',
'lidarr' => 'Media/lidarr_cleanup'];
$slugs = ['sonarr' => 'Arrs_Stack/sonarr_cleanup',
'radarr' => 'Arrs_Stack/radarr_cleanup',
'lidarr' => 'Arrs_Stack/lidarr_cleanup'];
$base = LOG_DIR . '/' . ($slugs[$type] ?? '');
$out = ['last_run' => null, 'end' => null, 'status' => null,
'tracked' => null, 'total' => null,
@@ -181,9 +181,9 @@ function vv_arr_cleanup_stats(string $type): array {
}
function vv_arr_discovery_stats(string $type): array {
$slugs = ['sonarr' => 'Media/playback_aware_sonarr_discovery',
'radarr' => 'Media/playback_aware_radarr_discovery',
'lidarr' => 'Media/playback_aware_lidarr_discovery'];
$slugs = ['sonarr' => 'Arrs_Stack/playback_aware_sonarr_discovery',
'radarr' => 'Arrs_Stack/playback_aware_radarr_discovery',
'lidarr' => 'Arrs_Stack/playback_aware_lidarr_discovery'];
$base = LOG_DIR . '/' . ($slugs[$type] ?? '');
$out = ['last_run' => null, 'status' => null, 'added' => null];
@@ -225,7 +225,7 @@ function vv_arr_discovery_stats(string $type): array {
}
function vv_arr_sync_stats(): array {
$base = LOG_DIR . '/Media/arr_sync';
$base = LOG_DIR . '/Arrs_Stack/arr_sync';
$out = ['last_run' => null, 'status' => null, 'added' => null,
'nodes' => null, 'blocklist_count' => null];
@@ -255,7 +255,7 @@ function vv_arr_sync_stats(): array {
}
function vv_arr_recovery_stats(): array {
$base = LOG_DIR . '/Media/arrs_failed_stalled_recovery';
$base = LOG_DIR . '/Arrs_Stack/arrs_failed_stalled_recovery';
$out = ['last_run' => null, 'status' => null, 'fixed' => 0, 'searched' => 0];
$jf = $base . '.json';