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.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
header('Content-Type: application/json');
|
||||
header('Cache-Control: no-cache, no-store');
|
||||
require_once dirname(__DIR__) . '/include/monitor.php';
|
||||
|
||||
$cacheFile = '/tmp/vv_cache_monitor_remote.json';
|
||||
$cacheTTL = 3600;
|
||||
|
||||
if (!isset($_GET['live']) && file_exists($cacheFile) && (time() - filemtime($cacheFile)) < $cacheTTL) {
|
||||
echo file_get_contents($cacheFile);
|
||||
exit;
|
||||
}
|
||||
|
||||
$out = json_encode([
|
||||
'remote_hosts' => vv_remote_hosts_stats(),
|
||||
'ts' => time(),
|
||||
]);
|
||||
|
||||
file_put_contents($cacheFile, $out);
|
||||
echo $out;
|
||||
Reference in New Issue
Block a user