From c83304fac8362e7a16a6f3bfe4506f64f3db641e Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Wed, 7 Jan 2026 08:58:54 +0100 Subject: [PATCH] fix: Add LAPI status check to wizard prerequisites (v0.6.0-r3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix wizard Next button being disabled issue: - Add lapi_status field to get_status() RPC method - Check LAPI availability using 'cscli lapi status' - Returns 'available' or 'unavailable' status - Enables wizard to proceed when LAPI is accessible Backend Changes: - root/usr/libexec/rpcd/luci.crowdsec-dashboard - Add LAPI status check before json_dump - Run 'cscli lapi status' to verify Local API accessibility Issue: Wizard showed LAPI as UNAVAILABLE even when working Cause: Missing lapi_status field in status RPC response Solution: Add LAPI availability check to backend Version: 0.6.0-3 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- package/secubox/luci-app-crowdsec-dashboard/Makefile | 2 +- .../root/usr/libexec/rpcd/luci.crowdsec-dashboard | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/package/secubox/luci-app-crowdsec-dashboard/Makefile b/package/secubox/luci-app-crowdsec-dashboard/Makefile index 0af3d149..4df22913 100644 --- a/package/secubox/luci-app-crowdsec-dashboard/Makefile +++ b/package/secubox/luci-app-crowdsec-dashboard/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-crowdsec-dashboard PKG_VERSION:=0.6.0 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_ARCH:=all PKG_LICENSE:=Apache-2.0 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 fb250123..e8c838f9 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 @@ -129,7 +129,16 @@ get_status() { local uptime_sec uptime_sec=$(cat /proc/uptime | cut -d' ' -f1 | cut -d'.' -f1) json_add_int "uptime" "$uptime_sec" - + + # LAPI status (check if Local API is accessible) + local lapi_status="unavailable" + if [ -x "$CSCLI" ]; then + if $CSCLI lapi status >/dev/null 2>&1; then + lapi_status="available" + fi + fi + json_add_string "lapi_status" "$lapi_status" + json_dump }