Problem: get_overview RPC was timing out (30s+) due to 12+ sequential cscli calls with CAPI data, causing "TypeError: can't assign to property 'countries' on 5" in LuCI. Solution: - Pre-cached architecture with /tmp/secubox/crowdsec-overview.json - get_overview() returns cached data instantly (0.08s) - refresh_overview_cache() runs via cron every minute - Reduced cscli calls from 12 to 4 (metrics, decisions, alerts, bouncers) - Extract flat decisions array using jsonfilter - Manual JSON building to avoid jshn argument size limits - Add /etc/cron.d/crowdsec-dashboard for periodic refresh Also includes: - Streamlit Control: Deploy functionality like metablogizer - Streamlit Control: Enhanced Security page with WAF/CrowdSec data - mitmproxy LuCI: Add timeout race to prevent page hang Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
4 lines
186 B
Plaintext
4 lines
186 B
Plaintext
# CrowdSec Dashboard cache refresh
|
|
# Refresh overview stats every minute to avoid UI timeouts
|
|
* * * * * root /usr/libexec/rpcd/luci.crowdsec-dashboard call refresh_cache >/dev/null 2>&1
|