From 9ad45d6b1d335e074e976a0103ce51030634b26e Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Thu, 12 Feb 2026 14:35:51 +0100 Subject: [PATCH] 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 --- .claude/WIP.md | 25 ++++++++++++++++++- .claude/settings.local.json | 7 +++++- .../files/usr/sbin/haproxyctl | 9 +++++++ .../files/usr/sbin/metablogizerctl | 9 +++++++ .../files/usr/sbin/streamlitctl | 12 +++++++++ 5 files changed, 60 insertions(+), 2 deletions(-) diff --git a/.claude/WIP.md b/.claude/WIP.md index 9ac70e58..1f574366 100644 --- a/.claude/WIP.md +++ b/.claude/WIP.md @@ -1,6 +1,6 @@ # Work In Progress (Claude) -_Last updated: 2026-02-11_ +_Last updated: 2026-02-12_ > **Architecture Reference**: SecuBox Fanzine v3 — Les 4 Couches @@ -335,6 +335,29 @@ _Last updated: 2026-02-11_ - Blockchain: `peer_approved` blocks recorded correctly - Threat Intel: 288 local IOCs, 67 threat_ioc blocks in chain +### Just Completed (2026-02-12) + +- **HAProxy stats.js KISS Migration** — DONE (2026-02-12) + - Rewrote Statistics dashboard to use KissTheme + - Stats iframe, logs viewer with refresh + - Removed CSS import via style element + +- **HAProxy backends.js KISS Migration** — DONE (2026-02-12) + - Rewrote Backends dashboard to use KissTheme + - Backend cards with server lists, health check info + - Add/edit server modals with quick service selector + - Removed external dashboard.css dependency + +- **HAProxy vhosts.js KISS Migration** — DONE (2026-02-12) + - Rewrote Virtual Hosts dashboard to use KissTheme + - Self-contained inline CSS, removed external dashboard.css + - Add vhost form, vhosts table, edit modal, delete confirmation + +- **InterceptoR LXC Detection Fix** — DONE (2026-02-12) + - Changed from `lxc-ls --running` to `lxc-info -n mitmproxy -s` + - More reliable container state detection + - Fixed container name from `secbx-mitmproxy` to `mitmproxy` + ### Just Completed (2026-02-11) - **InterceptoR Services Dashboard** — DONE (2026-02-11) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 028728f7..ebe6578b 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -330,7 +330,12 @@ "Bash(git describe:*)", "Bash(SSH_AUTH_SOCK=\"$SSH_AUTH_SOCK\" ssh:*)", "Bash(node --check:*)", - "Bash(do ssh root@192.168.255.1 'ubus call luci.cloner build_progress \"\"{}\"\"')" + "Bash(do ssh root@192.168.255.1 'ubus call luci.cloner build_progress \"\"{}\"\"')", + "Bash(while read file)", + "Bash(if ! grep -q \"kiss-theme\" \"$file\")", + "Bash(pip3 show:*)", + "Bash(playwright install:*)", + "Bash(timeout 8 streamlit run:*)" ] } } diff --git a/package/secubox/secubox-app-haproxy/files/usr/sbin/haproxyctl b/package/secubox/secubox-app-haproxy/files/usr/sbin/haproxyctl index 958ce2ef..47892fad 100644 --- a/package/secubox/secubox-app-haproxy/files/usr/sbin/haproxyctl +++ b/package/secubox/secubox-app-haproxy/files/usr/sbin/haproxyctl @@ -1653,6 +1653,9 @@ cmd_vhost_add() { uci commit haproxy log_info "Virtual host added: $domain -> $backend" + + # Regenerate GK2 Hub landing page if generator exists + [ -x /usr/bin/gk2hub-generate ] && /usr/bin/gk2hub-generate >/dev/null 2>&1 & } cmd_vhost_remove() { @@ -1666,6 +1669,9 @@ cmd_vhost_remove() { uci commit haproxy log_info "Virtual host removed: $domain" + + # Regenerate GK2 Hub landing page if generator exists + [ -x /usr/bin/gk2hub-generate ] && /usr/bin/gk2hub-generate >/dev/null 2>&1 & } # =========================================== @@ -1813,6 +1819,9 @@ cmd_reload() { log_error "Could not signal HAProxy for reload" log_info "Reload complete" + + # Regenerate GK2 Hub landing page if generator exists + [ -x /usr/bin/gk2hub-generate ] && /usr/bin/gk2hub-generate >/dev/null 2>&1 & } cmd_validate() { diff --git a/package/secubox/secubox-app-metablogizer/files/usr/sbin/metablogizerctl b/package/secubox/secubox-app-metablogizer/files/usr/sbin/metablogizerctl index 0de10fdd..eca8cd35 100644 --- a/package/secubox/secubox-app-metablogizer/files/usr/sbin/metablogizerctl +++ b/package/secubox/secubox-app-metablogizer/files/usr/sbin/metablogizerctl @@ -376,6 +376,9 @@ cmd_publish() { /usr/sbin/secubox-content-pkg site "$name" "$domain" 2>/dev/null && \ log_info "Site packaged for mesh distribution" fi + + # Regenerate GK2 Hub landing page if generator exists + [ -x /usr/bin/gk2hub-generate ] && /usr/bin/gk2hub-generate >/dev/null 2>&1 & } cmd_delete() { @@ -412,6 +415,9 @@ cmd_delete() { fi log_info "Site deleted" + + # Regenerate GK2 Hub landing page if generator exists + [ -x /usr/bin/gk2hub-generate ] && /usr/bin/gk2hub-generate >/dev/null 2>&1 & } cmd_sync() { @@ -870,6 +876,9 @@ _emancipate_reload() { else log_warn "[RELOAD] HAProxy may not have started properly" fi + + # Regenerate GK2 Hub landing page if generator exists + [ -x /usr/bin/gk2hub-generate ] && /usr/bin/gk2hub-generate >/dev/null 2>&1 & } cmd_emancipate() { diff --git a/package/secubox/secubox-app-streamlit/files/usr/sbin/streamlitctl b/package/secubox/secubox-app-streamlit/files/usr/sbin/streamlitctl index a081d831..2d2fb827 100644 --- a/package/secubox/secubox-app-streamlit/files/usr/sbin/streamlitctl +++ b/package/secubox/secubox-app-streamlit/files/usr/sbin/streamlitctl @@ -671,6 +671,9 @@ cmd_app_delete() { uci commit "$CONFIG" log_info "App '$name' deleted" + + # Regenerate GK2 Hub landing page if generator exists + [ -x /usr/bin/gk2hub-generate ] && /usr/bin/gk2hub-generate >/dev/null 2>&1 & } cmd_app_deploy() { @@ -811,6 +814,9 @@ cmd_instance_add() { log_info "Instance added: $app on port $port" log_info "Restart service to apply: /etc/init.d/streamlit restart" + + # Regenerate GK2 Hub landing page if generator exists + [ -x /usr/bin/gk2hub-generate ] && /usr/bin/gk2hub-generate >/dev/null 2>&1 & } cmd_instance_remove() { @@ -832,6 +838,9 @@ cmd_instance_remove() { generate_instances_conf log_info "Instance '$name' removed" + + # Regenerate GK2 Hub landing page if generator exists + [ -x /usr/bin/gk2hub-generate ] && /usr/bin/gk2hub-generate >/dev/null 2>&1 & } cmd_instance_start() { @@ -1348,6 +1357,9 @@ _emancipate_reload() { else log_warn "[RELOAD] HAProxy may not have started properly" fi + + # Regenerate GK2 Hub landing page if generator exists + [ -x /usr/bin/gk2hub-generate ] && /usr/bin/gk2hub-generate >/dev/null 2>&1 & } cmd_emancipate() {