From 8bd18ffc6376144f780102d66a5eed5756f5fc18 Mon Sep 17 00:00:00 2001 From: Weston Blieden Date: Tue, 14 Apr 2026 15:36:13 +0200 Subject: [PATCH] fix: use syslog header as primary node name source (prevents stale acap-tailscale_vpn) --- aarch64/app/html/index.html | 19 ++++++++++--------- aarch64_ROOT/app/html/index.html | 19 ++++++++++--------- aarch64_custom/app/html/index.html | 19 ++++++++++--------- arm/app/html/index.html | 19 ++++++++++--------- arm_ROOT/app/html/index.html | 19 ++++++++++--------- arm_custom/app/html/index.html | 19 ++++++++++--------- 6 files changed, 60 insertions(+), 54 deletions(-) diff --git a/aarch64/app/html/index.html b/aarch64/app/html/index.html index f9d13f9..6a5c782 100644 --- a/aarch64/app/html/index.html +++ b/aarch64/app/html/index.html @@ -448,17 +448,18 @@ tsIP = allIPs.length ? allIPs[allIPs.length - 1] : null; } - var nodeMatches = txt.match(/popBrowserAuthNow\("([^"]+)"\)/g); - if (!nodeMatches) nodeMatches = txt.match(/StartLoginInteractiveAs\("([^"]+)"\)/g); + // Primary: extract hostname from Axis syslog header (always the real device hostname) var node = null; - if (nodeMatches) { - var nm = nodeMatches[nodeMatches.length - 1].match(/"([^"]+)"/); - if (nm) node = nm[1]; - } + var hostLine = txt.match(/\d{4}-\d{2}-\d{2}T[\d:.]+[+-]\d{2}:\d{2}\s+(\S+)\s+\[/); + if (hostLine) node = hostLine[1]; + // Fallback: popBrowserAuthNow/StartLoginInteractiveAs (may contain stale acap-tailscale_vpn) if (!node) { - // Extract hostname from Axis syslog format: "2026-01-01T...+00:00 Hostname [ NOTICE ]" - var hostLine = txt.match(/\d{4}-\d{2}-\d{2}T[\d:.]+[+-]\d{2}:\d{2}\s+(\S+)\s+\[/); - if (hostLine) node = hostLine[1]; + var nodeMatches = txt.match(/popBrowserAuthNow\("([^"]+)"\)/g); + if (!nodeMatches) nodeMatches = txt.match(/StartLoginInteractiveAs\("([^"]+)"\)/g); + if (nodeMatches) { + var nm = nodeMatches[nodeMatches.length - 1].match(/"([^"]+)"/); + if (nm) node = nm[1]; + } } var loginMatches = txt.match(/active login:\s+\S+/g); diff --git a/aarch64_ROOT/app/html/index.html b/aarch64_ROOT/app/html/index.html index 4c84f7e..bf63b5e 100644 --- a/aarch64_ROOT/app/html/index.html +++ b/aarch64_ROOT/app/html/index.html @@ -448,17 +448,18 @@ tsIP = allIPs.length ? allIPs[allIPs.length - 1] : null; } - var nodeMatches = txt.match(/popBrowserAuthNow\("([^"]+)"\)/g); - if (!nodeMatches) nodeMatches = txt.match(/StartLoginInteractiveAs\("([^"]+)"\)/g); + // Primary: extract hostname from Axis syslog header (always the real device hostname) var node = null; - if (nodeMatches) { - var nm = nodeMatches[nodeMatches.length - 1].match(/"([^"]+)"/); - if (nm) node = nm[1]; - } + var hostLine = txt.match(/\d{4}-\d{2}-\d{2}T[\d:.]+[+-]\d{2}:\d{2}\s+(\S+)\s+\[/); + if (hostLine) node = hostLine[1]; + // Fallback: popBrowserAuthNow/StartLoginInteractiveAs (may contain stale acap-tailscale_vpn) if (!node) { - // Extract hostname from Axis syslog format: "2026-01-01T...+00:00 Hostname [ NOTICE ]" - var hostLine = txt.match(/\d{4}-\d{2}-\d{2}T[\d:.]+[+-]\d{2}:\d{2}\s+(\S+)\s+\[/); - if (hostLine) node = hostLine[1]; + var nodeMatches = txt.match(/popBrowserAuthNow\("([^"]+)"\)/g); + if (!nodeMatches) nodeMatches = txt.match(/StartLoginInteractiveAs\("([^"]+)"\)/g); + if (nodeMatches) { + var nm = nodeMatches[nodeMatches.length - 1].match(/"([^"]+)"/); + if (nm) node = nm[1]; + } } var loginMatches = txt.match(/active login:\s+\S+/g); diff --git a/aarch64_custom/app/html/index.html b/aarch64_custom/app/html/index.html index ff3ab46..04d2ef1 100644 --- a/aarch64_custom/app/html/index.html +++ b/aarch64_custom/app/html/index.html @@ -456,17 +456,18 @@ tsIP = allIPs.length ? allIPs[allIPs.length - 1] : null; } - var nodeMatches = txt.match(/popBrowserAuthNow\("([^"]+)"\)/g); - if (!nodeMatches) nodeMatches = txt.match(/StartLoginInteractiveAs\("([^"]+)"\)/g); + // Primary: extract hostname from Axis syslog header (always the real device hostname) var node = null; - if (nodeMatches) { - var nm = nodeMatches[nodeMatches.length - 1].match(/"([^"]+)"/); - if (nm) node = nm[1]; - } + var hostLine = txt.match(/\d{4}-\d{2}-\d{2}T[\d:.]+[+-]\d{2}:\d{2}\s+(\S+)\s+\[/); + if (hostLine) node = hostLine[1]; + // Fallback: popBrowserAuthNow/StartLoginInteractiveAs (may contain stale acap-tailscale_vpn) if (!node) { - // Extract hostname from Axis syslog format: "2026-01-01T...+00:00 Hostname [ NOTICE ]" - var hostLine = txt.match(/\d{4}-\d{2}-\d{2}T[\d:.]+[+-]\d{2}:\d{2}\s+(\S+)\s+\[/); - if (hostLine) node = hostLine[1]; + var nodeMatches = txt.match(/popBrowserAuthNow\("([^"]+)"\)/g); + if (!nodeMatches) nodeMatches = txt.match(/StartLoginInteractiveAs\("([^"]+)"\)/g); + if (nodeMatches) { + var nm = nodeMatches[nodeMatches.length - 1].match(/"([^"]+)"/); + if (nm) node = nm[1]; + } } var loginMatches = txt.match(/active login:\s+\S+/g); diff --git a/arm/app/html/index.html b/arm/app/html/index.html index 4c84f7e..bf63b5e 100644 --- a/arm/app/html/index.html +++ b/arm/app/html/index.html @@ -448,17 +448,18 @@ tsIP = allIPs.length ? allIPs[allIPs.length - 1] : null; } - var nodeMatches = txt.match(/popBrowserAuthNow\("([^"]+)"\)/g); - if (!nodeMatches) nodeMatches = txt.match(/StartLoginInteractiveAs\("([^"]+)"\)/g); + // Primary: extract hostname from Axis syslog header (always the real device hostname) var node = null; - if (nodeMatches) { - var nm = nodeMatches[nodeMatches.length - 1].match(/"([^"]+)"/); - if (nm) node = nm[1]; - } + var hostLine = txt.match(/\d{4}-\d{2}-\d{2}T[\d:.]+[+-]\d{2}:\d{2}\s+(\S+)\s+\[/); + if (hostLine) node = hostLine[1]; + // Fallback: popBrowserAuthNow/StartLoginInteractiveAs (may contain stale acap-tailscale_vpn) if (!node) { - // Extract hostname from Axis syslog format: "2026-01-01T...+00:00 Hostname [ NOTICE ]" - var hostLine = txt.match(/\d{4}-\d{2}-\d{2}T[\d:.]+[+-]\d{2}:\d{2}\s+(\S+)\s+\[/); - if (hostLine) node = hostLine[1]; + var nodeMatches = txt.match(/popBrowserAuthNow\("([^"]+)"\)/g); + if (!nodeMatches) nodeMatches = txt.match(/StartLoginInteractiveAs\("([^"]+)"\)/g); + if (nodeMatches) { + var nm = nodeMatches[nodeMatches.length - 1].match(/"([^"]+)"/); + if (nm) node = nm[1]; + } } var loginMatches = txt.match(/active login:\s+\S+/g); diff --git a/arm_ROOT/app/html/index.html b/arm_ROOT/app/html/index.html index 4c84f7e..bf63b5e 100644 --- a/arm_ROOT/app/html/index.html +++ b/arm_ROOT/app/html/index.html @@ -448,17 +448,18 @@ tsIP = allIPs.length ? allIPs[allIPs.length - 1] : null; } - var nodeMatches = txt.match(/popBrowserAuthNow\("([^"]+)"\)/g); - if (!nodeMatches) nodeMatches = txt.match(/StartLoginInteractiveAs\("([^"]+)"\)/g); + // Primary: extract hostname from Axis syslog header (always the real device hostname) var node = null; - if (nodeMatches) { - var nm = nodeMatches[nodeMatches.length - 1].match(/"([^"]+)"/); - if (nm) node = nm[1]; - } + var hostLine = txt.match(/\d{4}-\d{2}-\d{2}T[\d:.]+[+-]\d{2}:\d{2}\s+(\S+)\s+\[/); + if (hostLine) node = hostLine[1]; + // Fallback: popBrowserAuthNow/StartLoginInteractiveAs (may contain stale acap-tailscale_vpn) if (!node) { - // Extract hostname from Axis syslog format: "2026-01-01T...+00:00 Hostname [ NOTICE ]" - var hostLine = txt.match(/\d{4}-\d{2}-\d{2}T[\d:.]+[+-]\d{2}:\d{2}\s+(\S+)\s+\[/); - if (hostLine) node = hostLine[1]; + var nodeMatches = txt.match(/popBrowserAuthNow\("([^"]+)"\)/g); + if (!nodeMatches) nodeMatches = txt.match(/StartLoginInteractiveAs\("([^"]+)"\)/g); + if (nodeMatches) { + var nm = nodeMatches[nodeMatches.length - 1].match(/"([^"]+)"/); + if (nm) node = nm[1]; + } } var loginMatches = txt.match(/active login:\s+\S+/g); diff --git a/arm_custom/app/html/index.html b/arm_custom/app/html/index.html index ff3ab46..04d2ef1 100644 --- a/arm_custom/app/html/index.html +++ b/arm_custom/app/html/index.html @@ -456,17 +456,18 @@ tsIP = allIPs.length ? allIPs[allIPs.length - 1] : null; } - var nodeMatches = txt.match(/popBrowserAuthNow\("([^"]+)"\)/g); - if (!nodeMatches) nodeMatches = txt.match(/StartLoginInteractiveAs\("([^"]+)"\)/g); + // Primary: extract hostname from Axis syslog header (always the real device hostname) var node = null; - if (nodeMatches) { - var nm = nodeMatches[nodeMatches.length - 1].match(/"([^"]+)"/); - if (nm) node = nm[1]; - } + var hostLine = txt.match(/\d{4}-\d{2}-\d{2}T[\d:.]+[+-]\d{2}:\d{2}\s+(\S+)\s+\[/); + if (hostLine) node = hostLine[1]; + // Fallback: popBrowserAuthNow/StartLoginInteractiveAs (may contain stale acap-tailscale_vpn) if (!node) { - // Extract hostname from Axis syslog format: "2026-01-01T...+00:00 Hostname [ NOTICE ]" - var hostLine = txt.match(/\d{4}-\d{2}-\d{2}T[\d:.]+[+-]\d{2}:\d{2}\s+(\S+)\s+\[/); - if (hostLine) node = hostLine[1]; + var nodeMatches = txt.match(/popBrowserAuthNow\("([^"]+)"\)/g); + if (!nodeMatches) nodeMatches = txt.match(/StartLoginInteractiveAs\("([^"]+)"\)/g); + if (nodeMatches) { + var nm = nodeMatches[nodeMatches.length - 1].match(/"([^"]+)"/); + if (nm) node = nm[1]; + } } var loginMatches = txt.match(/active login:\s+\S+/g);