fix(core): Fix module detection, health check, quick actions, and HAProxy status

- Fix jshn boolean handling in secubox-core (use 1/0 instead of true/false)
- Fix BusyBox-compatible package cache generation (grep instead of awk)
- Add quick_action RPCD method for dashboard quick actions
- Enhance health check with module status (total, installed, enabled, active, failed)
- Add resource details to health check output
- Fix HAProxy container detection without lxc-info (fallback to pgrep)
- Rebuild secubox-feed packages with fixes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-01-30 07:55:31 +01:00
parent 98a98c888d
commit fda106c0e0
79 changed files with 287 additions and 138 deletions

View File

@ -54,16 +54,23 @@ method_status() {
stats_port=$(get_uci main stats_port 8404)
stats_enabled=$(get_uci main stats_enabled 1)
# Check container status
if lxc-info -n haproxy >/dev/null 2>&1; then
# Check container status - prefer lxc-info, fallback to pgrep lxc-start
if command -v lxc-info >/dev/null 2>&1; then
container_running=$(lxc-info -n haproxy -s 2>/dev/null | grep -q "RUNNING" && echo "1" || echo "0")
else
container_running="0"
# Fallback: check if lxc-start is running for haproxy
container_running=$(pgrep -f "lxc-start.*-n haproxy" >/dev/null 2>&1 && echo "1" || echo "0")
fi
# Check HAProxy process in container
# Check HAProxy process
if [ "$container_running" = "1" ]; then
haproxy_running=$(lxc-attach -n haproxy -- pgrep haproxy >/dev/null 2>&1 && echo "1" || echo "0")
# Try lxc-attach first, fallback to direct pgrep
if command -v lxc-attach >/dev/null 2>&1; then
haproxy_running=$(lxc-attach -n haproxy -- pgrep haproxy >/dev/null 2>&1 && echo "1" || echo "0")
else
# Fallback: check if haproxy process exists (it runs in container but visible from host)
haproxy_running=$(pgrep -f "haproxy.*haproxy.cfg" >/dev/null 2>&1 && echo "1" || echo "0")
fi
else
haproxy_running="0"
fi
@ -81,9 +88,16 @@ method_status() {
# Get stats
method_get_stats() {
local stats_output
local stats_output container_running
if lxc-info -n haproxy -s 2>/dev/null | grep -q "RUNNING"; then
# Check if container is running (use same detection as status method)
if command -v lxc-info >/dev/null 2>&1; then
container_running=$(lxc-info -n haproxy -s 2>/dev/null | grep -q "RUNNING" && echo "1" || echo "0")
else
container_running=$(pgrep -f "lxc-start.*-n haproxy" >/dev/null 2>&1 && echo "1" || echo "0")
fi
if [ "$container_running" = "1" ]; then
# Get stats via HAProxy socket
stats_output=$(run_ctl stats 2>/dev/null)
if [ -n "$stats_output" ]; then

View File

@ -8,7 +8,7 @@ Architecture: all
Installed-Size: 71680
Description: Comprehensive authentication and session management with captive portal, OAuth2/OIDC integration, voucher system, and time-based access control
Filename: luci-app-auth-guardian_0.4.0-r3_all.ipk
Size: 12086
Size: 12080
Package: luci-app-bandwidth-manager
Version: 0.5.0-r2
@ -20,7 +20,7 @@ Architecture: all
Installed-Size: 378880
Description: Advanced bandwidth management with QoS rules, client quotas, and SQM integration
Filename: luci-app-bandwidth-manager_0.5.0-r2_all.ipk
Size: 66974
Size: 66970
Package: luci-app-cdn-cache
Version: 0.5.0-r3
@ -32,7 +32,7 @@ Architecture: all
Installed-Size: 112640
Description: Dashboard for managing local CDN caching proxy on OpenWrt
Filename: luci-app-cdn-cache_0.5.0-r3_all.ipk
Size: 20436
Size: 20433
Package: luci-app-client-guardian
Version: 0.4.0-r7
@ -44,7 +44,7 @@ Architecture: all
Installed-Size: 307200
Description: Network Access Control with client monitoring, zone management, captive portal, parental controls, and SMS/email alerts
Filename: luci-app-client-guardian_0.4.0-r7_all.ipk
Size: 57047
Size: 57044
Package: luci-app-crowdsec-dashboard
Version: 0.7.0-r29
@ -56,7 +56,7 @@ Architecture: all
Installed-Size: 286720
Description: Real-time security monitoring dashboard for CrowdSec on OpenWrt
Filename: luci-app-crowdsec-dashboard_0.7.0-r29_all.ipk
Size: 53280
Size: 53275
Package: luci-app-cyberfeed
Version: 0.1.1-r1
@ -80,7 +80,7 @@ Architecture: all
Installed-Size: 153600
Description: LuCI SecuBox Service Exposure Manager
Filename: luci-app-exposure_1.0.0-r3_all.ipk
Size: 20534
Size: 20535
Package: luci-app-gitea
Version: 1.0.0-r2
@ -92,7 +92,7 @@ Architecture: all
Installed-Size: 92160
Description: Modern dashboard for Gitea Platform management on OpenWrt
Filename: luci-app-gitea_1.0.0-r2_all.ipk
Size: 15585
Size: 15586
Package: luci-app-glances
Version: 1.0.0-r2
@ -104,7 +104,7 @@ Architecture: all
Installed-Size: 40960
Description: Modern dashboard for Glances system monitoring with SecuBox theme
Filename: luci-app-glances_1.0.0-r2_all.ipk
Size: 6967
Size: 6966
Package: luci-app-haproxy
Version: 1.0.0-r8
@ -116,7 +116,7 @@ Architecture: all
Installed-Size: 204800
Description: Web interface for managing HAProxy load balancer with vhosts, SSL certificates, and backend routing
Filename: luci-app-haproxy_1.0.0-r8_all.ipk
Size: 33968
Size: 34169
Package: luci-app-hexojs
Version: 1.0.0-r3
@ -140,7 +140,7 @@ Architecture: all
Installed-Size: 112640
Description: Centralized cryptographic key management with hardware security module (HSM) support for Nitrokey and YubiKey devices. Provides secure key storage, certificate management, SSH key handling, and secret storage with audit logging.
Filename: luci-app-ksm-manager_0.4.0-r2_all.ipk
Size: 18725
Size: 18722
Package: luci-app-localai
Version: 0.1.0-r15
@ -152,7 +152,7 @@ Architecture: all
Installed-Size: 81920
Description: Modern dashboard for LocalAI LLM management on OpenWrt
Filename: luci-app-localai_0.1.0-r15_all.ipk
Size: 14360
Size: 14365
Package: luci-app-lyrion
Version: 1.0.0-r1
@ -176,7 +176,7 @@ Architecture: all
Installed-Size: 71680
Description: Modern dashboard for MagicMirror2 smart display platform with module manager and SecuBox theme
Filename: luci-app-magicmirror2_0.4.0-r6_all.ipk
Size: 12274
Size: 12277
Package: luci-app-mailinabox
Version: 1.0.0-r1
@ -188,7 +188,7 @@ Architecture: all
Installed-Size: 30720
Description: LuCI support for Mail-in-a-Box
Filename: luci-app-mailinabox_1.0.0-r1_all.ipk
Size: 5482
Size: 5485
Package: luci-app-media-flow
Version: 0.6.4-r1
@ -200,7 +200,7 @@ Architecture: all
Installed-Size: 102400
Description: Real-time detection and monitoring of streaming services (Netflix, YouTube, Spotify, etc.) with quality estimation, history tracking, and alerts. Supports nDPId local DPI and netifyd.
Filename: luci-app-media-flow_0.6.4-r1_all.ipk
Size: 19118
Size: 19115
Package: luci-app-metablogizer
Version: 1.0.0-r3
@ -212,7 +212,7 @@ Architecture: all
Installed-Size: 102400
Description: LuCI support for MetaBlogizer Static Site Publisher
Filename: luci-app-metablogizer_1.0.0-r3_all.ipk
Size: 21650
Size: 21652
Package: luci-app-metabolizer
Version: 1.0.0-r2
@ -236,7 +236,7 @@ Architecture: all
Installed-Size: 102400
Description: Modern dashboard for mitmproxy HTTPS traffic inspection with SecuBox theme
Filename: luci-app-mitmproxy_0.4.0-r6_all.ipk
Size: 18933
Size: 18934
Package: luci-app-mmpm
Version: 0.2.0-r3
@ -248,7 +248,7 @@ Architecture: all
Installed-Size: 51200
Description: Web interface for MMPM - MagicMirror Package Manager
Filename: luci-app-mmpm_0.2.0-r3_all.ipk
Size: 7904
Size: 7899
Package: luci-app-mqtt-bridge
Version: 0.4.0-r4
@ -260,7 +260,7 @@ Architecture: all
Installed-Size: 122880
Description: USB-to-MQTT IoT hub with SecuBox theme
Filename: luci-app-mqtt-bridge_0.4.0-r4_all.ipk
Size: 22779
Size: 22780
Package: luci-app-ndpid
Version: 1.1.2-r2
@ -272,7 +272,7 @@ Architecture: all
Installed-Size: 122880
Description: Modern dashboard for nDPId deep packet inspection on OpenWrt
Filename: luci-app-ndpid_1.1.2-r2_all.ipk
Size: 22453
Size: 22457
Package: luci-app-netdata-dashboard
Version: 0.5.0-r2
@ -284,7 +284,7 @@ Architecture: all
Installed-Size: 133120
Description: Real-time system monitoring dashboard with Netdata integration for OpenWrt
Filename: luci-app-netdata-dashboard_0.5.0-r2_all.ipk
Size: 22398
Size: 22400
Package: luci-app-network-modes
Version: 0.5.0-r3
@ -308,7 +308,7 @@ Architecture: all
Installed-Size: 81920
Description: Unified network services dashboard with DNS/hosts sync, CDN cache control, and WPAD auto-proxy configuration
Filename: luci-app-network-tweaks_1.0.0-r7_all.ipk
Size: 15464
Size: 15463
Package: luci-app-nextcloud
Version: 1.0.0-r1
@ -332,7 +332,7 @@ Architecture: all
Installed-Size: 71680
Description: Modern dashboard for Ollama LLM management on OpenWrt
Filename: luci-app-ollama_0.1.0-r1_all.ipk
Size: 11994
Size: 11996
Package: luci-app-picobrew
Version: 1.0.0-r1
@ -344,7 +344,7 @@ Architecture: all
Installed-Size: 51200
Description: Modern dashboard for PicoBrew Server management on OpenWrt
Filename: luci-app-picobrew_1.0.0-r1_all.ipk
Size: 9977
Size: 9978
Package: luci-app-secubox
Version: 0.7.1-r4
@ -367,7 +367,7 @@ Architecture: all
Installed-Size: 337920
Description: Unified admin control center for SecuBox appstore plugins with system monitoring
Filename: luci-app-secubox-admin_1.0.0-r19_all.ipk
Size: 57096
Size: 57097
Package: luci-app-secubox-crowdsec
Version: 1.0.0-r3
@ -379,7 +379,7 @@ Architecture: all
Installed-Size: 81920
Description: LuCI SecuBox CrowdSec Dashboard
Filename: luci-app-secubox-crowdsec_1.0.0-r3_all.ipk
Size: 13920
Size: 13921
Package: luci-app-secubox-netdiag
Version: 1.0.0-r1
@ -391,7 +391,7 @@ Architecture: all
Installed-Size: 61440
Description: Real-time DSA switch port statistics, error monitoring, and network health diagnostics
Filename: luci-app-secubox-netdiag_1.0.0-r1_all.ipk
Size: 11999
Size: 12001
Package: luci-app-secubox-netifyd
Version: 1.2.1-r1
@ -403,7 +403,7 @@ Architecture: all
Installed-Size: 215040
Description: Complete LuCI interface for netifyd DPI engine with real-time flow monitoring, application detection, network analytics, and flow action plugins
Filename: luci-app-secubox-netifyd_1.2.1-r1_all.ipk
Size: 39499
Size: 39500
Package: luci-app-secubox-portal
Version: 0.7.0-r2
@ -415,7 +415,7 @@ Architecture: all
Installed-Size: 163840
Description: Unified entry point for all SecuBox applications with tabbed navigation
Filename: luci-app-secubox-portal_0.7.0-r2_all.ipk
Size: 32229
Size: 32228
Package: luci-app-secubox-security-threats
Version: 1.0.0-r4
@ -439,7 +439,7 @@ Architecture: all
Installed-Size: 163840
Description: Unified service aggregation with HAProxy vhosts, Tor hidden services, and QR-coded landing page
Filename: luci-app-service-registry_1.0.0-r1_all.ipk
Size: 33352
Size: 33350
Package: luci-app-streamlit
Version: 1.0.0-r9
@ -451,7 +451,7 @@ Architecture: all
Installed-Size: 122880
Description: Modern dashboard for Streamlit Platform management on OpenWrt
Filename: luci-app-streamlit_1.0.0-r9_all.ipk
Size: 20472
Size: 20470
Package: luci-app-system-hub
Version: 0.5.1-r4
@ -475,7 +475,7 @@ Architecture: all
Installed-Size: 133120
Description: Modern dashboard for Tor anonymization on OpenWrt
Filename: luci-app-tor-shield_1.0.0-r10_all.ipk
Size: 24536
Size: 24534
Package: luci-app-traffic-shaper
Version: 0.4.0-r2
@ -499,7 +499,7 @@ Architecture: all
Installed-Size: 174080
Description: Nginx reverse proxy manager with Let's Encrypt SSL certificates, authentication, and WebSocket support
Filename: luci-app-vhost-manager_0.5.0-r5_all.ipk
Size: 29226
Size: 29225
Package: luci-app-wireguard-dashboard
Version: 0.7.0-r5
@ -511,7 +511,7 @@ Architecture: all
Installed-Size: 235520
Description: Modern dashboard for WireGuard VPN monitoring on OpenWrt
Filename: luci-app-wireguard-dashboard_0.7.0-r5_all.ipk
Size: 45369
Size: 45370
Package: luci-app-zigbee2mqtt
Version: 1.0.0-r2
@ -523,7 +523,7 @@ Architecture: all
Installed-Size: 40960
Description: Graphical interface for managing the Zigbee2MQTT docker application.
Filename: luci-app-zigbee2mqtt_1.0.0-r2_all.ipk
Size: 7094
Size: 7089
Package: luci-theme-secubox
Version: 0.4.7-r1
@ -546,7 +546,7 @@ Installed-Size: 92160
Description: Command line helper for SecuBox App Store manifests. Installs /usr/sbin/secubox-app
and ships the default manifests under /usr/share/secubox/plugins/.
Filename: secubox-app_1.0.0-r2_all.ipk
Size: 11188
Size: 11186
Package: secubox-app-adguardhome
Version: 1.0.0-r2
@ -560,7 +560,7 @@ Description: Installer, configuration, and service manager for running AdGuard
inside Docker on SecuBox-powered OpenWrt systems. Network-wide ad blocker
with DNS-over-HTTPS/TLS support and detailed analytics.
Filename: secubox-app-adguardhome_1.0.0-r2_all.ipk
Size: 2879
Size: 2883
Package: secubox-app-auth-logger
Version: 1.2.2-r1
@ -578,7 +578,7 @@ Description: Logs authentication failures from LuCI/rpcd and Dropbear SSH
- JavaScript hook to intercept login failures
- CrowdSec parser and bruteforce scenario
Filename: secubox-app-auth-logger_1.2.2-r1_all.ipk
Size: 9381
Size: 9380
Package: secubox-app-crowdsec-custom
Version: 1.1.0-r1
@ -601,7 +601,7 @@ Description: Custom CrowdSec configurations for SecuBox web interface protectio
- Webapp generic auth bruteforce protection
- Whitelist for trusted networks
Filename: secubox-app-crowdsec-custom_1.1.0-r1_all.ipk
Size: 5762
Size: 5763
Package: secubox-app-cs-firewall-bouncer
Version: 0.0.31-r4
@ -628,7 +628,7 @@ Description: SecuBox CrowdSec Firewall Bouncer for OpenWrt.
- Automatic restart on firewall reload
- procd service management
Filename: secubox-app-cs-firewall-bouncer_0.0.31-r4_aarch64_cortex-a72.ipk
Size: 5049327
Size: 5049324
Package: secubox-app-cyberfeed
Version: 0.2.1-r1
@ -642,7 +642,7 @@ Description: Cyberpunk-themed RSS feed aggregator for OpenWrt/SecuBox.
Features emoji injection, neon styling, and RSS-Bridge support
for social media feeds (Facebook, Twitter, Mastodon).
Filename: secubox-app-cyberfeed_0.2.1-r1_all.ipk
Size: 12452
Size: 12453
Package: secubox-app-domoticz
Version: 1.0.0-r2
@ -655,7 +655,7 @@ Installed-Size: 10240
Description: Installer, configuration, and service manager for running Domoticz
inside Docker on SecuBox-powered OpenWrt systems.
Filename: secubox-app-domoticz_1.0.0-r2_all.ipk
Size: 2548
Size: 2546
Package: secubox-app-exposure
Version: 1.0.0-r1
@ -670,7 +670,7 @@ Description: Unified service exposure manager for SecuBox.
- Dynamic Tor hidden service management
- HAProxy SSL reverse proxy configuration
Filename: secubox-app-exposure_1.0.0-r1_all.ipk
Size: 6833
Size: 6829
Package: secubox-app-gitea
Version: 1.0.0-r5
@ -693,7 +693,7 @@ Description: Gitea Git Platform - Self-hosted lightweight Git service
Runs in LXC container with Alpine Linux.
Configure in /etc/config/gitea.
Filename: secubox-app-gitea_1.0.0-r5_all.ipk
Size: 9406
Size: 9409
Package: secubox-app-glances
Version: 1.0.0-r1
@ -716,7 +716,7 @@ Description: Glances - Cross-platform system monitoring tool for SecuBox.
Runs in LXC container for isolation and security.
Configure in /etc/config/glances.
Filename: secubox-app-glances_1.0.0-r1_all.ipk
Size: 5534
Size: 5535
Package: secubox-app-haproxy
Version: 1.0.0-r23
@ -736,7 +736,7 @@ Description: HAProxy load balancer and reverse proxy running in an LXC containe
- Stats dashboard
- Rate limiting and ACLs
Filename: secubox-app-haproxy_1.0.0-r23_all.ipk
Size: 15684
Size: 15683
Package: secubox-app-hexojs
Version: 1.0.0-r8
@ -760,7 +760,7 @@ Description: Hexo CMS - Self-hosted static blog generator for OpenWrt
Runs in LXC container with Alpine Linux.
Configure in /etc/config/hexojs.
Filename: secubox-app-hexojs_1.0.0-r8_all.ipk
Size: 94935
Size: 94936
Package: secubox-app-localai
Version: 2.25.0-r1
@ -782,7 +782,7 @@ Description: LocalAI native binary package for OpenWrt.
API: http://<router-ip>:8081/v1
Filename: secubox-app-localai_2.25.0-r1_all.ipk
Size: 5724
Size: 5722
Package: secubox-app-localai-wb
Version: 2.25.0-r1
@ -806,7 +806,7 @@ Description: LocalAI native binary package for OpenWrt.
API: http://<router-ip>:8080/v1
Filename: secubox-app-localai-wb_2.25.0-r1_all.ipk
Size: 7956
Size: 7952
Package: secubox-app-lyrion
Version: 2.0.2-r1
@ -826,7 +826,7 @@ Description: Lyrion Media Server (formerly Logitech Media Server / Squeezebox S
Auto-detects available runtime, preferring LXC for lower resource usage.
Configure runtime in /etc/config/lyrion.
Filename: secubox-app-lyrion_2.0.2-r1_all.ipk
Size: 7284
Size: 7292
Package: secubox-app-magicmirror2
Version: 0.4.0-r8
@ -873,7 +873,7 @@ Description: Complete email server solution using docker-mailserver for SecuBox
Commands: mailinaboxctl --help
Filename: secubox-app-mailinabox_2.0.0-r1_all.ipk
Size: 7574
Size: 7568
Package: secubox-app-metabolizer
Version: 1.0.0-r3
@ -894,7 +894,7 @@ Description: Metabolizer Blog Pipeline - Integrated CMS with Git-based workflow
Pipeline: Edit in Streamlit -> Push to Gitea -> Build with Hexo -> Publish
Filename: secubox-app-metabolizer_1.0.0-r3_all.ipk
Size: 13978
Size: 13976
Package: secubox-app-mitmproxy
Version: 0.4.0-r16
@ -936,7 +936,7 @@ Description: MMPM (MagicMirror Package Manager) for SecuBox.
Runs inside the MagicMirror2 LXC container.
Filename: secubox-app-mmpm_0.2.0-r5_all.ipk
Size: 3980
Size: 3977
Package: secubox-app-nextcloud
Version: 1.0.0-r2
@ -950,7 +950,7 @@ Description: Installer, configuration, and service manager for running Nextclou
inside Docker on SecuBox-powered OpenWrt systems. Self-hosted file
sync and share with calendar, contacts, and collaboration.
Filename: secubox-app-nextcloud_1.0.0-r2_all.ipk
Size: 2955
Size: 2956
Package: secubox-app-ollama
Version: 0.1.0-r1
@ -972,7 +972,7 @@ Description: Ollama - Simple local LLM runtime for SecuBox-powered OpenWrt syst
Runs in Docker/Podman container.
Configure in /etc/config/ollama.
Filename: secubox-app-ollama_0.1.0-r1_all.ipk
Size: 5730
Size: 5739
Package: secubox-app-picobrew
Version: 1.0.0-r7
@ -994,7 +994,7 @@ Description: PicoBrew Server - Self-hosted brewing controller for PicoBrew devi
Runs in LXC container with Python/Flask backend.
Configure in /etc/config/picobrew.
Filename: secubox-app-picobrew_1.0.0-r7_all.ipk
Size: 5544
Size: 5540
Package: secubox-app-streamlit
Version: 1.0.0-r5
@ -1021,7 +1021,7 @@ Description: Streamlit App Platform - Self-hosted Python data app platform
Configure in /etc/config/streamlit.
Filename: secubox-app-streamlit_1.0.0-r5_all.ipk
Size: 11723
Size: 11724
Package: secubox-app-tor
Version: 1.0.0-r1
@ -1044,7 +1044,7 @@ Description: SecuBox Tor Shield - One-click Tor anonymization for OpenWrt
Configure in /etc/config/tor-shield.
Filename: secubox-app-tor_1.0.0-r1_all.ipk
Size: 7379
Size: 7377
Package: secubox-app-webapp
Version: 1.5.0-r7
@ -1062,7 +1062,7 @@ Description: SecuBox Control Center Dashboard - A web-based dashboard for monit
- Service management
- Network interface control
Filename: secubox-app-webapp_1.5.0-r7_all.ipk
Size: 39169
Size: 39172
Package: secubox-app-zigbee2mqtt
Version: 1.0.0-r3
@ -1075,15 +1075,16 @@ Installed-Size: 20480
Description: Installer, configuration, and service manager for running Zigbee2MQTT
inside Docker on SecuBox-powered OpenWrt systems.
Filename: secubox-app-zigbee2mqtt_1.0.0-r3_all.ipk
Size: 3546
Size: 3549
Package: secubox-core
Version: 0.10.0-r9
Depends: jq, jsonfilter
License: GPL-2.0
Section: admin
Maintainer: SecuBox Team
Architecture: all
Installed-Size: 440320
Installed-Size: 450560
Description: SecuBox Core Framework provides the foundational infrastructure for the
modular SecuBox system including:
- Module/AppStore management
@ -1094,5 +1095,5 @@ Description: SecuBox Core Framework provides the foundational infrastructure fo
- Unified CLI interface
- ubus RPC backend
Filename: secubox-core_0.10.0-r9_all.ipk
Size: 79091
Size: 80069

View File

@ -1,12 +1,12 @@
{
"feed_url": "/secubox-feed",
"generated": "2026-01-30T06:10:43+01:00",
"generated": "2026-01-30T07:26:42+01:00",
"packages": [
{
"name": "luci-app-auth-guardian",
"version": "0.4.0-r3",
"filename": "luci-app-auth-guardian_0.4.0-r3_all.ipk",
"size": 12086,
"size": 12080,
"category": "security",
"icon": "key",
"description": "Authentication management",
@ -18,7 +18,7 @@
"name": "luci-app-bandwidth-manager",
"version": "0.5.0-r2",
"filename": "luci-app-bandwidth-manager_0.5.0-r2_all.ipk",
"size": 66974,
"size": 66970,
"category": "network",
"icon": "activity",
"description": "Bandwidth monitoring and control",
@ -30,7 +30,7 @@
"name": "luci-app-cdn-cache",
"version": "0.5.0-r3",
"filename": "luci-app-cdn-cache_0.5.0-r3_all.ipk",
"size": 20436,
"size": 20433,
"category": "network",
"icon": "globe",
"description": "CDN caching",
@ -42,7 +42,7 @@
"name": "luci-app-client-guardian",
"version": "0.4.0-r7",
"filename": "luci-app-client-guardian_0.4.0-r7_all.ipk",
"size": 57047,
"size": 57044,
"category": "network",
"icon": "users",
"description": "Client management and monitoring",
@ -54,7 +54,7 @@
"name": "luci-app-crowdsec-dashboard",
"version": "0.7.0-r29",
"filename": "luci-app-crowdsec-dashboard_0.7.0-r29_all.ipk",
"size": 53280,
"size": 53275,
"category": "security",
"icon": "shield",
"description": "CrowdSec security monitoring",
@ -78,7 +78,7 @@
"name": "luci-app-exposure",
"version": "1.0.0-r3",
"filename": "luci-app-exposure_1.0.0-r3_all.ipk",
"size": 20534,
"size": 20535,
"category": "utility",
"icon": "package",
"description": "SecuBox package",
@ -90,7 +90,7 @@
"name": "luci-app-gitea",
"version": "1.0.0-r2",
"filename": "luci-app-gitea_1.0.0-r2_all.ipk",
"size": 15585,
"size": 15586,
"category": "utility",
"icon": "package",
"description": "SecuBox package",
@ -102,7 +102,7 @@
"name": "luci-app-glances",
"version": "1.0.0-r2",
"filename": "luci-app-glances_1.0.0-r2_all.ipk",
"size": 6967,
"size": 6966,
"category": "utility",
"icon": "package",
"description": "SecuBox package",
@ -114,7 +114,7 @@
"name": "luci-app-haproxy",
"version": "1.0.0-r8",
"filename": "luci-app-haproxy_1.0.0-r8_all.ipk",
"size": 33968,
"size": 34169,
"category": "utility",
"icon": "package",
"description": "SecuBox package",
@ -138,7 +138,7 @@
"name": "luci-app-ksm-manager",
"version": "0.4.0-r2",
"filename": "luci-app-ksm-manager_0.4.0-r2_all.ipk",
"size": 18725,
"size": 18722,
"category": "system",
"icon": "cpu",
"description": "Kernel memory management",
@ -150,7 +150,7 @@
"name": "luci-app-localai",
"version": "0.1.0-r15",
"filename": "luci-app-localai_0.1.0-r15_all.ipk",
"size": 14360,
"size": 14365,
"category": "utility",
"icon": "package",
"description": "SecuBox package",
@ -174,7 +174,7 @@
"name": "luci-app-magicmirror2",
"version": "0.4.0-r6",
"filename": "luci-app-magicmirror2_0.4.0-r6_all.ipk",
"size": 12274,
"size": 12277,
"category": "iot",
"icon": "monitor",
"description": "Smart mirror display",
@ -186,7 +186,7 @@
"name": "luci-app-mailinabox",
"version": "1.0.0-r1",
"filename": "luci-app-mailinabox_1.0.0-r1_all.ipk",
"size": 5482,
"size": 5485,
"category": "utility",
"icon": "package",
"description": "SecuBox package",
@ -198,7 +198,7 @@
"name": "luci-app-media-flow",
"version": "0.6.4-r1",
"filename": "luci-app-media-flow_0.6.4-r1_all.ipk",
"size": 19118,
"size": 19115,
"category": "media",
"icon": "film",
"description": "Media streaming",
@ -210,7 +210,7 @@
"name": "luci-app-metablogizer",
"version": "1.0.0-r3",
"filename": "luci-app-metablogizer_1.0.0-r3_all.ipk",
"size": 21650,
"size": 21652,
"category": "utility",
"icon": "package",
"description": "SecuBox package",
@ -234,7 +234,7 @@
"name": "luci-app-mitmproxy",
"version": "0.4.0-r6",
"filename": "luci-app-mitmproxy_0.4.0-r6_all.ipk",
"size": 18933,
"size": 18934,
"category": "security",
"icon": "lock",
"description": "HTTPS proxy and traffic inspection",
@ -246,7 +246,7 @@
"name": "luci-app-mmpm",
"version": "0.2.0-r3",
"filename": "luci-app-mmpm_0.2.0-r3_all.ipk",
"size": 7904,
"size": 7899,
"category": "utility",
"icon": "package",
"description": "SecuBox package",
@ -258,7 +258,7 @@
"name": "luci-app-mqtt-bridge",
"version": "0.4.0-r4",
"filename": "luci-app-mqtt-bridge_0.4.0-r4_all.ipk",
"size": 22779,
"size": 22780,
"category": "iot",
"icon": "message-square",
"description": "MQTT bridge",
@ -270,7 +270,7 @@
"name": "luci-app-ndpid",
"version": "1.1.2-r2",
"filename": "luci-app-ndpid_1.1.2-r2_all.ipk",
"size": 22453,
"size": 22457,
"category": "security",
"icon": "eye",
"description": "Deep packet inspection",
@ -282,7 +282,7 @@
"name": "luci-app-netdata-dashboard",
"version": "0.5.0-r2",
"filename": "luci-app-netdata-dashboard_0.5.0-r2_all.ipk",
"size": 22398,
"size": 22400,
"category": "monitoring",
"icon": "bar-chart-2",
"description": "System monitoring dashboard",
@ -306,7 +306,7 @@
"name": "luci-app-network-tweaks",
"version": "1.0.0-r7",
"filename": "luci-app-network-tweaks_1.0.0-r7_all.ipk",
"size": 15464,
"size": 15463,
"category": "network",
"icon": "wifi",
"description": "Network configuration",
@ -330,7 +330,7 @@
"name": "luci-app-ollama",
"version": "0.1.0-r1",
"filename": "luci-app-ollama_0.1.0-r1_all.ipk",
"size": 11994,
"size": 11996,
"category": "utility",
"icon": "package",
"description": "SecuBox package",
@ -342,7 +342,7 @@
"name": "luci-app-picobrew",
"version": "1.0.0-r1",
"filename": "luci-app-picobrew_1.0.0-r1_all.ipk",
"size": 9977,
"size": 9978,
"category": "utility",
"icon": "package",
"description": "SecuBox package",
@ -366,7 +366,7 @@
"name": "luci-app-secubox-admin",
"version": "1.0.0-r19",
"filename": "luci-app-secubox-admin_1.0.0-r19_all.ipk",
"size": 57096,
"size": 57097,
"category": "system",
"icon": "box",
"description": "SecuBox system component",
@ -378,7 +378,7 @@
"name": "luci-app-secubox-crowdsec",
"version": "1.0.0-r3",
"filename": "luci-app-secubox-crowdsec_1.0.0-r3_all.ipk",
"size": 13920,
"size": 13921,
"category": "system",
"icon": "box",
"description": "SecuBox system component",
@ -390,7 +390,7 @@
"name": "luci-app-secubox-netdiag",
"version": "1.0.0-r1",
"filename": "luci-app-secubox-netdiag_1.0.0-r1_all.ipk",
"size": 11999,
"size": 12001,
"category": "system",
"icon": "box",
"description": "SecuBox system component",
@ -402,7 +402,7 @@
"name": "luci-app-secubox-netifyd",
"version": "1.2.1-r1",
"filename": "luci-app-secubox-netifyd_1.2.1-r1_all.ipk",
"size": 39499,
"size": 39500,
"category": "system",
"icon": "box",
"description": "SecuBox system component",
@ -414,7 +414,7 @@
"name": "luci-app-secubox-portal",
"version": "0.7.0-r2",
"filename": "luci-app-secubox-portal_0.7.0-r2_all.ipk",
"size": 32229,
"size": 32228,
"category": "system",
"icon": "box",
"description": "SecuBox system component",
@ -438,7 +438,7 @@
"name": "luci-app-service-registry",
"version": "1.0.0-r1",
"filename": "luci-app-service-registry_1.0.0-r1_all.ipk",
"size": 33352,
"size": 33350,
"category": "utility",
"icon": "package",
"description": "SecuBox package",
@ -450,7 +450,7 @@
"name": "luci-app-streamlit",
"version": "1.0.0-r9",
"filename": "luci-app-streamlit_1.0.0-r9_all.ipk",
"size": 20472,
"size": 20470,
"category": "utility",
"icon": "package",
"description": "SecuBox package",
@ -474,7 +474,7 @@
"name": "luci-app-tor-shield",
"version": "1.0.0-r10",
"filename": "luci-app-tor-shield_1.0.0-r10_all.ipk",
"size": 24536,
"size": 24534,
"category": "utility",
"icon": "package",
"description": "SecuBox package",
@ -498,7 +498,7 @@
"name": "luci-app-vhost-manager",
"version": "0.5.0-r5",
"filename": "luci-app-vhost-manager_0.5.0-r5_all.ipk",
"size": 29226,
"size": 29225,
"category": "network",
"icon": "server",
"description": "Virtual host management",
@ -510,7 +510,7 @@
"name": "luci-app-wireguard-dashboard",
"version": "0.7.0-r5",
"filename": "luci-app-wireguard-dashboard_0.7.0-r5_all.ipk",
"size": 45369,
"size": 45370,
"category": "vpn",
"icon": "shield",
"description": "WireGuard VPN dashboard",
@ -522,7 +522,7 @@
"name": "luci-app-zigbee2mqtt",
"version": "1.0.0-r2",
"filename": "luci-app-zigbee2mqtt_1.0.0-r2_all.ipk",
"size": 7094,
"size": 7089,
"category": "iot",
"icon": "radio",
"description": "Zigbee device management",
@ -546,7 +546,7 @@
"name": "secubox-app",
"version": "1.0.0-r2",
"filename": "secubox-app_1.0.0-r2_all.ipk",
"size": 11188,
"size": 11186,
"category": "utility",
"icon": "package",
"description": "SecuBox package",
@ -558,7 +558,7 @@
"name": "secubox-app-adguardhome",
"version": "1.0.0-r2",
"filename": "secubox-app-adguardhome_1.0.0-r2_all.ipk",
"size": 2879,
"size": 2883,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -570,7 +570,7 @@
"name": "secubox-app-auth-logger",
"version": "1.2.2-r1",
"filename": "secubox-app-auth-logger_1.2.2-r1_all.ipk",
"size": 9381,
"size": 9380,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -582,7 +582,7 @@
"name": "secubox-app-crowdsec-custom",
"version": "1.1.0-r1",
"filename": "secubox-app-crowdsec-custom_1.1.0-r1_all.ipk",
"size": 5762,
"size": 5763,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -594,7 +594,7 @@
"name": "secubox-app-cs-firewall-bouncer",
"version": "0.0.31-r4_aarch64",
"filename": "secubox-app-cs-firewall-bouncer_0.0.31-r4_aarch64_cortex-a72.ipk",
"size": 5049327,
"size": 5049324,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -606,7 +606,7 @@
"name": "secubox-app-cyberfeed",
"version": "0.2.1-r1",
"filename": "secubox-app-cyberfeed_0.2.1-r1_all.ipk",
"size": 12452,
"size": 12453,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -618,7 +618,7 @@
"name": "secubox-app-domoticz",
"version": "1.0.0-r2",
"filename": "secubox-app-domoticz_1.0.0-r2_all.ipk",
"size": 2548,
"size": 2546,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -630,7 +630,7 @@
"name": "secubox-app-exposure",
"version": "1.0.0-r1",
"filename": "secubox-app-exposure_1.0.0-r1_all.ipk",
"size": 6833,
"size": 6829,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -642,7 +642,7 @@
"name": "secubox-app-gitea",
"version": "1.0.0-r5",
"filename": "secubox-app-gitea_1.0.0-r5_all.ipk",
"size": 9406,
"size": 9409,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -654,7 +654,7 @@
"name": "secubox-app-glances",
"version": "1.0.0-r1",
"filename": "secubox-app-glances_1.0.0-r1_all.ipk",
"size": 5534,
"size": 5535,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -666,7 +666,7 @@
"name": "secubox-app-haproxy",
"version": "1.0.0-r23",
"filename": "secubox-app-haproxy_1.0.0-r23_all.ipk",
"size": 15684,
"size": 15683,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -678,7 +678,7 @@
"name": "secubox-app-hexojs",
"version": "1.0.0-r8",
"filename": "secubox-app-hexojs_1.0.0-r8_all.ipk",
"size": 94935,
"size": 94936,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -690,7 +690,7 @@
"name": "secubox-app-localai",
"version": "2.25.0-r1",
"filename": "secubox-app-localai_2.25.0-r1_all.ipk",
"size": 5724,
"size": 5722,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -702,7 +702,7 @@
"name": "secubox-app-localai-wb",
"version": "2.25.0-r1",
"filename": "secubox-app-localai-wb_2.25.0-r1_all.ipk",
"size": 7956,
"size": 7952,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -714,7 +714,7 @@
"name": "secubox-app-lyrion",
"version": "2.0.2-r1",
"filename": "secubox-app-lyrion_2.0.2-r1_all.ipk",
"size": 7284,
"size": 7292,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -738,7 +738,7 @@
"name": "secubox-app-mailinabox",
"version": "2.0.0-r1",
"filename": "secubox-app-mailinabox_2.0.0-r1_all.ipk",
"size": 7574,
"size": 7568,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -750,7 +750,7 @@
"name": "secubox-app-metabolizer",
"version": "1.0.0-r3",
"filename": "secubox-app-metabolizer_1.0.0-r3_all.ipk",
"size": 13978,
"size": 13976,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -774,7 +774,7 @@
"name": "secubox-app-mmpm",
"version": "0.2.0-r5",
"filename": "secubox-app-mmpm_0.2.0-r5_all.ipk",
"size": 3980,
"size": 3977,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -786,7 +786,7 @@
"name": "secubox-app-nextcloud",
"version": "1.0.0-r2",
"filename": "secubox-app-nextcloud_1.0.0-r2_all.ipk",
"size": 2955,
"size": 2956,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -798,7 +798,7 @@
"name": "secubox-app-ollama",
"version": "0.1.0-r1",
"filename": "secubox-app-ollama_0.1.0-r1_all.ipk",
"size": 5730,
"size": 5739,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -810,7 +810,7 @@
"name": "secubox-app-picobrew",
"version": "1.0.0-r7",
"filename": "secubox-app-picobrew_1.0.0-r7_all.ipk",
"size": 5544,
"size": 5540,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -822,7 +822,7 @@
"name": "secubox-app-streamlit",
"version": "1.0.0-r5",
"filename": "secubox-app-streamlit_1.0.0-r5_all.ipk",
"size": 11723,
"size": 11724,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -834,7 +834,7 @@
"name": "secubox-app-tor",
"version": "1.0.0-r1",
"filename": "secubox-app-tor_1.0.0-r1_all.ipk",
"size": 7379,
"size": 7377,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -846,7 +846,7 @@
"name": "secubox-app-webapp",
"version": "1.5.0-r7",
"filename": "secubox-app-webapp_1.5.0-r7_all.ipk",
"size": 39169,
"size": 39172,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -858,7 +858,7 @@
"name": "secubox-app-zigbee2mqtt",
"version": "1.0.0-r3",
"filename": "secubox-app-zigbee2mqtt_1.0.0-r3_all.ipk",
"size": 3546,
"size": 3549,
"category": "secubox",
"icon": "package",
"description": "SecuBox backend service",
@ -870,7 +870,7 @@
"name": "secubox-core",
"version": "0.10.0-r9",
"filename": "secubox-core_0.10.0-r9_all.ipk",
"size": 79091,
"size": 80069,
"category": "system",
"icon": "box",
"description": "SecuBox core components",

View File

@ -163,6 +163,11 @@ case "$1" in
json_add_object "get_alerts"
json_close_object
# Quick actions
json_add_object "quick_action"
json_add_string "action" "string"
json_close_object
# State management
json_add_object "get_component_state"
json_add_string "component_id" "string"
@ -980,7 +985,70 @@ case "$1" in
json_dump
;;
quick_action)
read -r input
action=$(echo "$input" | jsonfilter -e '@.action')
json_init
case "$action" in
restart_services)
# Restart all SecuBox services
for svc in haproxy crowdsec tor netifyd; do
if [ -x "/etc/init.d/$svc" ]; then
/etc/init.d/$svc restart 2>/dev/null &
elif [ -x "/usr/sbin/${svc}ctl" ]; then
/usr/sbin/${svc}ctl restart 2>/dev/null &
fi
done
json_add_boolean "success" 1
json_add_string "message" "Services restart initiated"
;;
restart_*)
# Restart specific service: restart_haproxy, restart_crowdsec, etc.
svc_name="${action#restart_}"
if [ -x "/etc/init.d/$svc_name" ]; then
/etc/init.d/$svc_name restart 2>/dev/null
json_add_boolean "success" 1
json_add_string "message" "Service $svc_name restarted"
elif [ -x "/usr/sbin/${svc_name}ctl" ]; then
/usr/sbin/${svc_name}ctl restart 2>/dev/null
json_add_boolean "success" 1
json_add_string "message" "Service $svc_name restarted"
else
json_add_boolean "success" 0
json_add_string "message" "Service $svc_name not found"
fi
;;
update_packages)
opkg update 2>/dev/null &
json_add_boolean "success" 1
json_add_string "message" "Package update initiated"
;;
view_logs)
# Return recent system logs
json_add_boolean "success" 1
json_add_string "redirect" "/cgi-bin/luci/admin/status/syslog"
;;
export_config)
# Export configuration
if [ -x "/usr/sbin/secubox-recovery" ]; then
snapshot_name="export-$(date +%Y%m%d-%H%M%S)"
/usr/sbin/secubox-recovery snapshot "$snapshot_name" 2>/dev/null
json_add_boolean "success" 1
json_add_string "message" "Configuration exported as $snapshot_name"
else
json_add_boolean "success" 0
json_add_string "message" "Recovery system not available"
fi
;;
*)
json_add_boolean "success" 0
json_add_string "message" "Unknown action: $action"
;;
esac
json_dump
;;
getLogs)
read -r input

View File

@ -87,7 +87,7 @@ get_status() {
# Core info
json_add_string "version" "$SECUBOX_VERSION"
json_add_boolean "running" true
json_add_boolean "running" 1
json_add_string "hostname" "$(uci -q get system.@system[0].hostname)"
json_add_string "uptime" "$(uptime | awk '{print $3,$4}' | sed 's/,//')"
@ -121,8 +121,8 @@ get_status() {
# WAN status
local wan_device=$(uci -q get network.wan.device || uci -q get network.wan.ifname || echo "unknown")
local wan_ip=$(ip -4 addr show dev "$wan_device" 2>/dev/null | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1 | head -1 || echo "none")
local wan_connected="false"
[ -n "$wan_ip" ] && wan_connected="true"
local wan_connected=0
[ -n "$wan_ip" ] && wan_connected=1
json_add_object "wan"
json_add_boolean "connected" "$wan_connected"
@ -138,7 +138,15 @@ get_status() {
json_close_object
json_close_object
# Installed modules
# Installed modules - use cached opkg status for performance
# Build installed packages cache from opkg status db (fast, no subprocess per pkg)
local OPKG_STATUS_DB="/usr/lib/opkg/status"
local installed_cache="/tmp/secubox-installed-status"
if [ -r "$OPKG_STATUS_DB" ]; then
# BusyBox-compatible: use grep instead of awk
grep "^Package: " "$OPKG_STATUS_DB" | cut -d' ' -f2 > "$installed_cache" 2>/dev/null
fi
json_add_array "modules"
if [ -d "/usr/share/secubox/plugins/catalog" ]; then
for catalog in /usr/share/secubox/plugins/catalog/*.json; do
@ -146,11 +154,12 @@ get_status() {
local module_id=$(jsonfilter -i "$catalog" -e '@.id' 2>/dev/null)
local module_name=$(jsonfilter -i "$catalog" -e '@.name' 2>/dev/null)
# Check if module package is installed
local packages=$(jsonfilter -i "$catalog" -e '@.packages[0]' 2>/dev/null)
local installed=false
if [ -n "$packages" ]; then
opkg list-installed | grep -q "^$packages " && installed=true
# Check if module package is installed (try both paths for compatibility)
local packages=$(jsonfilter -i "$catalog" -e '@.packages.required[0]' 2>/dev/null)
[ -z "$packages" ] && packages=$(jsonfilter -i "$catalog" -e '@.packages[0]' 2>/dev/null)
local installed=0
if [ -n "$packages" ] && [ -f "$installed_cache" ]; then
grep -q "^${packages}$" "$installed_cache" && installed=1
fi
json_add_object ""
@ -161,6 +170,7 @@ get_status() {
done
fi
json_close_array
rm -f "$installed_cache"
json_dump
}
@ -170,10 +180,12 @@ run_health_check() {
local overall_status="healthy"
local warnings=0
local errors=0
local details=""
# Check CPU
local cpu_threshold=$(uci -q get secubox.settings.health_threshold_cpu || echo "80")
local cpu_load=$(uptime | awk -F'load average:' '{print $2}' | awk '{print $1}' | tr -d ',' | cut -d'.' -f1)
local cpu_load_full=$(uptime | awk -F'load average:' '{print $2}' | awk '{print $1}' | tr -d ',')
if [ "$cpu_load" -gt "$cpu_threshold" ]; then
log warn "CPU load high: $cpu_load"
warnings=$((warnings + 1))
@ -201,9 +213,37 @@ run_health_check() {
fi
# Check network connectivity
local network_ok=1
if ! ping -c 1 -W 2 8.8.8.8 >/dev/null 2>&1; then
log warn "No internet connectivity"
warnings=$((warnings + 1))
network_ok=0
fi
# Module health check - use appstore output for accurate data
local modules_installed=0
local modules_enabled=0
local modules_active=0
local modules_total=0
local modules_failed=0
if [ -x /usr/sbin/secubox-appstore ]; then
local appstore_out=$(/usr/sbin/secubox-appstore list --json 2>/dev/null)
if [ -n "$appstore_out" ]; then
modules_total=$(echo "$appstore_out" | jsonfilter -e '@.modules[*].id' 2>/dev/null | wc -l)
modules_installed=$(echo "$appstore_out" | jsonfilter -e '@.modules[*]' 2>/dev/null | grep '"installed": true' | wc -l)
modules_enabled=$(echo "$appstore_out" | jsonfilter -e '@.modules[*]' 2>/dev/null | grep '"enabled": true' | wc -l)
modules_active=$(echo "$appstore_out" | jsonfilter -e '@.modules[*]' 2>/dev/null | grep '"active": true' | wc -l)
# Count enabled but not active as potentially failed
modules_failed=$((modules_enabled - modules_active))
[ "$modules_failed" -lt 0 ] && modules_failed=0
if [ "$modules_failed" -gt 0 ]; then
log warn "$modules_failed enabled modules not running"
warnings=$((warnings + modules_failed))
[ "$overall_status" = "healthy" ] && overall_status="warning"
fi
fi
fi
# Output health status
@ -212,6 +252,32 @@ run_health_check() {
json_add_int "warnings" "$warnings"
json_add_int "errors" "$errors"
json_add_string "timestamp" "$(date -Iseconds)"
# Resource details
json_add_object "resources"
json_add_string "cpu_load" "$cpu_load_full"
json_add_int "cpu_threshold" "$cpu_threshold"
json_add_int "memory_percent" "$mem_percent"
json_add_int "memory_threshold" "$mem_threshold"
json_add_int "memory_total_mb" "$((mem_total / 1024))"
json_add_int "storage_percent" "$storage_percent"
json_add_int "storage_threshold" "$storage_threshold"
json_close_object
# Network status
json_add_object "network"
json_add_boolean "internet" "$network_ok"
json_close_object
# Module status
json_add_object "modules"
json_add_int "total" "$modules_total"
json_add_int "installed" "$modules_installed"
json_add_int "enabled" "$modules_enabled"
json_add_int "active" "$modules_active"
json_add_int "failed" "$modules_failed"
json_close_object
json_dump
return 0