generated from Dicken/dickendock
Fix: FritzBox faelschlich als Home Assistant erkannt + Reverse-DNS + Namens-Aenderungsvorschlaege beim Scan
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
export interface SoftwareSignatureInput {
|
||||
server?: string;
|
||||
body?: string;
|
||||
title?: string;
|
||||
port: number;
|
||||
}
|
||||
|
||||
@@ -16,12 +17,29 @@ function bodyContains(input: SoftwareSignatureInput, pattern: RegExp): boolean {
|
||||
return !!input.body && pattern.test(input.body);
|
||||
}
|
||||
|
||||
function titleMatches(input: SoftwareSignatureInput, pattern: RegExp): boolean {
|
||||
return !!input.title && pattern.test(input.title.trim());
|
||||
}
|
||||
|
||||
/**
|
||||
* Automatische Softwareerkennung anhand von HTTP-Response-Merkmalen
|
||||
* (Server-Header, HTML-Inhalt). Liste gemäß Spezifikation.
|
||||
*
|
||||
* Grundsatz: der `<title>`-Tag ist ein viel präziseres Signal als der
|
||||
* komplette Seiteninhalt und wird deshalb wo möglich zuerst geprüft. Reine
|
||||
* Volltextsuche im Body (bodyContains) besonders bei Marken-/Produktnamen
|
||||
* aus generischen Alltagswörtern (z. B. "Home Assistant") kann in
|
||||
* minifiziertem JavaScript anderer Web-UIs zufällig zutreffen - siehe
|
||||
* Bugreport: FritzBox-Repeater wurden fälschlich als "Home Assistant"
|
||||
* erkannt, weil beide Wörter irgendwo im ausgelieferten JS vorkamen.
|
||||
*/
|
||||
export const SOFTWARE_SIGNATURES: SoftwareSignature[] = [
|
||||
{ name: "Home Assistant", category: "Smart Home", matches: (i) => bodyContains(i, /home\s*assistant/i) },
|
||||
{
|
||||
name: "Home Assistant",
|
||||
category: "Smart Home",
|
||||
matches: (i) =>
|
||||
titleMatches(i, /^home\s*assistant$/i) || bodyContains(i, /frontend_latest\//i),
|
||||
},
|
||||
{
|
||||
name: "Synology DSM",
|
||||
category: "NAS",
|
||||
|
||||
Reference in New Issue
Block a user