From 0dd406d5172944bcf7874182628cf2b3756e034a Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Sat, 31 Jan 2026 18:59:49 +0100 Subject: [PATCH] fix(security-threats): Detect DPI from netifyd when ndpid not installed The threat monitor now checks netifyd_running and dpi_available fields in addition to ndpid running status. This fixes the "nDPId not running" warning when only netifyd is installed. - Check ndpid.running OR netifyd_running OR dpi_available - Show flow count in DPI service badge - Rename badge from "nDPId" to "DPI" for clarity Co-Authored-By: Claude Opus 4.5 --- .../resources/secubox-security-threats/api.js | 14 +++++++++++--- .../view/secubox-security-threats/dashboard.js | 3 ++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/package/secubox/luci-app-secubox-security-threats/htdocs/luci-static/resources/secubox-security-threats/api.js b/package/secubox/luci-app-secubox-security-threats/htdocs/luci-static/resources/secubox-security-threats/api.js index 48cc5a31..92e26cca 100644 --- a/package/secubox/luci-app-secubox-security-threats/htdocs/luci-static/resources/secubox-security-threats/api.js +++ b/package/secubox/luci-app-secubox-security-threats/htdocs/luci-static/resources/secubox-security-threats/api.js @@ -356,12 +356,13 @@ function getDashboardData() { callGetStatsByType(), callGetBlockedIPs(), callGetSecurityStats(), - callNdpidStatus().catch(function() { return { running: false }; }), + callNdpidStatus().catch(function() { return { running: false, dpi_available: false }; }), callNdpidFlows().catch(function() { return { flows: [] }; }), callNdpidTopApps().catch(function() { return { applications: [] }; }) ]).then(function(results) { var ndpidFlows = results[6].flows || []; var ndpidApps = results[7].applications || []; + var ndpidStatus = results[5] || {}; // Build device list from ndpid flows var devicesMap = {}; @@ -403,6 +404,10 @@ function getDashboardData() { return dev; }); + // DPI is available if either ndpid or netifyd is running + var dpiRunning = ndpidStatus.running || ndpidStatus.netifyd_running || ndpidStatus.dpi_available || false; + var dpiUptime = ndpidStatus.uptime || ndpidStatus.netifyd_uptime || 0; + return { status: results[0] || {}, threats: results[1].threats || [], @@ -410,8 +415,11 @@ function getDashboardData() { blocked: results[3].blocked || [], securityStats: results[4] || {}, ndpid: { - running: results[5].running || false, - uptime: results[5].uptime || 0 + running: dpiRunning, + uptime: dpiUptime, + ndpid_running: ndpidStatus.running || false, + netifyd_running: ndpidStatus.netifyd_running || false, + flow_count: ndpidStatus.flow_count || 0 }, devices: devices, topApps: ndpidApps, diff --git a/package/secubox/luci-app-secubox-security-threats/htdocs/luci-static/resources/view/secubox-security-threats/dashboard.js b/package/secubox/luci-app-secubox-security-threats/htdocs/luci-static/resources/view/secubox-security-threats/dashboard.js index c99bb9d8..bfc77c0c 100644 --- a/package/secubox/luci-app-secubox-security-threats/htdocs/luci-static/resources/view/secubox-security-threats/dashboard.js +++ b/package/secubox/luci-app-secubox-security-threats/htdocs/luci-static/resources/view/secubox-security-threats/dashboard.js @@ -86,7 +86,8 @@ return L.view.extend({ '🛡️ CrowdSec' ]), E('span', { 'class': 'service-badge ' + (ndpid.running ? 'active' : 'inactive') }, [ - '📡 nDPId' + '📡 DPI', + ndpid.flow_count ? ' (' + ndpid.flow_count + ')' : '' ]) ]) ]),