Commit Graph

1010 Commits

Author SHA1 Message Date
2eb79b6ebb feat(metacatalog): Add HAProxy vhost scanner
- New scan_haproxy() function indexes HAProxy vhosts as catalog entries
- Skips entries already indexed from MetaBlogizer/Streamlit sources
- Extracts backend, port, SSL/WAF status from UCI config
- Auto-detects content type from backend name (streamlit, metablog, media, cloud)
- Updated cmd_scan to include haproxy source
- Total entries: 120 -> 246

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-11 17:06:44 +01:00
1ac3c4e8c0 feat(metacatalog): Add LuCI dashboard (Phase 2)
New luci-app-metacatalog package:
- RPCD backend with 10 methods (list_entries, list_books, search, etc.)
- ACL permissions for read/write access
- Menu entry under SecuBox
- KISS-themed dashboard with:
  - Stats chips (entries, metablogs, streamlits, books)
  - Virtual books shelf with color-coded cards
  - Entry links to published content
  - Sync button for manual refresh
  - Landing page link

Deployed and tested on router.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-11 16:47:09 +01:00
bde9c41563 feat(metacatalog): Add Virtual Books content aggregator
New secubox-app-metacatalog package:
- CLI tool (metacatalogctl) with sync/scan/index/books/search commands
- Scanners for MetaBlogizer sites and Streamlit apps
- Auto-assignment engine with keyword + domain pattern matching
- 6 default virtual books (Divination, Visualization, Analytics, etc.)
- Tao prism fluoro theme landing page
- JSON APIs for catalog and books data
- Hourly cron sync
- BusyBox-compatible (sed-based extraction)

Initial test: 120 entries indexed (118 MetaBlogs, 2 Streamlits)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-11 16:42:42 +01:00
7cbd64061f feat(haproxy): Auto-sync mitmproxy routes on vhost add/remove
- Add automatic mitmproxy route sync after vhost operations
- Route through WAF by default: sets original_backend for route resolution
- Add --nowaf option to bypass WAF routing if needed
- Prevents missing routes when creating new vhosts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-11 16:22:46 +01:00
fbd0abd716 perf(crowdsec-dashboard): Pre-cached get_overview for instant response
Problem: get_overview RPC was timing out (30s+) due to 12+ sequential
cscli calls with CAPI data, causing "TypeError: can't assign to property
'countries' on 5" in LuCI.

Solution:
- Pre-cached architecture with /tmp/secubox/crowdsec-overview.json
- get_overview() returns cached data instantly (0.08s)
- refresh_overview_cache() runs via cron every minute
- Reduced cscli calls from 12 to 4 (metrics, decisions, alerts, bouncers)
- Extract flat decisions array using jsonfilter
- Manual JSON building to avoid jshn argument size limits
- Add /etc/cron.d/crowdsec-dashboard for periodic refresh

Also includes:
- Streamlit Control: Deploy functionality like metablogizer
- Streamlit Control: Enhanced Security page with WAF/CrowdSec data
- mitmproxy LuCI: Add timeout race to prevent page hang

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-11 15:24:57 +01:00
9081444c7a feat(streamlit-control): Phase 3 - auto-refresh, permissions, UI improvements
Streamlit Control Dashboard Phase 3:
- Add auto-refresh toggle to all main pages (10s/30s/60s intervals)
- Add permission-aware UI with can_write() and is_admin() helpers
- Containers page: tabs (All/Running/Stopped), search filter, info panels
- Security page: better CrowdSec parsing, threat table, raw data viewer
- Streamlit apps page: restart button, delete confirmation dialog
- Network page: HAProxy filter, WireGuard/DNS placeholders

fix(crowdsec-dashboard): Handle RPC error codes in overview.js

Fix TypeError when CrowdSec RPC returns error code instead of object.
Added type check to treat non-objects as empty {} in render/pollData.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-11 14:54:30 +01:00
99d9f307dd feat(secubox-core): Add dynamic KISS Apps discovery methods
- get_installed_apps: Returns installed apps with menu paths and status
- get_kiss_menu: Returns dynamic menu by category (security, system, productivity, media)
- Enables KISS UI to dynamically show installed apps
- Updated ACL to include new methods

Also on router:
- Created rpcd-watchdog service that monitors rpcd every 60s
- Automatically restarts rpcd if luci module fails

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-11 11:16:47 +01:00
175dbbe953 fix(secubox): Fix ANSI color codes in help output
- Use printf to generate actual escape sequences instead of literal strings
- Fixes colors not rendering in 'secubox help' output
- POSIX sh heredoc doesn't interpret \033 escapes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-11 10:32:47 +01:00
9b58d6db38 feat(secubox-core): Add SecuBox banner replacing OpenWrt default
- Custom ASCII art banner with SecuBox branding
- Shows helpful info: CLI help, dashboard URL
- Installed to /etc/banner on device
- Added to conffiles for upgrade preservation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-11 10:26:59 +01:00
66b58c74d6 feat(catalog): Add Streamlit Forge and RezApp Forge to KISS Apps
- luci-app-streamlit-forge: Streamlit app publishing platform
  - Category: productivity, runtime: lxc
  - Templates, SSL exposure, mesh publishing

- luci-app-rezapp: Docker to LXC app converter
  - Category: system, runtime: native
  - Catalog browsing, package generation

- Updated new_releases section
- Total plugins: 37 → 39

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-11 09:44:08 +01:00
06b7a17d84 fix(metablogizer): Add empty Build/Compile rule for shell-only package
Without this rule, the build system attempts to run 'make' in the
build directory, which fails because there's no Makefile there.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-10 19:07:50 +01:00
f8367fc0a3 feat(metablogizer): Add duplicate port detection and auto-fix
- Fix get_next_port() to check both uhttpd and metablogizer configs
- Add check-ports command to scan for duplicate port assignments
- Add fix-ports command to auto-assign new ports to duplicates
- Update WIP.md with 2026-03-10 changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-10 18:41:31 +01:00
fe762b6eb1 feat(system-hub): Add HAProxy routes health check panel
- Add get_service_health RPCD method to check all HAProxy routes
- Integrate /usr/sbin/service-health-check for backend HTTP probing
- Add health panel in services.js with up/down stats and health %
- Display down services list with tooltips showing IP:port
- Add refresh button for manual health check trigger
- Update ACL with get_service_health read permission
- 5-minute cache for health data with force-refresh option

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 13:28:06 +01:00
0cdbffda4c feat(dev-status): Redesign widget v2.1 with dynamic architecture dashboard
- 4-layer architecture visualization (Core, AI, MirrorNet, Certification)
- 22+ features with dependency tracking (dependsOn/usedBy)
- 80+ components with status indicators
- Interactive filters: layer, status, category with localStorage persistence
- Feature cards: click to expand and see full dependencies
- Live RPCD data refresh (60s auto-refresh)
- Standalone HTML page for public access (/dev-status.html)
- ES5 compatible for older browsers
- Milestone timeline to v1.0

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 13:02:28 +01:00
d7524d6300 docs: Sync HISTORY.md and dev-status with RTTY Remote
- Added entry #78 for RTTY Remote Control Module (Phases 1-3)
- Updated dev-status Phase 4 progress: 55% → 65%
- Updated stats: modules 38→40, commits 1500→1650, LOC 45k→52k

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 18:02:18 +01:00
bc3be1709b feat(rtty-remote): Add Web Terminal view (Phase 3)
Integrates ttyd WebSocket terminal into RTTY Remote module:
- New "Web Terminal" menu item in System Hub
- Iframe-based terminal embedding ttyd on port 7681
- Node selector for local/remote terminal access
- Remote node detection (direct ttyd or SSH fallback)
- Fullscreen and refresh controls
- RPCD method: start_terminal for remote node terminal info

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 17:54:30 +01:00
5ae2227bf2 fix(rtty-remote): Correct haproxy method name in support panel
Change vhost_list to list_vhosts to match actual RPCD method.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 17:36:42 +01:00
0290aa39db feat(rtty-remote): Add token-based shared access for support sessions
Implements token-based authentication that grants RPC and terminal access
without requiring LuCI credentials. Support technicians can connect using
a short 6-character code.

CLI commands:
- rttyctl token generate [ttl] [permissions]
- rttyctl token list
- rttyctl token validate <code>
- rttyctl token revoke <code>
- rttyctl token-rpc <code> <object> <method> [params]

RPCD methods:
- token_generate: Create support token with TTL
- token_list: List active tokens
- token_validate: Check token validity
- token_revoke: Revoke a token
- token_rpc: Execute RPC with token auth (no LuCI session needed)

LuCI Support Panel:
- Generate code with selectable validity (30m/1h/2h/4h)
- Enter code to connect to remote node
- Token-authenticated RPC execution
- Live token list with copy/revoke actions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 17:17:58 +01:00
6101773bc2 fix(rtty-remote): Use direct ubus for local addresses to bypass auth
Local addresses (127.0.0.1, localhost, 192.168.255.1, lan IP) now use
direct ubus call instead of HTTP JSON-RPC, providing full access to
all ubus methods without authentication restrictions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 17:12:28 +01:00
02ed4f3b34 fix(rtty-remote): Fix RPCD rpc_call JSON response format
- jshn cannot embed raw JSON in objects, use printf instead
- Return proper {"success":true,"result":{...}} format
- Handle error cases with escaped error messages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 17:06:32 +01:00
8b65bd64e9 fix(rtty-remote): Add null checks and move to KISS UI System Hub
- Fix TypeError in support.js: add null checks for DOM elements
- Move menu entries from Services to System Hub (KISS UI)
- Menu paths: admin/secubox/system/system-hub/rtty-remote
- Menu paths: admin/secubox/system/system-hub/support

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 17:01:43 +01:00
2c763c3583 feat(rtty-remote): Add RTTY Remote Control module with support panel
New packages:
- secubox-app-rtty-remote: Backend with rttyctl CLI
- luci-app-rtty-remote: LuCI dashboard with KISS theme

Features:
- RPCD Proxy: Execute remote ubus calls to mesh nodes over HTTP
- Support Panel: Remote assistance with shareable session codes
- Session tracking: SQLite database for audit trail
- Quick actions: System info, network, services, vhosts, reboot
- RPC Console: Execute arbitrary ubus commands

CLI commands:
- rttyctl nodes - List mesh nodes
- rttyctl rpc <node> <object> <method> - Execute remote RPCD
- rttyctl rpc-list <node> - List available objects
- rttyctl sessions - Show session history

LuCI views:
- dashboard.js: Node management, stats, RPC console
- support.js: Remote assistance with session codes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 11:17:08 +01:00
68c9449c01 feat(luci-vortex-dns): Add zone management and secondary DNS UI
Dashboard now includes:
- Authoritative Zones table with View/Dump/Reload actions
- Import Zone modal with domain input
- Zone content viewer with download option
- Secondary DNS providers section
- Add Secondary modal (OVH/Gandi/Cloudflare support)

New RPC calls for zone_list, zone_dump, zone_import, zone_export,
zone_reload, secondary_list, secondary_add, secondary_remove.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 09:47:43 +01:00
592e46bde8 fix(vortex-dns): Fix shell glob syntax error in zone list
Remove 2>/dev/null from for-loop glob pattern which causes syntax
error in BusyBox ash shell. The [ -f "$zf" ] check handles the
case when no zone files exist.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 09:11:05 +01:00
34dab42a42 feat(vortex-dns): Add zone management and secondary DNS features
Add comprehensive zone management for DNS master functionality:
- vortexctl zone list/dump/import/export/reload commands
- Secondary DNS provider configuration (OVH support)
- RPCD methods for LuCI integration
- ACL permissions for new methods

This enables importing zones from external providers (Gandi) and
configuring OVH as secondary DNS with SecuBox as authoritative master.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 08:42:29 +01:00
356dc5f529 fix(haproxyctl): Fix duplicate userlist and path ACL indentation
- Skip UCI userlists already defined in AUTH_USERLIST_FILE to avoid
  duplicate 'secubox_users' userlist warning
- Fix indentation of nocache http-request rules in _emit_sorted_path_acls
- Use correct ACL names for path-based nocache rules

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-07 14:35:40 +01:00
640ceafa43 fix(mitmproxy): Change WAF proxy port from 8889 to 8890
Port 8889 conflicts with avatar-tap Streamlit service.
Updated mitmproxy-in instance to use port 8890 for HAProxy WAF routing.

Changes:
- UCI config: proxy_port and listen_port now default to 8890
- mitmproxyctl: Updated fallback defaults and documentation
- README: Updated architecture diagrams with correct port

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-07 11:13:42 +01:00
ee49126530 fix(routes-status): RPCD handler timeout for large vhost lists
- Root cause: jshn overhead + subshell issues with piped while loops
- Solution: Direct JSON output with printf, temp file for vhosts
- Deployed ACL file for LuCI authentication
- Handler now returns 226 vhosts in <10 seconds

Also:
- Added ROADMAP.md with version milestones and dependency graph
- Updated WIP.md with today's completed tasks

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-07 08:11:28 +01:00
bc8148db50 fix(lyrion,photoprism): Update default media paths for external drives
- Lyrion: Default media_path changed from /srv/media to /mnt/MUSIC
- PhotoPrism: Default originals_path changed from /srv/photoprism/originals to /mnt/PHOTO

These paths reflect the actual mount points used for external media storage.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-07 06:29:54 +01:00
d01828d632 feat(avatar-tap): Add session capture and replay package
New packages for passive network tap with session replay capabilities:

secubox-avatar-tap:
- Mitmproxy-based passive session capture
- Captures authenticated sessions (cookies, auth headers, tokens)
- SQLite database for session storage
- CLI tool (avatar-tapctl) for management
- Transparent proxy mode support
- Runs inside streamlit LXC container

luci-app-avatar-tap:
- KISS-style dashboard for session management
- Real-time stats (sessions, domains, replays)
- Replay/Label/Delete actions per session
- Start/Stop controls

Designed for SecuBox Avatar authentication relay system
with future Nitrokey/GPG integration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-06 20:41:21 +01:00
62962751d5 fix(photoprism): Add readonly mode for HFS+ read-only volumes
- Add PHOTOPRISM_READONLY=true to prevent writes to originals
- Add PHOTOPRISM_SIDECAR_PATH and PHOTOPRISM_CACHE_PATH to writable storage
- Create run_photoprism_cmd helper to pass environment to lxc-attach
- Fixes indexing on read-only Apple Photos library mounts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-06 12:07:35 +01:00
363e2af9d6 feat(photoprism): Add configurable originals_path via UCI/LuCI
- Add originals_path option to UCI config (default: /srv/photoprism/originals)
- Add set_config RPC method to update originals_path from LuCI
- Add Storage Settings section to LuCI dashboard
- Update LXC config to use configurable ORIGINALS_PATH
- Update get_stats to scan originals_path instead of data_path/originals
- Lyrion media_path already configurable via Settings page

Both services now support external mount points:
- PhotoPrism: /mnt/PHOTO for photos
- Lyrion: /mnt/MUSIC for music

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-06 11:34:09 +01:00
7bcd09b81d fix(photoprism): Switch to SQLite database for simpler LXC setup
- Replace MariaDB with SQLite (no external database needed)
- Update LXC config with proper device permissions and capabilities
- Install libvips42 instead of mariadb-server
- Fix binary path to ./bin/photoprism
- Use environment variables instead of options.yml
- Simplify backup to just archive storage directory
- Update WIP.md with SQLite note

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-06 11:18:03 +01:00
26519e7619 feat(photoprism): Add private photo gallery with AI features
New packages:
- secubox-app-photoprism: LXC-based PhotoPrism deployment
  - Debian Bookworm container with MariaDB, FFmpeg
  - AI face recognition, object detection, places/maps
  - photoprismctl CLI: install/start/stop/index/import/emancipate
  - HAProxy integration via mitmproxy (WAF-safe)

- luci-app-photoprism: KISS-themed dashboard
  - Stats cards (photos, videos, storage)
  - Service controls and AI feature display
  - Emancipate form for public exposure
  - RPCD backend with 12 methods

docs: Update WIP.md with PhotoPrism feature

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-06 10:00:49 +01:00
70056e02ed feat(ai-gateway): Add /login command with credential validation
- CLI: aigatewayctl login [provider] - validates credentials before saving
- Rollback on auth failure (preserves previous credentials)
- Format warnings for provider-specific API key patterns
- RPCD: login method for LuCI frontend integration
- ACL: Added write permission for login method

docs: Refactor WIP.md and update HISTORY.md
- WIP.md: 1470 → 108 lines (keep only March 2026 items)
- HISTORY.md: Add entries #74-75 (Feb 2026 milestones)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-06 09:49:46 +01:00
5b8c4cd52c feat(vhosts-checker): Dark theme UI with emoji status and fixed route detection
- Fix jshn boolean handling (use 1/0 instead of "true"/"false")
- Rework UI with dark theme compatible styling
- Add emoji-based status indicators (🔗🔒🛡️)
- Simplify interface with async Load More pagination
- Update README.md to v0.18.0 with 86 modules

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-04 11:37:08 +01:00
686fe113c5 feat(vhosts-checker): Add KISS UI dashboard for HAProxy vhosts status
Renamed from routes-status to vhosts-checker to avoid conflict with
OpenWrt's default network routes page.

- KISS UI theme with header chips and status cards
- Shows HAProxy vhosts with mitmproxy route status (OUT/IN)
- SSL certificate status indicators
- WAF bypass detection
- Sync routes and add missing route actions
- Accessible at Status → VHosts Checker and KISS UI Network → VHosts Checker

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-04 11:07:22 +01:00
bd2883d612 Revert "feat(routes-status): Add KISS UI theme integration"
This reverts commit 5b8c7f498a.
2026-03-04 11:04:21 +01:00
5b8c7f498a feat(routes-status): Add KISS UI theme integration
- Rewrite overview.js with KissTheme.wrap() for consistent SecuBox styling
- Add header chips for stats (vhosts, active, missing routes, WAF bypass, SSL)
- Add service status cards (HAProxy, mitmproxy, host IP)
- Add to KISS navigation under Network → Routes Status

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-04 11:02:33 +01:00
eb9adfd06a feat(routes-status): Add LuCI dashboard for HAProxy vhosts and mitmproxy routes
New package luci-app-routes-status providing:
- HAProxy vhosts status overview (218+ vhosts supported)
- mitmproxy route configuration status (OUT/IN routes)
- SSL certificate status indicators
- WAF bypass detection (vhosts not using mitmproxy_inspector)
- Sync routes and add missing route actions
- RPCD backend with batch processing for large vhost counts

Accessible at Status → Routes Status in LuCI.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-04 10:50:27 +01:00
2bb40d9419 fix(users,routing): Add gitea/jellyfin support and fix mitmproxy routes
secubox-users:
- Add gitea and jellyfin to supported services list
- Add create/update/delete handlers for gitea (via API) and jellyfin
- Update CLI help and status display to include new services

luci-app-secubox-users:
- Add jellyfin service checkbox and badge in frontend
- Update RPCD handler to check jellyfin service status

mitmproxy routing fix:
- nextcloudctl: Use host LAN IP instead of 127.0.0.1 for WAF routes
  (mitmproxy runs in container, can't reach host's localhost)
- metablogizerctl: Same fix for mitmproxy route registration
- mitmproxyctl: Fix sync_metablogizer_routes to use host IP

This fixes 502/403 errors when accessing services through HAProxy->mitmproxy
because the mitmproxy container couldn't route to 127.0.0.1 on the host.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-04 10:16:07 +01:00
518891d538 fix(rpcd): Fix shell syntax errors in RPCD handlers
- network-modes: Remove orphan code block after final esac statement
- netdata-dashboard: Replace bash process substitution with POSIX awk

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-04 09:59:42 +01:00
8769a60275 feat(sbom): Add CRA Annex I compliant SBOM pipeline
Implements comprehensive Software Bill of Materials generation for
EU Cyber Resilience Act compliance with ANSSI CSPN certification path.

SBOM Pipeline:
- scripts/check-sbom-prereqs.sh: Prerequisites validation (OpenWrt, tools, Kconfig)
- scripts/sbom-generate.sh: Multi-source SBOM generation (native, feed, rootfs, firmware)
- scripts/sbom-audit-feed.sh: PKG_HASH/PKG_LICENSE feed audit with MANIFEST.md
- Makefile: SBOM targets (sbom, sbom-quick, sbom-validate, sbom-scan, sbom-audit)
- .github/workflows/sbom-release.yml: CI with CVE gating and auto-security issues

Documentation:
- SECURITY.md: CRA Art. 13 §6 compliant vulnerability disclosure policy
- docs/sbom-pipeline.md: Architecture, CRA mapping, ANSSI CSPN guidance

AI Gateway (bonus feed):
- secubox-ai-gateway: 3-tier data classification (LOCAL_ONLY/SANITIZED/CLOUD_DIRECT)
- luci-app-ai-gateway: LuCI dashboard with provider management and audit logging

Output formats: CycloneDX 1.6 (primary) + SPDX 2.3 (secondary)
Tools: syft, grype, cyclonedx-cli (auto-installed if missing)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-04 08:01:00 +01:00
684673d714 fix(emancipate): Direct mitmproxy route registration on emancipation
Previously, emancipation relied on secubox-route or mitmproxyctl sync-routes
which didn't reliably add routes to haproxy-routes.json. This caused newly
emancipated services to return 404 from mitmproxy.

Changes:
- streamlitctl: Direct JSON write as primary method for route registration
- metablogizerctl: Direct JSON write as primary method
- peertubectl: Direct JSON write as primary method
- pinaforectl: Direct JSON write + route through mitmproxy_inspector for WAF

All emancipation flows now directly write to /srv/mitmproxy-in/haproxy-routes.json
using Python, with secubox-route and mitmproxyctl as fallbacks.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 16:38:30 +01:00
8a242cb229 fix(cdn-cache): Use correct field name for bandwidth saved stats
The RPCD returns 'bytes_saved' but the JS was looking for
'bandwidth_saved_bytes', causing the "BW Saved" stat to always show 0.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 11:32:47 +01:00
59dbd714a5 fix(tools): Add curl redirect handling to image builder scripts
Validated secubox-image.sh and secubox-sysupgrade.sh scripts:
- Fixed curl redirect issue: ASU API returns 301 redirects
- Added -L flag to 9 curl calls across both scripts
- Verified all device profiles valid (mochabin, espressobin, x86-64)
- Confirmed POSIX sh compatibility for sysupgrade script
- Validated first-boot script syntax

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 09:44:04 +01:00
29d309649e feat(wireguard): Implement Reverse MWAN WireGuard v2 Phase 1
WireGuard mesh peers as backup internet uplinks via mwan3 failover.

CLI (wgctl) uplink commands:
- uplink list/add/remove/status/test - Manage peer uplinks
- uplink failover enable/disable - Toggle automatic failover
- uplink priority/offer/withdraw - Priority and mesh advertising

Uplink Library (/usr/lib/wireguard-dashboard/uplink.sh):
- Gossip protocol integration via secubox-p2p
- WireGuard interface creation with IP allocation (172.31.x.x/16)
- mwan3 failover integration
- Connectivity testing and latency measurement

RPCD Backend (9 new methods):
- Read: uplink_status, uplinks
- Write: add_uplink, remove_uplink, test_uplink, offer_uplink,
         withdraw_uplink, set_uplink_priority, set_uplink_failover

UCI Config (/etc/config/wireguard_uplink):
- Global settings: auto_failover, failover_threshold, ping_interval
- Provider settings: offering state, bandwidth/latency advertisement
- Per-uplink config: interface, peer_pubkey, endpoint, priority

Phase 2 pending: LuCI dashboard integration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-01 15:43:17 +01:00
0c55ef6ec1 feat(nextcloud): Enhance integration with WAF, backups, mail, sync URLs
- WAF-safe SSL: Route through mitmproxy_inspector, auto-add routes
- Scheduled backups: setup-backup-cron with hourly/daily/weekly support
- Email/SMTP: setup-mail command for outbound notifications
- CalDAV/CardDAV: connections command shows sync URLs for all clients
- New RPCD methods: get_connections, setup_mail, setup_backup_cron
- ACL updated with new method permissions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-01 09:07:19 +01:00
b542ac7d3c feat: WAF auto-ban, cache busting, deployment docs, CVE Layer 7 docs
Changes:
- Enable WAF auto-ban by default (sensitivity: moderate, min_severity: high)
- Add whitelist for common safe IPs (localhost, router)
- Add browser cache busting via version parameter in CSS loads
- Document deployment scripts in secubox-tools/README.md
- Create CVE Layer 7 architecture documentation

WAF auto-ban now active with:
- 3 threats within 5 minutes triggers ban
- 4-hour ban duration
- Critical CVEs (Log4Shell, SQLi, CMDi) ban immediately

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-28 18:06:12 +01:00
d351ae515a feat(ai): Integrate MCP server and threat-analyst with AI Gateway
Route AI requests through the AI Gateway for data sovereignty compliance.

Changes:
- secubox-mcp-server: ai.sh now prefers AI Gateway (port 4050), falls back to LocalAI
- secubox-threat-analyst: UCI config adds ai_gateway_url option
- threat-analyst CLI shows both Gateway and LocalAI status
- analyzer.sh and appliers.sh use ai_url (Gateway preferred)
- README updated with AI Gateway integration section

The AI Gateway ensures threat data (IPs, MACs, logs) is classified as
LOCAL_ONLY and never leaves the device, supporting ANSSI CSPN compliance.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-28 17:59:20 +01:00