fix: correct module detection in secubox RPCD script
Fixed the modules page showing empty list by correcting: - RPCD script detection to use 'luci.' prefix (luci.crowdsec-dashboard, etc.) - Module ID extraction to remove 'luci.' prefix and '-dashboard' suffix - Package name for crowdsec to use full 'luci-app-crowdsec-dashboard' - Added ksm-manager to the module list Now the /admin/secubox/modules page will correctly detect and display all installed SecuBox modules. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
4a4e59dc63
commit
645f644da8
@ -14,7 +14,7 @@ config module 'crowdsec'
|
||||
option category 'security'
|
||||
option icon 'shield'
|
||||
option color '#22c55e'
|
||||
option package 'luci-app-crowdsec'
|
||||
option package 'luci-app-crowdsec-dashboard'
|
||||
option config 'crowdsec'
|
||||
option installed '0'
|
||||
option enabled '0'
|
||||
|
||||
@ -10,12 +10,12 @@
|
||||
# Module registry - auto-detected from /usr/libexec/rpcd/
|
||||
detect_modules() {
|
||||
local modules=""
|
||||
local scripts="crowdsec-dashboard netdata-dashboard netifyd-dashboard wireguard-dashboard network-modes client-guardian system-hub bandwidth-manager auth-guardian media-flow vhost-manager cdn-cache traffic-shaper"
|
||||
local scripts="luci.crowdsec-dashboard luci.netdata-dashboard luci.netifyd-dashboard luci.wireguard-dashboard luci.network-modes luci.client-guardian luci.system-hub luci.bandwidth-manager luci.auth-guardian luci.media-flow luci.vhost-manager luci.cdn-cache luci.traffic-shaper luci.ksm-manager"
|
||||
|
||||
for script in $scripts; do
|
||||
if [ -x "/usr/libexec/rpcd/$script" ]; then
|
||||
# Convert script name to module ID (remove -dashboard suffix, convert dashes to underscores)
|
||||
local module_id=$(echo "$script" | sed 's/-dashboard$//' | sed 's/-/_/g')
|
||||
# Remove luci. prefix, remove -dashboard suffix, convert dashes to underscores
|
||||
local module_id=$(echo "$script" | sed 's/^luci\.//' | sed 's/-dashboard$//' | sed 's/-/_/g')
|
||||
modules="$modules $module_id"
|
||||
fi
|
||||
done
|
||||
|
||||
Loading…
Reference in New Issue
Block a user