Commit Graph

1093 Commits

Author SHA1 Message Date
2b7850379d fix(metablogizer): Use Python for reliable mitmproxy route updates
Replace fragile sed-based JSON manipulation with Python for adding
mitmproxy routes. The new add_mitmproxy_route() helper function:
- Updates both /srv/mitmproxy/ and /srv/mitmproxy-in/ routes files
- Uses proper JSON parsing instead of string substitution
- Ensures sites are immediately accessible after one-click deploy

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-23 08:29:33 +01:00
4f40316757 fix(metablogizer): Republish HAProxy vhost on domain change
When editing a site and changing its domain, automatically:
- Remove the old HAProxy vhost for the previous domain
- Create a new vhost for the new domain with priority=50
- Regenerate and reload HAProxy configuration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-23 08:20:08 +01:00
0da6c125a8 feat(metablogizer): Add Edit button to site dashboard
Add inline Edit button for each site in the dashboard allowing users
to modify site name, domain, description, and enabled status directly
from the overview page without navigating to settings.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-23 08:19:12 +01:00
daacdb731c feat(talk-hpb): Add Nextcloud Talk High Performance Backend package
New package secubox-app-talk-hpb:
- Docker-based signaling server and Janus WebRTC gateway
- Auto-generates TURN/SIGNALING/INTERNAL secrets
- Creates HAProxy vhost with SSL/ACME
- STUN/TURN server with UDP+TCP support
- CLI tool: talk-hpbctl setup/status/test/logs

Hub generator v5:
- Add PeerTube videos with thumbnails and duration badges
- Fix Streamlit instance detection (=instance vs =app)
- Total count now: sites + streamlit + videos

MetaBlogizer fix:
- Add priority=50 to new vhosts to prevent wildcard catch

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-22 15:13:02 +01:00
8223692436 feat(gk2hub): Add dynamic hub generator v3 with categories and previews
- Multi-view portal with grid/list/compact modes
- Automatic site categorization (Intelligence, Dev, Finance, etc.)
- Iframe thumbnail previews of real site content
- Tag cloud and category tabs with emoji indicators
- Instant search by domain/name/category
- Auto-refresh via cron every 5 minutes
- Created explicit vhosts for 54 MetaBlogizer sites
- Fixed wildcard routing priority

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-22 09:41:45 +01:00
a0ac5e1a16 fix(metablogizer): Add vhost creation for chunked upload methods
Both create_site_from_upload and upload_and_create_site were missing
HAProxy vhost creation step (step 8 from create_site method).

Changes:
- Add vhost creation with backend=mitmproxy_inspector for WAF routing
- Add mitmproxy route to /srv/mitmproxy-in/haproxy-routes.json
- Apply same fix to original create_site method for consistency

This ensures all MetaBlogizer uploaded sites are immediately accessible
via HTTPS and all traffic passes through WAF inspection.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-22 00:07:27 +01:00
011b59892a feat(metablogizer): Add chunked upload for large files
- Add create_site_from_upload RPC method for chunked site creation
- Modify JS api to auto-chunk files >40KB (ubus message size limit)
- Upload chunks sequentially via upload_chunk, then finalize with
  create_site_from_upload
- Add no_cache vhost option to haproxyctl for cache-control headers
- Fix large file upload failures caused by shell argument size limits

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 23:54:35 +01:00
50ddd2c1fe fix(peertube-import): Improve subtitle file detection pattern
- Changed glob pattern from ${slug}*.vtt to *.vtt to catch all subtitle files
- Fixed language extraction regex to work with any filename format
- Redirected yt-dlp subtitle output to stderr

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 20:24:07 +01:00
bbf2b19415 feat(peertube): Add video import with multi-track subtitle sync
- New peertube-import script for importing from YouTube, Vimeo, 1000+ sites
- CGI endpoints for portal integration (peertube-import, peertube-import-status)
- Portal UI: Video Import card with progress tracking
- Multi-language subtitle download and PeerTube caption upload
- Fixed stdout/stderr separation for reliable function returns
- UCI config: uses peertube.admin.username/password
- Package version bumped to 1.2.0
- Added README.md with full documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 20:18:51 +01:00
e3db75cd0a fix(peertube-analyse): Handle missing automatic_captions field in yt-dlp output
PeerTube videos don't include the automatic_captions field in their
yt-dlp JSON output. The jq filter was attempting (.automatic_captions | keys)
which fails with "null (null) has no keys" when the field is missing.

Fixed by adding null-coalescing: ((.automatic_captions // {}) | keys)
Also applied same fix to subtitles field for consistency.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 19:10:52 +01:00
f76dfe8a67 feat(peertube): Add web interface for video analysis
- Create standalone web UI at /peertube-analyse/
- Add CGI backend (peertube-analyse, peertube-analyse-status)
- Add RPCD methods: analyse, analyse_status
- Update portal with Intelligence & Analyse section
- Expose via analyse.gk2.secubox.in with SSL

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 18:34:26 +01:00
ab49e19c32 feat(peertube): Add transcript extraction & AI analysis tool
New CLI: peertube-analyse
- Extract video metadata via yt-dlp
- Download existing PeerTube subtitles (VTT)
- Fallback to Whisper local transcription (medium model)
- Claude AI analysis with structured intelligence report

Features:
- POSIX-compatible (OpenWrt, Alpine, Debian)
- Modular pipeline with graceful degradation
- Colored terminal output with status indicators
- Configurable Whisper model and language
- Truncation for large transcripts (12k chars)

CLI flags:
  --url <url>         Video URL
  --no-whisper        Subtitles only
  --force-whisper     Force transcription
  --no-analyse        Skip Claude analysis
  --model <name>      Whisper model
  --lang <code>       Language code

Output structure:
  ./output/<slug>/
    ├── <slug>.meta.json
    ├── <slug>.transcript.txt
    └── <slug>.analyse.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 18:15:55 +01:00
df58e96a9a feat(turn): Add setup-nextcloud command for Nextcloud Talk
- turnctl setup-nextcloud [turn-domain] [use-port-443]
  - Configures TURN for Nextcloud Talk compatibility
  - Uses port 443 by default (firewall-friendly)
  - Generates auth secret if not exists
  - Outputs admin settings to paste into Nextcloud Talk

- LuCI integration:
  - New "Nextcloud Talk" section in TURN overview
  - Shows STUN/TURN/secret settings for easy copy-paste
  - RPC method: setup_nextcloud

- ACL updated with setup_nextcloud permission

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 18:11:42 +01:00
6db547f7f8 feat: Add WebRadio, TURN server, and Lyrion streaming integration
New packages:
- luci-app-webradio: Web radio management with Lyrion bridge tab
- luci-app-turn: TURN/STUN server UI for WebRTC (Jitsi integration)
- secubox-app-lyrion-bridge: Lyrion → Squeezelite → FFmpeg → Icecast pipeline
- secubox-app-squeezelite: Squeezelite audio player with FIFO output
- secubox-app-turn: TURN server with ACME SSL and Jitsi setup
- secubox-app-webradio: Icecast/ezstream web radio server

Features:
- HTTPS streaming via HAProxy (stream.gk2.secubox.in)
- Lyrion Music Server bridge for streaming playlists to Icecast
- TURN server with time-limited credential generation
- CrowdSec integration for WebRadio security
- Schedule-based radio programming with jingles

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 17:46:54 +01:00
05d12ab130 feat(portal): Add guide link to login page
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 14:07:08 +01:00
d3ab23b07d feat(portal): Redirect root URL to login page
portal.secubox.in/ now redirects to /login.html for SSO flow

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 13:36:33 +01:00
20e4680d1a feat(portal): Update services dashboard with SecuBox theme
- Use SecuBox blue cyberpunk theme (matching login.html)
- Check secubox_token for authentication, redirect to login.html if missing
- Add Guacamole to administration services
- Consistent styling across all portal pages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 13:27:23 +01:00
08ebaefafb feat(portal): Add login and password reset pages for SSO
- Add login.html with RPCD authentication via luci.secubox-users
- Add reset.html for token-based password recovery
- Both pages use SecuBox cyberpunk dark theme
- Default password: Secubox@2026

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 13:21:15 +01:00
e7b6039c96 feat(portal): Add SSO authentication with SecuBox core users
Portal login now authenticates against SecuBox users (UCI config)
instead of hardcoded credentials.

New RPCD methods in luci.secubox-users:
- authenticate: Verify username/password, return session token
- recover: Send password reset email
- reset_password: Set new password with recovery token

Portal pages:
- login.html: Login form with password recovery link
- reset.html: Password reset form (from email link)

Features:
- SHA256 password hashing
- Session tokens stored in /tmp/secubox-sessions/
- Email-based password recovery via mailctl
- Public ACL access (no LuCI login required)
- Passwords synced to services if sync_passwords=1

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 12:58:38 +01:00
2607bfb911 refactor(luci-app-secubox): KISS UI regeneration for all core views
Rewrote 5 core SecuBox LuCI views with KISS pattern:
- modules.js: 565→280 lines, filter tabs, module cards
- monitoring.js: 442→245 lines, SVG charts, 5s polling
- alerts.js: 451→255 lines, timeline, severity filters
- settings.js: 540→220 lines, UCI form with chips
- services.js: 1334→410 lines, provider status, health checks

Total: 3332→1410 lines (~58% reduction)

Changes:
- Removed legacy deps: SecuNav, Theme, Cascade, SbHeader
- Inline CSS with dark mode via prefers-color-scheme
- KissTheme.wrap() for consistent navigation
- Self-contained views with no external CSS dependencies

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 12:24:07 +01:00
bea65ed3e6 feat(matrix): Add Matrix/Conduit E2EE messaging server integration
- secubox-app-matrix: Conduit homeserver in LXC container
  - matrixctl CLI: install/uninstall, user/room management, federation
  - DID identity integration, P2P mesh publication
- luci-app-matrix: LuCI dashboard with 17 RPCD methods
  - Install wizard, status cards, service controls
  - User management, emancipate (public exposure)
  - Identity/mesh integration, logs viewer
- Updated apps-local.json with messaging category metadata
- Conduit v0.10.12 with Matrix Protocol v1.12 support

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 10:48:30 +01:00
5a1276590e feat(metablogizer): Add KISS one-click features matching Streamlit
- Add upload_and_create_site: one-click deploy with auto HAProxy setup
- Add unpublish_site: remove HAProxy vhost while preserving content
- Add set_auth_required: toggle authentication requirement per site
- Add get_sites_exposure_status: exposure/cert status for all sites
- Simplify dashboard to KISS UI pattern with status badges
- Action buttons: Share, Upload, Expose/Unpublish, Lock/Unlock, Delete

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 10:23:18 +01:00
397d7e2f74 feat(streamlit): Add one-click deploy, expose, unpublish, and auth toggle
KISS workflow enhancements:
- One-click deploy: Upload file auto-creates app + instance + starts
- One-click expose: Creates HAProxy vhost + SSL cert in one action
- One-click unpublish: Removes exposure and revokes certificate
- Auth toggle: Enable/disable SecuBox user authentication per instance
- Exposure status: Shows cert validity and expiry in instances table
- Visual indicators: Green badge for exposed, orange for pending cert

New RPCD methods:
- upload_and_deploy: Upload + auto-create instance
- emancipate_instance: One-click vhost + SSL setup
- unpublish: Revoke exposure
- set_auth_required: Toggle authentication requirement
- get_exposure_status: Full exposure info with cert status

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 10:11:57 +01:00
94812b465d refactor(streamlit): Simplify dashboard to KISS UI pattern
Reduce dashboard from ~1000 to ~400 lines following MetaBlogizer pattern:
- Replace cbi-value divs with simple status table
- Compact instances table with Enable/Disable/Expose/Delete actions
- Compact apps table with Edit/Delete actions
- Inline forms for adding instances and uploading files
- Remove Gitea section and rename functions
- Cleaner emancipate modal

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 09:52:00 +01:00
42218a4b78 feat(peertube): Add auto-upload for video imports
Videos imported via yt-dlp are now automatically uploaded to PeerTube:
- OAuth authentication using UCI-stored admin credentials
- Video upload via PeerTube REST API
- Real-time job status polling with import_job_status method
- Progress indicator in LuCI UI
- Automatic cleanup of temp files

New RPCD method: import_job_status for polling job progress.
Version bumped to 1.1.0.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 09:21:18 +01:00
b2ec879814 fix(feed): Add missing secubox-app-ipblocklist backend package
The IP Blocklist backend package was missing from the feed.
Manually built and added the IPK since wget-ssl dependency
failed to build in the SDK.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 07:52:09 +01:00
f9f2be9252 fix(system-hub): Fix get_denoise_stats RPCD returning no response
- Replace jsonfilter with grep for CrowdSec decision counting
- Add ipset existence check before listing blocked IPs
- Add safety fallbacks for empty/invalid counts
- Bump version to 0.5.2-r2

The jsonfilter -e '@[*]' approach failed with CrowdSec's
multi-line JSON output, causing exit code 251 errors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 07:05:24 +01:00
cec4893db9 feat(security): Implement SysWarden Evolution #1-3 security enhancements
Evolution #1 - IP Blocklist (secubox-app-ipblocklist, luci-app-ipblocklist):
- Pre-emptive blocking layer with ipset (~100k IPs)
- Default sources: Data-Shield, Firehol Level 1
- Supports nftables (fw4) and iptables backends
- LuCI KISS dashboard with sources/whitelist management

Evolution #2 - AbuseIPDB Reporter (luci-app-crowdsec-dashboard v0.8.0):
- New "AbuseIPDB" tab in CrowdSec Dashboard
- crowdsec-reporter.sh CLI for reporting blocked IPs
- RPCD handler luci.crowdsec-abuseipdb with 9 methods
- Cron job for automatic reporting every 15 minutes
- IP reputation checker in dashboard

Evolution #3 - Log Denoising (luci-app-system-hub v0.5.2):
- Three modes: RAW, SMART (noise ratio), SIGNAL_ONLY (filter known IPs)
- Integrates with IP Blocklist ipset + CrowdSec decisions
- RPCD methods: get_denoised_logs, get_denoise_stats
- Denoise mode selector panel with noise ratio indicator

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-20 20:11:24 +01:00
a81e8dd8ca fix(bandwidth-manager): Fix traffic graphs for nftables kernel
- Return Mbps as decimal strings instead of integers (shows 0.45 instead of 0)
- Replace iptables tracking with conntrack/nftables for per-client bytes
- Works with nftables kernel that has no iptables compatibility

Note: Add cron job for historical data: */5 * * * * ubus call luci.bandwidth-manager record_stats

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-20 16:39:26 +01:00
53dc035955 fix(crowdsec): Read WAF threats from mitmproxy-in instance
The CrowdSec dashboard was reading from /srv/mitmproxy/threats.log
but the WAF input instance writes to /srv/mitmproxy-in/threats.log.

Fixed paths:
- threats.log: /srv/mitmproxy -> /srv/mitmproxy-in
- autoban-processed.log: /srv/mitmproxy -> /srv/mitmproxy-in

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-20 16:29:29 +01:00
bab3ce3e33 feat(portal): Add SSO portal with gk2 subdomains and guide page
- Portal page with all service links using *.gk2.secubox.in format
- User guide with updated gk2 subdomain URLs
- Guide link added to login page bottom
- HAProxy vhost configured for portal.secubox.in
- WAF routing enabled through mitmproxy

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-20 15:26:14 +01:00
2f7d57dced feat(hexojs): Add content upload wizard and moderation system
- Add upload.js wizard with multi-target publishing (HexoJS, Gitea, Streamlit, MetaBlogizer)
- Add submit.js for user content submission with moderation workflow
- Add moderation RPCD methods: submit_for_review, list_pending, approve_submission, reject_submission
- Update ACL with new moderation permissions
- Add menu entries for Upload and Submit & Moderate views

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-20 14:11:20 +01:00
9887b3555d feat(vm): Add LuCI VM Manager and Vortex Firewall stats improvements
- Add luci-app-vm for LXC container management dashboard
  - Status bar with total/running/stopped containers, disk usage
  - Container cards with Start/Stop/Restart, Snapshot, Export
  - RPCD handler with 10 methods

- Fix Vortex Firewall statistics tracking
  - Replace x47 multiplier with unique_ips metric
  - Read blocks from BIND RPZ log via stats file
  - RPCD now returns unique_ips count

- Add c3box-vm-builder.sh for portable VM creation
  - Downloads OpenWrt x86-64 image
  - Injects SecuBox configuration
  - Converts to VMDK/VDI/OVA formats

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-20 12:57:09 +01:00
58220065b5 feat(v0.23.0): Matrix homeserver, SaaS Relay CDN caching, Media Hub dashboard
Matrix Homeserver (Conduit):
- E2EE mesh messaging using Conduit v0.10.12 in LXC container
- matrixctl CLI: install/uninstall, user/room management, federation
- luci-app-matrix: status cards, user form, emancipate, mesh publish
- RPCD backend with 17 methods
- Identity (DID) integration and P2P mesh publication

SaaS Relay CDN Caching & Session Replay:
- CDN cache profiles: minimal, gandalf (default), aggressive
- Session replay modes: shared, per_user, master
- saasctl cache/session commands for management
- Enhanced mitmproxy addon (415 lines) with response caching

Media Services Hub Dashboard:
- Unified dashboard at /admin/services/media-hub
- Category-organized cards (streaming, conferencing, apps, etc.)
- Service status indicators with start/stop/restart controls
- RPCD backend querying 8 media services

Also includes:
- HexoJS static upload workflow and multi-user auth
- Jitsi config.js Promise handling fix
- Feed package updates

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-20 11:44:26 +01:00
b6747c197e feat(security): Add instant ban feature and user management
- Add enhanced instant ban for critical threats (SQL injection, CVE exploits, RCE)
  - CrowdSec trigger scenario for single-hit bans on severity=critical
  - Instant ban daemon (10s polling) for rapid response
  - UCI options: instant_ban_enabled, instant_ban_duration (48h default)
  - WAF addon updated to route critical threats to instant-ban.log

- Add centralized user management (secubox-core-users, luci-app-secubox-users)
  - CLI tool: secubox-users add/del/passwd/list/sync/status
  - LuCI dashboard under System > SecuBox Users
  - Unified user provisioning across Nextcloud, PeerTube, Matrix, Jabber, Email

- Add Matrix/Conduit integration (secubox-app-matrix, luci-app-matrix)
  - LXC-based Conduit homeserver deployment
  - Full RPCD handler with user/room management
  - HAProxy integration for federation

- Add provision-users.sh script for bulk user creation
- Update secubox-feed with new IPKs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-19 20:17:28 +01:00
91cfd35d7a feat(voip): Add call recording feature with LuCI management
- Add MixMonitor integration for automatic call recording
- Add voipctl rec commands: enable/disable/status/list/play/download/delete/cleanup
- Add recordings.js LuCI view with audio player and date filtering
- Add RPCD methods for recording management
- Add UCI config section for recording settings (format, retention)
- Fix OVH API signature to use openssl instead of sha1sum
- Improve PJSIP trunk config with realm and qualify settings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-19 15:11:46 +01:00
7b4cf2dfe6 feat(portal): Add VoIP/Jabber/Mail to luci-tree categories
Add luci-app-voip, luci-app-jabber, luci-app-jitsi, luci-app-mail,
luci-app-nextcloud, luci-app-webradio to AI & Communication category.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-19 14:45:54 +01:00
e416fa14a6 feat(jabber): Add VoIP integration to LuCI dashboard
Add Jingle VoIP, SMS Relay, and Voicemail Notifications sections to
the Jabber overview.js. Expose 9 new RPC methods in api.js for VoIP
control. Also includes remaining VoIP package updates (dialer view,
asterisk-config.sh) from previous session.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-19 14:37:17 +01:00
64bfeccfdb feat(mitmproxy): Add VoIP/XMPP WAF protection rules
New WAF categories for VoIP and Jabber security:

- voip: SIP header injection, ARI command injection, FreePBX RCE,
  AMI web access, multipart traversal, Digest auth attacks
- xmpp: XSS in messages/presence, BOSH hijack, XXE via XInclude,
  WebSocket XSS, HTTP upload abuse, null byte in JID
- cve_voip: Asterisk PJSIP crash (CVE-2021-26906), negative CL DoS,
  Via header overflow, Route header crash, SDP buffer overflow,
  CSeq method overflow, FreePBX/Kamailio/OpenSIPS CVEs
- cve_xmpp: Prosody namespace confusion, stream DoS, upload DoS,
  ejabberd disco leak, Converse.js XSS, Strophe.js parsing crash,
  Tigase unauth user creation

Also added:
- UCI waf_rules section with toggles for all 12 categories
- Auto-ban options for VoIP/XMPP attack patterns
- Updated waf-sync script for new categories

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-19 10:43:06 +01:00
6affa7cd30 fix(voip): Add Debian Bullseye repo for Asterisk package
Asterisk was removed from Debian Bookworm main repositories.
Added Bullseye repo with pinning to install asterisk packages.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-19 09:27:22 +01:00
4ca46b61e2 feat(voip): Add VoIP packages with OVH provisioning and Jabber integration
New packages:
- secubox-app-voip: Asterisk PBX in LXC container
- luci-app-voip: Dashboard with extensions, trunks, click-to-call

VoIP features:
- voipctl CLI for container, extensions, trunks, calls, voicemail
- OVH Telephony API auto-provisioning for SIP trunks
- Click-to-call web interface with quick dial
- RPCD backend with 15 methods

Jabber VoIP integration:
- Jingle VoIP support (STUN/TURN via mod_external_services)
- SMS relay via OVH (messages to sms@domain)
- Voicemail notifications via Asterisk AMI → XMPP
- 9 new RPCD methods for VoIP features

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-19 09:22:06 +01:00
3c992026ed feat(jabber): Add Converse.js webchat interface and fix Prosody binding
- Add webchat setup with Converse.js for browser-based chat access
- Fix Prosody HTTP binding to all interfaces (not just localhost)
- Add http_interfaces and https_interfaces to config
- Run Prosody as prosody user to avoid root permission issues
- Add /chat/ path for webchat served by Prosody http_files module
- Mount webchat directory in LXC container for easy customization
- Update install/emancipate output to show webchat URL

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-19 08:58:46 +01:00
8377f8b092 fix(jabber): Fix Prosody startup and process detection
- Run Prosody as prosody user (not root) via su -s /bin/sh
- Fix process detection to look for lua.*prosody pattern
- Generate SSL certs using openssl instead of prosodyctl
- Remove deprecated cross_domain_websocket option
- Create config file before certificate generation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-19 08:00:33 +01:00
b0d208777d feat(jabber): Add Jabber/XMPP server packages (Prosody)
New packages:
- secubox-app-jabber: LXC-based Prosody XMPP server with:
  - Debian Bookworm container
  - Full XMPP support (C2S, S2S, MUC, MAM)
  - HTTP upload for file sharing
  - BOSH and WebSocket for web clients
  - SSL/TLS encryption
  - User and room management via jabberctl

- luci-app-jabber: LuCI dashboard with:
  - Status overview and service controls
  - User management (add/delete)
  - Emancipate workflow (HAProxy + SSL + DNS)
  - Connection info display
  - Log viewer

CLI commands:
  jabberctl install/uninstall/start/stop/status
  jabberctl user add/del/passwd/list
  jabberctl room create/delete/list
  jabberctl emancipate <domain>

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-19 07:48:09 +01:00
3150c65e99 feat(peertube): Add yt-dlp video import to LuCI dashboard
- Install yt-dlp in PeerTube LXC container for video downloads
- Add RPCD methods: import_video, import_status
- Add UI section with URL input and download button
- Support YouTube, Vimeo, and 1000+ video sites
- Download videos to import folder for PeerTube admin upload
- Show download status and video count

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 16:20:50 +01:00
75b85080fa feat(mitmproxy): Add WAF Filters UI to LuCI dashboard
- Add new WAF Filters tab displaying 10 detection categories
- Categories: sqli, xss, lfi, rce, cve_2024, scanners, webmail, api_abuse, nextcloud, roundcube
- Toggle enable/disable per category with live updates
- Expandable rules tables with patterns, descriptions, CVE links
- Summary stats: total categories, active filters, rule count
- RPCD methods: get_waf_rules, toggle_waf_category
- Update menu entry and ACL permissions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 16:02:58 +01:00
edbd58d95d feat(security): Add ndpid to security dashboard, Streamlit/MetaBlogizer to apps
Security KISS Dashboard:
- Add ndpid (nDPI daemon) to RPCD status method
- Add ndpid to services monitoring array (6 services total)

APPS Portal:
- Add Streamlit to Services category (Python data apps)
- Add MetaBlogizer to Services category (AI blog generation)

Also includes secubox-cloner enhancements from earlier session.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 15:29:54 +01:00
dd1e7cbbde feat(security-threats): Add Wazuh SIEM to security status bar
- Add wazuh_running status check to RPCD handler
- Display Wazuh alongside CrowdSec, netifyd, mitmproxy in dashboard

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 14:57:46 +01:00
4d193c5e48 feat(nextcloud): Enhance LXC package with storage stats and backup management
- Update Nextcloud version to 31.0.5
- Add auto-start (lxc.start.auto) for boot persistence
- Add memory limit cgroup configuration
- Fix nginx /apps/ path for static assets (CSS, JS, SVG)
- Add Storage tab with disk usage visualization
- Add delete backup functionality
- Add RPCD methods: uninstall, get_storage, delete_backup
- Update ACL permissions for new methods
- Rewrite README.md with LXC architecture docs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 14:41:04 +01:00
418e99e481 feat(webradio): Add luci-app-webradio LuCI interface
Complete WebRadio management interface for OpenWrt:
- Dashboard with server status, listeners, now playing
- Icecast/Ezstream server configuration
- Playlist management with shuffle/upload
- Programming grid scheduler with jingle support
- Live audio input via DarkIce (ALSA)
- Security: SSL/TLS, rate limiting, CrowdSec integration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 14:25:31 +01:00
a47800df6f fix(dns-master): Make bump_serial POSIX-compatible
Replace bash-specific substring syntax with POSIX alternatives:
- ${var:0:8} -> cut -c1-8
- ${var:8:2} -> cut -c9-10
- $((10#$var + 1)) -> expr

This fixes "arithmetic syntax error" when running via RPCD (busybox ash).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 07:34:47 +01:00
f95b381077 fix(mailserver): Fix dovecot users file permissions in user_add/passwd
Both user_add and user_passwd functions now set correct permissions
(644 root:dovecot) after updating /etc/dovecot/users inside the
container. This prevents "Permission denied" errors on authentication
after adding users or changing passwords.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 07:30:49 +01:00
3aacabd5c1 fix(mailserver): Fix dovecot users file permissions after add-user
Ensure /etc/dovecot/users has 644 permissions and root:dovecot ownership
after adding a user. Without this, dovecot cannot read the passwd-file
and authentication fails with "Permission denied".

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 07:26:46 +01:00
95e14c183b fix(mailserver): Improve Dovecot startup permissions
- Create login/token-login/empty directories with correct ownership
- Set proper permissions for dovenull user on login directories
- Remove stale auth-token-secret.dat on startup (prevents "compromised token" errors)
- Increase sleep time after dovecot start for socket creation
- Fix permissions again after socket creation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 07:11:22 +01:00
8412639a8c fix(nextcloud): Add cron setup for background jobs
Configure Nextcloud cron job (every 5 minutes) in container startup
script for proper background task execution (file scanning, cleanup,
notifications, etc.)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 03:50:29 +01:00
aa86161af0 fix(nextcloud): Remove /apps/ location block breaking static files
The ^~ /apps/ location was taking precedence over static file regex
locations, causing SVG icons to return 404. The root location's
rewrite to index.php already handles app routing correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 03:49:01 +01:00
fe8c3aaf5e fix(nextcloud): Add /apps/ nginx location to fix 403 errors
The /apps/dashboard/ and other app paths were returning 403 Forbidden
because nginx was matching the directory via try_files before routing
to PHP. Added explicit location ^~ /apps/ to rewrite to index.php.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 03:44:24 +01:00
f5d2122fd3 fix(mailserver): Ensure dovecot users file is readable
Add permission fix for /etc/dovecot/users in startup script.
Without this, dovecot auth fails with "Permission denied" when
trying to read the passwd-file for LMTP delivery.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 16:02:27 +01:00
a0fc2cee62 fix(mailserver): Add UCI firewall rules for mail ports
The firewall-setup command now adds:
- Input rules for ports 25, 143, 465, 587, 993 (accept from WAN)
- Forward rules for mail ports (WAN -> LAN mailserver)
- DNAT rules in firewall.user (excluding LAN subnet)

This ensures nftables input_wan and forward_wan chains allow
mail traffic to reach the mailserver container.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 15:56:31 +01:00
4154913810 fix(mailserver): Use lmdb instead of hash for postfix maps
Alpine Linux uses LMDB instead of Berkeley DB hash format.
Changed virtual_mailbox_maps from hash: to lmdb: prefix.

Also fixes:
- nftables forward_wan missing port 25 accept rule
- nftables input_wan missing port 25 accept rule
- gk2@secubox.in missing from vmailbox

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 15:51:48 +01:00
19406e128c fix(mailserver): Complete dovecot permission fixes
- Add dovecot run directory permission setup
- Add dovenull to dovecot group (fixes login directory access)
- Update HISTORY.md with changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 15:43:46 +01:00
c379aee903 fix(mailserver): Add dovecot run directory permission fix
Fix anvil-auth-penalty socket permission issues that caused
authentication failures. Ensures /run/dovecot has correct ownership
before and after dovecot starts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 15:26:43 +01:00
4bd0c09b2e feat(nextcloud): Add user management and password reset
- Add list_users RPCD method to list Nextcloud users via OCC
- Add reset_password RPCD method for password reset via OCC
- Add Users tab in LuCI dashboard with user list
- Add password reset modal with confirmation
- Parse Nextcloud user:displayname JSON format

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 15:10:35 +01:00
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