Push master.conf to all partners immediately on raw-editor save

vv_push_master_conf() in config.php: finds all remote HOST* entries,
resolves Tailscale IPs, SCPs master.conf to each.
rawconf.php calls it after a successful write when file=master.conf.
Scheduler save button shows sync status: "✓ Saved · synced to HOST2"
or "✓ Saved · push failed: HOST2" on error.

Also fix path bug in partnership_transfer.sh — was SCPing to
appdata root instead of Configurations/.
This commit is contained in:
Gmer4Lfe
2026-05-30 14:21:02 -04:00
parent 26f3778786
commit da0c303f22
4 changed files with 59 additions and 7 deletions
+13 -4
View File
@@ -2593,13 +2593,22 @@ function vvSaveRawConf() {
vvPost('/plugins/varaverk/api/rawconf.php', {file: vvRawConfFile, content})
.then(d => {
btn.disabled = false;
if (d.ok) {
btn.textContent = '✓ Saved';
setTimeout(() => { btn.textContent = 'Save Conf'; }, 2500);
} else {
if (!d.ok) {
btn.textContent = 'Save Conf';
alert('Save failed: ' + (d.error ?? 'Unknown error'));
return;
}
const push = d.push ?? [];
if (push.length === 0) {
btn.textContent = '✓ Saved';
} else if (push.every(p => p.ok)) {
const hosts = push.map(p => p.host).join(', ');
btn.textContent = '✓ Saved · synced to ' + hosts;
} else {
const failed = push.filter(p => !p.ok).map(p => p.host).join(', ');
btn.textContent = '✓ Saved · push failed: ' + failed;
}
setTimeout(() => { btn.textContent = 'Save Conf'; }, 3500);
})
.catch(() => { btn.disabled = false; btn.textContent = 'Save Conf'; });
}