Deliver master.conf to a node that has no Varaverk on it yet, which is the node that needs it

Phase 1 exists to hand the partner its identity before the install, but the push refused any
host without varaverk.cfg — so the conf could only ever reach a node that no longer needed it
to be told who it was. It now resolves the remote's conf directory across both install layouts
and creates the internal one when neither exists.
This commit is contained in:
Gmer4Lfe
2026-08-16 16:14:23 -04:00
parent f627658567
commit 4f95cc6d13
5 changed files with 118 additions and 34 deletions
+6 -1
View File
@@ -412,7 +412,12 @@ require_once '/usr/local/emhttp/plugins/varaverk/include/config.php';
if (empty(\$results)) { echo 'no remote hosts'; exit(0); }
\$failed = 0;
foreach (\$results as \$r) {
echo \$r['host'] . ': ' . (\$r['ok'] ? 'pushed' : 'FAILED — ' . \$r['error']) . PHP_EOL;
// 'seed' means the partner had no master.conf anywhere — say so, because that is the case
// where the push carried the mesh's identity to a node that could not have known it.
\$what = (\$r['mode'] ?? '') === 'seed'
? 'seeded → ' . (\$r['path'] ?? '')
: 'pushed → ' . (\$r['path'] ?? '');
echo \$r['host'] . ': ' . (\$r['ok'] ? \$what : 'FAILED — ' . \$r['error']) . PHP_EOL;
if (!\$r['ok']) \$failed++;
}
exit(\$failed > 0 ? 1 : 0);