secubox-openwrt/luci-app-secubox/Makefile
CyberMind-FR dd588e0520 fix(secubox): complete LuCI interface fixes - all views now functional
Fixed 5 major issues in SecuBox LuCI interface:

1. AppStore Empty (secubox-core v0.8.0-r3)
   - Simplified get_appstore_apps RPCD method
   - Removed complex error handling that was failing silently
   - Added catalog.json (38 KB, 37 plugins) to Makefile installation
   - Result: AppStore now displays 37 plugins in 8 categories

2. Dashboard/Components Empty (secubox-core v0.8.0-r3)
   - Implemented 3 new RPCD methods:
     * get_dashboard_data - Module counts and system uptime
     * get_system_health - CPU, memory, disk metrics with health score
     * get_alerts - System threshold alerts
   - Result: Dashboard shows health score 93/100, system metrics

3. Modules View Empty (luci-app-secubox v0.7.1-r1)
   - Fixed API method name mismatches in api.js:
     * modules → getModules
     * status → getStatus
     * module_info → getModuleInfo
     * health → getHealth
   - Updated ACL with all new RPCD method names
   - Added debug logging to modules.js
   - Removed conflicting config files
   - Result: 61 modules displayed with working filters

4. System Hub Components Empty (luci-app-system-hub v0.5.1-r3)
   - Fixed RPCD backend call: modules → getModules
   - Updated ACL to allow new SecuBox method names
   - Result: 61 components displayed

5. Catalog/Profile/Template Files
   - Added 39 individual plugin catalog files
   - Added 5 profile JSON files (enterprise, home-office, etc.)
   - Added 2 template files (firewall-zone, nginx-vhost)
   - Updated Makefile to install all catalog files

Version bumps:
- secubox-core: 0.8.0-r1 → 0.8.0-r3
- luci-app-secubox: 0.7.0-r6 → 0.7.1-r1
- luci-app-system-hub: 0.5.1-r2 → 0.5.1-r3

Files modified: 13 modified, 46 added, 2 deleted
Lines of code: ~300+ added
RPCD methods: 3 added, 5 fixed
ACL files: 2 updated

Status: Production ready - all backend tests passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-01 18:30:58 +01:00

85 lines
3.0 KiB
Makefile

include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-secubox
PKG_VERSION:=0.7.1
PKG_RELEASE:=1
PKG_LICENSE:=Apache-2.0
PKG_MAINTAINER:=CyberMind <contact@cybermind.fr>
LUCI_TITLE:=LuCI - SecuBox Hub (Central Dashboard)
LUCI_DESCRIPTION:=Central control hub for all SecuBox modules. Provides unified dashboard, module status, system health monitoring, and quick actions.
LUCI_DEPENDS:=+luci-base +rpcd +curl +jq +secubox-core
LUCI_PKGARCH:=all
# File permissions (CRITICAL: Helper scripts MUST be executable 755)
# Format: path:owner:group:mode
# - Helper scripts: 755 (if executable)
# - Data files: 644 (readable by all - INSTALL_DATA sets this automatically)
# - Directories: 755 (set automatically by INSTALL_DIR)
# - CSS/JS files: 644 (set automatically by luci.mk)
# Note: RPCD backend is now provided by secubox-core package
PKG_FILE_MODES:=/usr/libexec/secubox/fix-permissions.sh:root:root:755
include $(TOPDIR)/feeds/luci/luci.mk
define Package/$(PKG_NAME)/install
# Call parent LuCI installer for htdocs and root
$(call Package/luci/install,$(1))
# Install SecuBox data directories (custom, not handled by luci.mk)
$(INSTALL_DIR) $(1)/usr/share/secubox
$(INSTALL_DIR) $(1)/usr/share/secubox/profiles
$(INSTALL_DIR) $(1)/usr/share/secubox/appstore
# Install profiles
$(INSTALL_DATA) ./profiles/*.json $(1)/usr/share/secubox/profiles/ 2>/dev/null || true
# Install appstore catalog
$(INSTALL_DATA) ./appstore/apps.json $(1)/usr/share/secubox/appstore/apps.json
endef
define Package/$(PKG_NAME)/postinst
#!/bin/sh
# SecuBox post-installation script
# Ensures appstore catalog and permissions are correct
[ -n "$${IPKG_INSTROOT}" ] || {
# Check if appstore catalog exists
if [ ! -f /usr/share/secubox/appstore/apps.json ]; then
echo "WARNING: SecuBox appstore catalog not found at /usr/share/secubox/appstore/apps.json"
# Try to restore from package ROM overlay
if [ -f /rom/usr/share/secubox/appstore/apps.json ]; then
echo " Restoring from package overlay..."
mkdir -p /usr/share/secubox/appstore
cp /rom/usr/share/secubox/appstore/apps.json /usr/share/secubox/appstore/apps.json
echo " ✓ Restored appstore catalog"
else
echo " ERROR: Appstore catalog not found in package!"
echo " The app store will be empty until this is fixed."
echo " Try: opkg remove luci-app-secubox && opkg install luci-app-secubox"
fi
fi
# Set proper permissions (safe even if files don't exist)
chmod 755 /usr/share/secubox 2>/dev/null || true
chmod 755 /usr/share/secubox/appstore 2>/dev/null || true
chmod 644 /usr/share/secubox/appstore/apps.json 2>/dev/null || true
chmod 755 /usr/share/secubox/profiles 2>/dev/null || true
# Reload RPCD to pick up new methods
/etc/init.d/rpcd reload 2>/dev/null || true
echo "SecuBox: Installation complete"
if [ -f /usr/share/secubox/appstore/apps.json ]; then
echo " ✓ Appstore catalog: /usr/share/secubox/appstore/apps.json"
else
echo " ✗ Appstore catalog: MISSING"
fi
echo " ✓ RPCD methods available via: ubus call luci.secubox"
}
exit 0
endef
# call BuildPackage - OpenWrt buildroot