Commit Graph

9 Commits

Author SHA1 Message Date
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
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
0083513cdc fix(streamlit): Add chunked upload to bypass uhttpd 64KB JSON limit and support top-level .py apps
uhttpd-mod-ubus silently rejects JSON-RPC requests >64KB with "Parse error",
causing uploads of .py files >48KB to fail with "No related RPC reply".

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

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

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 08:44:19 +01:00
5317f37e7a refactor(streamlit): KISS UI redesign
Simplify LuCI interface from 5 tabs to 2:
- Dashboard: status, controls, apps list, upload (all-in-one)
- Settings: configuration options

Remove complex custom CSS, use standard LuCI styles.

Deleted: overview.js, apps.js, instances.js, logs.js
Added: dashboard.js (single-page dashboard)
Updated: settings.js (simplified form), menu.json

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 07:17:20 +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
474fe7830d feat(metabolizer): Add blog CMS pipeline with Gitea, Streamlit, HexoJS
Metabolizer Blog Pipeline - integrated CMS for SecuBox:
- Gitea: Mirror GitHub repos, store blog content
- Streamlit: CMS app with markdown editor and live preview
- HexoJS: Static site generator (clean → generate → publish)
- Webhooks: Auto-rebuild on git push
- Portal: Static blog served at /blog/

Pipeline: Edit in Streamlit CMS → Push to Gitea → Build with Hexo → Publish

Packages:
- secubox-app-streamlit: Streamlit server with LXC container
- luci-app-streamlit: LuCI dashboard for Streamlit apps
- secubox-app-metabolizer: CMS pipeline orchestrator

CMS Features:
- Two-column markdown editor with live preview
- YAML front matter editor
- Post management (drafts, publish, unpublish)
- Media library with image upload
- Git sync and Hexo build controls
- Cyberpunk theme styling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 10:35:21 +01:00