Point the WebGUI symlink at the actual install, and report this host's identity rather than HOST1's
The .plg hardcoded the flash path and runs every boot, so an appdata node served a stale copy that never receives pulls — fixes appeared to do nothing, indefinitely.
This commit is contained in:
@@ -91,11 +91,22 @@ $items = [];
|
||||
// ── Identity ──────────────────────────────────────────────────────────────────
|
||||
preg_match('/^\s*HOST1\s*=\s*"([^"]*)"/m', $master, $m1);
|
||||
$host1 = trim($m1[1] ?? '');
|
||||
// "Server identity" is this server's, not HOST1's. It was hardcoded to read master.conf's HOST1
|
||||
// and print "HOST1: <name>", so on the mirror the row that answers "which host am I" confidently
|
||||
// named the other machine — and reported ok purely because the owner's slot was filled in, which
|
||||
// says nothing about whether this host resolved to a slot at all.
|
||||
$myName = '';
|
||||
if ($hostId !== 'unknown') {
|
||||
preg_match('/^\s*' . preg_quote($hostIdUp, '/') . '\s*=\s*"([^"]*)"/m', $master, $mSelf);
|
||||
$myName = trim($mSelf[1] ?? '');
|
||||
}
|
||||
$items[] = [
|
||||
'id' => 'identity',
|
||||
'label' => 'Server identity',
|
||||
'ok' => !empty($host1),
|
||||
'detail' => $host1 ? "HOST1: $host1" : 'HOST1 blank in master.conf',
|
||||
'ok' => $hostId !== 'unknown' && !empty($myName),
|
||||
'detail' => ($hostId !== 'unknown' && $myName)
|
||||
? "$hostIdUp: $myName"
|
||||
: 'This host does not match any HOST* entry in master.conf',
|
||||
];
|
||||
|
||||
// ── Host conf ─────────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user