Commit Graph

310 Commits

Author SHA1 Message Date
81f9c639a4 docs(metablog): 8-task implementation plan for site.json schema (ref #101)
8 tasks:
1. JSON Schema draft-07 file
2. Python validator + enricher module + 7 pytest cases
3. Wire helper into load_sites() (warn-only validation)
4. Add python3-jsonschema to debian/control
5. Backfill script (SSH orchestrator + Gitea probe for streamlit_app)
6. 3-gate smoke test
7. Live backfill run + summary
8. .gitignore + README + tracking + finish worktree

Self-review: spec coverage complete, no placeholders, identifiers
consistent (_load_site_json, _schema_enrich, _schema_validate,
status keywords, paths).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 17:12:21 +02:00
542f236601 docs(metablog): Design spec for site.json schema + version metadata (ref #101)
Sub-project C of #49. JSON Schema draft-07 + Python validator/enricher +
backfill script + API extension. Permissive validation (log warnings,
don't reject). version + last_updated derived from git when site.json
lacks them. Backfill creates complete site.json for the 105 sites
without one (auto-detects streamlit_app via Gitea repo presence) and
preserves the 61 existing ones unless --force.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 17:06:00 +02:00
2f440c6194 Merge remote-tracking branch 'origin/master' into feature/95-streamlit-per-site-version-pinning-conta
# Conflicts:
#	.claude/HISTORY.md
#	.claude/WIP.md
#	.gitignore
2026-05-12 16:59:00 +02:00
744770750e Merge remote-tracking branch 'origin/master' into feature/94-metablogizer-gitea-ingest-import-166-sit
# Conflicts:
#	.claude/HISTORY.md
#	.claude/WIP.md
2026-05-12 16:57:43 +02:00
4a388994d3 Merge remote-tracking branch 'origin/master' into feature/49-feat-metablogizer-streamlit-version-mana
# Conflicts:
#	.claude/HISTORY.md
2026-05-12 16:56:06 +02:00
d110c00786 docs(streamlit): Full-run ingest summary (ref #95)
28 Streamlit apps ingested into gitea.gk2.secubox.in/gandalf/streamlit-*.
First pass had 20 failures from pre-existing broken Gitea repo stubs;
bulk-deleted via API and second pass cleaned to 0 fail.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 16:29:34 +02:00
37df7b9c9b docs(streamlit): 9-task implementation plan for Gitea version pinning (ref #95)
9 tasks:
1. Per-app ingest function (scripts/lib/streamlit-ingest-app.sh)
2. Orchestrator (scripts/streamlit-ingest.sh) — preflights + JSON report
3. 3-app smoke + idempotent re-run
4. Full 30-app run + summary commit
5. streamlitctl deploy --from-gitea --tag + rollback subcommand
6. FastAPI _get_apps() enrichment (current_tag, deployed_at)
7. Deploy/rollback cycle smoke (canary: yijing)
8. .gitignore + README + Session 163 tracking
9. Finish worktree + PR (Refs #49 sub-F, Closes #95)

Reuses patterns + helpers from sub-project B (#97):
- scripts/lib/gitea-ssh-preflight.sh (sourced)
- gitea@ SSH user (not git@)
- defensive | tail -1 | tr -d '\n' on status capture (FU4 from B)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 16:29:34 +02:00
c7613288f0 docs(streamlit): Design spec for Gitea version pinning (ref #95)
Sub-project F of #49. Audit shows 30 directory-form apps in
/srv/streamlit/apps/ (23 already have .git/, 7 don't), running
inside the existing streamlit LXC at 10.100.0.50.

Design:
- Mirror all 30 apps to gandalf/streamlit-<app> on Gitea
- Retarget existing .git + push history for the 23 (preserves
  any local commits); git init + push for the 7
- Tag v1.0.0 on initial state
- streamlitctl deploy <app> --from-gitea --tag <vX.Y.Z>:
  clone tag into /srv/streamlit/apps/<app>/ with backup of
  the current content; restart running instance if any
- streamlitctl rollback <app>: restore latest backup
- New API fields: current_tag, deployed_at (read from
  .deploy.json or git describe --tags --exact-match)

YAGNI: no multi-version side-by-side, no container per
version, no webhook trigger.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 16:29:34 +02:00
CyberMind
2744758b9e
Health banner: live panel (visitor-origin + live-hosts + cert-status) (#98)
* docs(spec): Health banner live panel design (ref #92)

Three public banner sections sharing one polling/CORS pipeline:
- VisitorOrigin: nft set seen_src + GeoLite2-ASN.mmdb, threshold-gated
  rollup, raw IPs discarded before persistence
- LiveHosts: HAProxy admin socket, 60 x 1-min ring buffer over req_tot
  deltas, hostname-heuristic frontend filter
- CertStatus: scan /etc/letsencrypt/live + cryptography parse, classify
  valid / expiring_soon / expiring_critical / expired

Each section fails independently; section hidden on enabled=false,
empty entries, or fetch error. All three endpoints are unauthenticated,
CORS-open, Cache-Control max-age=300.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(plan): Health banner live panel implementation plan (ref #92)

14-task TDD plan: tests scaffold -> config helpers -> three aggregators
(visitor-origin / live-hosts / cert-status) -> FastAPI lifespan wiring ->
nftables ruleset -> geoipupdate timer -> debian packaging -> banner v1.3.0
-> README + tracking docs -> full-suite verification + PR.

Also reconciles spec with codebase conventions: service user is 'secubox'
(not 'secubox-metrics'); config lives in /etc/secubox/secubox.conf, not a
separate metrics.toml.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(metrics): Scaffold pytest layout for new aggregators (ref #92)

Adds tests/__init__.py and conftest.py that wire packages/secubox-metrics/api
and the repo-wide common/ onto sys.path so individual aggregator modules can
be imported in isolation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(core): Add visitor_origin / live_hosts / cert_status config helpers (ref #92)

Three new section helpers in secubox_core.config that merge defaults with
operator-supplied TOML overrides. Each section defaults to enabled=false so
the live-panel aggregators stay quiet on systems that haven't opted in.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(metrics): Use tmp_path fixture + drop unused import (ref #92)

Switches the config-helper tests from a hard-coded /tmp path to pytest's
tmp_path fixture, matching the pattern in packages/secubox-haproxy/tests/.
Removes the now-unused 'from unittest.mock import patch' line.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(metrics): VisitorOrigin aggregator (ref #92)

Pure-Python aggregator that polls the nft seen_src set, resolves ASNs via
GeoLite2 mmdb, and emits a threshold-gated top-N rollup. Private/loopback IPs
are skipped at lookup time; raw IPs never leave the function scope; the
threshold gate runs before persistence so the cache file never contains
attributable counts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(metrics): VisitorOrigin code-review followups (ref #92)

- mmdb auto-reopen on mtime change (Important): close + reopen when stat
  reports a different mtime; previously _mmdb_mtime was dead state.
- _read_nft_set defensive parse (Important): guard against {elem: str} shapes
  to prevent a latent TypeError.
- current() returns a defensive copy (Minor): no more by-reference leak of
  internal state.
- Drop unused ip_address import and unused monkeypatch parameter (Minor).
- Tighten tiebreak test to assert ASN order, not just count order (Minor).
- Add test for mtime-based reopen.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(metrics): Pin VisitorOrigin error-path behaviour (ref #92)

Regression tests for refresh_once: disabled config, missing mmdb, and nft
subprocess failure must all yield a non-throwing degraded payload.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(metrics): LiveHosts aggregator with 60x1-min ring buffer (ref #92)

Reads HAProxy admin socket via raw AF_UNIX, parses 'show stat' CSV, filters
internal frontends (leading underscore or no dot), ring-buffers per-frontend
deltas over 60 minutes, and emits a top-N hostname rollup. Counter-reset
detection (cur < prev) yields a fresh-baseline bucket instead of a negative
delta. current() returns a defensive copy mirroring the VisitorOrigin fix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(metrics): Pin LiveHosts CSV parser + missing-socket paths (ref #92)

Tests the show-stat CSV parser against the real HAProxy column order and
asserts that an absent admin socket returns a degraded payload rather than
raising.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(metrics): CertStatus aggregator (ref #92)

Scans /etc/letsencrypt/live for cert.pem files, classifies each by days
remaining (valid / expiring_soon / expiring_critical / expired) using the
operator's warn_days/critical_days thresholds, and emits a summary + soonest
next-renewal host. A single corrupt PEM never kills the scan. Days remaining
computed with math.ceil so a cert expiring in 2.99d reports 3d, consistent
with certbot/renewal tooling expectations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(metrics): correct expired boundary when using math.ceil (ref #92)

math.ceil maps any cert that expired within the last 24 h to days=0,
which the previous `days < 0` guard treated as expiring_critical instead
of expired. Changing the guard to `days <= 0` closes the gap: with ceil,
days=0 means actual remaining time is in (-86400, 0] — i.e. already
past or exactly at expiry — so classifying it as expired is correct.
All four existing tests continue to pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(metrics): Wire three live-panel aggregators into FastAPI lifespan (ref #92)

Adds the three asyncio background tasks under a single lifespan and exposes
their current() payloads on /api/v1/metrics/{visitor-origin,live-hosts,cert-status}
with a 5-min Cache-Control. Endpoints stay unauthenticated by design — the
aggregators only emit threshold-gated, hostname-only data.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(metrics): Await cancelled lifespan tasks + tidy import order (ref #92)

- Important: lifespan finally now awaits gather(*tasks, return_exceptions=True)
  after cancel(), so blocking subprocess/socket I/O in aggregator refreshes
  doesn't race uvicorn's shutdown timeout.
- Minor: move 'from contextlib import asynccontextmanager' into the stdlib
  import group at the top of the file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(metrics): Ship nftables ingress tap for visitor-origin (ref #92)

Private inet secubox_metrics table with a timeout'd src-IP set, hooked from
prerouting at priority -300 so additions happen before secubox-firewall's
filter chain decides whether to drop the packet.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(metrics): Weekly GeoLite2 ASN refresh timer (ref #92)

Conditional on /etc/secubox/secrets/maxmind.conf existing, so the unit is a
silent no-op on installs that haven't supplied a license key. RandomizedDelay
spreads load when many boxes deploy together.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* build(metrics): Package live-panel deps, nft ruleset, and geoipupdate timer (ref #92)

- control: add python3-maxminddb, python3-cryptography, geoipupdate, nftables
- rules: install nftables/ and systemd/ assets
- postinst: secubox -> haproxy group, cache + secrets + GeoIP dirs,
            nftables reload, timer enable
- service: ReadWritePaths gains /var/cache/secubox

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(metrics): Run geoipupdate as secubox + restart svc on upgrade (ref #92)

- secubox-geoipupdate.service: User/Group=secubox so .mmdb files inherit the
  ownership the metrics service expects when reading them. Previously the
  unit ran as root and created root-owned files that secubox-metrics could
  not open.
- postinst: switch 'systemctl start' to 'systemctl restart' so the secubox
  user's new haproxy-group membership is picked up by an already-running
  service after an upgrade.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(banner): v1.3.0 live panel — visitor origin, live hosts, cert status (ref #92)

Three independent fetch loops on a shared 30s cadence, three DOM sections,
per-section hide on enabled=false / empty / fetch error. Uses existing
design tokens (gold/cyan/matrix-green) so no new CSS variables are added.
A failing section never affects the others.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(banner): Correct banner element id lookup in live-panel (ref #92)

The new live-panel sectionContainer() helper looked up
getElementById('sbx-health-banner'), but the actual banner element is
created with id='health-banner'. The mismatch made banner null, so the
three live-panel sections were silently never appended to the DOM.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs: Session 160 — Health Banner Live Panel (ref #92)

README documents the three new endpoints + config blocks. HISTORY / WIP /
MIGRATION-MAP entries describe the feature, the spec/plan paths, and the
session's outcome.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(metrics): Address whole-branch review findings (ref #92)

- Wrap _read_nft_set / _read_haproxy_stats in asyncio.to_thread so blocking
  I/O (subprocess up to 5s, AF_UNIX recv up to 2s) no longer stalls the
  event loop on every refresh tick.
- Replace falsy current() guard with explicit _refreshed flag. Previously,
  a successful refresh that produced entries=[] would fall through to the
  on-disk cache, serving stale non-empty data during low-traffic periods.
- Move geoipupdate from Depends to Recommends. It lives in bookworm/contrib,
  so a hard dependency breaks 'apt install secubox-metrics' on systems
  without contrib enabled. The aggregator already degrades gracefully when
  the mmdb is absent, making Recommends the correct strength. README
  documents the contrib note.
- prerm stops + disables secubox-geoipupdate.timer/service so 'apt remove'
  doesn't leave an orphan timer firing weekly with a missing unit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: CyberMind-FR <gandalf@Gk2.net>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 16:27:56 +02:00
0cb6ad6434 docs(metablog): Record full-run ingest summary (ref #94)
166 sites ingested into gitea.gk2.secubox.in/gandalf/metablog-*.
First pass had 72 failures from pre-existing broken Gitea repo
stubs; bulk-deleted via API and second pass cleaned to 0 fail.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 15:10:06 +02:00
cf1e13ccc8 docs(metablog): Add 8-task implementation plan for Gitea ingest (ref #94)
8 tasks:
1. Gitea config patch (ENABLE_PUSH_CREATE_USER, DEFAULT_BRANCH=main)
2. SSH preflight + key enrolment helper
3. Per-site ingest function (idempotent, history-preserving)
4. Orchestrator with preflights + JSON report
5. Smoke test on 3 sites (incl. idempotent re-run + clone-vs-source diff)
6. Full 166-site run + verification + summary commit
7. .gitignore + README + WIP/HISTORY tracking
8. Finish worktree + PR (Refs #49 sub-B, Closes #94)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 15:10:05 +02:00
577dc31d20 docs(metablog): Design spec for Gitea ingest of 166 sites (ref #94)
Sub-project B of #49. Audit shows 166 sites in /srv/metablogizer/sites/:
83 have local .git pointing at unreachable old Gitea (192.168.255.1:3001
or git.gk2/droplet-sites), 83 are raw files.

Design:
- All 166 land at gandalf/metablog-<site> on gitea.gk2.secubox.in (single
  namespace, even for the 12 ex-droplet-sites)
- Existing .git: retarget remote + push history (preserves 1 commit)
- Missing .git: git init + initial commit
- ENABLE_PUSH_CREATE_USER=true in Gitea app.ini so push creates repos
- SSH auth via gandalf's enrolled key; no API token plumbing
- Idempotent: skip if remote HEAD matches local HEAD
- v1.0.0 tag on HEAD after first push (per issue text)
- output/ingest-report.json captures per-site status

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 15:10:05 +02:00
CyberMind
122cd6cebc
WebUI Obfuscation - admin.HOSTNAME.secubox.in Only (#96)
* docs(spec+plan): WebUI obfuscation design and implementation plan (ref #44)

Spec: docs/superpowers/specs/2026-05-12-webui-obfuscation-design.md
Plan: docs/superpowers/plans/2026-05-12-webui-obfuscation.md

The design locks the SecuBox WebUI to admin.<HOSTNAME>.<DOMAIN_SUFFIX>
via strict-regex ACLs in HAProxy AND nginx, both driven by
/etc/default/secubox as the single source of truth. New package
secubox-defaults ships the env file; secubox-haproxy API exposes
/webui/admin-domain (info), /webui/nginx-config (JWT, rendered vhost),
/webui/refresh (JWT, cache invalidate). A safe renderer script writes
the nginx vhost atomically; haproxyctl + Python /generate both inject
the strict ACL at the top of http-in and https-in frontends.

Plan has 15 tasks with TDD steps, exact file paths, and complete code
in every step (no TBD/TODO). Acceptance criteria + integration test
script included.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(secubox-defaults): scaffold package skeleton (ref #44)

* feat(secubox-defaults): ship /etc/default/secubox env file (ref #44)

* feat(secubox-defaults): postinst autodetect + dpkg-trigger (ref #44)

* feat(secubox-haproxy): webui_identity helper + tests (ref #44)

Implement webui_identity module that parses /etc/default/secubox
and exposes canonical admin URL + regex pattern for HAProxy acl.

New module:
- api/webui_identity.py: Parses SECUBOX_HOSTNAME and SECUBOX_DOMAIN_SUFFIX
  with LRU cache and invalidation support.

Tests (TDD):
- tests/test_webui_identity.py: 5 test cases covering basic parsing,
  missing hostname validation, custom suffix handling, comment handling,
  and cache invalidation.
- tests/conftest.py: sys.path bootstrap for api/ imports.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(webui_identity): catch OSError on defaults read + test (ref #44)

* feat(secubox-haproxy): GET /webui/admin-domain endpoint (ref #44)

* feat(secubox-haproxy): GET /webui/nginx-config rendered vhost (ref #44)

* feat(secubox-haproxy): POST /webui/refresh cache invalidation (ref #44)

* feat(secubox-haproxy): secubox-render-nginx-webui safe renderer (ref #44)

* feat(haproxyctl): inject strict-regex WebUI ACL at frontend top (ref #44)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(secubox-haproxy): /generate symmetry with strict WebUI ACL (ref #44)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(secubox-haproxy): dpkg-trigger refresh on secubox-defaults-changed (ref #44)

* build(secubox-haproxy): depend on secubox-defaults (ref #44)

* test(infra): integration test for WebUI obfuscation (ref #44)

* docs: HISTORY Session 159 — WebUI obfuscation (ref #44)

Records the complete WebUI obfuscation work: new secubox-defaults
package, three /webui/* endpoints, nginx renderer script, haproxyctl
+ Python generator symmetry, dpkg trigger plumbing, integration test.
Includes notes on the brainstorming → spec → plan → subagent-driven
execution flow and the 6 fix iterations caught by reviewers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: CyberMind-FR <gandalf@Gk2.net>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 14:07:11 +02:00
7b1b356aaf docs(gitea): Add 10-task implementation plan for Gitea repair (ref #49)
10 tasks: 2 repo-side conf files, pre-change HAProxy backup, manual
haproxy.cfg edit (3 injection points), nginx vhost install,
idempotent postinst, smoke test for 5 validation gates, tracking
docs, rollback procedure, finish-worktree.

Bug #91 (haproxyctl regenerates broken config) is honored throughout:
all HAProxy edits are manual with timestamped backups.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 12:38:23 +02:00
7839199746 docs(gitea): Add design spec for Gitea repair (ref #49, refs #91)
Sub-project A of #49: expose existing Gitea LXC (10.100.0.40) at
https://gitea.gk2.secubox.in/ and ssh://git@gitea.gk2.secubox.in:2222/.
Uses existing wildcard cert; backend nginx_vhosts (direct, no
mitmproxy WAF for git smart-HTTP traffic).

Records haproxyctl regression #91 as a hard constraint: edit
haproxy.cfg manually with backup, never run haproxyctl vhost add
until the generator is fixed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 12:35:34 +02:00
3594642129 docs(apt): Tick plan checkboxes per code audit (ref #89)
48 steps audited against actual code in cmd/secubox/. Marked
48 steps as completed; 0 remain genuinely incomplete.

All code verified present and passing:
- internal/apt: Client, Server, packages — all functions exist
- cmd: apt.go, apt_server.go, clone.go — all commands registered
- tests: client_test.go, packages_test.go, apt_test.go, clone_test.go — all PASS
- go build succeeds; promptui in go.mod; binary serves correct --help output

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 12:23:02 +02:00
a99773418b docs(plan): SSL certificate health in Health Banner implementation
5 tasks, 25 steps, TDD approach
Reference: CM-SSL-BANNER-2026-05-12

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-12 10:51:43 +02:00
de03af12c2 docs(spec): SSL certificate health in Health Banner
- Display cert expiry days for current domain
- Thresholds: >7j ok, 3-7j warn, <3j error
- Backend: get_ssl_status() in health API
- Frontend: SSL line in banner after score

Reference: CM-SSL-BANNER-2026-05-12

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-12 10:24:17 +02:00
b8fd0ff190 docs(plan): multi-agent worktree workflow design (ref TBD)
Brainstorming-validated spec for `scripts/agent-worktree.sh` plus a new
CLAUDE.md doctrine section. Enables parallel multi-agent work by binding
each task to one GitHub issue, one branch, and one external worktree
under `~/CyberMindStudio/secubox-deb-worktrees/`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 09:45:26 +02:00
8de7ad76d8 docs(plan): multi-agent worktree workflow implementation plan (ref #83)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 09:41:00 +02:00
7f793b98e8 docs(plan): CMSD-1.0 license headers Phase A implementation plan
17 TDD tasks covering: scaffolding, render_header for 4 comment styles,
detect_existing tri-state, apply() per language with placement rules
(Python shebang+encoding, Bash shebang, HTML doctype, Markdown
frontmatter), walk() with skip-list and enrollment allowlist, CLI
dispatch, self-hosting, GitHub Actions workflow, README and CLAUDE.md
updates, smoke tests, and PR opening. Phase B/C left as operational
follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 09:16:08 +02:00
4529b5c11a docs(spec): CMSD-1.0 license headers across the codebase
Brainstormed design for adding the SPDX-CMSD-1.0 header to every
first-party source file (~2,170 across 6 languages), backed by a
reusable Python tool (scripts/license-headers.py), a CI check, and
a phased per-package rollout. Spec covers scope, header rendering
per language, placement rules, tool architecture, CI integration
with an enrollment allowlist, and verification steps.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 09:10:37 +02:00
33b55d22f7 docs(apt): Add implementation plan for public repo staging (ref #80)
10 tasks: --filter flag, tier-manifest helper, GPG bootstrap,
orchestrator, deploy artifacts, validation gate, .gitignore,
full pipeline run, tracking-file updates.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 09:05:45 +02:00
06ac00e64c docs(apt): Add public repo staging design (ref #80)
Brainstormed design for staging a signed APT repo at output/repo/
with amd64 + arm64 (mochabin) packages for bookworm, using existing
Go CLI and shell tooling. No network operations - user pushes
artifacts to apt.secubox.in out-of-band.

Layered build: base -> tier-lite -> tier-standard -> tier-pro
GPG: persistent ~/.gnupg/secubox/
License: CMSD-1.0 embedded in staged tree

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 09:02:51 +02:00
e6189bbaa5 docs(opad): add implementation plan for doctrine documents
7-task plan to create 5 OPAD doctrinal documents:
1. Directory structure
2. JSON Schema (opad-profile.schema.json)
3. Pydantic models (models.py + tests)
4. OPAD.md core doctrine
5. CSPN.matrix.md threat matrix
6. OPAD-OPERATIONS.md operational guide
7. Final validation

Reference: CM-WALL-OPAD-2026-05

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-12 08:54:53 +02:00
5ccf862f05 docs(opad): Add OPAD doctrine design specification
Design spec for 5 OPAD doctrinal documents:
- OPAD.md: Core doctrine, invariants, injection primitives
- CSPN.matrix.md: Threat × capability matrix for ANSSI
- opad-profile.schema.json: 3-prong profile JSON Schema
- models.py: Pydantic equivalents for FastAPI
- OPAD-OPERATIONS.md: Operational guide

Reference: CM-WALL-OPAD-2026-05
Version: 2.4.0

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-12 08:39:42 +02:00
cf328e5a42 docs: add implementation plan for APT and Clone commands 2026-05-11 06:10:20 +02:00
fcca5a7dce docs: add design spec for secubox apt and clone commands
Hybrid approach:
- Client operations (apt setup, clone) in pure Go
- Server operations (apt init/publish/sync) wrap existing shell scripts

Features:
- secubox apt: full repo management + client setup
- secubox clone: interactive bootstrap wizard for new systems

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-11 05:44:35 +02:00
ddd87e55c7 feat(secubox): add manifest generator
- Define Manifest struct with kernel, partitions, boot, output
- Implement Generate() from Profile and Board
- Add ToYAML() for serialization with header comments

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-10 21:08:32 +02:00
3335a5053f docs: Add Meta-Script Generator implementation plan
17 tasks with TDD approach:
- Go CLI with cobra/viper (gen, build, fetch, ota, info)
- Profile loader with inheritance merger
- Board configuration and tweaks
- Package scanner for debian/secubox.yaml
- Manifest and Makefile generation
- Interactive wizard with promptui
- Hardware detection
- APT repository with lintian compliance

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-10 20:00:56 +02:00
da706eeb28 docs: Add Meta-Script Generator v2.0.0 design spec
Design specification for secubox CLI tool:
- Go-based unified CLI (gen, build, fetch, ota)
- Profile hierarchy with hardware detection
- Package self-description (debian/secubox.yaml)
- A/B partition OTA with auto-rollback
- Dual APT repo (apt.secubox.in + apt.gk2.secubox.in)
- Multi-arch with lintian compliance

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-10 19:56:50 +02:00
fa92fe722c feat(ci): Unified sync-all workflow + eyemote visual banner
- Add .github/workflows/sync-all.yml: unified CI/CD on all pushes
  - Discovers changed packages and computes project metrics
  - Auto-updates README badges (packages, migration, endpoints)
  - Auto-updates WIP.md with CI sync entries
  - Creates releases on tags
  - Generates GitHub step summary with metrics table
- Add docs/assets/secubox-eyemote-banner.svg: 6-ring status SVG
  - Matches Round UI design (AUTH/WALL/BOOT/MIND/ROOT/MESH rings)
  - Displays live metrics: 131 packages, 2000+ endpoints, 94% migration
  - Cyberpunk/hermetic palette with glow effects
- Update README.md: add eyemote banner at top
- Update docs/wiki/Home.md: add eyemote banner at top

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-10 09:28:00 +02:00
68e7763fc3 docs: Add Eye Remote Multigadget skill and wiki
- Add /multigadget skill covering autorun, storage, round UI, tooling
- Add Eye-Remote-Multigadget.md unified wiki hub
- Add Build-System.md to wiki with build documentation
- Add AI-BUILD-PROMPT.md for GPT/Gemini assistance
- Update sidebar and home page with new links
- Update WIP.md with #70 and #71 done

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-10 09:12:42 +02:00
d8f28ff40f feat(auth): Track IP and User-Agent in sessions
Login endpoint now captures:
- Client IP (from X-Forwarded-For, X-Real-IP, or connection)
- User-Agent header

Session events include this info for session storage.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-09 11:19:45 +02:00
9ec377ab8f docs: Add remaining screenshots and thumbnails
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-09 11:07:56 +02:00
129b1291dd feat(ui): Add domain filtering, error pages, and user sessions
- Add wrong-domain.html landing page for non-admin domains
- Add unknown-module.html for 404 on admin domain
- Metablogizer: auto-publish on startup, republish-all button
- Metablogizer: empty-site.html for sites with no content
- Metablogizer: change default domain suffix to .gk2.secubox.in
- Users: add active sessions display and revocation
- Nginx: domain filtering (only admin.gk2.secubox.in allowed)
- Nginx: /login clean URL without .html extension

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-09 11:02:42 +02:00
950ff7ee09 feat(ui): Add mobile hamburger menu + portal login redirect
- sidebar.js v2.36.0: Mobile responsive hamburger menu toggle
  - Auto-show hamburger button on screens < 768px
  - Overlay to close sidebar on tap outside
  - Close sidebar on nav item click (mobile)
  - Added toggleMobile/closeMobile to public API

- portal/login.html: Transparent redirect to /login.html
  - Preserves query params and hash for external links
  - Fallback for JavaScript disabled browsers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-09 10:18:40 +02:00
72802ad596 docs(screenshots): Add/update 48 module screenshots
Captured via capture-screenshots.py with 30s delay for cache refresh.
Includes thumbnails for wiki index.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-09 10:09:38 +02:00
eef430e123 feat(docs): Add screenshot capture system and multilingual wiki generator
- scripts/capture-screenshots.py: Auto-discovers 117 modules from packages/
  - Playwright-based capture with JWT authentication
  - 30-second delay per page for cache refresh
  - Thumbnail generation (400x225)
  - JSON manifest output

- scripts/generate-docs.py: Extended to 105 modules
  - Multilingual descriptions (EN, FR, DE, ZH)
  - --include-screenshots flag for wiki integration
  - Category index pages (CATEGORIES-XX.md)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-09 10:09:21 +02:00
00766234d2 feat(kernel): Add complete nftables support + busybox rescue docs
Kernel nftables fix (issue #64):
- Added CONFIG_NF_TABLES_INET, CONFIG_NF_TABLES_IPV4/IPV6
- Added NFT_CT, NFT_LOG, NFT_LIMIT, NFT_REJECT, NFT_COUNTER
- CrowdSec firewall bouncer now works correctly

Build script safety:
- Added deploy_to_device() with safe module extraction
- Prevents /lib symlink overwrite disaster

Documentation:
- FAQ-BUSYBOX-RESCUE.md: Emergency recovery when libc inaccessible
- PROMPT-BUSYBOX-TECHTIP.md: Gemini prompt for visual tech tip
- QUICKSHEET: Added emergency recovery section

Sidebar v2.32.0:
- Per-LED tooltips (Hardware/Services/Security)
- Fixed tooltip positioning for sidebar elements

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-08 18:27:30 +02:00
da8b7c5570 feat(led): HealthBump v2.1.0 with activity detection and K2000 party
- Activity-based brightness: ACTIVE (100) on change, SLEEP (20) when stable
- K2000 (Knight Rider) sweep effect for boot/alerts
- New commands: k2000, success, boot, alert, rainbow
- Aligned I2C timing with secubox-led-safe (300ms write delay)
- Simplified to POSIX /bin/sh for reliability
- Documented I2C bus recovery via platform driver rebind
- Removed unstable connect/activity flash

Ref #52

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-08 11:15:09 +02:00
dbf76b7f29 feat(led): Add 3-tier LED HealthBump system with kernel timer triggers
- LED1 (HW): Orange 4s cycle - hardware layer (CPU, memory, WAN)
- LED2 (SVC): Green 3s cycle - services layer (HAProxy, Nginx, certs)
- LED3 (SEC): Blue 2s cycle - security layer (CrowdSec bans)

Uses slow kernel timer triggers instead of userspace scripts to avoid
I2C bus errors on Debian 6.12 kernel (mv64xxx driver timing issues).

Scripts:
- secubox-led: Manual LED control with layer aliases
- secubox-led-trigger: Kernel timer trigger setup
- secubox-healthbump: Health status checker (30s timer)
- secubox-led-pulse: Userspace pulse daemon (deprecated)

Systemd services:
- secubox-led-trigger.service: Setup timers at boot
- secubox-healthbump.timer: Health check every 30s

Reference: docs/reference/secubox-led-pulse-openwrt.sh (original OpenWrt script)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-08 08:29:08 +02:00
52bd3dd520 docs(led): Update HealthBump with variable pulse speeds and fixes
LED System improvements:
- Brightness value 10 (optimal for IS31FL3199)
- Variable pulse speeds: slow(HW), medium(SVC), fast(SEC)
- Rate-based security detection
- Color gradient for hardware load level
- Fixed I2C communication issues
- Removed conflicting old scripts

Pulse timing:
- LED1 (bottom/HW): 0.15s (slow - infrastructure)
- LED2 (middle/SVC): 0.08s (medium - services)
- LED3 (top/SEC): 0.03s (fast - security alerts)

Ref #39, #60

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-08 07:34:20 +02:00
288b3e7cd6 feat(led): Add HealthBump 3-tier LED status system
LED health indicator system for MOCHAbin:
- LED1 (Bottom): Hardware layer (net, cpu, memory)
- LED2 (Middle): Services layer (vhosts, certs, haproxy)
- LED3 (Top): Security layer (crowdsec, alerts, attacks)

Colors: green=ok, yellow=warn, red=error, blue=message

Files on MOCHAbin:
- /usr/local/bin/secubox-led (manual control)
- /usr/local/bin/secubox-healthbump (auto checker)
- systemd timer runs every 30 seconds

Documentation: docs/LED-HEALTHBUMP.md
Kernel config: board/mochabin/kernel/config-6.12-openwrt-merged.fragment

Ref #39

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-08 07:08:37 +02:00
40ed39be4b docs(wiki): Add MOCHAbin kernel LED documentation
- Create docs/wiki/MOCHAbin-Kernel.md with complete LED kernel guide
- Document Debian base config + SecuBox fragment approach
- Document GPIO polarity fix for IS31FL3199
- Add build instructions and troubleshooting
- Update sidebar with Kernel LED link
- Update HISTORY.md with session 115

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-07 16:59:55 +02:00
ce71b06595 docs(session106): Add GitHub Issues workflow + GST references
- Add GitHub Issues synchronization workflow to CLAUDE.md
  - Mandatory sync between WIP/TODO and GitHub Issues
  - Manual validation rule before closing issues
  - Quick reference commands for gh CLI

- Add GST MOCHAbin technical references
  - docs/references/gst/mochabin-release-v4.10.txt
  - docs/references/gst/MOCHABIN-BOX-block-diagram-Jan10-2020.pdf

- Update WIP.md with Session 106 progress
  - LED IS31FL3199 investigation findings
  - DTB Factory GST vs mainline Linux differences
  - Technical references memorized (~/DEVEL/GST, ~/DEVEL/ARMADA)

Related: #38, #39

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-06 14:52:44 +02:00
d90afdc22d docs(migration): Add implementation plan for OpenWrt to Debian migration
26 tasks, 135 steps covering:
- Phase 1: LXC/storage/network preparation
- Phase 2: Container creation (mail, nextcloud, matrix, gitea)
- Phase 3: Data sync (certs, configs, databases, mailboxes)
- Phase 4: Cutover procedure with verification

Includes rollback procedure and summary checklist.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-05 12:35:41 +02:00
a9199d1f40 docs(migration): Add OpenWrt to Debian migration design spec
Big Bang migration plan from C3BOX (OpenWrt) to SecuBox-DEB (Debian):
- 4 phases: Prepare, Build, Sync, Cutover
- LXC containers for Mail, NextCloud, Matrix, Gitea
- Host-native gateway services (HAProxy, CrowdSec, nftables)
- Data migration strategy for 94 SSL certs + service data
- Cutover procedure with rollback plan

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-05 12:31:36 +02:00
40fcbead45 docs(wiki): Add financing model pages + errata BPI-R4
Wiki pages added (from SECUBOX-WIKI-PROMPT.md spec):
- Financing-Model.md — 3 pillars (BYOH, sponsoring, shareware)
- Support.md — Donation channels, postcard-ware
- Hardware-Matrix.md — BYOH compatibility matrix
- Sponsor-a-Port.md — Hardware port sponsorship
- Acknowledgments.md — Credits wall (MBROLA format)
- Fiscal-Notes.md — Sponsoring vs mécénat legal framework
- Architecture.md — 6 modules, profile-generator, ZKP
- Roadmap.md — Current state + undated wishlist
- _Footer.md — Wiki footer

Updated:
- Home.md — Restructured with support section
- _Sidebar.md — Added Projet + Soutenir navigation

Errata:
- ERRATA-2026-05-03-001-BPI-R4.md — BPI-R4 vs BPI-R4 Pro specs
- Applied correction: BPI-R4 = 4GB/4×GbE, BPI-R4 Pro = 8GB/4×2.5GbE

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-03 18:46:42 +02:00
0b705981e9 docs(plan): Add mitmproxy WAF migration implementation plan
15 tasks covering complete module migration:
- Package scaffold and debian files
- Configuration (TOML + WAF rules JSON)
- mitmproxyctl CLI for LXC management
- secubox_waf.py threat detection addon
- FastAPI routers (status, settings, alerts, haproxy, waf)
- WebUI pages (status, settings, filters)
- Nginx configuration
- README documentation

Session 90

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-03 07:48:38 +02:00
9e1bbfb173 docs(spec): Add mitmproxy WAF migration design specification
Design spec for migrating mitmproxy WAF module from OpenWrt to Debian:
- WAF-in mode only (HAProxy backend inspection)
- Single unified secubox-mitmproxy package
- LXC container with secubox_waf.py threat detection addon
- 18 FastAPI endpoints for status, alerts, HAProxy integration, WAF rules
- CrowdSec integration for automatic IP banning
- Full WebUI with status, settings, and filters pages
- TOML configuration format

Session 90

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-03 07:42:43 +02:00
082ebe0e15 docs(methodology): Emancipate SecuBox-Dev methodology as standalone guide
Extract reusable development methodology from 88+ sessions into portable document:
- Project tracking structure (.claude/ files: WIP, TODO, HISTORY, PATTERNS)
- Session-based development workflow with numbered sessions
- Migration patterns (Shell/UCI → FastAPI/TOML)
- Performance patterns for embedded systems (background cache, parallel exec)
- Compliance framework with checklists
- Templates for new projects

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-03 07:08:24 +02:00
814325dc83 docs(plan): HAProxy WebUI CRUD implementation plan
11 tasks with 37 steps covering:
- Modal system and toast notifications
- Form validation and API error handling
- VHost CRUD (add/edit/delete)
- Backend CRUD (add/edit/delete)
- Server CRUD (nested under backends)
- Certificate CRUD (request/delete)
- Table enhancements with action buttons

Single file modification pattern maintained.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-02 17:51:09 +02:00
6210fd3591 docs(spec): HAProxy WebUI enhancement design
Design spec for adding CRUD operations to HAProxy dashboard:
- VHost management (add/edit/delete)
- Backend management with nested servers
- Certificate request and deletion
- Modal system with P31 Phosphor theme
- Toast notifications for feedback
- Client-side validation

Approach A: Minimal Enhancement (~450 lines in single file)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-02 17:48:05 +02:00
d4387c2392 docs: Update report with Gitea fix (7.6GB → 2.1GB)
Applied LXC memory limit to fix Gitea memory leak on MOCHAbin.
Load average dropped from 6.80 to 4.07.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-30 12:02:15 +02:00
5d32a321cc docs: Expand performance report with device roadmap
Added sections:
- MOCHAbin OpenWrt reference (obsolete but informative)
- Future devices roadmap (ESPRESSObin Ultra, RPi 4/5, Orange Pi 5, etc.)
- Performance profiles by category (lite/standard/full/enterprise)
- Companion devices (Eye Remote, ESP32, M5Stack)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-30 11:23:28 +02:00
df554488e8 docs: Add performance report for ESPRESSObin
HTML report covering:
- System metrics baseline (memory, CPU, disk)
- API latency measurements (P50: 187ms)
- Per-service memory consumption analysis
- Optimization recommendations
- Benchmark tools documentation

Target: ESPRESSObin V7 (1GB RAM, Armada 3720)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-30 11:22:17 +02:00
55eff8fee9 feat(eye-remote): Add recovery boot protocols + unified design charter
Recovery Boot System:
- Add mvebu64boot protocol for Armada 7040/8040 (MOCHAbin 64-bit boot)
- Add kwboot protocol for Armada 3720 (ESPRESSObin serial boot)
- Add XMODEM-CRC file transfer protocol for BootROM
- Add RecoveryController with auto-detection and multi-protocol support
- Port mvebu64boot.c (Pali Rohár) to async Python implementation

Design Charter v2.0:
- Sync graphic charter with Eye Remote dashboard metrics
- Add module → metric mapping (AUTH=CPU, WALL=MEM, BOOT=DISK, etc.)
- Add unified alert thresholds across Eye Remote and Smart-Strip
- Document RGB values for SK6812 LEDs
- Add pod layout diagram for round display
- Add transport badge colors (OTG=ROOT, WiFi=MESH)

Smart-Strip v1.2:
- Sync with graphic charter module colors and metrics
- Add alert threshold table matching Eye Remote
- Document automatic metric mode behavior

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-29 13:01:43 +02:00
33304e7b6f feat(build): Add kiosk mode + VirtualBox setup + Profile Generator architecture
VM-x64 Build Improvements:
- Enable kiosk mode by default with GRUB menu entries
- Increase image size to 8GB (5.5GB root) for full package set
- Add proper EFI boot configuration with 3 boot modes
- Pre-generate SSL certificates during build
- Add TTY2 autologin for emergency console access

VirtualBox Support:
- Add scripts/vbox-setup.sh for automated VM setup
- Add wiki/VirtualBox-Setup.md with comprehensive guide
- Support bridged, NAT, and host-only network modes
- Auto-detect network adapter for bridged mode

Architecture Documentation:
- Add docs/architecture/profile-generator.md (v0.2)
- Define tier × board × flavors resolution model
- Document 3 CLI tools: secubox-gen, secubox-build, secubox-fetch
- Add Phase 12-14 roadmap alignment for Ulule Campaign 1

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-29 09:16:36 +02:00
32fecbf010 feat(hardware): Add Smart-Strip HMI module (SBX-STR-01) + fix lite profile build
Smart-Strip v1.1:
- RP2350A MCU with TrustZone-M + AT42QT2120 touch IC
- 6× RGB LEDs (SK6812-MINI-E) + 6 capacitive touch zones
- Dual-mode: USB-C 2.0 (HID+CDC) / I²C (0x42)
- Hamiltonien sweep AUTH→MESH following SecuBox charte
- Parser CDC with whitelist grammar (no eval, no dynamic alloc)
- Interactive HTML simulator included

Build fixes:
- Skip X11/kiosk packages for SECUBOX_LITE=1 profiles
- Skip netdata/glances for lite profiles (ESPRESSObin)
- Skip LXC for lite profiles (limited storage)
- ESPRESSObin image now fits in 3584M (548M compressed)

Files:
- docs/hardware/smart-strip-v1.1.md (550-line spec)
- docs/hardware/smart-strip/simulator.html
- packages/secubox-smart-strip/firmware/{parser,ring_buffer}.{c,h}
- packages/secubox-smart-strip/host/secubox_smart_strip.py
- wiki/Smart-Strip.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-27 19:03:08 +02:00
b0ae4f1f23 docs(wiki): Add missing wiki pages for complete navigation
Add placeholder pages for sidebar links:
- Architecture-Modules.md
- Architecture-Security.md
- Configuration-Advanced.md
- Modules-Networking.md
- Modules-Security.md
- QEMU-ARM64.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-26 21:33:29 +02:00
223fce6c19 docs(wiki): Reorganize to focus on SecuBox OS Appliance
- Home.md: SecuBox OS as main product with full documentation
- _Sidebar.md: Eye Remote moved to "Addons" section
- Eye-Remote.md: Marked as optional addon, not main feature

The wiki now presents SecuBox OS as the core product with:
- Complete module stack (125 modules)
- ARM64 + x86_64 support
- Security features (firewall, IDS, WAF, DPI)
- Eye Remote as optional monitoring addon

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-26 20:41:06 +02:00
29595a64d3 docs: Add TOOLS.md and missing README files
- docs/TOOLS.md: Complete reference of all build/generation tools
- scripts/README.md: Documentation for scripts directory
- remote-ui/README.md: Documentation for remote-ui module

Also fix build-storage-img.sh to use same slipstream logic as
build-ebin-live-usb.sh:
- Search packages in output/debs AND ~/.cache/secubox/debs
- Use dpkg -i --force-depends --force-overwrite (faster)
- Install all packages at once instead of per-package apt

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-26 20:38:29 +02:00
133837f017 docs: Add Eye Remote Swiss Army implementation plan
21 tasks across 6 phases:
- Phase 1: Core Infrastructure (Mode manager, failover, renderer)
- Phase 2: Display Modes (Dashboard, Local, Flash, Gateway)
- Phase 3: Web Remote Server (FastAPI, routes, control.html)
- Phase 4: System Controls (WiFi, Bluetooth, display)
- Phase 5: Advanced Features (device manager, remote control, fleet)
- Phase 6: Integration & Polish (main.py, WebSocket, testing)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-26 17:07:08 +02:00
582a2d5702 docs: Add Eye Remote Swiss Army Dashboard design spec
- 4 operating modes: Dashboard, Local, Flash, Gateway
- Web Remote control at :8080 (touchless)
- Auto-detect + flag file override for mode switching
- Staged failover with visual feedback
- Unified Python Agent architecture

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-26 17:01:20 +02:00
84bb4cf033 docs(wiki): Reorganize with SecuBox as main, Eye Remote as subsection
- Sidebar: Clear separation between SecuBox and Eye Remote sections
- Home: SecuBox focused with Eye Remote as compact subsection
- Eye-Remote.md: New index page for all Eye Remote docs
- Clean navbar structure with module colors

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-25 09:37:48 +02:00
2c763ce6a7 fix(eye-remote): White icons for visibility on colored slices
- Convert icons to white using alpha channel as mask
- Icons now visible on colored slice backgrounds
- Simplified icon loading with absolute path
- Radial positioning for icons and labels
- Added wiki page documenting all icons

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-25 09:35:54 +02:00
7838ffa1f1 docs: Add Eye Remote touchscreen controller implementation plan
13-task TDD implementation plan covering:
- MenuItem and MenuState data models
- Static menu definitions for 6-slice radial menus
- MenuNavigator state machine
- Slice detection from touch coordinates
- RadialRenderer for framebuffer display
- ActionExecutor with LocalAPI integration
- TouchHandler menu mode integration
- Component wiring in main.py
- Menu icon generation
- Comprehensive test coverage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-24 10:06:35 +02:00
ba8edad728 docs: Add Eye Remote touchscreen controller design spec
Comprehensive design for radial menu touch interface:
- 6-slice pie navigation optimized for circular display
- Dual-scope control (local Pi Zero + remote SecuBox)
- Gesture-based interaction (tap, swipe, long press)
- Hierarchical menu structure with dynamic data loading
- Error handling and visual feedback patterns

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-24 09:36:26 +02:00
a056e4c7bc docs: Update tracking files for USB OTG ECM fix (Session 64)
- HISTORY.md: Document usb0→usb1 ECM fix for Linux hosts
- WIP.md: Mark USB OTG fix as completed v2.1.1
- TODO.md: Add P11-R17 checkbox for USB OTG fix
- Eye-Remote-Bootstrap.md: Update to v2.1.1 with fix note

The USB composite gadget creates usb0 (RNDIS) and usb1 (ECM).
Linux hosts use cdc_ether driver which maps to usb1.
Fixed by configuring only usb1 to avoid asymmetric routing.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-04-24 08:33:44 +02:00
0a199ae362 docs(eye-remote): add bootstrap references to existing wiki pages
- Add "Bootstrap Role (v2.1.0)" section to Eye-Remote-Implementation.md with capabilities, use cases, architecture, configuration, workflow, and security considerations
- Update Table of Contents in Eye-Remote-Implementation.md to include bootstrap section
- Add bootstrap reference to Eye Remote section in Home.md
- Add bootstrap functionality note to Architecture-Boot.md with cross-reference to Eye-Remote-Bootstrap.md

This cross-references the new Eye-Remote-Bootstrap feature across related documentation pages.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-23 11:49:07 +02:00
27e60770cd docs(eye-remote): add FR and ZH translations for Bootstrap wiki
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-23 11:47:11 +02:00
6a606f4df4 docs(eye-remote): Add Eye-Remote-Bootstrap wiki page
Add comprehensive wiki documentation covering:
- System architecture with USB OTG gadget (ECM/ACM/mass storage)
- Double-buffer 4R boot media management
- Complete REST API specification with examples
- Boot workflow diagrams and state machine
- TFTP shadow channel for testing
- Image requirements and validation rules
- Troubleshooting guide for common issues

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-04-23 11:38:25 +02:00
d1601fde8e docs(eye-remote): add U-Boot boot commands documentation 2026-04-23 11:32:07 +02:00
67afb50034 docs(eye-remote): add bootstrap v2.1.0 implementation plan
14-task plan for mass_storage LUN + TFTP shadow channel:
- T1-T2: gadget-setup.sh and systemd service
- T3-T5: Pydantic models, core logic, FastAPI router
- T6: dnsmasq TFTP configuration
- T7: U-Boot documentation
- T8-T9: Debian packaging and build script
- T10: Integration tests
- T11-T14: Wiki and documentation updates

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-23 10:30:05 +02:00
ff9dd27d65 docs(eye-remote): Add bootstrap v2.1.0 design specification
Design spec for adding mass_storage LUN + TFTP shadow channel:
- USB composite gadget: ECM + ACM + mass_storage concurrent
- 4R double-buffer: active/shadow slots with atomic swap
- FastAPI /boot-media/ endpoints for upload/swap/rollback
- dnsmasq TFTP serving shadow slot for testing
- Shell (gadget-setup.sh) + Python (core/boot_media.py) split

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-23 10:23:19 +02:00
fec2ec11d3 docs(wiki): Expand wiki to comprehensive SecuBox documentation
- Update Home.md with full SecuBox system overview
- Add Architecture-Boot.md (5-layer boot chain, CSPN compliance)
- Add Design-System.md (6-module color system, typography)
- Add Developer-Guide.md (stack, conventions, patterns)
- Add Modules.md (all 125 modules with screenshots)
- Update _Sidebar.md with comprehensive navigation
- Fix fb_dashboard.py type hint for _read_from_socket

Wiki now covers: system overview, architecture, modules, security,
development guidelines, Eye Remote, and all hardware platforms.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-22 10:08:37 +02:00
3cc5e6dee0 docs(wiki): Add Home.md and navigation sidebar
- Create Home.md with links to Eye Remote pages
- Add _Sidebar.md for GitHub wiki navigation
- Quick start guide and build instructions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-22 09:47:31 +02:00
0f9c1f4531 docs(eye-remote): Add gateway/emulator wiki documentation
- Usage modes: emulator, gateway, fleet
- API endpoints reference
- Metrics profiles (idle/normal/busy/stressed)
- Dashboard integration guide
- Development and troubleshooting

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-22 09:08:53 +02:00
4f19a35b5d docs(eye-remote): Add complete display requirements to wiki
- Full display stack diagram (7 layers)
- Required packages table
- Service dependencies
- Boot sequence (9 steps)
- Critical configuration files list

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-22 09:07:52 +02:00
be92d7df0b docs(eye-remote): Add hardware wiki + sync CI workflow
- Eye-Remote-Hardware.md: GPIO pinout, USB OTG, DPI timings, gadget modes
- Update CI workflow to v2.0.0
- Fix build script: add DNS for chroot network access

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-22 08:56:21 +02:00
8bb92be81b docs(eye-remote): Add README and wiki implementation guide
- README.md: Quick start, architecture, configuration, troubleshooting
- Eye-Remote-Implementation.md: Full wiki with timeline, components,
  build system, display config, API reference, lessons learned

Documents the complete Eye Remote v2.0.0 framework implementation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-21 22:05:36 +02:00
cca602da56 docs: Add integration test guide for Eye Remote v2.0.0
Complete testing guide covering:
- Gateway emulator installation and usage
- Unit test execution (13 tests)
- Agent-gateway integration testing
- API module verification
- Troubleshooting section

Part of Eye Remote v2.0.0 implementation (Task 14).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-21 11:11:26 +02:00
e1d496641e docs: Add Eye Remote v2.0.0 implementation plan
14 tasks across 4 phases:
- Phase 1: Eye Remote Agent (config, HTTP client, metrics bridge, device manager)
- Phase 2: SecuBox Module (models, registry, token manager, API routers)
- Phase 3: Gateway Tool (CLI, emulator, server)
- Phase 4: Packaging & Integration (Debian, build script, e2e test)

Each task includes TDD approach with failing tests first,
complete code, exact file paths, and commit instructions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-21 08:41:31 +02:00
7d46e9a0ad docs: Add Eye Remote integration design specification
Comprehensive spec for Eye Remote ↔ SecuBox integration:
- secubox-eye-agent: Multi-SecuBox connection manager
- secubox-eye-remote: SecuBox management module + WebUI
- secubox-eye-gateway: Dev emulator + fleet gateway
- Device token auto-authentication
- Touchless pairing via QR code
- Bidirectional control (Eye can control SecuBox)
- SSH auto-provisioning
- Screenshot, OTA, serial console features

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-21 08:32:35 +02:00
4165d6d66c feat(network): Smart auto-IP with ARP collision detection (v1.7.0.2)
- Add ARP-based IP collision detection for multi-device environments
- MAC-based pseudo-random IP offset to spread devices across range
- Gratuitous ARP announcement to prevent IP conflicts
- Fix EspressoBin DSA network: target wan interface, not eth0 CPU port
- Static IP fallback 192.168.255.250 when DHCP unavailable
- Sync all build scripts to version 1.7.0
- Add screenshot script with 90+ module URLs
- Add mock HTML screenshots for documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-14 16:28:02 +02:00
7a34189ed4 feat(kiosk): Add VirtualBox debug logging for X11 troubleshooting
- Add generate_debug_report() to secubox-kiosk-launcher
- Capture system info, virtualization, graphics hardware
- Log DRM/KMS devices, kernel modules, Xorg status
- Enhanced error reporting with dmesg and VT status
- Debug reports saved to /tmp/kiosk-debug-*.log
- Add v1.6.7.2 overlay installer scripts
- Add emoji font fixes for navbar icons
- Add screenshots for v1.6.7.1

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-13 08:26:06 +02:00
040abc330a docs(wiki): Complete German translations and consolidate wiki
- Add 8 German translation files (Home, Installation, Live-USB,
  ARM-Installation, ESPRESSObin, Configuration, Troubleshooting,
  API-Reference)
- Remove duplicate docs/wiki/ directory (10 files)
- Remove fragmented Modules.md, Modules-FR.md, Modules-ZH.md
  (keep comprehensive MODULES-*.md versions)
- Update sidebar with German (DE) links for all pages
- Translation coverage now 100% for EN, FR, ZH, DE

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-10 19:32:12 +02:00
de77a1aa4e feat(build): Add modular build system and fix package dependencies
Build System:
- Add image/lib/common.sh with shared build functions
- Add profiles for vm-x64, x64-live, rpi400, espressobin-v7
- Add BUILD-SYSTEM.md documentation
- Add splash screens (boot.png, tui-splash.sh, kiosk-loading.sh)
- Add Plymouth theme for boot splash

Package Dependencies:
- Fix python3-uvicorn -> python3-uvicorn | python3-pip
- Fix python3-fastapi -> python3-fastapi | python3-pip
- Fix python3-httpx -> python3-httpx | python3-pip
- Allows packages to install when pip-provided deps are used

Documentation:
- Add Build-System.md wiki page
- Update _Sidebar.md with build system links
- Add VM-Testing.md improvements

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-10 17:31:24 +02:00
d9d2eb4edf docs: Add modules architecture documentation
- modules-architecture.md: 6-domain module organization
- secubox_modules_architecture.svg: Visual diagram
2026-04-10 10:47:35 +02:00
3b1f844bab docs: Add graphic charter with 6-module color system
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-10 10:26:05 +02:00
9690412f29 feat: Add secubox-ui-manager, boot architecture docs, and plymouth theme
New features:
- secubox-ui-manager: Unified UI management with KUI/TUI/Console fallback
  - State machine for mode transitions
  - Hypervisor detection and optimization
  - Modular debug system (levels 0-5)
  - Health monitoring with automatic fallback

- Plymouth secubox-cube theme with CRT effects and module icons

- Boot architecture documentation (ANSSI CSPN reference)
  - Chain de boot diagram (SVG)
  - Execution modes: PROMPT/KIOSK/API

Fixes:
- build-live-usb.sh: Remove Type=idle from getty override
- build-live-usb.sh: Add StandardInput/StandardOutput for proper TTY

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-10 10:23:54 +02:00
066ed94468 Add OpenWRT Master-Link client implementation guide
docs/OPENWRT-MASTERLINK.md:
- RPCD backend script (luci.masterlink)
- LuCI JavaScript view for join/leave UI
- UCI config template
- OpenWRT package Makefile
- ACL permissions file
- CLI and web UI testing commands
- Complete directory structure for luci-app-masterlink

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 13:38:38 +01:00
fbd475351d Update module screenshots with roadmap v1.1.0
- 45 module screenshots captured from VM
- Includes updated roadmap page with full migration tracking
- Shows 102 OpenWRT modules, 38 migrated, 64 pending

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 08:03:47 +01:00
26c27d226d Add OpenWRT vs Debian comparison and update migration status
- Create docs/OPENWRT-DEBIAN-COMPARISON.md with full module comparison
  - OpenWRT: 103 luci-app modules
  - Debian: 52 packages (49 UI + 3 backend)
  - 43 modules migrated, 68 pending
  - ~1000+ API endpoints documented
  - Technology stack comparison
  - Roadmap for remaining phases

- Update MIGRATION-MAP.md with accurate counts and link to comparison
- Update WIP.md with Session 16 progress (UI theme, screenshots, docs)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 07:27:31 +01:00
f33b447294 Update all module screenshots and documentation
- Captured 45 module screenshots with new CRT theme
- Updated docs/SCREENSHOTS-VM.md with module gallery
- Updated wiki documentation for OpenWRT and Debian
- All modules now have consistent light theme navbar

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 07:22:52 +01:00
1534f89b2b Add UI documentation with module list and theme guide
- docs/UI-GUIDE.md: Comprehensive UI documentation
  - Navbar integration requirements
  - Menu categories and module list
  - Color palette for light/dark themes
  - Menu configuration format
  - Maintenance script usage
- docs/screenshots/: Placeholder for module screenshots

Note: Screenshots need to be captured manually and added to docs/screenshots/

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 07:20:23 +01:00
442650d53e Add OpenWrt implementation prompts for mesh daemon and CRT theme
Documentation for porting SecuBox to OpenWrt:
- OPENWRT-MESH-DAEMON.md: Complete spec for secuboxd on OpenWrt
  - C/Lua implementation guidelines
  - UCI configuration format
  - procd init script
  - Control socket protocol (compatible with Debian)
  - mDNS discovery via umdns
  - LuCI integration structure

- OPENWRT-CRT-THEME.md: P31 phosphor green theme for LuCI
  - Complete CSS stylesheet (cascade.css)
  - CRT effects engine (scanlines, glow, flicker)
  - Color palette and typography specs
  - Component styling (tables, forms, buttons, badges)
  - OpenWrt package Makefile
  - Topology visualization CSS

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-25 08:41:15 +01:00
6e56dd7135 Add multilingual module documentation
- Add MODULES-EN/FR/DE/ZH.md with 48 modules documented
- Update sidebar with multilingual module links
- Add Metrics Dashboard to screenshots documentation
- All 47 module screenshots linked to GitHub

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-25 05:28:54 +01:00
6f6f3667b6 Add Live USB documentation and wiki pages
- docs/LIVE-USB.md: Complete guide for bootable USB
- wiki/: GitHub wiki content (Home, Live-USB, Sidebar)
- README.md: Add Live USB quick start section

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 17:59:07 +01:00
3d42000827 secubox-metrics: P31 phosphor theme for metrics dashboard
- Full inline CSS with CRT phosphor green (#33ff66) spectrum
- Dark tube background (#050803) with bloom text effects
- Removed dependency on external theme.css
- New screenshot showing live metrics dashboard

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 16:15:01 +01:00
129c9e5d46 Add Metrics Dashboard screenshot
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 16:11:37 +01:00
0873446338 Add Metrics Dashboard to documentation
- Add secubox-metrics README
- Update MIGRATION-MAP with 52 modules
- Update multilingual wiki docs (EN, FR, DE, ZH)
- Add Metrics Dashboard to all module lists

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 15:42:33 +01:00
a4fa81d349 Add complete package READMEs and multilingual wiki documentation
- Generate README.md for all 45 secubox-* packages with screenshots
- Add multilingual wiki pages (EN, FR, DE, ZH) documenting 47 modules
- Add generate-docs.py tool for documentation generation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 15:31:34 +01:00
a05b76428f Update screenshots with stable portal service
All 45 modules captured with proper authentication.
Portal service now stable (watchdog fix applied).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 15:26:55 +01:00
c1e4b45d47 Fix screenshot tool login with aiohttp
- Use aiohttp to login via API (bypasses browser SSL issues)
- Inject JWT token into browser localStorage
- All 45 modules now captured with proper authentication
- Portal service watchdog needed (keeps dying)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 13:24:30 +01:00
1f2386b1a8 Update screenshots and wiki documentation
- Refreshed all 45 VM module screenshots
- Updated screenshot-tool.py with better login selectors
- Wiki documentation ready in docs/wiki/
  - secubox-debian-ui.md
  - secubox-openwrt-ui.md
  - UI-COMPARISON.md

Screenshots gallery: docs/SCREENSHOTS-VM.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 13:04:43 +01:00
482ffaf7aa Fix portal auth and add watchdog support
api/main.py:
- Persist default admin user on first load
- Add startup event to ensure users.json exists
- Better error handling for JSON decode errors

secubox-portal.service:
- Restart=always with WatchdogSec=30
- RuntimeDirectory=secubox ensures socket dir exists
- ExecStartPre creates /etc/secubox with proper ownership
- StartLimitBurst=5 prevents restart loops

Fixes authentication issues on fresh boot.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 12:54:04 +01:00
948003c307 Add screenshot tool and wiki documentation
scripts/screenshot-tool.py:
- Playwright-based screenshot capture for all 47 modules
- Supports VM (localhost:9443) and device (192.168.255.1)
- Auto-login with JWT token handling
- Generates markdown documentation per host
- Side-by-side comparison generator
- Wiki page generators for both repositories
- Module listing with categories and icons

docs/wiki/:
- secubox-openwrt-ui.md: OpenWRT LuCI documentation
- secubox-debian-ui.md: Debian CRT P31 theme documentation
- UI-COMPARISON.md: Side-by-side comparison guide

Usage:
  python3 scripts/screenshot-tool.py --host vm
  python3 scripts/screenshot-tool.py --host device
  python3 scripts/screenshot-tool.py --compare --all

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 12:36:19 +01:00
5d2264cadc Add comprehensive module documentation
- docs/MODULES.md: Complete documentation for all 46 modules
  - Organized by category (dashboard, security, network, etc.)
  - API endpoint counts and descriptions
  - CRT P31 phosphor theme documentation
  - Screenshot checklist for visual documentation
  - Module architecture and build instructions
- docs/screenshots/: Directory for module screenshots
- Updated WIP.md with Session 11 documentation work
- Updated MIGRATION-MAP.md with secubox-soc module

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 12:25:27 +01:00