Commit Graph

1030 Commits

Author SHA1 Message Date
778ab4a1e8 fix(mailserver): Fix password reset hash corruption
- Use printf instead of echo to preserve $6$ hash prefix
- Write dovecot entry to temp file to avoid shell expansion
- Use correct uid:gid 102:105 for vmail user
- Add userdb_mail field to dovecot passwd format
- Use /var/mail path to match container layout

The SHA512-CRYPT hash ($6$...) was being corrupted when passed
through nested shell commands - the $6$ was interpreted as a
shell variable and removed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 13:59:06 +01:00
7151bc6138 feat(mailserver): Add mail autoconfig and user repair features
Autoconfig:
- Created config-v1.1.xml (Thunderbird), autodiscover.xml (Outlook),
  email.mobileconfig (Apple) for automatic mail client configuration
- Added uhttpd instance on port 8025 to serve autoconfig files
- Added HAProxy backends with waf_bypass for autoconfig domains
- Added mailctl autoconfig-setup and autoconfig-status commands

LuCI Mailserver:
- Added user_repair method for mailbox repair (doveadm force-resync)
- Added repair button to user actions in overview

LuCI Nextcloud:
- Added list_users method to list Nextcloud users
- Added reset_password method for password reset via OCC

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 13:26:23 +01:00
856a167ad4 fix(mailserver): Add firewall-setup command excluding LAN clients
- Add mailctl firewall-setup command to configure mail port forwarding
- Add mailctl firewall-clear command to remove mail firewall rules
- Firewall rules now use "! -s LAN_SUBNET" to exclude LAN clients
- LAN clients can reach external mail servers (OVH, Gmail, etc.)
- WAN traffic on mail ports redirected to local mailserver

Fixes SSL certificate errors when LAN clients connect to external IMAP/SMTP

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 13:02:45 +01:00
23c38cd2f1 feat(mailserver): Add alias management via ubus
- Fix alias_add RPCD to read JSON from stdin (ubus compatibility)
- Add alias_del function to users.sh
- Add alias del command to mailctl
- Add alias_del RPCD method

Tested: alias_add, alias_list, alias_del all work via ubus call

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 12:38:55 +01:00
67441bd97b feat(nextcloud): Add tabs to KISS sidebar navigation
Add Nextcloud Overview and Settings tabs to kiss-theme sidebar for
consistent navigation across all SecuBox apps.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 12:31:27 +01:00
7bfec387dc feat(hexojs): Add tabs to KISS sidebar navigation
- Add HexoJS tabs (Overview, Posts, Editor, Media, Deploy, Sync, Theme,
  Settings) to kiss-theme.js nav config
- Remove duplicate inline tabs from overview.js
- Tabs now appear in sidebar when HexoJS is selected

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 10:43:27 +01:00
1585975e90 refactor(hexojs): Use shared kiss-theme module
Replace inline CSS with shared secubox/kiss-theme module for simpler,
faster, more efficient rendering. Code reduced from 320 to 188 lines.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 10:36:56 +01:00
832afe9851 feat(hexojs): KISS-style dashboard with inline CSS
Completely rewrote overview.js with self-contained inline CSS following
the KISS design pattern. Dark theme with stats grid, quick actions,
instance cards with status badges, and clean backups table.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 10:34:22 +01:00
44178cbbf5 fix(hexojs): Fix RPC expect unwrapping in dashboard load function
The listInstances and listBackups RPC declarations use expect which
unwraps the response array directly. Changed results[0].instances to
results[0] and results[3].backups to results[3].

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 10:30:59 +01:00
c2cd204ea9 feat(hexojs): Multi-instance enhancement with backup/restore and Git integration
- Add backup/restore commands to hexoctl (backup, restore, backup list/delete)
- Add GitHub clone support (hexoctl github clone <url> [instance] [branch])
- Add Gitea push support (hexoctl gitea push [instance] [message])
- Add quick-publish command (clean + build + publish in one step)
- Add 15 new RPCD methods for instance/backup/git management
- Rewrite LuCI dashboard with KISS theme:
  - Multi-instance management with status cards
  - Instance controls: start/stop, quick publish, backup, editor, preview
  - GitHub/Gitea clone modals
  - Backup table with restore/delete
  - Stats grid: instances, posts, drafts, backups
- Update API with 12 new RPC declarations
- Update ACL with new permissions

Also includes DNS Master app created in previous session.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 10:26:55 +01:00
16ed7e2d7a fix(mailserver): Add IMAP port 143 to status check
- Added port 143 to RPCD port detection list
- Fixed KISS nav path for Nextcloud (admin/secubox/services/nextcloud)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 09:56:51 +01:00
efa74990be feat(mailserver): KISS theme enhancement for LuCI dashboard
- Complete rewrite of overview.js with full KISS theme styling
- 4-column stats grid (Status, Users, Storage, SSL)
- Port status cards with visual indicators
- Two-column layout: Users + Aliases tables
- Webmail card with status badge and quick actions
- Connection info panel with server details
- Live polling with 10s refresh
- Added fix_ports, alias_del methods to ACL
- Added Mail Server + Nextcloud to KISS nav sidebar

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 09:52:19 +01:00
2bc2eac994 fix(nextcloud): Fix nginx config for Nextcloud app routing
- Change location / from try_files to rewrite for proper app URL handling
- Fixes 403 errors when accessing /apps/* URLs after authentication
- All URLs now properly route through index.php

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 08:17:49 +01:00
5b6bf8560a fix(nextcloud): Use configurable HTTP port and correct PHP-FPM socket
- Change nginx to listen on ${NEXTCLOUD_HTTP_PORT:-8080} instead of hardcoded port 80
- Fix PHP-FPM socket path to use detected PHP version (php${PHP_VERSION}-fpm.sock)
- Avoids port conflict with HAProxy on port 80 when using host networking

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 08:10:03 +01:00
b78ea3b683 fix(nextcloud): Fix LXC rootfs download and chroot mounts
- Parse HTML directory listing instead of non-existent index.json
- URL-encode colon in date path for LXC image server
- Add mount_chroot_fs/umount_chroot_fs helpers for proper chroot
- Mount /dev, /dev/pts, /proc, /sys before running apt
- Remove php-smbclient (not in base repos)
- Install gnupg/gpgv first for apt verification

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 08:02:01 +01:00
09b40c3b88 feat(nextcloud): Migrate to LXC with full-stack enhancement
- Migrate from Docker to Debian 12 LXC container
- Full stack: Nginx, MariaDB, Redis, PHP 8.2-FPM, Nextcloud
- Rewrite nextcloudctl CLI with install/backup/restore/ssl/occ commands
- New UCI config schema: main, db, redis, ssl, backup sections
- Enhanced RPCD backend with 15 methods
- KISS dashboard with Overview/Backups/SSL/Logs tabs
- Updated dependencies for LXC packages
- SecuBox menu path integration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 07:49:17 +01:00
59d0e89a8c feat(gk2hub): Use subdomain URLs instead of redirect paths
- Infrastructure: media, localai, webmail, feed, tube, social, wazuh
- MetaBlogizer: HAProxy vhost lookup for automatic subdomain detection
- Added icons for new service types (tube, social, wazuh, etc.)
- 67 services now display with proper subdomain URLs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 17:01:54 +01:00
42d85c4d0f fix(mitmproxy): Use WAF input data path for threat stats
- Changed RPCD handler to read from /srv/mitmproxy-in (WAF input)
- Previously read from /srv/mitmproxy which had no threat data
- Fixed threats_today, alerts, autobans stats
- Check mitmproxy-in and mitmproxy-out containers for running status

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 10:30:21 +01:00
851910e185 feat(wazuh): Add watchdog to wazuh-agent startup script
Adds a watchdog loop that checks every 60 seconds if wazuh-agentd
is running and automatically restarts the Wazuh service if it stops.

Fixes agent disconnection issues caused by wazuh-agentd process dying.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 09:11:07 +01:00
f3f6eb4e4b fix(haproxy,mitmproxy): Fix config reload and preserve Host header
haproxyctl:
- Copy generated config to /etc/haproxy/ inside container before reload
- HAProxy reads from /etc/haproxy/haproxy.cfg, not /opt/haproxy/config/

mitmproxy haproxy_router.py:
- Save original Host header before setting backend destination
- Restore Host header after routing to preserve it for backend validation
- Fixes PeerTube OAuth and other apps that validate Host header

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 07:40:20 +01:00
1a8beb45e0 feat(peertube,portal): Add PeerTube config and generative luci-tree
- secubox-app-peertube: Update default port to 9001, hostname to tube.gk2.secubox.in
- luci-app-secubox-portal: Add RPCD backend for dynamic tree generation
  - get_tree: Auto-discovers luci-app-* packages grouped by category
  - get_containers: Lists LXC containers with running state
  - get_vhosts: Lists HAProxy virtual hosts
- luci-tree.js: Rewritten to use RPC for live data with refresh button

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 06:48:10 +01:00
ffb9fe3785 fix(peertube): Change default port from 9000 to 9001
Port 9000 is used by Lyrion music server.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 06:04:25 +01:00
5c34ca2cae feat(luci): Add luci-app-peertube dashboard for PeerTube video platform
- RPCD handler (luci.peertube) with 11 methods: status, start, stop,
  install, uninstall, update, logs, emancipate, live_enable,
  live_disable, configure_haproxy
- ACL permissions for read (status, logs) and write operations
- Dashboard features:
  - Install wizard with features and requirements
  - Service status display with access URL
  - Live streaming toggle with enable/disable buttons
  - HAProxy configuration status
  - Emancipate form for public exposure
  - Logs viewer with refresh

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 05:51:04 +01:00
dcc34c8bf6 feat(peertube): Add PeerTube video platform package
New secubox-app-peertube package for self-hosted video streaming:

- LXC Debian container with PostgreSQL, Redis, Node.js, FFmpeg
- peertubectl control script with install/update/emancipate commands
- UCI configuration for server, transcoding, live streaming, storage
- procd init script with respawn support
- HAProxy integration with WebSocket and extended timeouts
- RTMP live streaming support (optional)
- S3/object storage support (configurable)
- Admin commands for user management
- Backup/restore functionality

Commands:
  peertubectl install              - Create LXC container with full stack
  peertubectl emancipate <domain>  - Full exposure with HAProxy + ACME
  peertubectl admin create-user    - Create user accounts
  peertubectl live enable          - Enable RTMP live streaming
  peertubectl backup/restore       - Database backup

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 05:43:22 +01:00
daa755986e fix(streamlitctl): Add mitmproxy route sync step to emancipation
After emancipating a service, automatically sync routes to mitmproxy
WAF to ensure traffic can be properly routed through the mitmproxy
containers without manual intervention.

The new _emancipate_mitmproxy() function calls mitmproxyctl sync-routes
after HAProxy configuration to keep mitmproxy routing table in sync.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 05:29:48 +01:00
1513041d90 fix(vortex-firewall): Detect BIND RPZ in addition to dnsmasq
RPCD handler now checks for both:
- /etc/dnsmasq.d/vortex-firewall.conf (dnsmasq mode)
- /etc/bind/zones/rpz.vortex.zone (BIND RPZ mode)

This fixes the "0 blocked domains" display when using BIND DNS server.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 17:31:06 +01:00
c3ebb4a42a fix(interceptor): Check mitmproxy-in/out containers instead of mitmproxy
The mitmproxy service now uses separate containers:
- mitmproxy-in: External WAF (WAN protection)
- mitmproxy-out: Insider WAF (LAN threat detection)

Updated RPCD handler to check correct container names for status.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 17:21:25 +01:00
54d555206b chore(feed): Update secubox-app-bonus local feed packages
Regenerated Packages index with proper Filename fields for all ipk files.
Updated all package versions to latest builds.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 17:18:02 +01:00
e3093aab6b feat(luci-app-wazuh): Add KISS UI theme and add to feed
- Rewrite overview.js to use KissTheme wrapper
- Add health status cards for Agent, Manager, Indexer, CrowdSec
- Add alert statistics with color-coded counters
- Add security layers table (Firewall, IPS, SIEM, WAF)
- Add quick actions with restart agent button
- Include built IPK in secubox-feed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 16:36:44 +01:00
9eaa16171d fix(mitmproxy): Fix wildcard route priority matching
- Support both "*.domain" and ".domain" wildcard formats in haproxy_router.py
- Sort wildcards by length (longest first) for correct specificity matching
- Add auto-reload: check routes file mtime every 10 requests
- Update metablogizerctl to use mitmproxyctl sync-routes

Also fix luci-app-wazuh api.js to use baseclass.extend

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 16:03:43 +01:00
b1c34021db feat(wazuh): Add LuCI dashboard for Wazuh SIEM integration
Create luci-app-wazuh package with unified security monitoring dashboard
inspired by SysWarden's layered defense model:

- 4 views: Overview, Alerts, File Integrity, Agents
- RPCD handler with 12 API methods for status, alerts, FIM, agent control
- SysWarden-style 4-layer security visualization:
  - Layer 1: Vortex Firewall + nftables (kernel-level)
  - Layer 2: CrowdSec + Bouncer (IPS)
  - Layer 3: Wazuh Manager (SIEM/XDR)
  - Layer 4: mitmproxy + HAProxy (WAF)
- CrowdSec integration for threat correlation
- Real-time polling and auto-refresh
- Simplified printf-based JSON output (avoids jshn segfault)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 14:45:05 +01:00
a3f3b2dd8c fix(wazuh): Handle multiple deb archive compression formats
Support xz, gz, and zst compression for data.tar in deb packages.
Modern Wazuh debs use data.tar.xz instead of data.tar.gz.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 14:28:15 +01:00
7d87bfbc92 feat(wazuh): Add Wazuh Manager LXC container package
New package secubox-wazuh-manager provides complete SIEM stack:
- Wazuh Manager: Agent management, log analysis, threat detection
- Wazuh Indexer: OpenSearch-based alert storage
- Wazuh Dashboard: Web UI for visualization (port 5601)

Features:
- Automated LXC container deployment with Debian 12
- HAProxy integration with waf_bypass for dashboard
- Agent management commands (list, info, remove)
- API access and token generation
- Log viewing for all components
- Shell access for administration

CLI: wazuh-managerctl with install/start/stop/status/configure-haproxy

Requirements: 4GB+ RAM, 20GB+ storage for production use

Complements secubox-app-wazuh agent for full SIEM deployment.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:31:31 +01:00
6f777761e7 feat(wazuh): Add Wazuh security agent package
New package secubox-app-wazuh provides:
- Wazuh Agent installation and management for ARM64/OpenWrt
- File Integrity Monitoring (FIM) for /etc, /usr/sbin, /etc/config
- Log analysis: syslog, CrowdSec, firewall
- Rootcheck and Security Configuration Assessment
- CrowdSec integration for threat sync
- CLI: wazuhctl with install/configure/register/status commands

Wazuh provides SIEM/XDR capabilities complementing CrowdSec:
- Endpoint detection and response
- Compliance monitoring (PCI-DSS, GDPR, HIPAA)
- Vulnerability detection
- Active response automation

Requires external Wazuh Manager or future secubox-wazuh-manager LXC.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:28:00 +01:00
f38df2b319 feat(metablogizer): Enhance emancipate with WAF and path ACL integration
- Add _emancipate_mitmproxy() to register domain in WAF routes
- Add _emancipate_path_acl() to create secubox.in/gk2/{name} path routing
- Auto-detect wildcard SSL coverage for *.gk2.secubox.in domains
- Restart mitmproxy-in container after adding routes
- Update help text with 7-step workflow

Emancipate now handles full deployment:
1. DNS A record (Gandi/OVH)
2. Vortex DNS mesh publication
3. HAProxy vhost + backend
4. WAF/mitmproxy integration
5. Path ACL (secubox.in/gk2/{name})
6. SSL certificate (or wildcard)
7. Zero-downtime reload

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:21:27 +01:00
cd53d508fa feat(jellyfin): Update to v3.0.0 with LXC-based deployment
- Rebuilt secubox-app-jellyfin package with LXC controller
- Updated package feed with new Jellyfin ipk
- Synced all SecuBox packages to local feed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 09:48:51 +01:00
2b8fb1cd62 feat(apps): Convert Docker-based apps to LXC
Converted secubox-app-jellyfin, secubox-app-mailserver, and added
secubox-app-roundcube to use LXC containers instead of Docker.

Changes:
- jellyfinctl: Now uses LXC at 192.168.255.31
- mailserverctl: New controller for Alpine LXC with Postfix/Dovecot
- roundcubectl: New package for Roundcube webmail LXC

All controllers support:
- Bootstrap Alpine rootfs using static apk
- LXC configuration generation
- HAProxy integration with waf_bypass
- Start/stop/status commands

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 09:07:33 +01:00
2637fb516b fix(haproxy): Add waf_bypass option for WebSocket-heavy apps
Streamlit apps require WebSocket connections that mitmproxy WAF
doesn't handle properly. Added waf_bypass UCI option to allow
specific vhosts to route directly to backends while other
services still get WAF protection.

- Add waf_bypass option check in haproxyctl
- Vhosts with waf_bypass=1 skip mitmproxy_inspector
- Fixes blank page issue with Streamlit apps

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 08:03:27 +01:00
b62f82b77e feat(gotosocial): Migrate to LXC container with Alpine rootfs
- Create Alpine 3.21 LXC container with gcompat for glibc compatibility
- GoToSocial v0.17.0 runs inside container with host networking
- Data directory bind-mounted at /data inside container
- Add user management commands via chroot/lxc-attach
- Add `shell` command for container access
- Add `user password` command for password resets
- Fix architecture variable naming (aarch64/arm64 confusion)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 07:16:54 +01:00
85dd9a4bdc feat(pinafore): Add Mastodon client hub package
Creates a landing page with links to public Mastodon clients
(Pinafore, Elk, Semaphore) pre-configured for the local GoToSocial
instance.

- pinaforectl install [instance] - Create client hub
- pinaforectl start/stop - Manage uhttpd server
- pinaforectl emancipate <domain> - Expose via HAProxy

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 06:34:40 +01:00
82f167a8d5 fix(gotosocial): Fix config paths and CLI flags
- Change db-address from /data/ to /srv/gotosocial/ for direct host mode
- Change storage path from /data/ to /srv/gotosocial/
- Fix --config to --config-path to match GoToSocial v0.17 CLI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 06:28:09 +01:00
d98bcdf7f4 fix(mitmproxy): Sync routes to all instance data paths
The sync-routes command was only writing to the default /srv/mitmproxy
path. Now copies haproxy-routes.json to all configured instances
(mitmproxy-in, mitmproxy-out) so the HAProxy router addon can
properly route traffic.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 06:13:45 +01:00
507263f6a7 fix(mitmproxy): Sync autoban config to all instances
The reload-autoban command was only writing to the default data path,
missing the mitmproxy-in and mitmproxy-out instances. Now iterates
over all configured instances to ensure autoban.json is updated
everywhere.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 06:03:46 +01:00
1fcddb6de3 fix(luci-mitmproxy): Preserve autoban enabled state on save
Add rmempty=false to autoban enabled flag to prevent LuCI from
removing the option when saving the form. This fixes the issue
where saving settings would reset autoban to disabled.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 05:56:01 +01:00
cac9fa3e4f fix(mitmproxy): Fix false positives for legitimate browsers
- Remove 'mozilla/5.0' from BOT_SIGNATURES - was flagging ALL modern
  browsers as bots since this is the standard UA prefix
- Fix suspicious UA detection - no longer flags normal browsers
- Increase CrowdSec bruteforce threshold from 5/30s to 10/60s to reduce
  false positives from normal login flows

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 05:51:53 +01:00
2bc8c29f94 feat(luci-mitmproxy): Add Auto-ban settings with sensitivity control
Add new Auto-ban section to mitmproxy settings page with:
- Sensitivity level switch (Strict/Moderate/Permissive)
- Minimum severity threshold
- Ban duration configuration
- Per-threat-type ban toggles (SQLi, CVE, scanners, etc.)
- Bot whitelist configuration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 05:41:02 +01:00
418cb2c76e fix(mitmproxy): Fix SSRF false positives for internal traffic
SSRF detection was triggering on any request to internal IPs
(192.168.x.x, 10.x.x.x, etc.) because it was checking the target
URL itself. Now only checks query parameters and request body for
SSRF patterns, which is where actual SSRF attacks occur.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 05:38:26 +01:00
cafe8196ac feat(haproxy): Add global WAF routing option
Add `waf_enabled` and `waf_backend` options to haproxy.main config.
When waf_enabled=1, all vhost and path-based routing goes through
the WAF backend (default: mitmproxy_inspector) instead of directly
to service backends.

This enables global traffic inspection through mitmproxy WAF while
maintaining proper routing via haproxy_router addon.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 05:29:35 +01:00
5fa5924533 fix(mitmproxy): Add per-instance haproxy_router_enabled override
Allow disabling HAProxy router mode per-instance via UCI option
`mitmproxy.<instance>.haproxy_router_enabled`. This prevents port
conflicts when running multiple mitmproxy instances (e.g., mitmproxy-out
on 8888 and mitmproxy-in on 8889) where only the inbound instance
needs HAProxy router mode.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 05:21:07 +01:00
b8d34e7e3a fix(haproxy): Use LAN IP for backends (HAProxy runs in LXC container)
- metablogizer: Use network.lan.ipaddr instead of 127.0.0.1 for server address
- service-registry: Same fix for emancipate function
- hexojs: Same fix for HAProxy backend creation
- gotosocial: Switch from LXC to direct execution mode
  - v0.18.0 has cgroup bugs, using v0.17.0 instead
  - Remove LXC container dependency
  - Use /srv/gotosocial for binary and data
  - Add proper PID file management

The HAProxy container cannot reach 127.0.0.1 on the host, so all HAProxy
backend servers must use the LAN IP (typically 192.168.255.1).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 14:49:50 +01:00
f20bb1df6b feat(gotosocial): Add GoToSocial Fediverse server packages
Add secubox-app-gotosocial and luci-app-gotosocial for running a lightweight
ActivityPub social network server in LXC container.

Features:
- gotosocialctl CLI with install, start, stop, user management
- LXC container deployment (ARM64)
- HAProxy integration via emancipate command
- UCI configuration for instance, container, proxy, federation settings
- LuCI web interface with overview, users, and settings tabs
- Mesh integration support for auto-federation between SecuBox nodes
- Backup/restore functionality

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 13:52:58 +01:00
92b422e900 fix(gitea): Remove cgroup mount to fix LXC startup on some kernels
- Remove cgroup:mixed from lxc.mount.auto (causes "Failed to create
  cgroup at_mnt" error on certain kernel configurations)
- Disable cgroup memory limit since cgroup is not mounted
- Fixes Gitea container failing to start with cgroup mount errors

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 13:41:58 +01:00
747d1ffbaa perf(secubox-p2p): Optimize shared services for faster LuCI response
- Skip IPv6 addresses and use active_address when available
- Filter out local node from shared services query
- Increase curl max-time to 10s for slow CGI responses
- Skip null/empty peer addresses
- Reduces response time from 48s to ~5s

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 12:20:44 +01:00
2248785ff6 fix(secubox-p2p): Fix shared services endpoint and add peer attribution
- Change service endpoint from port 8080 to /cgi-bin/p2p-services
- Exclude local node from shared services query
- Extract .services array from response JSON
- Add peer address to each shared service for attribution
- Handle empty/null responses gracefully

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 11:03:36 +01:00
e1a8413fa7 feat(led): Add safe LED script for MochaBin
- 1 second delay between I2C writes to prevent bus lockup
- Error detection with backoff
- Max 3 consecutive errors then stops
- 10 second update interval
- Commands: start, stop, status, test

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 09:28:39 +01:00
36e61cead8 fix(streamlit): Fix emancipate to use app name not instance name
The emancipate function was checking for app folder existence using
instance name (e.g., "pix") instead of the actual app name
(e.g., "bazi_calculator"). Now properly resolves app from UCI config.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 08:59:18 +01:00
004fc32725 feat(secubox-p2p): Add mesh-sync-packages for simple IPK deployment
Simple tool to sync LuCI resources, views, RPCD handlers, ACLs and
menus from master node to all mesh peers. No IPK rebuild required.

Usage: mesh-sync-packages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 08:49:19 +01:00
06f93297a5 feat(streamlit): Add ACL rules and mesh distribution to emancipate
- Added _emancipate_acl() to create HAProxy ACL routing rules
- Added _emancipate_mesh() to distribute emancipated services to P2P peers
- Added cmd_emancipate_all() for bulk emancipation of all instances
- Emancipate now: DNS + Vortex + HAProxy + ACL + SSL + Mesh + Reload

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 08:48:30 +01:00
c1fa622eee fix(secubox-p2p): Remove invalid 'local' in case statement
BusyBox ash doesn't support 'local' keyword outside functions.
This was causing health_check RPC to hang with no response.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 08:40:14 +01:00
e52fdfc299 fix(secubox-p2p): Fix discoverPeers API method name
Changed P2PAPI.discoverPeers() to P2PAPI.discover() to match the
actual method exposed by the API module.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 08:32:16 +01:00
aa13009f54 fix(luci-app-secubox-p2p): Move menu to admin/services/secubox-p2p
Rename from admin/secubox/mirrorbox to admin/services/secubox-p2p
for consistent URL structure with other service apps.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 08:29:21 +01:00
b4fcccfbf9 feat(luci-app-cloner): Add partition tools to ASU builds
- Add fdisk, resize2fs, partx-utils to ASU package list
- Enables partition expansion on first boot for fresh installs
- Addresses kernel limitation with online ext4 resize

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 08:13:53 +01:00
4ee7fe2143 fix(luci-app-cloner): Fix SSH host key mismatch and button disabled issues
- Fix build button being unclickable by properly handling disabled attribute
  (only set when isBuilding is true, not undefined/false)
- Fix SSH host key mismatch errors in do_scp by cleaning stale known_hosts
  entries from all possible locations (/root/.ssh, /.ssh, /overlay/upper/.ssh)
  before transfers - prevents failures after device reflash
- Add cursor:pointer style to build button for better UX

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 07:45:28 +01:00
b5b2b98b68 feat(luci-app-cloner): Add remote device management and ASU clone builder
- Add remote device management: scan_network, list_remotes, add_remote,
  remove_remote, remote_status, remote_upload, remote_flash RPCD methods
- Add secubox-asu-clone script for on-the-fly firmware generation via
  OpenWrt ASU (Attended Sysupgrade) API
- Include full LuCI packages in ASU builds (luci-base, luci-mod-admin-full,
  luci-mod-network, luci-mod-status, luci-mod-system, etc.)
- Add partition expansion script (10-expand-rootfs) to use full SD card/eMMC
  with proper UUID and boot config handling for both MBR and GPT
- Add robust provisioning script (99-secubox-provision) with network retry,
  firewall handling, and SecuBox package installation from local feed
- Use dropbear's dbclient for SSH operations (OpenWrt native)
- Support mochabin, espressobin-v7, espressobin-ultra, x86-64 devices
- Default to OpenWrt version 24.10.5

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 07:30:36 +01:00
6fee51aed1 feat(streamlit): Add BaZi complete app with dark theme
- Four Pillars of Destiny (八字) calculator with French translations
- Dark theme styling: rgba backgrounds, light text colors
- Maître du Jour section with high contrast green accents
- Five Elements balance visualization
- Ten Gods relationships and yearly analysis

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 06:01:42 +01:00
3b453c495b fix(streamlit): Add poppler-utils for PDF support
Required by pdf2image to convert PDFs to images in apps like pdf_slideshow.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 03:36:07 +01:00
029e0112fb feat(streamlit): Add Tong Shu Chinese Almanac app (wuyun_liuqi)
- Add 通書 Tong Shu almanac with Wu Yun Liu Qi calculations
- Dark theme compatible styling with transparent backgrounds
- French translations for zodiac animals and Chinese terms
- Uses st.html() for proper HTML rendering in Streamlit 1.33+
- Includes: Four Pillars, Day Quality, Clash/Directions, Activities

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 16:00:01 +01:00
a472e755ea feat(gk2hub): Add GK2 Hub landing page generator package
New package secubox-app-gk2hub provides:
- /usr/bin/gk2hub-generate: Dynamic landing page generator
- /www/gk2-hub/index.html: Served via uhttpd

Aggregates services from:
- Streamlit instances (from UCI config)
- MetaBlogizer sites (from /srv/metablogizer/sites/)
- Infrastructure services (hardcoded)

Auto-regenerates on install via postinst script.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 14:41:53 +01:00
9ad45d6b1d feat(haproxy,metablogizer,streamlit): Add GK2 Hub landing page regeneration hooks
Add hooks to auto-regenerate the GK2 Hub landing page when services change:
- haproxyctl: vhost add/remove, reload
- metablogizerctl: publish, delete, emancipate
- streamlitctl: instance add/remove, app delete, emancipate

The gk2hub-generate script dynamically builds the landing page from
HAProxy vhosts, Streamlit instances, and MetaBlogizer sites.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 14:35:51 +01:00
9048f6b53b style(ndpid): Migrate dashboard and flows views to KISS theme
- Remove old secubox-theme and secubox-portal/header dependencies
- Remove external dashboard.css stylesheet
- Replace ndpid/api with direct RPC declarations
- Use KISS classes (kiss-card, kiss-stat, kiss-table, kiss-badge, kiss-btn)
- Add consistent navigation tabs
- Add poll toggle for auto-refresh control
- Use CSS variables (--kiss-blue, --kiss-green, --kiss-muted, etc.)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 13:51:36 +01:00
4ef8fdbe07 style(network-tweaks): Migrate overview.js to KISS theme
- Remove external CSS loading (dashboard.css)
- Convert impact cards to KISS grid with CSS variables
- Update proxy settings cards (AdGuard, CDN Cache, WPAD) to KISS styling
- Convert components grid and cards to KISS theme
- Update sync section and component details modal
- Use KissTheme.E() throughout with consistent styling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 12:14:04 +01:00
7a9de56ba1 style(device-intel): Migrate dashboard views to KISS theme
- dashboard.js: KISS stats grid, source chips, type cards, recent devices table
- devices.js: KISS filter bar, device table with inline actions, edit/detail modals
- emulators.js: KISS emulator cards with status badges, mini tables
- mesh.js: KISS peer cards grid, remote devices table

Removes external CSS loading (cssLink pattern) and di-* class prefixes.
Uses KissTheme.E(), kiss-* classes, and CSS variables throughout.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 12:11:42 +01:00
04325c789f style(haproxy): Migrate acls.js and settings.js to KISS theme
ACLs & Routing (acls.js):
- Removed CSS import, replaced cbi- classes with kiss- classes
- Add ACL form with name, type, pattern, backend selector
- Add Redirect form with match host, target, code options
- KISS-styled tables for ACL and redirect rules
- Delete confirmation modals and toast notifications

Settings (settings.js):
- Removed CSS import, replaced cbi- classes with kiss- classes
- Service settings: enable, ports, max connections, memory, log level
- Statistics dashboard: enable, port, username, password
- Timeouts: connect, client, server, HTTP request, keep-alive, retries
- ACME/Let's Encrypt: enable, email, staging, key type, renew days
- KISS-styled form inputs with grid layout

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 12:06:23 +01:00
1ff116e93d style(haproxy): Migrate overview.js to KISS theme
Rewrote HAProxy Overview dashboard to use KissTheme:
- Removed external dashboard.css loading
- Replaced all hp- classes with kiss- classes
- Emergency banner with service status and controls
- Stats grid with vhosts, backends, certs counts
- System health grid with container/haproxy/config status
- Virtual hosts table preview
- Backends and certificates cards
- Quick actions grid (start/stop/reload/validate/regenerate/stats)
- Connection details with endpoints
- KISS toast notifications

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 12:03:55 +01:00
c5e4d5a903 style(haproxy): Migrate stats.js to KISS theme
Rewrote HAProxy Statistics dashboard to use KissTheme:
- Removed CSS import via style element
- Replaced all hp- classes with kiss- classes
- Stats iframe with KISS-styled border
- Logs viewer with line count selector and refresh button
- Empty state for disabled stats or stopped service
- Consistent styling with vhosts.js and backends.js

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 11:58:22 +01:00
053c49217c style(haproxy): Migrate backends.js to KISS theme
Rewrote HAProxy Backends dashboard to use KissTheme:
- Removed external dashboard.css dependency
- Replaced all hp- classes with kiss- classes and inline styles
- Self-contained inline CSS using KISS variables
- Backend cards with server lists, health check info
- Add backend form with mode, balance, health check options
- Add/edit server modals with quick service selector
- Delete confirmations and toast notifications
- Consistent styling with vhosts.js

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 11:56:22 +01:00
7ea2ff43ba fix(interceptor): Use lxc-info for more reliable container detection
Changed LXC container status detection from lxc-ls to lxc-info:
- lxc-info -n mitmproxy -s provides direct state query
- More reliable than parsing lxc-ls --running output
- Fixed container name from secbx-mitmproxy to mitmproxy

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 11:35:16 +01:00
d5f7da4774 style(haproxy): Migrate vhosts.js to KISS theme
Rewrote HAProxy Virtual Hosts dashboard to use KissTheme:
- Self-contained inline CSS using KISS variables
- Removed external dashboard.css dependency
- Add vhost form with domain/backend/SSL inputs
- Vhosts table with status badges and actions
- Edit modal and delete confirmation dialogs
- Toast notifications for user feedback

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 11:35:11 +01:00
c69ae43961 feat(interceptor,ddos): Add Insider WAF pillar and DDoS hardening profile
InterceptoR Insider WAF (6th pillar):
- RPCD: get_insider_waf_status() tracking LAN client threats
- Dashboard: 🔒 Insider WAF card with threat stats
- CrowdSec scenarios for insider threats:
  - C2 beacon, exfiltration, DNS tunneling, lateral movement
  - Cryptominer, IoT botnet, suspicious TLDs, high volume

DDoS Protection Hardening:
- Config Advisor: 8 DDoS checks (SYN cookies, conntrack, RP filter,
  ICMP rate, CrowdSec http-dos, HAProxy maxconn, mitmproxy WAF, Vortex)
- ANSSI rules: New "ddos" category with remediation steps
- Documentation: DOCS/DDOS-PROTECTION.md with full guide

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 10:46:16 +01:00
1d084b1439 fix(haproxy): Process specific vhosts before wildcard vhosts
HAProxy evaluates ACL rules in order - first match wins. Wildcard
suffix rules (*.gk2.secubox.in) were catching all subdomains before
specific vhost rules could match.

Fix: Split vhost ACL generation into two passes:
1. First: exact and regex matches (specific domains)
2. Second: suffix matches (wildcards)

This ensures wanted.gk2.secubox.in matches before *.gk2.secubox.in

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 10:26:06 +01:00
e364595b16 feat(ai-insights,tor-shield): KISS cyberpunk theme and domain exclusions
AI Insights Dashboard:
- Rewrite CSS with KISS cyberpunk theme (dark bg, neon accents, glowing effects)
- Fix CVE feed RPCD for OpenWrt/BusyBox compatibility (date format, JSON building)
- Add wget fallback for CVE fetch

Tor Shield:
- Add excluded_domains support for bypassing Tor routing
- Resolve domains via nslookup and add to iptables RETURN rules
- Default exclusions: openwrt.org, downloads.openwrt.org, services.nvd.nist.gov

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 10:00:38 +01:00
040b69ad1d feat(ai-insights): Add CVE feed panel to dashboard
- Add get_cve_feed RPCD method fetching from NVD API
- Add CVE feed panel showing recent vulnerabilities with CVSS scores
- Cache CVE feed for 30 minutes to reduce API calls
- Link CVE IDs to NVD detail pages
- Color-code severity (critical/high/medium/low)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 09:43:41 +01:00
4f0e7d7cc4 fix(kiss): Update nav paths and add AI Insights
- Fix Traffic Shaper path to admin/secubox/network/traffic-shaper
- Fix Bandwidth Manager path to admin/secubox/network
- Fix Network Modes path to admin/secubox/network
- Add AI Insights to AI & LLM category
- Add Traffic Shaper sub-tabs (Overview, Classes, Rules, Stats, Presets)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 09:36:42 +01:00
28d781cfc7 fix(cloner): Fix ASU API request format for image building
- Convert packages string to proper JSON array format
- Add -dnsmasq to avoid conflict with dnsmasq-full
- Add rootfs_size_mb: 512 for larger package sets
- Trim default packages to fit in standard rootfs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 09:30:17 +01:00
3e5c246ea8 fix(cloner): Fix RPC unwrapping in refresh() for images/tokens/clones
Same expect unwrapping bug was present in refresh() function,
causing stats to show counts but content to show "No items"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 09:12:30 +01:00
481ba074db fix(cloner): Add build_progress method and fix device list unwrapping
- Add build_progress RPCD method to track image build status
- Fix handleBuild() to handle RPC expect array unwrapping
- The expect: { devices: [] } unwraps the array, so data IS the array

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 09:11:13 +01:00
e5782c1f9c fix(cloner): Add build_progress method to ACL read permissions
The build_progress RPCD method was missing from ACL, causing
"Access denied" (-32002) errors when polling build status.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 08:54:59 +01:00
b1c9abe5cf fix(cloner): Fix empty devices list due to RPC expect unwrapping
RPC declarations with expect: { field: [] } unwrap the response,
so data[n] IS the array, not data[n].field.

Changed:
- this.images = data[1] || []
- this.tokens = data[2] || []
- this.clones = data[3] || []
- this.devices = data[4] || []

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 08:52:44 +01:00
417a572338 feat(streamlit): Auto-create Gitea repo and push on all uploads
- Add gitea push to upload_app (small files)
- Add gitea push to upload_zip
- Add gitea push to save_source (edit)
- Chunked upload already had gitea push

Every app creation/update now automatically:
1. Creates Gitea repo if not exists (streamlit-<name>)
2. Pushes changes to the repo

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 08:50:12 +01:00
fdc7467630 feat(kiss): Add sub-tabs navigation and fix Streamlit reupload
KISS Theme:
- Add expandable sub-tabs under active sidebar items
- Apps with multiple views show nested tabs when active
- Support for CrowdSec, HAProxy, WireGuard, Ollama, Tor Shield,
  CDN Cache, InterceptoR, mitmproxy, Client Guardian

Cloner:
- Full KISS theme rewrite with stats grid, quick actions
- TFTP boot commands with copy button
- Progress tracking for image builds

Streamlit:
- Fix reupload not applying changes - auto-restart service after upload
- Show "Restarting..." spinner during service reload

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 07:36:36 +01:00
9a6aaf8caf fix(kiss): Correct cloner nav path to admin/secubox/system/cloner
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 07:23:07 +01:00
2837cc6551 fix(kiss): Full-width responsive layout
- Add full-width overrides for LuCI containers
- Main content area now uses calc(100% - 220px) width
- Override max-width constraints on body, maincontent, containers
- Better responsive breakpoints for mobile
- Minimized mode uses full width
- Improved table/card sizing at smaller breakpoints

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 07:16:26 +01:00
cd888203c1 feat(kiss): Add Streamlit apps category to navigation
- New Streamlit category with external app links
- France TV, Yijing Oracle, Fabricator, Bazi Complete, SecuBox Control
- External links open in new tab with ↗ indicator
- Support for both internal paths and external URLs in nav items

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 07:04:04 +01:00
2d9beb6f67 feat(kiss): Collapsible multi-level navigation with extended Ollama features
- KISS Theme v2.1: Collapsible nav sections with icons, auto-expand active
- Add comprehensive navigation with all SecuBox apps organized by category
- Fix Client Guardian path to admin/secubox/security/guardian
- Fix Cookie Tracker path to admin/secubox/interceptor/cookies

- Ollama: Add system resources card (RAM/disk usage with progress bars)
- Ollama: Add API endpoints card with copy-to-clipboard
- Ollama: Add container logs viewer with refresh
- Ollama: Add system_info, logs, model_info RPCD methods
- Ollama: Update stats to show RAM/disk usage

- Fix Vortex Firewall menu path to admin/secubox/security

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 06:56:26 +01:00
ea5880a76b feat(theme): Add toggle buttons for KISS chrome visibility
- Add two toggle buttons in bottom-right corner
- 📐/📏 button: Toggle sidebar & top bar on/off
- 👁️ button: Switch between KISS and LuCI mode
- Three viewing modes: Full KISS, Content Only, LuCI
- Add .kiss-chrome-hidden class for minimized mode

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 06:42:31 +01:00
73dabec337 feat(theme): KISS Theme v2.0 with top bar and responsive sidebar
- Add fixed top bar with hamburger menu, logo, breadcrumb, logout
- Collapsible sidebar with scrolling for long menus
- Expanded navigation: Dashboard, Security, Services, Apps, System
- Preserve #tabmenu for internal view tab navigation
- Mobile overlay backdrop for sidebar
- Responsive breakpoints: 1024px, 768px, 480px
- Toggle button moved to bottom-right corner

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 06:33:41 +01:00
498c613466 fix(haproxy): Improve responsive design for mobile devices
- Emergency banner stacks vertically on mobile
- Quick actions use CSS grid (3-col → 2-col)
- Tables get horizontal scroll on narrow screens
- Health grid adapts to 3-col → 2-col on mobile
- Stats grid compact layout on small screens
- Reduced padding and font sizes for mobile

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 06:29:00 +01:00
ee9afc0ccf feat(crowdsec): Add organization column to alerts table
- Add batch IP lookup via ip-api.com for org/ISP info
- Display organization column between Source and Country
- Cache org lookups to avoid repeated requests
- Include organization in search filter
- Skip private IP ranges (192.168.x, 10.x, 127.x)

fix(mitmproxy): Fix null text appearing in status table

- Use concat([]) pattern instead of ternary null returns
- Prevents "null" text from rendering in DOM

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 06:26:26 +01:00
ce9c42bc37 feat(dashboard): Add LAN, BR-WAN, and public IPs to network panel
- Update RPCD get_public_ips to return 4 IP fields:
  - lan_ipv4: br-lan interface IP
  - wan_ipv4: br-wan interface IP
  - public_ipv4: Real public IP (cached from ipify.org)
  - public_ipv6: Global IPv6 from br-wan
- Update dashboard to display 4-column IP grid with icons
- Add responsive CSS for 2x2 layout on small screens

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 06:17:27 +01:00
41fb86ce47 feat(crowdsec): Add Facebook/Meta and Ahrefs to whitelist
Whitelist trusted crawlers to prevent false positive SSRF alerts:
- Facebook/Meta: 69.171.x, 173.252.x, 31.13.x, 157.240.x, etc.
- Ahrefs SEO: 54.39.210.x, 167.114.139.x, 54.36.x

Changed from ip/cidr format to expression format for CrowdSec
compatibility on OpenWrt.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 05:44:48 +01:00
e58f479cd4 feat(waf): Update WAF scenarios with 2024-2025 CVEs and OWASP threats
Add detection patterns for latest actively exploited vulnerabilities:
- CVE-2025-55182 (React2Shell, CVSS 10.0)
- CVE-2025-8110 (Gogs RCE), CVE-2025-53770 (SharePoint)
- CVE-2025-52691 (SmarterMail), CVE-2025-40551 (SolarWinds)
- CVE-2024-47575 (FortiManager), CVE-2024-21887 (Ivanti)
- CVE-2024-3400, CVE-2024-0012, CVE-2024-9474 (PAN-OS)

New attack categories based on OWASP Top 10 2025:
- HTTP Request Smuggling (TE.CL/CL.TE conflicts)
- AI/LLM Prompt Injection (ChatML, instruction markers)
- WAF Bypass techniques (Unicode normalization, double encoding)
- Supply Chain attacks (CI/CD poisoning, dependency confusion)
- Extended SSTI (Jinja2, Freemarker, Velocity, Thymeleaf)
- API Abuse (BOLA/IDOR, mass assignment)

CrowdSec scenarios split into 11 separate files for reliability.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 05:02:57 +01:00
92ec210524 feat(theme): Add global KISS mode support to SecuBox theme
- Add setKissMode(), toggleKissMode(), isKissMode() methods to theme.js
- Add initKissMode() for automatic initialization from localStorage
- Add _injectKissCSS() for dark theme styling
- Add _injectKissSidebar() for C3BOX navigation
- Add _hideChrome()/_showChrome() for toggling LuCI UI elements
- Add kiss-loader.js for standalone auto-initialization
- KISS mode persists via localStorage across all pages

Usage:
1. Click the eye toggle (👁️) on any SecuBox page
2. Or call Theme.setKissMode(true) from JS console
3. Mode persists across page navigation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 12:19:49 +01:00
e6e9867592 fix(interceptor): Fix WPAD DHCP option detection
- Check dhcp_option before dhcp_option_force
- Fix PAC URL extraction using grep -oE

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 12:12:34 +01:00
edca533f07 feat(ui): Apply KISS theme with C3BOX sidebar to SecuBox views
- InterceptoR: Refactor to use shared KissTheme.wrap() module
  - Remove duplicate inline CSS (~200 lines)
  - Use shared theme for sidebar navigation

- IoT Guard: Update to KISS dark theme styling
  - Use KissTheme.wrap() with sidebar
  - Update stat cards to use KISS classes
  - Update device chips and anomaly table styling

- mitmproxy: Add KISS theme wrapper
  - Add KissTheme.wrap() for sidebar navigation
  - Update info card styling to match theme

- System Hub: Update to KISS theme
  - Add KissTheme.wrap() for sidebar navigation
  - Update quick actions to use kiss-btn class
  - Inject KISS-compatible extra styles for cards

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 12:09:42 +01:00
546da471f8 feat(ui): Add C3BOX sidebar navigation to KISS theme
- Add shared navigation config in kiss-theme.js
- Add renderSidebar() method for reusable sidebar
- Add wrap() helper for full page with sidebar
- Update InterceptoR to use sidebar layout
- Responsive: collapses on mobile, icons-only on tablet

Other views can use: KissTheme.wrap([content], 'active/path')

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 12:03:33 +01:00
03e90bb4af feat(ui): Add KISS theme with eye toggle and git status tracking
- Add shared kiss-theme.js module for consistent dark theme across views
- Add eye toggle button (👁️) to switch between KISS and LuCI modes
- Add git repo status methods to luci.gitea RPCD:
  - get_repo_status: branch, ahead/behind, staged/modified files
  - get_commit_history: recent commits with stats
  - get_commit_stats: daily commit counts for graphs
- Update InterceptoR overview with KISS styling and responsive grid
- Fix quick links paths (network-tweaks → admin/network/)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 12:00:00 +01:00
1ab19cb778 fix(interceptor): Fix RPCD handler shell syntax error
Remove 'local' keyword from case statement block where it's not
allowed in POSIX shell. Replace && block conditions with proper
if/then/fi statements for health score calculation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 11:51:53 +01:00
af622285ed feat(portal): Add login button and LuCI tree navigation
- Add login/logout button in topbar (detects session state)
- Add collapsible LuCI Quick Nav tree in left sidebar
- Add LuCI Tree screen with grid view of all module links
- 7 categories: Core, Security, Network, Services, Monitoring, System, P2P

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 11:46:47 +01:00
8e2a4c47de fix(iot-guard): Add default UCI config file
Add /etc/config/iot-guard with default settings so the Settings
page loads without RPC errors. Includes main config, zone policy,
allowlist, and blocklist sections.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 11:42:03 +01:00
9be3da58be fix(portal): Simplify LuCI tree view for better compatibility
- Rewrite using standard LuCI view pattern matching other portal views
- Use simple data array structure instead of nested objects
- Add proper event listener for search filter
- Organize 90+ links into 17 categories
- Fix JavaScript errors on public endpoint

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 11:27:07 +01:00
13c1e596d2 feat(core): Add 3-tier stats persistence and LuCI tree navigation
Stats Persistence Layer:
- Add secubox-stats-persist daemon for never-trashed stats
- 3-tier caching: RAM (/tmp) → buffer → persistent (/srv)
- Hourly snapshots (24h), daily aggregates (30d)
- Boot recovery from persistent storage
- Heartbeat line: real-time 60-sample buffer (3min window)
- Evolution view: combined influence score over time

RPCD Stats Module:
- get_timeline: 24h evolution for all collectors
- get_evolution: combined influence score timeline
- get_heartbeat_line: real-time 3min buffer
- get_stats_status: persistence status and current values
- get_history: historical data per collector
- get_collector_cache: current cache value

LuCI Tree Navigation:
- Add clickable tree of all 60+ SecuBox LuCI apps
- Organized by category: Security, Network, Monitoring, Services, etc.
- Real-time search filter
- Available at /secubox-public/luci-tree and /admin/secubox/luci-tree

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 11:23:27 +01:00
8055bca368 feat(interceptor): Add InterceptoR transparent traffic interception
The Gandalf Proxy - unified traffic interception with 5 pillars:

New packages:
- secubox-cookie-tracker: HTTP cookie classification with mitmproxy addon
  - SQLite database for cookie tracking
  - 100+ known tracker domains (Google Analytics, Facebook, etc.)
  - CLI: cookie-trackerctl status/list/block/report

- luci-app-interceptor: Unified dashboard aggregating all pillars
  - Health score (0-100%) based on active pillars
  - Status cards: WPAD, mitmproxy, CDN Cache, Cookie Tracker, API Failover

Enhanced modules:
- luci-app-network-tweaks: WPAD enforcement via iptables redirect
  - setWpadEnforce/getWpadEnforce RPCD methods
  - Catches clients ignoring WPAD auto-discovery

- luci-app-cdn-cache: API failover and offline mode
  - stale-if-error patterns for /api/ and .json endpoints
  - WAN hotplug script (99-cdn-offline) toggles offline mode
  - collapsed_forwarding for duplicate request handling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 10:58:53 +01:00
8ef0c70d0f feat(iot-guard): Add IoT device isolation and security monitoring
Backend (secubox-iot-guard):
- OUI-based device classification with 100+ IoT vendor prefixes
- 10 device classes: camera, thermostat, lighting, plug, assistant, etc.
- Risk scoring (0-100) with auto-isolation threshold
- Anomaly detection: bandwidth spikes, port scans, time anomalies
- Integration with Client Guardian, MAC Guardian, Vortex Firewall
- iot-guardctl CLI for status/list/scan/isolate/trust/block
- SQLite database for devices, anomalies, cloud dependencies
- Traffic baseline profiles for common device classes

Frontend (luci-app-iot-guard):
- KISS-style overview dashboard with security score
- Device management with isolate/trust/block actions
- Vendor classification rules editor
- Settings form for UCI configuration
- RPCD handler with 11 methods
- Public ACL for unauthenticated dashboard access

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 10:36:04 +01:00
0544adbee6 fix(portal): Hide all LuCI chrome for full viewport
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 10:13:31 +01:00
3ac0a31cea feat(portal): C3BOX async progressive rendering with public ACL
- Async progressive cache: instant render from localStorage, async RPC updates
- Public ACL: unauthenticated access for secubox-public/portal route
- Progressive DOM updates via updateText() helpers
- No blocking Promise.all - each fetch updates its section on completion

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 10:07:22 +01:00
11e444e0f7 feat(luci): KISS rewrite for System Hub and SecuBox Dashboard
- System Hub overview.js: self-contained with inline CSS, 6 status cards
  (hostname, uptime, services, CPU, temp, health score), 3 resource bars,
  quick actions, services table, 5s polling, dark mode

- SecuBox dashboard.js: removed external deps (api, theme, nav, header),
  inline CSS, header chips, stats cards, health panel, public IPs,
  modules table, quick actions, alerts timeline, 15s polling, dark mode

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 09:28:17 +01:00
64648db2ec feat(vortex-firewall): Add BIND RPZ support for DNS blocking
Auto-detects DNS server (BIND vs dnsmasq) and generates appropriate
blocklist format:
- BIND: Response Policy Zone (RPZ) with NXDOMAIN responses
- dnsmasq: addn-hosts sinkhole file (existing)

Tested with 46,067 blocked domains on BIND named server.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 08:15:26 +01:00
2c21226043 fix(dnsguard): Fix detector status UCI path in RPCD handler
The handler was looking for dns-guard.detector_${det}.enabled but
UCI config uses dns-guard.${det}.enabled (without detector_ prefix).

This caused all detectors to show as Disabled in the dashboard.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 07:42:37 +01:00
7f3260c025 fix(vortex-firewall): Optimize feed import and fix data validation
- Replace defunct malwaredomains feed with ThreatFox (abuse.ch)
- Add is_valid_domain() function to validate domain format
- Optimize intel_merge() with batch SQL transactions
- Previous: 765 domains with invalid entries (HTML parsing artifacts)
- Now: 46,056 valid domains from 3 feeds (URLhaus, OpenPhish, ThreatFox)

Performance: Batch import completes in seconds vs minutes for 45K+ domains.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 07:22:28 +01:00
a3d89ce6f6 feat(luci-app-vortex-firewall): Add LuCI dashboard for DNS firewall
KISS-style dashboard for Vortex DNS Firewall with:
- Status cards: Active state, Blocked Domains, Total Blocks, x47 Impact
- Quick actions: Update Feeds, Block Domain, Search Domain
- Threat intelligence feeds table with domain counts and update times
- Top blocked domains table with threat badges
- Threat distribution visualization
- Live polling (10s) for real-time stats updates
- Dark mode support

Menu: Services > Vortex DNS Firewall

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 07:09:44 +01:00
d2953c5807 feat(vortex-firewall): Add DNS-level threat blocking with x47 multiplier
Phase 1 implementation of Vortex DNS Firewall - SecuBox's first line
of defense blocking threats at DNS level BEFORE any connection is
established.

Features:
- Threat intel aggregator (URLhaus, OpenPhish, Malware Domains)
- SQLite-based blocklist database with domain deduplication
- dnsmasq integration via sinkhole hosts file
- x47 vitality multiplier concept (each DNS block prevents ~47 connections)
- RPCD handler for LuCI integration with 8 methods
- CLI tool: vortex-firewall intel/stats/start/stop

Tested with 765 blocked domains across 3 threat feeds.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 06:58:02 +01:00
750f79db3c feat(cloner): Add multi-device image support
- Support building images for: mochabin, espressobin-v7, espressobin-ultra, x86-64
- New CLI: secubox-cloner build --device espressobin-v7
- New CLI: secubox-cloner devices (list supported devices)
- RPCD: list_devices method, build_image accepts device_type param
- LuCI: Device selection dropdown in build modal
- LuCI: Device column in images table with badges
- Each device type has its own TFTP image file

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 06:17:12 +01:00
06d9d08f86 feat(luci-app-cloner): Add cloning station LuCI dashboard
- Dashboard with status cards: device, TFTP, tokens, clones
- Quick actions: Build Image, Start/Stop TFTP, Token generation
- Clone images table with size and TFTP-ready status
- Token management with auto-approve option
- U-Boot flash commands display when TFTP is running
- RPCD handler with 10 methods for full cloner management

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 05:13:33 +01:00
0e5965dd6c fix(client-guardian): Restore original menu path 2026-02-10 20:07:22 +01:00
e3d7873d7b fix(dashboard): Fix empty recent_visitors due to subshell issue
- Pipe | while runs in subshell, json_add calls don't affect parent
- Use temp files to avoid subshell: write data to file, then read
- Fixed https_visitors, top_endpoints, recent_visitors arrays
- All arrays now properly populated with visitor data

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 12:12:20 +01:00
c731058b01 fix(crowdsec-dashboard): Fix decision count in get_overview
- Replace --no-api + jsonfilter with jq length for counting
- jsonfilter cannot properly count JSON arrays
- --no-api flag returns empty results
- Applied fix to both get_overview() and stats functions
- Active Bans now shows correct count (was showing 0)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 12:08:01 +01:00
46655a2dca feat(metrics): Make dashboard live with 3-second polling
- Add poll.add() for continuous 3-second updates
- Use data-attributes for efficient DOM targeting
- Add CSS pulse animation on value changes
- Add live indicator with timestamp
- Implement updateValue, updateBar, updateList methods
- No page rebuilds - direct element text updates
- KISS and fast real-time metrics

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 11:51:15 +01:00
d8578653b4 feat(metrics): Add active sessions panel to SecuBox Metrics
- Add get_active_sessions RPCD method to dashboard module
- Display session counts: Tor circuits, HTTPS, Streamlit, Mitmproxy, SSH
- Add ACTIVE SESSIONS panel with yellow/gold theme
- Add RECENT VISITORS panel showing visitor IPs and countries
- Add TOP ENDPOINTS panel showing accessed paths
- Add ACL permissions for get_active_sessions
- Auto-refresh with other metrics every 10 seconds

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 11:45:29 +01:00
dd6ecd2567 fix(crowdsec-dashboard): Fix decision count showing 0
- Remove --no-api flag which returned empty results
- Use jq length instead of jsonfilter for counting arrays
- Add grep fallback when jq is not available
- Count all decisions, alerts, and bouncers correctly

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 11:28:28 +01:00
947182ae54 feat(metrics): Add web traffic country stats to SecuBox Metrics
- Add callGetVisitStats RPC from security-threats API
- Add WEB TRAFFIC section with total requests, bots/humans counts
- Display country flags and visit counts for top 8 countries
- Add TOP HOSTS section showing top 5 visited hosts
- Green color theme for traffic sections

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 10:46:26 +01:00
bda567ed98 feat(security-threats): Add visit stats with country and URL metrics
- Add get_visit_stats RPCD method parsing mitmproxy threats.log
- Returns total requests, by_country, by_host, by_type, by_severity,
  bots_vs_humans breakdown, and top_urls (all top 10)
- Add callGetVisitStats RPC declaration to api.js
- Add renderVisitStats function to dashboard with traffic analytics grid
- Shows traffic breakdown by country, host, and URL patterns

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 10:40:30 +01:00
7dd5f7cb8e feat(luci): Add SecuBox Metrics view under Status menu
New LuCI view at Status > SecuBox Metrics showing:
- System health (load, CPU, uptime)
- Resources (memory, disk)
- Services (HAProxy, sites, apps, Tor)
- Network connections
- Security stats (CrowdSec bans, attacks, countries)

Auto-refreshes every 10 seconds with cyberpunk styling.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 10:27:55 +01:00
b1c22b7f10 feat(dashboard): Add system overview infographic to LuCI admin
- Add get_system_overview RPCD method
- Add renderSystemOverview to admin dashboard.js
- Display system health, resources, services, network, security stats
- Styled with cyberpunk theme

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 10:21:15 +01:00
0f5fc39778 feat(core): Add secubox-dashboard system infographic tool
New CLI tool for system overview:
- Console mode: ASCII formatted dashboard
- JSON mode: Structured data for LuCI integration

Displays:
- System health (load, CPU, memory, disk)
- Services (HAProxy, MetaBlogizer, Streamlit, Tor)
- Network connections (total, Tor, HTTPS)
- Security stats (CrowdSec bans, attack types, countries)

Usage: secubox-dashboard [console|json]

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 10:11:29 +01:00
54113d8454 feat(gitea): Create repositories as private by default
Changed default visibility from public to private for new Gitea
repositories created by metablogizerctl and streamlitctl.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 08:22:33 +01:00
90f555f38a fix(secubox-core): Remove metablogizer from LXC watchdog
MetaBlogizer uses per-site uhttpd instances, not LXC containers.
The watchdog was incorrectly treating it as an LXC service and
constantly trying to restart a non-existent container.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 07:43:20 +01:00
d01aa59726 fix(streamlit): Fix typo n# -> # in RPCD handler
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 07:27:36 +01:00
7c1c3993e0 feat(gitea): Auto-push to Gitea after file uploads
- Add automatic Gitea push after upload_finalize in Streamlit RPCD
- Add automatic Gitea push after upload_finalize in MetaBlogizer RPCD
- Fix MetaBlogizer to use site name instead of UCI section ID for push
- Fix metablogizerctl to read Gitea config from dedicated gitea section

Uploaded files via LuCI are now automatically synced to Gitea repos.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 07:13:47 +01:00
c1c91f1227 feat: Auto-Gitea integration for apps and sites
Streamlit:
- App create/deploy now auto-pushes to Gitea when enabled
- Add 'gitea init-all' command to initialize repos for all existing apps
- Scans all app directories and creates Gitea repos

MetaBlogizer:
- Site create now auto-pushes to Gitea when token configured
- Add 'gitea init-all' command to initialize repos for all existing sites
- Iterates over UCI site configs and syncs to Gitea

Usage:
  # Configure Gitea once
  uci set streamlit.gitea.enabled=1
  uci set streamlit.gitea.url='http://192.168.255.1:3000'
  uci set streamlit.gitea.user='admin'
  uci set streamlit.gitea.token='<token>'
  uci commit streamlit

  # Initialize all existing apps/sites
  streamlitctl gitea init-all
  metablogizerctl gitea init-all

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 06:47:09 +01:00
364f19d421 feat: Add Gitea auto-push and fix Tor Shield server mode
Streamlit/MetaBlogizer:
- Add 'gitea push <name>' command to both streamlitctl and metablogizerctl
- Auto-creates Gitea repo via API if it doesn't exist
- Initializes git, commits all files, and pushes to Gitea
- Stores repo reference in UCI for future syncs

Tor Shield:
- Add 'wan_input_allow' option for server preset
- Server mode now properly allows WAN inbound (ports 80, 443, 8443)
- Uses nftables rules to integrate with OpenWrt firewall4
- Outbound traffic still routed through Tor (kill_switch)
- Cleanup nftables rules on stop/disable

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 06:42:50 +01:00
a694241604 fix(crowdsec): Fix alerts extraction in overview collector
Replace failing awk-based JSON parsing with jsonfilter per-alert extraction.
Alerts now correctly populate in CrowdSec dashboard.

Changes:
- Use jsonfilter to extract created_at, scenario, source_ip per alert
- Loop through up to 8 alerts with index-based access
- Remove Python dependency (not available on OpenWrt)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 06:07:57 +01:00
8b1c82ab5c fix(luci-mitmproxy): Fix alerts field mapping in Recent Alerts
Backend uses timestamp/source_ip but JS was looking for time/ip.
Fixed field mappings:
- timestamp -> time display
- source_ip -> ip display
- request -> details fallback

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 05:04:48 +01:00
32e744a808 fix(luci-mitmproxy): Add Recent Alerts section to status page
Alerts data was loaded but not displayed. Added new section showing:
- Time, IP, country, type, severity, details
- Limited to 25 most recent alerts
- Clear alerts button
- Proper severity colors and icons

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 04:59:36 +01:00
744123b615 docs: Update FAQ with HAProxy SNI/certs.list troubleshooting
- Add HAProxy multi-domain SSL certificate matching issue
- Document crt-list solution for SNI issues
- Minor updates to settings and streamlit readme

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-09 16:49:02 +01:00
d76e26ed52 feat(cloner): Add U-Boot power-on intercept mode
- Add uboot_poweron_intercept() for aggressive boot interception
- Sends continuous break chars while monitoring for Marvell>> prompt
- Supports modes: break (default), poweron, wait
- Uses Python serial for precise timing and pattern detection
- Updates secubox-cloner with improved serial handling

Usage: ./secubox-clone-station.sh uboot /dev/ttyUSB0 poweron

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-09 16:48:36 +01:00
ee9a54b0a5 fix(waf): Add LuCI whitelist and moderate sensitivity mode
- Add TRUSTED_PATH_PREFIXES for LuCI, ubus, and CGI paths
- Fix moderate mode to always require threshold (3 attempts in 5 min)
  instead of immediate ban on critical threats
- Add WireGuard endpoint whitelist support to prevent VPN peer bans
- New script: mitmproxy-sync-wg-endpoints extracts peer IPs from UCI
- Bump version to v2.4

Prevents accidental bans from legitimate external LuCI login attempts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-09 16:47:17 +01:00
2c7b92219e feat(mitmproxy): Add Active Bans panel to dashboard
Shows all CrowdSec bans with:
- IP address, reason, source (WAF/CrowdSec), country, expiration
- Summary counts: total, WAF autobans, CrowdSec detections
- Unban button for each entry with confirmation dialog
- Empty state when no bans active

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-09 07:24:39 +01:00
e9ef4a0e7e feat(mitmproxy): Add bans list and unban RPCD methods
New methods for threats monitor dashboard:
- bans: Get CrowdSec decisions with counts by source
  Returns total, mitmproxy_autoban, crowdsec counts + full bans array
- unban: Remove ban by IP address

Updates ACL to include new methods for LuCI access.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-09 07:21:58 +01:00
d0d060add1 feat(haproxy): Add dynamic path ACL management commands
New haproxyctl path commands:
- path list: Show all path ACLs with patterns and backends
- path sync <prefix> <host>: Auto-generate ACLs from all backends
  Extracts short name from backend (metablog_X -> X, streamlit_Y -> Y)
  Skips existing ACLs, only adds new ones
- path add: Manually add single path ACL
- path remove: Remove specific path ACL
- path clear: Remove all ACLs matching prefix

This enables dynamic route updates when backends change.
Example: haproxyctl path sync /gk2 secubox.in

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-09 06:56:54 +01:00
5ccba836fa fix(haproxy): Sort path ACLs by length for correct matching order
Path-based ACLs are now sorted by pattern length (longest first) before
being emitted to haproxy.cfg. This ensures specific paths like /gk2/evolution
match before general paths like /gk2.

Two-phase approach:
- _collect_path_acl() stores ACL data with pattern length prefix
- _emit_sorted_path_acls() sorts by length descending and emits rules

Enables apex domain path routing: secubox.in/gk2/** instead of *.gk2.secubox.in

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-09 06:37:25 +01:00
c28200fdd5 feat(haproxy): Add path-based ACL routing support
- Add _add_path_acl() function to process UCI 'acl' sections
- Support path_beg, path_end, path, path_reg, path_dir match types
- Path ACLs are processed before vhost ACLs (higher priority)
- Fix http_request list handling to avoid duplicate output
- Enables gk2.secubox.in/evolution routing to streamlit_evolution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 11:55:38 +01:00
c0cab9ae36 fix(jitsi): Use LAN IP instead of localhost for backends
- jitsi_web: 127.0.0.1:8443 → 192.168.255.1:8443
- jitsi_xmpp: 127.0.0.1:5280 → 192.168.255.1:5280

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 11:36:58 +01:00
dde2e12568 feat(haproxy): Add wildcard domain support and Vortex hub
- Support suffix matching for wildcard domains (*.domain.tld)
- Add match_type option: exact, suffix, regex
- Enable subdomain-to-path mapping for mesh publishing
- Prepare infrastructure for distributed Vortex DNS nodes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 11:27:14 +01:00
a661c9bea8 feat(luci-mitmproxy): Replace alerts with subdomain metrics view
- Display per-subdomain request/threat counts
- Show protocol distribution (HTTP/HTTPS)
- Show top URIs and countries per domain
- Sort by request count, limit to top 25

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 11:18:43 +01:00
46af1ccdd1 feat(mitmproxy): Add subdomain-based WAF metrics tracking
- Track requests, threats, protocols per subdomain
- Record HTTP methods, status codes, top URIs, countries
- New RPCD method: subdomain_metrics
- Metrics auto-saved to /tmp/secubox-subdomain-metrics.json
- Add wan_setup/wan_clear to ACL write permissions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 11:15:04 +01:00
e6b65679a4 feat(haproxy): Add presse.cybermood.eu vhost
- Add vhost for presse.cybermood.eu
- Add backend cybermood_presse on port 4001
- Add ACME certificate entry
- Add ACL routing rules
- Fix backends to use LAN IP (192.168.255.1) instead of localhost

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 10:52:09 +01:00
a7521d6274 feat(haproxy): Add cybermood.eu vhost configuration
- Add vhost entries for cybermood.eu and www.cybermood.eu
- Add backend configuration (cybermood_web on port 4000)
- Add ACME certificate entries for SSL
- Add ACL routing rules in template
- Switch to crt-list for multi-certificate SNI support

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 10:35:11 +01:00
e28f7b952f refactor(secubox-core): Modularize luci.secubox RPCD handler
Split 2544-line monolithic handler into thin dispatcher + 14 modules:
- _common.sh: Shared utilities (json_success, check_service_running, etc.)
- core.sh: getStatus, getVersion, reload
- modules.sh: Module management (install, remove, update)
- profiles.sh: Profile management
- snapshots.sh: Snapshot/recovery
- health.sh: Health & diagnostics
- dashboard.sh: Dashboard data & quick actions
- appstore.sh: AppStore & catalog operations
- state.sh: Component state management
- network.sh: WAN access, services, proxy mode
- feeds.sh: Feed management
- skills.sh: Skill management
- feedback.sh: Issue/resolution tracking
- p2p.sh: P2P hub operations

Benefits:
- Each module is focused on a single domain
- Easier to maintain, test, and debug
- New features can be added as new modules

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 09:45:13 +01:00
872038341a feat(evolution): Real-time sync for all tabs (60s cache)
- Changed fetch_file() TTL from 300s to 60s
- All tabs now refresh every minute like Devel tab
- Updated footer to reflect unified refresh interval

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 07:53:29 +01:00
7aab04d012 feat(evolution): Add real-time GitHub commits display
- New "🚀 Devel" tab with live GitHub commit activity (1-min cache)
- Metrics: Commits Today, This Week, Contributors, Stars
- Commit type distribution (feat/fix/docs/refactor/chore)
- Recent commits list with hash, message, author, relative time
- Repository stats: forks, watchers, open issues
- Cyberpunk-themed commit cards with color-coding
- Pulsing live indicator animation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 07:15:05 +01:00
8015d790e0 feat(cloner): Add SecuBox Station Cloner/Deployer
Host-side orchestrator (secubox-clone-station.sh):
- Dual USB serial control with MOKATOOL integration
- ASU API firmware building for clone images
- TFTP serving with auto-generated U-Boot commands
- Full workflow: detect → pull → flash → verify

On-device CLI (secubox-cloner):
- Build ext4 images for same device type
- TFTP server management via dnsmasq
- Clone token generation with auto-approve
- Integration with master-link mesh onboarding

First-boot provisioning (50-secubox-clone-provision):
- Partition resize to full disk (parted + resize2fs)
- Master discovery via mDNS/network scan
- Automatic mesh join with pre-approved tokens

Master-link enhancements:
- ml_clone_token_generate() for 24h auto-approve tokens
- ml_token_is_auto_approve() for token type detection
- Auto-approve logic in join request handler

SecuBox CLI additions:
- secubox clone (build, serve, token, status, list, export)
- secubox master-link (status, peers, token, join, approve)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 06:52:59 +01:00
320277b87f fix(haproxy): Add proc/sys mount to LXC config for lxc-attach
The HAProxy LXC container was missing lxc.mount.auto = proc:mixed sys:ro
which caused lxc-attach to fail with "mount -t proc proc /proc" error.

This prevented the LED watchdog from checking HAProxy status via
lxc-attach -n haproxy -- pgrep haproxy, triggering false SPUNK alerts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 06:24:09 +01:00
ab34719f9f feat(secubox-core): Add secubox-landing page generator
- Add secubox-landing script to generate landing pages from HAProxy vhosts
- Integrate landing command into secubox CLI
- Add boot hook to regenerate landing pages on startup
- Fix HAProxy multi-cert SNI using crt-list instead of directory mode
- Fix backend IPs from 127.0.0.1 to 192.168.255.1 for LXC compatibility
- Auto-convert localhost IPs in RPCD handler and CLI tools

Landing page features:
- Groups all services by zone with stats header
- Shows SSL certificate status per domain
- Categorizes by type: Streamlit, Blog, Admin, Media, Dev, etc.
- Regenerates at boot (30s after startup)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 06:15:37 +01:00
bfd2ed7c1f feat(fabricator): Add Widget Fabricator Streamlit app with live data
SecuBox Fabricator - Universal Constructor for SecuBox Components:
- Main dashboard with live stats from UCI and JSON cache
- Collectors page: manage stats scripts, view/run collectors, JSON cache
- Apps page: Streamlit instance management with test/restart/deploy
- Blogs page: MetaBlogizer site management from UCI config
- Services page: HAProxy vhosts/backends, Peek/Poke/Emancipate
- Widgets page: dashboard widget designer with live stats preview

All pages now use actual live data from UCI configs and /tmp/secubox/*.json

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 11:05:09 +01:00
9884965e2b feat(heartbeat): Add DNS, BIND, CrowdSec health monitoring
- Add DNS resolution test to heartbeat status
- Include BIND, CrowdSec, HAProxy, mitmproxy service checks
- Add security metrics (crowdsec_bans, dns_response)
- Improve health score calculation with all services

Router changes (not in repo):
- Enabled BIND recursion with forwarders (9.9.9.9, 1.1.1.1)
- Added BIND query/security logging
- Added CrowdSec acquisition for BIND logs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 10:12:52 +01:00
adec1144d6 feat: Streamlit ZIP flatten, mitmproxy bot whitelist, Fabricator app
- Add extract_zip_flatten() to Streamlit RPCD for nested ZIP handling
- Add bot whitelist to mitmproxy WAF (Facebook, Google, Bing crawlers)
- Skip threat detection for whitelisted legitimate crawlers
- Track Fabricator app and stats evolution in HISTORY.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 09:59:20 +01:00
a00f4b6b84 feat(secubox-core): Add detail collector for LuCI flash views
- Creates double-buffered JSON caches with last N entries
- Caches: threats, kernel, syslog, crowdsec details
- Writes to /tmp/secubox and /www for LuCI access
- Cron runs every minute for real-time updates
- Usage: secubox-detail-collector [count] [type]

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 09:03:36 +01:00
e31e43b8d7 feat(mitmproxy): Add modular WAF rules with CVE patterns and autoban fixes
- Add waf-rules.json with 46 patterns across 8 categories:
  - sqli, xss, lfi, rce (OWASP Top 10)
  - cve_2024 (recent CVE exploits)
  - scanners, webmail, api_abuse
- Add waf_loader.py dynamic rules loader module
- Add mitmproxy-waf-sync UCI to JSON config sync script
- Fix GeoIP: install geoip2 package in container
- Fix autoban: add cron job, lower min_severity to "high"
- Enable WAF for webmail (mail.secubox.in)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 07:46:26 +01:00
58b6dc1d2a fix(crowdsec-dashboard): Fix Threat Origins displaying [object Object]
parseCountries() now correctly handles countries as array of objects
[{country: "US", count: 67}, ...] instead of only plain {US: 67} format.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 06:34:27 +01:00
82fb9c7d42 feat(haproxy): Add End of Internet fallback page and http-request support
- Create cyberpunk-style End of Internet page for unknown domains
- Add http-request UCI option support in haproxyctl generator
- Support path rewriting backends with http-request set-path
- Configure end_of_internet as default backend for both frontends
- Update docs with HAProxy enhancements (entry #59)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 05:37:39 +01:00
e25509cb90 fix(haproxy): Validate backend names, reject IP:port misconfiguration
Add validation in _add_vhost_acl() to detect when vhost backend
is set to IP:port format instead of a proper backend name.

This prevents haproxy config generation errors like:
  [ALERT] unable to find required use_backend: '127.0.0.1:8081'

When detected, logs a warning and skips the vhost instead of
generating invalid config that crashes HAProxy.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 22:30:38 +01:00
549c0425e7 feat: Stats evolution, LED tri-color pulse, Widget Fabricator
Stats Collection:
- Add unified secubox-stats-collector for crowdsec/mitmproxy/firewall
- Add secubox-status-json and metablogizer-json for landing page
- JSON cache files in /tmp/secubox/ for double-buffer status

LED Pulse Daemon:
- Tri-color status sync matching control panel (Health/CPU/Memory)
- SPUNK ALERT mode for critical service failures (HAProxy/CrowdSec down)
- Integrated into secubox-core init.d for auto-start on boot

Landing Page:
- Add Blogaliser section with MetaBlogizer sites
- Add health indicators (green/yellow/red status dots)
- Add security stats (dropped, bans, connections)

Streamlit Enhancements:
- Add test_upload RPCD method for upload validation
- Add reupload button for replacing existing apps
- Add secubox_control.py reading from cache (LXC-compatible)
- Update ACL and API for new methods

HAProxy Fixes:
- Fix invalid use_backend entries (IP:port -> backend names)
- Add streamlit_hello backend
- Save routing to UCI config for persistence

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 20:43:45 +01:00
7b77f839a9 fix(secubox-core): BusyBox-compatible LED pulse (no fractional sleep)
BusyBox sleep doesn't support fractional seconds (0.33s fails).
Changed to rapid triple-pulse burst then 3s rest:
- Beat1 (LED1) → Beat2 (LED2) → Beat3 (LED3) in quick succession
- Shell overhead (~50ms) provides inter-beat timing
- 3 second sleep between cycles

Pattern visible on MochaBin RGB LEDs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 17:36:24 +01:00
aab58a2b43 fix(secubox-core): Adjust LED pulse timing to 0.33s (tiers de second)
Changed LED heartbeat tick interval from 0.15s to 0.33s for more
visible pulse pattern. Adjusted cycle pause from 8 to 6 ticks.

Triple-pulse cycle now spans ~4 seconds total:
- 3 beats + 2 gaps + 6 rest = 11 ticks × 0.33s = ~3.6s

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 17:26:52 +01:00
22caf0c910 feat(streamlit): Add emancipate command for KISS ULTIME MODE exposure
Adds full exposure workflow for Streamlit apps:
- DNS A record registration (Gandi/OVH via dnsctl)
- Vortex DNS mesh publication
- HAProxy vhost with SSL and backend creation
- ACME certificate request
- Zero-downtime HAProxy reload

Usage: streamlitctl emancipate <app> [domain]
Domain auto-generated from vortex wildcard if not specified.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 17:26:45 +01:00
a47ae9656c feat(secubox-core): Add triple-pulse LED heartbeat with staggered cascade
Implements organic "bump-bump-bump (pause)" pattern across 3 RGB LEDs:
- LED1 (health) leads the pulse sequence
- LED2 (threat) follows with offset timing (décalé)
- LED3 (capacity) trails as final beat in cascade
- Smooth intensity transitions between beats
- Subtle breathing effect during rest period
- Event pulse override preserved for alerts

Pattern timing: beat1 → gap → beat2 → gap → beat3 → rest (0.15s ticks)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 17:22:49 +01:00
301dccec33 fix(secubox-core): Prevent duplicate avahi-publish processes in mesh discovery
Track avahi-publish PID in /tmp/secubox-avahi-mesh.pid and check if process
is still running before spawning a new one. Prevents process accumulation
when discover_peers() is called repeatedly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 17:21:07 +01:00
0a3b1dfc6e feat(secubox-core): Add double-buffer status cache and fix LED blocking
- Remove mmc0 LED from heartbeat loop (was causing LED freeze)
- Implement background status_collector_loop() with staggered intervals
- Add 10 cache files at /tmp/secubox/*.json for instant status reads
- Add status_cached RPCD methods to 6 packages:
  - luci.crowdsec-dashboard
  - luci.mitmproxy
  - luci.secubox-netifyd
  - luci.client-guardian
  - luci.mac-guardian
  - luci.network-anomaly

Dashboards and APIs now read pre-computed JSON cache instead of
spawning subprocesses, eliminating blocking during concurrent requests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 16:34:35 +01:00
f70d5cce79 fix(mailserver): Align Postfix/Dovecot mail paths for Roundcube visibility
- Change mount point from var/mail to home/vmail for proper Dovecot integration
- Update virtual_mailbox_base from /var/mail to /home/vmail
- Create Maildir/{cur,new,tmp} structure matching Dovecot's mail_location
- Fix vmailbox entries to include Maildir/ suffix
- Update vmail user home directory to /home/vmail

This resolves the issue where emails delivered by Postfix were not visible
in Roundcube because Dovecot was looking in ~/Maildir/ subdirectory.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 12:15:47 +01:00
a2dd2499d6 feat(secubox-core): Add file integrity monitoring
- secubox-integrity: SHA256-based file integrity checker
- Monitors critical files: haproxy.cfg, firewall, network, passwd, shadow
- Cron job runs check every 5 minutes
- LED pulse alert on file changes
- Commands: init, check, status, clear

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 11:07:24 +01:00
29ba711acc feat(secubox-core): Add 4-LED dashboard with dedicated functions
LED assignment for MochaBin:
- led1: Global health status (green/yellow/red with pulse variations)
- led2: Security threat meter (CrowdSec + mitmproxy activity)
- led3: Global capacity (CPU + Network combined, color gradient)
- mmc0: Classic heartbeat when stable, rapid blink on state changes

Features:
- Fast 1.5s heartbeat loop for reactive visual feedback
- Health score from services (HAProxy, CrowdSec) + memory/disk
- Threat level from CrowdSec alerts and mitmproxy stats
- Combined CPU load + network throughput capacity meter
- Event pulse system for config/task/alert notifications
- State change detection for mmc0 stability indicator

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 10:41:50 +01:00
52d982218a feat(streamlit): Add SecuBox Evolution Dashboard
Interactive Streamlit landing page showing project evolution:
- Real-time sync with GitHub master (HISTORY.md, WIP.md, TODO.md, README.md)
- Milestone tracking with dates and timeline view
- Full-text search across all project files
- Feature distribution charts
- Dark cyberpunk theme matching SecuBox design

Deployed on port 8510, added to GK2 landing page.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 09:54:59 +01:00
5205b3b2bd feat(secubox-core): Add LED heartbeat for MochaBin and Vortex services dashboard
- Add LED heartbeat to secubox-core daemon using MochaBin's RGB LEDs (led1)
  - Green flash: system healthy
  - Double red flash: warning state
  - Long red flash: error state
  - Blue flash: boot/startup
- LED pulses once per watchdog cycle (default 60s)
- New UCI options: led_heartbeat (default 1), watchdog_interval (default 60)
- Add "Node Services" section to Vortex DNS LuCI dashboard showing published sites
- Bump secubox-core version to 0.10.0-r12

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 09:38:13 +01:00
e3784537c3 fix(emancipate): Multi-zone DNS and hyphenated site names
- Add -z/--zone option to dnsctl for zone override
- Detect correct DNS zone from domain suffix (secubox.in, maegia.tv, cybermind.fr)
- Register on both published domain zone AND vortex node subdomain
- Fix hyphenated site names (e.g., bazi-weekly) in UCI lookups

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 09:20:39 +01:00
df34698acb feat(metablogizer): Add LuCI Emancipate button with async workflow
- Add Emancipate button to dashboard sites table
- Implement async RPC with job polling to avoid XHR timeout
- Add emancipate + emancipate_status RPCD methods
- Add ACL permissions for new RPC methods
- Change HAProxy reload to restart for clean state
- Document RPCD ACL requirements in CLAUDE.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 08:52:53 +01:00
e21ca8a060 feat(metablogizer): Add KISS ULTIME MODE emancipate workflow
Add `metablogizerctl emancipate <name>` command for one-command full
exposure workflow:
1. DNS A record via dnsctl (Gandi/OVH based on availability)
2. Vortex DNS mesh publication
3. HAProxy vhost with SSL/ACME enabled
4. SSL certificate request (webroot mode)
5. Zero-downtime HAProxy reload

Usage:
  metablogizerctl create myblog blog.example.com
  metablogizerctl emancipate myblog

Bump version to 1.1.0.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 08:30:58 +01:00
bea29dd848 fix(mailserver): Sync password changes to Dovecot users file
- user_passwd now updates /etc/dovecot/users inside container
- user_add also syncs new users to Dovecot
- Fixes password reset not working (was only updating host file)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 06:28:07 +01:00
bede51d80c fix(mailserver): Enable submission/smtps/pop3s ports
- Add fix-ports command to enable ports 587, 465, 995
- Install dovecot-pop3d package for POP3S support
- Add submission/smtps services to Postfix master.cf
- Uncomment pop3s/imaps SSL listeners in Dovecot
- Add Fix Ports button to LuCI Quick Actions
- Include dovecot-pop3d in initial container setup

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 06:20:21 +01:00
71315c9c3b feat(mailserver): Add password reset UI for mail users
- Add Reset Password button to user table
- Add showResetPasswordModal with password confirmation
- Add callUserPasswd RPC declaration
- Fix RPCD handler to read JSON from stdin or $3

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 06:13:41 +01:00
714313633b fix(config-advisor): BusyBox ash compatibility fixes
- Replace bash arrays with POSIX loops in scoring.sh
- Replace bc with shell arithmetic (bc not available on OpenWrt)
- Wrap RPCD handlers in functions for local keyword compatibility
- Fix process substitution < <() to use pipe instead

Tested on router: CLI and RPCD working, score calculation correct.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 06:08:28 +01:00
0f4649c1e0 feat(config-advisor): Add ANSSI CSPN compliance checking packages
secubox-config-advisor:
- 7 check categories (network, firewall, auth, encryption, services, logging, updates)
- 25+ security rules with severity-weighted scoring (0-100, grade A-F)
- Auto-remediation for 7 checks with dry-run mode
- LocalAI integration for AI-powered suggestions
- config-advisorctl CLI with 20+ commands

luci-app-config-advisor:
- Dashboard with score circle, grade, risk level, compliance rate
- Compliance view by category with pass/fail/warn badges
- Remediation view with apply/preview buttons
- Settings for framework, weights, categories, LocalAI

Part of v1.0.0 ANSSI CSPN certification roadmap.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 05:56:17 +01:00
f2dfb5c144 feat(ai): Add v0.19 AI agent packages
Network Anomaly Agent (secubox-network-anomaly):
- 5 detection modules: bandwidth, connection flood, port scan, DNS, protocol
- EMA-based baseline comparison
- LocalAI integration for threat assessment
- network-anomalyctl CLI

LocalRecall Memory System (secubox-localrecall):
- Persistent memory for AI agents
- Categories: threats, decisions, patterns, configs, conversations
- EMA-based importance scoring
- LocalAI integration for summarization
- localrecallctl CLI with 13 commands

AI Insights Dashboard (luci-app-ai-insights):
- Unified view across all AI agents
- Security posture scoring (0-100)
- Agent status grid with alert counts
- Aggregated alerts from all agents
- Run All Agents and AI Analysis actions

LuCI Dashboards:
- luci-app-network-anomaly with real-time stats
- luci-app-localrecall with memory management

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 18:58:08 +01:00
006ff03c86 feat(mirrornet): Add v0.19 MirrorNetworking core packages
MirrorNet Core (secubox-mirrornet):
- DID-based identity (did:plc:) with keypair management
- Peer reputation scoring (0-100) with trust levels
- Service mirroring via reverse proxy chaining
- Enhanced gossip protocol with priority routing
- Health monitoring with anomaly detection
- mirrorctl CLI with 30+ commands

Identity Package (secubox-identity):
- Standalone DID generation (AT Protocol compatible)
- HMAC-SHA256 keys with Ed25519 fallback
- Key rotation with backup support
- Trust scoring integration
- identityctl CLI with 25+ commands

P2P Intel Package (secubox-p2p-intel):
- Signed IOC sharing for mesh
- Collectors: CrowdSec, mitmproxy, WAF, DNS Guard
- Cryptographic signing and validation
- Source trust verification
- Application: nftables/iptables/CrowdSec
- Approval workflow for manual review
- p2p-intelctl CLI with 20+ commands

LuCI Dashboard (luci-app-secubox-mirror):
- Identity card with DID, hostname, role
- Peer reputation table with trust levels
- Gossip protocol statistics
- Health alerts with acknowledgment
- RPCD handler with 15 methods

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 18:43:19 +01:00
93b9636258 fix(threat-analyst): Async AI chat to handle slow LocalAI inference
- LocalAI inference takes 30-60s on ARM64 hardware
- Changed RPCD chat handler to async pattern:
  - Returns poll_id immediately
  - Background process runs AI query (120s timeout)
  - Saves result to /var/lib/threat-analyst/chat_*.json
  - Client polls with poll_id to get result
- Updated api.js with chatAsync() that polls automatically
- Changed default LocalAI port from 8081 to 8091
- Frontend shows "Thinking..." message with spinner during inference
- Uses curl instead of wget (BusyBox wget doesn't support --post-data=-)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 16:41:27 +01:00
223abb1114 feat(vortex-dns): Complete meshed subdomain delegation system
- Add init.d script for daemon mode with procd integration
- Update Makefile to install init script
- Add packages to bonus feed (secubox-vortex-dns, luci-app-vortex-dns)
- Update tracking files with completion status

Features:
- Master/slave hierarchical DNS delegation
- Wildcard domain management (*.domain)
- First Peek auto-registration of services
- Gossip-based exposure config sync via secubox-p2p
- Submastering for nested hierarchies
- LuCI dashboard with mode detection and action buttons

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 13:23:18 +01:00
0d619d4780 feat(domoticz): Add password reset via RPCD
New RPCD method: reset_password
- Resets Domoticz admin password via SQLite
- Accessible from LuCI dashboard
- MD5 hashes the password before storing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 13:10:18 +01:00
7f4f34b930 feat(vortex-dns): Add LuCI dashboard for mesh DNS management
New package: luci-app-vortex-dns
- Dashboard showing mode, status, sync info
- Master section with delegated zones table
- Slave section with parent master info
- Mesh peers section with online status
- Actions: Initialize master, Join slave, Delegate zone, Mesh sync
- RPCD handler with 8 methods

Also fixes:
- Mail port hijacking: WAN-only DNAT rules
- Threat-analyst LocalAI port: 8081 → 8091
- Domoticz password reset

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 13:05:01 +01:00
b7f3eb9613 fix(mailserver): Fix mydestination conflict with virtual domains
mydestination included $mydomain which caused "User unknown in local
recipient table" errors because Postfix treated the domain as local
instead of virtual.

Changes:
- Remove $mydomain from mydestination in setup.sh
- Update fix-postfix command to also fix this issue
- Ensure vdomains file is properly created

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 12:36:28 +01:00
ae26317815 fix(mailserver): Use LMDB maps instead of hash for Alpine Postfix
Alpine Linux's Postfix is compiled with LMDB support, not BerkeleyDB
hash support. This caused "Temporary lookup failure" errors on send.

Changes:
- Changed virtual_alias_maps and virtual_mailbox_maps to lmdb: prefix
- Copy resolv.conf to Postfix chroot for DNS resolution
- Added `mailctl fix-postfix` command to repair existing installations

Root cause: virtual_alias_maps was configured as hash:/etc/postfix/virtual
but the hash map type is not supported on Alpine, only lmdb.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 12:27:00 +01:00
44493ebfe3 feat: Add CVE Triage Agent and Vortex DNS, fix webmail login
New Packages:
- secubox-cve-triage: AI-powered CVE analysis and vulnerability management
  - NVD API integration for CVE data
  - CrowdSec CVE alert correlation
  - LocalAI-powered impact analysis
  - Approval workflow for patch recommendations
  - Multi-source monitoring (opkg, LXC, Docker)

- luci-app-cve-triage: Dashboard with alerts, pending queue, risk score

- secubox-vortex-dns: Meshed multi-dynamic subdomain delegation
  - Master/slave hierarchical DNS delegation
  - Wildcard domain management
  - First Peek auto-registration
  - Gossip-based exposure config sync
  - Submastering for nested hierarchies

Fixes:
- Webmail 401 login: config.docker.inc.php was overriding IMAP host
  to ssl://mail.secubox.in:993 which Docker couldn't reach
- Fixed mailctl webmail configure to use socat proxy (172.17.0.1:10143)

Documentation:
- Added LXC cgroup:mixed fix to FAQ-TROUBLESHOOTING.md
- Updated CLAUDE.md to include FAQ consultation at startup

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 12:19:54 +01:00
460e33c7c7 feat(mailctl): Add daily report and fix port status check
- Port status now checks inside container (not localhost)
- Added report command: generate, send, enable, disable
- Daily report includes server status, mail queue, logs, storage
- Cron job setup for automated daily reports at 7 AM
- Report sent to admin_email configured in UCI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 11:10:43 +01:00
58fe0909ac refactor: Remove mailinabox packages, replaced by secubox-app-mailserver
Deleted:
- secubox-app-mailinabox (Docker-based)
- luci-app-mailinabox

Replaced by custom native implementation:
- secubox-app-mailserver (LXC Postfix+Dovecot)
- luci-app-mailserver

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 10:52:03 +01:00
04d61baa6f fix(rpcd): Remove local keyword from backup/mailserver handlers
POSIX shell doesn't allow 'local' outside functions.
Fixed for busybox/ash compatibility.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 10:48:25 +01:00
ded107e408 feat(luci-app-mailserver): Add unified mail server dashboard
All-in-one LuCI interface for:
- Mail server status and control
- User/alias management with modals
- Port status monitoring
- DNS/SSL setup actions
- Webmail configuration
- Mesh backup integration

RPCD handler with 17 methods for full mail management.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 10:43:55 +01:00
c6fb79ed3b feat: Add unified backup manager, custom mail server, DNS subdomain generator
New packages:
- secubox-app-backup: Unified backup for LXC containers, UCI config, services
- luci-app-backup: KISS dashboard with container list and backup history
- secubox-app-mailserver: Custom Postfix+Dovecot in LXC with mesh backup

Enhanced dnsctl with:
- generate: Auto-create subdomain A records
- suggest: Name suggestions by category
- mail-setup: MX, SPF, DMARC record creation
- dkim-add: DKIM TXT record management

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 10:40:32 +01:00
e13b6e4c8c feat(vhost-manager): Add centralized VHost manager
- Create secubox-app-vhost-manager package for unified vhost orchestration
- Single CLI tool (secubox-vhost) manages HAProxy, DNS, Tor, Mesh, mitmproxy
- Unified UCI config (/etc/config/vhosts) as single source of truth
- Backend adapters for each component (haproxy.sh, dns.sh, tor.sh, mesh.sh, mitmproxy.sh)
- Centralized backend resolution function (backends.sh)
- Import tool for existing HAProxy vhosts
- Validation of backend reachability before creation

Also includes:
- FAQ-TROUBLESHOOTING.md with LXC cgroup v1/v2 fixes
- Fix mitmproxyctl cgroup v1 -> v2 syntax for container compatibility
- HAProxy backend resolution bugfixes

CLI commands:
  secubox-vhost add <domain> <service> <port> [--ssl] [--tor] [--mesh]
  secubox-vhost remove/list/status/enable/disable/set/sync/validate/import

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 10:16:19 +01:00
0e0749ed08 feat: Add threat-analyst, dns-guard, mcp-server and DNS provider DynDNS
New packages:
- secubox-threat-analyst: AI-powered threat analysis with CrowdSec integration
- luci-app-threat-analyst: LuCI dashboard for threat intelligence
- secubox-dns-guard: DNS security monitoring and blocking
- secubox-mcp-server: Model Context Protocol server for AI assistant integration

Enhancements:
- dns-provider: Add DynDNS support (dyndns, get, update, domains commands)
- gandi.sh: Full DynDNS with WAN IP detection and record updates
- luci-app-dnsguard: Upgrade to v1.1.0 with improved dashboard

Infrastructure:
- BIND9 DNS setup for secubox.in with CAA records
- Wildcard SSL certificates via DNS-01 challenge
- HAProxy config fixes for secubox.in subdomains
- Mail server setup with Roundcube webmail

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 08:30:28 +01:00
113f41b09c feat(localai): Upgrade to v3.9.0 with Agent Jobs and Memory Reclaimer
Upgrade LocalAI from v2.25.0 to v3.9.0 with new features:

- **Agent Jobs Panel**: Schedule and manage background agentic tasks
- **Memory Reclaimer**: LRU eviction for loaded models, automatic VRAM cleanup
- **VibeVoice backend**: New voice synthesis support

Update README with:
- v3.9 feature highlights
- Complete CLI command reference
- Model presets table (tinyllama, phi2, mistral, gte-small)
- API endpoints documentation
- SecuBox Couche 2 integration notes

This is part of the v0.18 AI Gateway roadmap.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 05:02:45 +01:00
a0d0bb24ca feat(mac-guardian): Add WiFi MAC security packages to bonus feed
- Build and add secubox-app-mac-guardian_0.5.0-r1_all.ipk
- Build and add luci-app-mac-guardian_0.5.0-r1_all.ipk
- Sync luci-app-mac-guardian to local-feed for SDK building
- Update apps-local.json catalog with proper metadata:
  - Category: security, Icon: wifi
  - Descriptions for frontend and backend packages
- Rebuild all bonus feed packages

Package features:
- WiFi MAC address spoofing detection
- OUI anomaly detection for device fingerprinting
- MAC flood protection via hotplug.d integration
- CrowdSec scenarios for automated threat response

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 04:55:53 +01:00
bf3395a6fa feat(jellyfin): Add post-install setup wizard
- Add 4-step modal wizard for first-time configuration
- Step 1: Welcome with Docker/container status checks
- Step 2: Add/remove media library paths with type presets
- Step 3: Network configuration (domain, HAProxy, ACME)
- Step 4: Complete with link to Jellyfin Web UI
- Add RPCD methods: get_wizard_status, set_wizard_complete,
  add_media_path, remove_media_path, get_media_paths
- Auto-trigger wizard when installed but not configured
- Add wizard.css with step indicators and form styling
- Update Makefile to install CSS resources

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 04:45:26 +01:00
b75fbd516c feat(exposure): Add Mesh column and Emancipate modal to dashboard
- Add emancipate/revoke/get_emancipated RPCD methods
- Add Mesh toggle column with blue theme styling
- Add Emancipate button in header with multi-channel modal
- Modal allows selecting Tor/DNS/Mesh channels
- Add mesh badge to header stats
- Update ACL and API wrapper for new methods

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 04:45:04 +01:00
53af5ac2e9 feat(exposure): Add emancipate/revoke commands for multi-channel exposure
- `emancipate <service> <port> <domain> [--tor] [--dns] [--mesh] [--all]`
  Unified multi-channel exposure: Tor + DNS/SSL + Mesh in single command
- `revoke <service> [--tor] [--dns] [--mesh] [--all]`
  Removes exposure from selected channels
- Enhanced `status` command shows emancipated services with active channels
- UCI tracking for emancipation state (port, domain, channel flags)
- Integrates with dnsctl, haproxyctl, and secubox-p2p

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 04:18:33 +01:00
5a856e5da2 feat(monitoring): Add empty-state loading and dynamic bandwidth units
- Add animated "Collecting data..." overlay with pulsing dots during
  5-second chart warmup period
- Chart legend transitions from "Waiting" to "Live" when data arrives
- Add formatBits() helper for network rate display (Kbps/Mbps/Gbps)
- Network rates now use SI units (bits) instead of bytes
- Cyberpunk theme support for empty state styling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 04:04:32 +01:00
c5e22fd08d refactor(nav): Unify navigation component with auto-theme initialization
SecuNav.renderTabs() now automatically initializes theme and loads CSS,
eliminating boilerplate from views. Added renderCompactTabs() for nested
modules and renderBreadcrumb() for back-navigation.

Updated module navs: cdn-cache, client-guardian, crowdsec-dashboard,
media-flow, mqtt-bridge, system-hub. Removed ~1000 lines of duplicate CSS.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 03:42:32 +01:00
304ac7b9a1 feat: P2P App Store, Remote Access & Mesh Media packages
P2P App Store Emancipation:
- secubox-p2p: Package distribution via mesh peers (CGI API, RPCD, CLI)
- packages.js: LuCI view with LOCAL/PEER badges, fetch/install actions
- devstatus.js: Dev Status widget with Gitea commits, v1.0 progress tracking
- secubox-feed: sync-content command for auto-installing content packages
- ACL fix for P2P feed RPCD methods

Remote Access:
- secubox-app-rustdesk: Native hbbs/hbbr relay server from GitHub releases
- secubox-app-guacamole: LXC Debian container with guacd + Tomcat (partial)

Content Distribution:
- secubox-content-pkg: Auto-package Metablogizer/Streamlit as IPKs
- Auto-publish hooks in metablogizerctl and streamlitctl

Mesh Media:
- secubox-app-ksmbd: In-kernel SMB3 server with ksmbdctl CLI
- Pre-configured shares for Jellyfin, Lyrion, Backup

UI Consistency:
- client-guardian: Ported to sh-page-header chip layout
- auth-guardian: Ported to sh-page-header chip layout

Fixes:
- services.js: RPC expect unwrapping bug fix
- metablogizer: Chunked upload for uhttpd 64KB limit

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 00:33:53 +01:00
9513bcb839 fix(domoticz): Correct README to say Debian instead of Alpine
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 22:06:53 +01:00
f2f24afe12 feat(domoticz): Rewrite from Docker to LXC Debian container
- Switch from Docker to LXC with Debian bookworm rootfs and native
  Domoticz binary from GitHub releases (latest/download pattern)
- Fix LXC cgroup2 terminal allocation: add lxc.tty.max, lxc.pty.max,
  cgroup2 device permissions for standard char devices, disable seccomp
- Fix PID 1 issue: run domoticz as child process with signal forwarding
- Use quoted heredoc with sed placeholders for start script generation
- Update LuCI view: Docker → LXC references, add memory usage display
- Remove Docker image UCI option, update catalog runtime to "lxc"
- Fix streamlit LXC config: same cgroup2/terminal/seccomp fixes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 22:05:39 +01:00
89896568b1 feat(domoticz): Add LuCI dashboard with MQTT auto-bridge and Zigbee2MQTT integration
New luci-app-domoticz package with RPCD handler (12 methods), LuCI overview
(status, IoT integration, MQTT, HAProxy, mesh, logs), and full service lifecycle.
Enhanced domoticzctl with configure-mqtt (auto Mosquitto+Z2M bridge), configure-haproxy,
backup/restore, mesh-register, and uninstall commands. UCI extended with mqtt/network/mesh
sections. Catalog updated with LuCI package and IoT tags. MirrorNetworking strategic
document noted in planning files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 21:32:17 +01:00
79bb3c43f4 feat: Add smbfs mount manager, Jellyfin READMEs, Glances host visibility, planning updates
New secubox-app-smbfs package for SMB/CIFS remote directory management
with smbfsctl CLI (add/remove/mount/umount/test/status), UCI config,
auto-mount init script, and Jellyfin/Lyrion media path integration.

Glances LXC: host bind mounts (/rom, /overlay, /boot, /srv), Docker
socket fix (symlink loop), fs plugin @exit_after patch, hostname/OS
identity, pre-generated /etc/mtab.

KISS READMEs for secubox-app-jellyfin and luci-app-jellyfin. Planning
files updated with Domoticz IoT, AI Gateway strategy, App Store P2P
emancipation, and v2 roadmap items.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 21:02:46 +01:00
eebc84d0b9 fix(zigbee2mqtt): Fix adapter type, config format, and add MQTT dependency
The z2m 2.x breaking changes required three fixes discovered during
live deployment testing on the router:
- Adapter renamed from `ezsp` to `ember` in zigbee-herdsman 4.0.0
- Config format needs `version: 4` and nested `homeassistant.enabled`
- Start script needs `ZIGBEE2MQTT_DATA` env var for correct config path
- Add `mosquitto-nossl` as package dependency (MQTT broker required)
- Direct `/dev/ttyUSB0` passthrough works; socat TCP bridge does not

Also updates project planning files (HISTORY.md, TODO.md, WIP.md,
CLAUDE.md) and rebuilds bonus feed with latest IPKs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 19:29:59 +01:00
acd7e87e56 chore(bonus-feed): Rebuild feed with zigbee2mqtt LXC and device-intel fixes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 18:33:18 +01:00
f4157811c5 fix(device-intel): Fix empty vendor column and add OUI emoji display
- Fix wrong mac-guardian DB path (clients.db -> known.db) in 3 files
- Add standalone OUI vendor fallback for ARP/DHCP-only devices
- Expand oui.tsv from ~30 to 100+ entries (GL.iNet, Bosch, Samsung, Docker, etc.)
- Add vendorDisplay() with emoji prefixes for MAC types:
  container, virtual, randomized, IoT, mesh peer

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 18:33:10 +01:00
c5d40cf464 feat(zigbee2mqtt): Rewrite from Docker to LXC Alpine container
Replace Docker-based zigbee2mqtt with a KISS LXC approach using Alpine
Linux container with Node.js + zigbee2mqtt, matching the HAProxy LXC
pattern. Adds USB serial passthrough for Sonoff Dongle Lite MG21.

- zigbee2mqttctl: Full LXC lifecycle (install, update, check, shell)
- RPCD: LXC diagnostics (lxc, cp210x, serial, container, service)
- api.js: Fix callApply missing params (payload was silently dropped)
- overview.js: Match new LXC diagnostics, fix applyConfig call
- Makefiles: Replace +dockerd +docker +containerd with +lxc +kmod-usb-serial-cp210x

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 18:32:57 +01:00
eab2e5d159 chore(bonus-feed): Rebuild feed with jellyfin ipk and latest fixes
Includes rebuilt packages with RPCD function wrapper fix, crowdsec
decisions fix, and new secubox-app-jellyfin package.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 18:07:54 +01:00
64fb579248 feat(exposure): Sort services by DNS domain names first, then by port
Services with HAProxy DNS domains are now displayed at the top of the
table sorted alphabetically by domain, followed by remaining services
sorted by port number.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 18:07:48 +01:00
155f9d8005 feat(jellyfin): Add uninstall, update, backup, HAProxy integration and LuCI actions
- Add jellyfinctl commands: uninstall, update, backup, configure-haproxy
- Add RPCD methods: uninstall, update, backup, configure_haproxy
- Add domain and disk_usage to status display
- Add action buttons in LuCI overview: Update, Backup, Configure HAProxy, Uninstall
- Add UCI options: domain, backup_path, haproxy_enabled

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 17:10:44 +01:00
b32a0c222b chore(bonus-feed): Rebuild all feed packages with latest fixes
Includes device-intel, dns-provider, crowdsec-dashboard, and jellyfin
packages plus updated Packages index.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 17:07:19 +01:00
e1d70c5bac fix(crowdsec-dashboard): Fix decisions list empty due to wrong RPC expect key
The callDecisions RPC declaration used expect: { alerts: [] } but the
backend returns { decisions: [...] }, causing the unwrapped result to
always be empty. Also removed leftover console.log debug statements.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 17:00:46 +01:00
f561dda7a2 fix(rpcd): Wrap call handlers in function for BusyBox ash local keyword compatibility
BusyBox ash rejects `local` outside a function. Both RPCD handlers used
`local` directly in the case block, causing "not in a function" errors
and silent RPC failures (empty responses).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 16:39:50 +01:00
78802f2850 fix(luci): Fix menu navigation and settings Save & Apply for device-intel and dns-provider
- Change menu action type from "firstchildview" to "firstchild" to fix runtime exception
- Remove null handleSaveApply/handleSave/handleReset so form.Map default save works
- Update Gandi API link from defunct account.gandi.net to admin.gandi.net PAT page

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 16:22:11 +01:00
abc0f66246 fix(device-intel): Fix BusyBox compatibility and data source mapping
- Replace bash-only $((16#hex)) with printf "%d" 0x for ash
- Fix client-guardian collector to use actual UCI fields (name, zone,
  status, first_seen, last_seen)
- Add ARP table collector for IP resolution and online detection
- Fix di_get_summary jsonfilter counting (use per-field extraction)
- Rename uci_get to di_ctl_get to avoid collision with OpenWrt's
  /lib/functions.sh which overwrites it
- Replace rx_bytes/tx_bytes/risk_score with first_seen/last_seen
  timeline in show command

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 16:10:12 +01:00
932c578dad fix(device-intel): Align Makefile with SDK build pattern
Add PKG_ARCH:=all, empty Build/Compile, conffiles section, and
consistent SECTION/CATEGORY/SUBMENU to match other secubox-app packages.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 16:02:07 +01:00
57db9cfb40 feat: Add device-intel and dns-provider packages
Add 4 new packages implementing unified device intelligence and
DNS provider API management:

- secubox-app-dns-provider: dnsctl CLI with OVH, Gandi, Cloudflare
  adapters for DNS record CRUD, HAProxy vhost sync, propagation
  verification, and ACME DNS-01 wildcard certificate issuance
- luci-app-dns-provider: RPCD handler + LuCI views for provider
  settings and DNS record management
- secubox-app-device-intel: Aggregation layer merging mac-guardian,
  client-guardian, DHCP, P2P mesh, and exposure data with heuristic
  classification engine and USB/MQTT/Zigbee emulator modules
- luci-app-device-intel: RPCD handler + 5 LuCI views (dashboard,
  devices, emulators, mesh, settings) with shared API and CSS

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 15:47:20 +01:00
297917e79a feat(jellyfin): Add secubox-app-jellyfin and luci-app-jellyfin packages
Docker-based Jellyfin media server with UCI config (port, image, media
paths, GPU transcoding), procd init, jellyfinctl CLI, and LuCI frontend
with status/config/logs view.

Also adds Punk Exposure Engine architectural README documenting the
Peek/Poke/Emancipate service exposure model and DNS provider API
roadmap. CLAUDE.md updated with architectural directive.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 14:50:59 +01:00
c6de8b2b1b chore(exposure): Remove obsolete view files replaced by KISS redesign
Delete overview.js, tor.js, ssl.js — all functionality is now in the
single services.js view.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 14:27:46 +01:00
9def2ad15a fix(exposure): Fix toggle switches always showing as ON
Use DOM property assignment (cb.checked = value) instead of HTML
attribute ('checked': false) which browsers treat as checked since
any attribute presence means ON for boolean HTML attributes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 14:19:49 +01:00
4c8799d520 feat(exposure): KISS redesign with enriched service names and vhost integration
Collapse 4-tab UI into single-table view. Enrich scan with real names
from uhttpd UCI, streamlit UCI, docker containers, glances and Lyrion.
Add vhost_list RPCD method to show HAProxy domains and uhttpd instances.
Fix RPC expect unwrapping, trim CSS from 870 to 178 lines.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 14:15:04 +01:00
dc6a8f9c62 fix(streamlit): Auto-install requirements from ZIP uploads and support non-standard filenames
The install_requirements() function only matched requirements.txt exactly,
missing files like requirements_bazi.txt shipped in user ZIP uploads. Now
falls back to any requirements*.txt file. RPCD upload handlers (upload_zip,
upload_finalize) also trigger pip install inside the container at deploy time.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 12:31:02 +01:00
0083513cdc fix(streamlit): Add chunked upload to bypass uhttpd 64KB JSON limit and support top-level .py apps
uhttpd-mod-ubus silently rejects JSON-RPC requests >64KB with "Parse error",
causing uploads of .py files >48KB to fail with "No related RPC reply".

- Add chunked upload (upload_chunk + upload_finalize) that splits base64
  content into 40KB pieces sent sequentially, then reassembles server-side
- Frontend auto-selects chunked upload when content exceeds 40KB
- Stop polling during upload to prevent RPC batch conflicts
- RPCD handlers use cat-to-tempfile instead of shell variables for stdin
  to avoid BusyBox argument size limits
- Container startup script handles top-level .py files (not just subdirs)
- streamlitctl cmd_instance_start also handles top-level .py files
- Add upload_chunk and upload_finalize to ACL

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 10:16:47 +01:00
8691a5e048 fix(streamlit): Fix btoa crash on UTF-8 .py file upload
Read all files as ArrayBuffer and use Uint8Array chunked encoding
for base64, replacing btoa(text) which throws DOMException on
non-ASCII characters (accents, CJK, etc).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 09:40:51 +01:00
db486a56ad fix(streamlit): Fix ZIP upload, app management and add rename support
- Fix ZIP upload: install unzip dependency, fix empty array check
  (jsonfilter returns "[ ]" not "[]"), redirect unzip stdout to
  prevent JSON corruption, use readAsArrayBuffer instead of
  deprecated readAsBinaryString, add .catch() error handler
- Fix list_apps to scan subdirectories for ZIP-uploaded apps,
  skip Streamlit pages/ convention dir, prefer app.py as entry point
- Fix set_active_app: replace broken streamlitctl call with direct
  UCI update
- Fix remove_app: replace broken streamlitctl call with direct
  file removal and UCI cleanup
- Fix add_app: replace broken streamlitctl call with direct UCI
- Add rename_app and rename_instance RPCD methods with ACL entries
- Activate now auto-creates an instance with next available port
- Apps list shows UCI display name separate from filesystem ID
- Sanitize uploaded filenames for UCI compatibility
- Add rename buttons and modals for apps and instances
- Add error notifications for failed deletes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 09:25:01 +01:00
f2b40efbfa fix(streamlit): Add missing RPCD ACL entries for Gitea and zip methods
Adds get_gitea_config, gitea_list_repos to read permissions and
save_gitea_config, gitea_clone, gitea_pull, preview_zip, upload_zip
to write permissions, fixing "Access denied" (-32002) errors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 08:44:19 +01:00
daa4c48375 fix(localai): Add gte-small preset, fix RPC expect unwrapping and chat JSON escaping
- Add gte-small embedding model preset to localaictl with proper YAML
  config (embeddings: true, context_size: 512)
- Fix RPC expect declarations across api.js, dashboard.js, models.js to
  use empty expect objects, preserving full response including error fields
- Replace fragile sed/awk JSON escaping in RPCD chat and completion
  handlers with file I/O streaming through awk for robust handling of
  special characters in LLM responses
- Switch RPCD chat handler from curl to wget to avoid missing output
  file on timeout (curl doesn't create -o file on exit code 28)
- Bypass RPCD 30s script timeout for chat by calling LocalAI API
  directly from the browser via fetch()
- Add embeddings flag to models RPC and filter embedding models from
  chat view model selector

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 08:36:20 +01:00
28acb7e70f fix(localai): Fix health check and uptime detection in RPCD handler
Health check grep was case-sensitive ("ok") but LocalAI returns "OK".
Uptime detection fell into the lxc-info branch (command exists on router)
even though no localai container runs, causing uptime to always be 0.
Simplified to always use /proc/PID which works for both native and
containerized processes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 19:04:23 +01:00
02126aa7d3 feat(wireguard-dashboard): Persist server endpoints in UCI for reuse across views
Server endpoints were stored only in browser sessionStorage, lost on tab
close/refresh. Now endpoints are saved in a dedicated UCI config file
(wireguard_dashboard) with RPCD methods to manage them. The wizard
auto-saves the endpoint after tunnel creation, and peers/QR views use a
dropdown of saved endpoints instead of requiring manual re-entry.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:32:36 +01:00
2ed00d1967 fix(wireguard-dashboard): Fix RPC expect unwrapping, wizard interface naming and key persistence
- Change generateConfig/generateQR RPC declarations to use empty expect
  so error responses are not silently discarded by LuCI's RPC unwrapper
- Simplify handleShowQR to always check backend for stored key first
- Auto-detect next available interface name in wizard (wg1 if wg0 exists)
- Pass private key to addPeer in wizard's createPeers for QR persistence

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 17:35:44 +01:00
75e3f59207 fix(wireguard-dashboard): Bypass jshn for QR code output to avoid argument size limit
The base64-encoded SVG QR code exceeded jshn's argument list limit,
causing "Argument list too long" errors. Build the JSON response
manually via file I/O so the large string is never passed as a
command argument.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 16:57:53 +01:00
2ab0965917 feat(wireguard-dashboard): Persist peer private keys in UCI for QR code generation
Store the client private key in UCI config (_client_private_key) when a
peer is created, so QR codes and config files can be generated after
page refresh without prompting the user to manually re-enter the key.
Old peers without stored keys still get the manual entry fallback.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 16:54:26 +01:00
2d810a2e95 feat(mac-guardian): Add DHCP lease protection for odhcpd
Prevent odhcpd crashes from MAC randomization causing hostname conflicts,
stale lease pile-up, and lease flooding. Adds hostname dedup, stale lease
cleanup, flood detection, CLI commands, RPC methods, and LuCI dashboard card.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 16:22:37 +01:00
373d77368e feat(mac-guardian): Rename to secubox-app-mac-guardian and add LuCI interface
Rename package folder to follow secubox-app-* convention and add
luci-app-mac-guardian with KISS dashboard: status cards, client table
with trust/block actions, recent alerts, and configuration form.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 16:06:48 +01:00