Commit Graph

700 Commits

Author SHA1 Message Date
2bf005f428 fix(metablogizer): Add default UCI config for menu visibility
- Add /etc/config/metablogizer with default settings
- Update Makefile to install config as conffile
- Fixes 404 error when accessing MetaBlogizer in LuCI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 12:35:58 +01:00
bca0ba5ada fix(multi): CrowdSec health check, MetaBlogizer menu, Portal apps
- CrowdSec Dashboard: Add bouncer_count, geoip_enabled, acquisition_count,
  scenario_count fields to get_overview and get_health_check RPCD functions
- MetaBlogizer: Fix menu path to admin/secubox/services/metablogizer
- Portal: Add MetaBlogizer and Gitea to apps registry for services section

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 12:34:50 +01:00
40195b5983 fix(crowdsec-dashboard): Show CAPI blocklist decisions in stats
The dashboard was showing 0 decisions because `cscli decisions list`
only returns local decisions, not CAPI blocklist entries.

Fixed by:
- Parsing CAPI decision counts from `cscli metrics` output
- Added separate local_decisions and capi_decisions fields
- Updated overview to show "CAPI Blocklist" and "Local Bans" separately
- Fixed get_capi_metrics to use metrics parsing instead of decisions list

This correctly shows ~15,000 CAPI blocklist IPs instead of 0.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 12:21:28 +01:00
32d737483b fix(crowdsec): Fix parsers and acquisition for v1.7.6 compatibility
- Change evt.Line contains -> evt.Line.Raw contains in parsers
  (pipeline.Line type requires .Raw accessor for string operations)
- Remove invalid filter: field from acquisition configs
  (filter belongs in parsers, not acquisition files)

Fixes CrowdSec v1.7.6 startup failures.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 12:08:03 +01:00
51c2f9d1a1 feat(metablogizer): Add KISS static site publisher with auto-vhost
New luci-app-metablogizer package replacing metabolizer with simplified
static site publishing:

- RPCD backend with create/delete/sync site methods
- Auto HAProxy vhost creation with SSL/ACME
- Nginx LXC container integration for serving static files
- Git sync from Gitea repositories
- QR code generation for published URLs
- Social share buttons (Twitter, LinkedIn, Facebook, Telegram, WhatsApp, Email)
- Drag-and-drop file upload UI
- SecuBox light theme styling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 11:56:06 +01:00
4811613711 feat(crowdsec): Upgrade to v1.7.6 with Go 1.23 compatibility
- Bump CrowdSec version from 1.7.4 to 1.7.6
- Add modernc.org/sqlite v1.34.2 vendor module (Go 1.21 compatible)
- Patch strings.SplitSeq in hubtest for Go 1.23 compatibility
- Add replace directive for sqlite to use vendored version

Built and tested: crowdsec_1.7.6-r1_aarch64_cortex-a72.ipk (80MB)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 11:33:49 +01:00
1fb2b11d4a feat(crowdsec+haproxy): Dashboard refactor, custom parsers & scenarios
CrowdSec Dashboard:
- Refactor all views (alerts, bouncers, decisions, overview, settings)
- Add soc.css for Security Operations Center styling
- Remove 3000+ lines of redundant code

CrowdSec Custom Parsers & Scenarios:
- Add secubox-gitea parser and bruteforce scenario
- Add secubox-haproxy parser and bruteforce scenario
- Add secubox-streamlit parser and bruteforce scenario
- Add secubox-webapp parser and bruteforce scenario
- Update Makefile for new parser/scenario files

HAProxy:
- Update api.js, backends.js view improvements
- Update luci.haproxy RPCD backend
- Update haproxyctl helper script

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 11:16:17 +01:00
8c062b6d60 docs: Update README v0.16.0 with 38 modules, add CHANGELOG
- README.md: Update to v0.16.0 with all 38 modules categorized
- CHANGELOG.md: Create comprehensive changelog (v0.12.0-v0.16.0)
- CLAUDE.md: Add toolchain build rules for Go/CGO packages
- secubox-tools/README.md: Add SDK vs toolchain build guidance
- TODO-ANALYSE.md: Mark completed tasks, update health score
- HISTORY.md: Document ARM64 toolchain discovery, multi-instance
- dev-status-widget.js: Update stats (38 modules, 1500 commits)

SDK builds produce LSE atomics that crash on some ARM64 CPUs.
Go/CGO packages (crowdsec, netifyd) must use full toolchain.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 10:58:48 +01:00
5a4f7986ac go 2026-01-27 06:42:55 +01:00
04908fc414 feat(multi): CrowdSec LAPI port fix, Streamlit/HexoJS multi-instance
CrowdSec:
- Change LAPI default port from 8080 to 8180 (avoid Docker conflict)
- Update bouncer config, init script, and RPCD dashboard
- Fix port detection hex value (1FF4 for 8180)

Streamlit:
- Complete rewrite with folder-based app structure
- Multi-instance support (multiple apps on different ports)
- Gitea integration (clone, pull, setup commands)
- Auto-install requirements.txt with hash-based caching

HexoJS:
- Multi-instance support with folder structure
- Multiple blog instances on different ports

HAProxy:
- Auto-generate fallback backends (luci, apps, default_luci)
- Add --server letsencrypt to ACME commands

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 06:37:19 +01:00
0be687b89b feat(hexojs): Add Build & Publish LuCI interface for Gitea workflow
- Add publish_to_www RPCD method to publish static files to /www/blog
- Add Build & Publish card in sync.js with configurable publish path
- Add generate RPC call for building site
- Fix file permissions for all RPCD scripts and init.d scripts
- Bump luci-app-hexojs to 1.0.0-r3

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 16:18:40 +01:00
d6861fe732 feat(streamlit+haproxy): Enhanced instance management and ACME cron
Streamlit Instances:
- Add Publish button with HAProxy integration (uses instance port)
- Add Edit dialog for modifying instance settings
- Replace enable/disable buttons with checkbox
- Get LAN IP dynamically from status data
- Bump luci-app-streamlit to r8

HAProxy:
- Add haproxy-acme-cron script for background cert processing
- Cron runs every 5 minutes to issue pending ACME certificates
- Prevents UI blocking during certificate issuance
- Bump secubox-app-haproxy to r19

RPCD:
- Fix json_error to return consistent format with json_success

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 13:08:48 +01:00
2de769dcab fix(streamlit): Fix settings page value loading
- Fix enabled/disabled select showing wrong value
- Normalize memory limit values (1G/2G/4G -> 1024M/2048M/4096M)
- Fix boolean value handling for headless and usage stats
- Use Object.assign for conditional selected attribute
- Bump to r6

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:54:33 +01:00
c1734c8ea0 fix(streamlit): Fix LuCI instance management bugs
- Add ACL permissions for instance RPC methods
- Fix settings page select styling (use st-form-input class)
- Fix memory limit options to match actual config values (1024M)
- Fix app selector dropdown in instances view (proper array handling)
- Bump luci-app-streamlit to r5

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:49:32 +01:00
6fda6e220d feat(streamlit): Add LuCI instance management for multi-app support
- Add Instances tab to LuCI Streamlit dashboard
- RPCD backend: list/add/remove/enable/disable instances
- API module: instance management methods
- UI: Instance table with status, port, enable/disable/remove actions
- Add Instance form with app selector and auto port assignment
- Apply & Restart button to apply instance changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:43:17 +01:00
750dccd644 Merge branch 'release/v0.15.0' 2026-01-26 12:38:02 +01:00
34698cac4e fix(streamlit): Fix ash shell compatibility for nested functions
- Move nested functions outside parent functions (ash doesn't support local functions)
- Fix _build_instance_entry and _print_instance_json syntax

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:36:49 +01:00
8adf53cb34 Merge branch 'release/v0.15.0' 2026-01-26 12:31:50 +01:00
a596eb64d8 feat(streamlit): Multi-instance support for compartmentalized apps
- Add multi-instance mode: run multiple apps on different ports
- New UCI config structure with 'instance' sections
- Container starts multiple streamlit processes via STREAMLIT_INSTANCES env
- CLI commands: instance list/add/remove/enable/disable
- Each instance has its own port, requirements auto-install
- Backward compatible: single-app mode still works
- Bumped to 1.0.0-r4

Example config:
  config instance 'dashboard'
    option app 'dashboard.py'
    option port '8502'
    option enabled '1'

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:31:37 +01:00
70254afc38 Merge branch 'release/v0.15.0' 2026-01-26 11:41:59 +01:00
24dc62cb79 feat(streamlit): Add Publish wizard for HAProxy vhost mapping
- Add "Publish" button to deploy apps via HAProxy reverse proxy
- Wizard configures: domain, SSL, ACME certificate
- Creates HAProxy backend + server + vhost automatically
- Shows PUBLISHED badge for apps with HAProxy integration
- Bumped luci-app-streamlit to 1.0.0-r2

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 11:41:47 +01:00
5d41a6cff8 Merge branch 'release/v0.15.0' 2026-01-26 11:39:35 +01:00
af94288f61 feat(streamlit): Add requirements.txt auto-install support
- Auto-detect and install app-specific requirements on container start
- Supports: <app>.requirements.txt, <app>_requirements.txt, requirements.txt
- Uses hash-based caching to avoid reinstalling on each restart
- Bumped to 1.0.0-r3

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 11:39:25 +01:00
5cd6c128f3 Merge branch 'release/v0.15.0' 2026-01-26 11:25:55 +01:00
26daa57a4b fix(multi): HAProxy duplicate server, Streamlit headless, dashboard optimization
Fixes:
- HAProxy: Prevent duplicate server names when both inline and separate
  server UCI sections exist for same backend
- Streamlit: Force --server.headless=true in start script (required for server)
- Dashboard: Optimize get_dashboard_data RPC call (6.56s → 0.09s) by using
  fast catalog counting instead of slow appstore list command
- Exposure: Add themed dashboard with SecuBox styling
- ACL: Add missing RPCD permissions for various LuCI apps

Version bumps:
- luci-app-exposure: 1.0.0-r3
- secubox-core: 0.10.0-r5
- secubox-app-haproxy: 1.0.0-r18
- secubox-app-streamlit: 1.0.0-r2
- Portal: v0.15.51

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 11:04:02 +01:00
e79a643134 feat(haproxy): Add certificate staging/production validation
- Add cert_is_production() to detect Let's Encrypt staging certificates
- Add cert_validate_public() to verify certificate publicly via curl/openssl
- Add cert_info() to display certificate details (domain, issuer, dates)
- Add cmd_cert_verify command for on-demand certificate verification
- Update cmd_cert_list to show staging/production status with icons
- Update cmd_cert_add to warn about staging mode and verify after issuance
- Bump package release to r16

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 08:49:04 +01:00
0e9ed474dd feat(exposure): Add toggle switches for Tor/SSL service exposure
- Replace buttons with toggle switches for enabling/disabling exposures
- Show current exposure status with colored indicators
- Load and display Tor hidden services and SSL backends status
- Add stats cards for exposable services, Tor services, and SSL backends
- Modal dialogs for configuring exposure parameters on toggle
- Bump luci-app-exposure to 1.0.0-r2

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 08:41:36 +01:00
c9075bc190 feat(haproxy): Add exposed services integration and fix cert key naming
- Fix HAProxy certificate key naming (.key -> .crt.key) for directory loading
- Add auto-fix in container startup script for existing certificates
- Add list_exposed_services RPC method to fetch services from secubox-exposure
- Add dynamic port scanning for running services discovery
- Add "Quick Select" dropdown in Add Server modal for service auto-fill
- Bump luci-app-haproxy to 1.0.0-r8
- Bump secubox-app-haproxy to 1.0.0-r15

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 08:34:57 +01:00
62cf871eeb feat(haproxy): Add emergency health banner and quick restart buttons
- HAProxy overview: Add prominent emergency banner showing service status
  with quick health indicators (Container/HAProxy/Config) and one-click
  Restart/Start/Stop buttons
- SecuBox dashboard: Add Critical Services Quick Restart section with
  buttons for HAProxy, CrowdSec, Tor Shield, and Gitea
- Metabolizer config: Fix portal_path to /www/blog

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 08:13:40 +01:00
1a4096fd2e feat(security-threats): Add Firewall & Network stats to dashboard
- Add get_security_stats RPC to API
- Add renderFirewallStats section with 6 stat cards:
  - WAN Dropped packets
  - Firewall Rejects
  - CrowdSec Bans
  - CrowdSec Alerts 24h
  - Invalid Connections
  - HAProxy Connections
- Visual gradient cards with formatted numbers (K/M suffixes)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 06:35:39 +01:00
a1bad31807 fix(multi): Exposure fixes, MagicMirror2 port, Tor Shield health card
Exposure Manager:
- Fix RPCD subshell issues in status and ssl_list methods
- Fix JS views to handle both array and object API responses

MagicMirror2:
- Change default port from 8082 to 8085 (avoid CyberFeed conflict)
- Update mm2ctl, RPCD, settings.js, dashboard.js, config

Tor Shield:
- Add restart method to RPCD and API
- Add health status minicard (Service, Bootstrap, DNS, Kill Switch)

Portal:
- Add 'active-ports' section for detected services
- Separate portal apps (Services) from detected ports (Active Ports)

Service Detection:
- Prioritize port-based identification over process name

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 17:22:52 +01:00
7566014096 fix(exposure): Fix RPCD subshell issues and api.js baseclass
- RPCD: Use temp file for scan to avoid pipe subshell issues
- api.js: Use baseclass.extend() for proper LuCI module pattern
- Menu: Remove UCI dependency that caused 404
- Makefile: Make haproxy/tor optional dependencies

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 16:19:04 +01:00
795a76c99a chore(portal): Bump package version to 0.7.0-r1
New features in this release:
- Service Exposure integration in network section
- Security stats on dashboard (WAN drops, firewall rejects, CrowdSec)
- Threat Monitor in security cards
- Fixed http:// URLs for local services

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 16:07:48 +01:00
d05c86b286 chore(portal): Bump version to v0.15.48
Update displayed version in header and portal UI.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 16:05:41 +01:00
c1444e1478 feat(portal): Add Service Exposure to network section
New app entry for service-exposure in portal network apps:
- Port conflict management
- Tor hidden services
- HAProxy SSL backends

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 15:53:38 +01:00
1056026168 feat(luci): Add LuCI interface for Service Exposure Manager
Complete LuCI app with:
- Overview dashboard with stats (services, Tor, SSL counts)
- Port conflict detection and warnings
- Services list with quick actions
- Tor hidden services management (add/list/remove)
- HAProxy SSL backends management (add/list/remove)

Views: overview.js, services.js, tor.js, ssl.js
RPCD: luci.exposure backend
Menu: admin/secubox/network/exposure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 15:49:29 +01:00
b198bb754a feat(exposure): Add SecuBox Service Exposure Manager
New unified tool for service exposure management:
- Port conflict detection and resolution (scan, conflicts, fix-port)
- Dynamic Tor hidden service management (tor add/list/remove)
- HAProxy SSL reverse proxy configuration (ssl add/list/remove)

Commands:
  secubox-exposure scan              # List listening services
  secubox-exposure conflicts         # Detect port collisions
  secubox-exposure tor add gitea     # Create .onion for service
  secubox-exposure ssl add svc domain # Add HAProxy SSL backend

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 15:44:43 +01:00
0c3c0c131d fix(core): Improve service detection by process name
Service detection now prioritizes process name matching over port-based
detection for more accurate identification of netifyd, streamlit,
cyberfeed, metabolizer, magicmirror, and picobrew services.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 15:40:16 +01:00
ed41ac326d fix(portal): Use http:// for local service URLs
Services in LXC/Docker containers don't have SSL certificates,
so always use http:// instead of inheriting the browser's protocol.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 15:32:36 +01:00
37b88e47b9 feat(portal): Add Threat Monitor to security cards and stats
- Add threat-monitor app to security section in portal.js
- Add security stats RPC call (get_security_stats)
- Display packets blocked and alerts on dashboard
- Add Threat Monitor to featured quick access apps
- Show WAN dropped + firewall rejects in events section
- Link to Threat Monitor dashboard from events

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 15:24:37 +01:00
283f2567be feat(security): Add security stats and Gitea mirror commands
Security Stats:
- Add get_security_stats RPCD method for quick overview
- Track WAN drops, firewall rejects, CrowdSec bans
- Add secubox-stats CLI tool for quick stats check

Gitea Mirror Commands:
- Add mirror-sync to trigger mirror repository sync
- Add mirror-list to show all mirrored repos
- Add mirror-create to create new mirrors from GitHub URLs
- Add repo-list to list all repositories
- Requires API token: uci set gitea.main.api_token=<token>

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 15:15:50 +01:00
CyberMind
d2b2a10519
Merge pull request #13 from gkerma/release/v0.15.0
fix: Add restart to services and fix wireguard qrcode module
2026-01-25 15:14:59 +01:00
b7edc32695 fix: Add restart to services and fix wireguard qrcode module
- haproxy: Add explicit restart_service function
- tor-shield: Add explicit restart_service function
- wireguard-dashboard/qrcode.js: Use baseclass.extend() pattern
  to fix "factory yields invalid constructor" error

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 14:40:46 +01:00
CyberMind
ed12f106c4
Merge pull request #12 from gkerma/release/v0.15.0
Release/v0.15.0
2026-01-25 11:45:06 +01:00
fed7bd43c1 fix(haproxy): Combine fullchain + key for HAProxy certificates
HAProxy requires certificate files to contain both the fullchain
(cert + intermediate CA) and the private key concatenated together.

Changes:
- haproxyctl: Fix cert_add to create combined .pem files
- haproxy-sync-certs: New script to sync ACME certs to HAProxy format
- haproxy.sh: ACME deploy hook for HAProxy
- init.d: Sync certs before starting HAProxy
- Makefile: Install new scripts, add cron job for cert sync

This fixes the "No Private Key found" error when HAProxy tries to
load certificates that only contain the fullchain without the key.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 11:42:29 +01:00
785ba9eb4c fix(wireguard): Handle RPC expect unwrapping in API and views
The RPC expect clause unwraps responses - when `expect: { peers: [] }`
is used, the response `{peers: [...]}` gets unwrapped to just `[...]`.

Fixed:
- api.js: getAllData and getMonitoringData now handle both array
  and object formats for peers, interfaces, and rates
- overview.js: render and polling functions now safely unwrap
  data that may be array or nested object

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 10:45:25 +01:00
787fe3864e fix(tor-shield): Fix json_init bug and permission issues
RPCD backend:
- Fix critical json_init bug: variables must be extracted BEFORE
  json_init() which wipes the loaded JSON. Affected functions:
  save_settings, do_enable, set_bridges, add/remove_hidden_service
- Fix process detection: use pgrep instead of pid file
- Fix uptime calculation: get PID from pgrep, not pid file
- Fix RPC expect unwrapping in getDashboardData for presets

Init script:
- Remove PidFile directive (procd manages the process)
- Clean up stale files before starting to avoid permission issues
- Set proper ownership on torrc after generation
- Fix iptables chain creation to handle "already exists" gracefully
- Remove from OUTPUT chain before attempting chain deletion

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 09:59:07 +01:00
5400e34e1f fix(tor-shield): Handle RPC expect unwrapping in hidden services view
Same issue as circuits - RPC expect clause unwraps response to array.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 09:17:19 +01:00
134736a0e9 fix(tor-shield): Handle RPC expect unwrapping in circuits API
The RPC expect clause unwraps the response, so circuits data may be
an array directly rather than an object with circuits property.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 09:13:21 +01:00
0c54940010 fix(tor-shield): Multiple bug fixes for control socket and startup
- Fix subshell bug in get_circuits (pipe loses JSON state)
- Add has_control flag to status for frontend awareness
- Fix UseBridges without bridge lines causing Tor to fail
- Fix hidden service directory ownership (tor:tor)
- Change log output from file to syslog
- Fix run directory ownership and permissions (700)
- Add CookieAuthentication for control socket auth
- Use socat instead of nc (BusyBox lacks Unix socket support)
- Add socat as package dependency
- Optimize duplicate curl calls in status check
- Use fallback IP services for real_ip detection

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 09:05:18 +01:00