From 4e98c03be46b9da2a636c27885072d2410668d86 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Tue, 6 Jan 2026 16:04:08 +0100 Subject: [PATCH] fix(luci-app-crowdsec-dashboard): Prevent RPC timeout when CrowdSec not running MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added service status check in check_cscli() function to immediately return an error instead of timing out when crowdsec service is not running. This fixes the 'XHR request timed out' error in the dashboard when CrowdSec is stopped. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .../root/usr/libexec/rpcd/luci.crowdsec-dashboard | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/package/secubox/luci-app-crowdsec-dashboard/root/usr/libexec/rpcd/luci.crowdsec-dashboard b/package/secubox/luci-app-crowdsec-dashboard/root/usr/libexec/rpcd/luci.crowdsec-dashboard index 6fec481d..053baf0f 100755 --- a/package/secubox/luci-app-crowdsec-dashboard/root/usr/libexec/rpcd/luci.crowdsec-dashboard +++ b/package/secubox/luci-app-crowdsec-dashboard/root/usr/libexec/rpcd/luci.crowdsec-dashboard @@ -15,12 +15,18 @@ secubox_log() { CSCLI="/usr/bin/cscli" -# Check if cscli exists +# Check if cscli exists and crowdsec is running check_cscli() { if [ ! -x "$CSCLI" ]; then echo '{"error": "cscli not found"}' exit 1 fi + + # Check if crowdsec service is running + if ! pgrep -x crowdsec >/dev/null 2>&1; then + echo '{"error": "crowdsec service not running"}' + exit 1 + fi } # Get decisions list