Commit Graph

47 Commits

Author SHA1 Message Date
cf1c220134 fix(mediaflow,rpi400): postinst #DEBHELPER# comment bug + kiosk conffile prompts
Two failures surfaced by the strict apt-get pass that --kiosk runs in the
rpi chroot (the lenient `dpkg -i --force-depends || true` had been swallowing
the first one on every build):

1. secubox-mediaflow postinst had `#DEBHELPER#` inside a comment. dh_installsystemd
   substitutes that token textually wherever it appears, so it expanded the
   systemd block mid-comment and orphaned "; kick one refresh" onto its own
   line → `syntax error near ';'` → configure fails on EVERY install. Reword
   the comment (real token stays alone on line 22). Bump to ~bookworm3.

2. The kiosk apt-get relied on DEBIAN_FRONTEND=noninteractive, which governs
   debconf, not dpkg's conffile prompt — a pre-existing /etc/secubox/mesh.toml
   triggered an interactive prompt that EOFs on the closed chroot stdin and
   aborted the build. Pass --force-confdef/--force-confold (as the main
   dpkg --configure pass already does) to auto-keep existing conffiles.

Co-Authored-By: Gerald KERMA <devel@cybermind.fr>
2026-07-22 13:11:45 +02:00
feda7182ed fix(rpi400): ship auth runtime deps + wire --kiosk through CI
secubox-auth/users crash at import on the rpi400 image because it is built
with `dpkg -i --force-depends` + debootstrap --include, so their declared
Depends (python3-argon2, python3-pyotp, python3-qrcode) are never pulled —
unlike normal apt installs on mochabin. The engine does `from argon2 import
...` / `import pyotp` / `import qrcode`, so the daemon dies at startup →
nginx 502 → no login. Add pyotp+qrcode (pure-Python) to INCLUDE_PKGS and
argon2 via the QEMU-proven pip step (mirroring the cryptography exclusion).

Also expose the kiosk GUI through CI: a `kiosk` workflow_dispatch boolean
→ build-image.sh --kiosk → forwarded to build-rpi-usb.sh, so a rebuilt
rpi400 image can ship the chromium fullscreen dashboard.

Co-Authored-By: Gerald KERMA <devel@cybermind.fr>
2026-07-22 11:53:42 +02:00
a52af3b50a feat(netplan): standardize SecuBox LAN to 192.168.10.0/24; bump 1.10.0 (ref #760)
Default br-lan 192.168.1.1/24 collided with common ISP-router LANs
(Freebox/Livebox 192.168.1.0/24) when the appliance sits behind one:
WAN(DHCP)+LAN land on the same subnet -> duplicate route, ARP ambiguity,
unreachable mgmt IP. Observed live on c3box behind a Freebox.

- All board netplans (mochabin, espressobin-v7/ultra, x64-vm, x64-live)
  + VM LANs (vm-x64, vm-arm64) -> br-lan/LAN 192.168.10.1/24
- Generators: secubox-netmodes (inline + router.yaml.j2 template),
  secubox-hub preview, secubox-net-detect
- dnsmasq (espressobin-v7.conf): dhcp-range + option:router + dns-server
- live-usb build scripts + self-signed cert SANs -> IP:192.168.10.1
- Out of scope (untouched): 192.168.255.1 mgmt/trusted-proxy whitelist,
  WAN-probe GATEWAYS lists, remote-ui/round + tests
- Minor "medium" bump 1.9.0 -> 1.10.0 (core build scripts; mochabin-live
  stays on its 2.0.0 track)

Live: c3box br-lan already 192.168.10.1/24 + netmodes template aligned;
gk2 WAN moved to eth2 DHCP @ .200 (Freebox reservation on eth2 MAC).
2026-06-27 17:11:23 +02:00
27c1890278 fix(rpi-usb): show mouse cursor in kiosk on Pi 400 (closes #444)
ExecStart had `startx -- :0 vt7 -nocursor`. The -nocursor flag hides
the X mouse pointer — designed for touch-panel kiosks but wrong for
the Pi 400 (keyboard + USB mouse form factor).

Operator at a salon demo can't see where they click → device looks
broken. P0 for salon readiness, not cosmetic.

The kiosk launcher already disables screen blanking + DPMS via xset,
but doesn't manage the cursor. With -nocursor removed, X's default
behaviour applies (cursor visible on motion).

Live SD patch path :
  sed -i 's| -nocursor||' /etc/systemd/system/secubox-kiosk.service
  systemctl daemon-reload && systemctl restart secubox-kiosk.service
2026-06-02 08:18:13 +02:00
07814990b8 fix(rpi-usb): mass-mask non-essential services for Pi 400 boot (closes #442)
v2.13.10 image has every kiosk artefact correctly installed (#436
chain), but the Pi 400 never reaches graphical.target — multi-user
hangs forever because 140+ secubox-* services are enabled by default
(each .deb postinst adds itself to multi-user.target.wants/).

Pi 400 = 4 GB / quad-core ; the boot storm overwhelms the board.
Journal shows restart loops at 13+ on multiple secubox-* + kernel
"task blocked for more than 120 seconds" before the boot is just
abandoned at tty1.

Trim multi-user.target.wants/ down to a 20-entry whitelist after
the dpkg -i loop : the Debian/system minimum + the SecuBox web stack
serving http://127.0.0.1/ to chromium (auth, certs, cookies, core,
defaults, hardening, hub, portal, runtime, system, users + nginx).

Everything else remains *installed* — only the boot wants symlink
is removed, so a future "rpi400 + LXC profile" can re-enable
selectively without re-packaging.

Also drops secubox-bootmenu.service from sysinit.target.wants : it
fails with exit 1 in the early-boot tty context (read -t before
getty is ready) and is redundant on rpi400 because the image
pre-seeds boot-mode=kiosk + default.target=graphical.target.

Verified manually on the v2.13.10 SD : a live patch with the same
whitelist (130 symlinks removed, 20 kept) boots cleanly to kiosk.

Follow-up to #436 chain (PRs #437-#441). This is the *architectural*
counterpart of "feedback_no_mass_daemon_restart" — same pattern,
build-time instead of runtime.
2026-06-02 07:50:05 +02:00
fa696d74e2 fix(rpi-usb): bind-mount /boot/firmware onto self instead of tmpfs (ref #436)
v2.13.9 build progressed past the kiosk assertion and Step 7 rsync.
But then Step 7 (Pi bootloader config) failed :

  grep: /tmp/.../mnt/boot/firmware/config.txt: No such file or directory

The tmpfs at /boot/firmware (PR #438) was the wrong primitive. Files
that raspi-firmware writes during postinst (config.txt, vmlinuz, initrd,
dtbs) go to the tmpfs — and are DESTROYED when Step 6.5 umounts it.
Step 7 then rsyncs ${ROOTFS}/boot/firmware/ (empty) to the loop-mounted
real BOOT partition, then tries to read config.txt which doesn't exist.

Replace `mount -t tmpfs` with `mount --bind ${ROOTFS}/boot/firmware
${ROOTFS}/boot/firmware`. The directory becomes a mountpoint
(raspi-firmware's `mountpoint -q` check passes), AND writes go to the
underlying directory on the ROOTFS filesystem (preserved after umount).

Step 7's rsync of ${ROOTFS}/boot/firmware/ to the real BOOT partition
now carries config.txt + kernel + initrd + dtbs that raspi-firmware
populated during build.

This should finally close #436. Chain :
  PR #437 — chroot safety net (systemctl wrapper, policy-rc.d, tmpfs)
  PR #438 — bump tmpfs 64M→512M + bind /proc + /sys
  PR #439 — force WantedBy symlink (absolute, broken host check)
  PR #440 — relative symlink (assertion passes)
  PR #441 — tmpfs → bind-mount (config.txt persists)
2026-06-01 12:18:38 +02:00
11c9984e2a fix(rpi-usb): relative symlink for graphical.target.wants (ref #436)
v2.13.8 still failed the kiosk assertion. PR #439's `ln -sf
"/etc/systemd/system/secubox-kiosk.service"` created an *absolute*
symlink that, from the host's perspective, points to
`/etc/systemd/system/secubox-kiosk.service` on the HOST filesystem
(which doesn't exist there). `[[ -e symlink ]]` follows the target,
so the check returned false even though the symlink itself was
present at the right path.

Switch to a *relative* target (`../secubox-kiosk.service`) :
- matches systemctl's own convention for WantedBy symlinks
- resolves correctly inside the chroot at runtime
- resolves correctly from the host's assertion check at build time

This should be the actual last piece. Build chain: chroot safety net
(PR #437) → bigger tmpfs + /proc/sys (PR #438) → WantedBy symlink
(PR #439 absolute, this PR relative) → assertion passes → image ships.
2026-06-01 10:34:40 +02:00
e4447e0a2a fix(rpi-usb): force graphical.target.wants symlink for kiosk (ref #436)
Follow-up to PR #438. v2.13.7 build progressed all the way to the
build-time assertion, which then failed with:

  [WARN] secubox-kiosk.service not in graphical.target.wants/
  [FAIL] Kiosk artefacts incomplete — refusing to publish a broken image

Under SYSTEMD_OFFLINE=1 inside a qemu-arm64 chroot, `systemctl enable
secubox-kiosk.service` returns 0 but doesn't always materialise the
WantedBy symlink. Create it explicitly right after the enable call
(belt-and-suspenders against any quirk of offline systemctl behaviour).

This is the last piece: chroot safety net (PR #437), bigger tmpfs +
/proc + /sys (PR #438), and now the WantedBy symlink. Expected v2.13.8:
the assertion finally passes, Step 7 rsyncs, image ships.

Chain: #423#433 (PR #435) → #436 (PRs #437, #438, this).
2026-06-01 09:09:22 +02:00
ef9e9dc133 fix(rpi-usb): bump tmpfs /boot/firmware 64M→512M + bind /proc,/sys (ref #436)
Follow-up to PR #437. v2.13.6 build hit two new failures inside the
safety net :

1. **ENOSPC on tmpfs /boot/firmware** — 64M was too small. The
   raspi-firmware post-update.d hook copies kernel (~25M) + initrd
   (~30M arm64) + dtbs + overlays. Bumped to 512M to cover all
   firmware artefacts comfortably.

2. **/proc + /sys not bind-mounted into the chroot** — raspi-firmware's
   hook uses `findmnt /boot/firmware` which reads /proc/mounts. Without
   /proc mounted in the chroot it errored
   `findmnt: can't read /proc/mounts`. Now bound at safety-net install
   (matches the pattern build-live-usb.sh uses at lines 277-278) and
   unmounted at teardown.

Both errors surface during the apt --fix-broken install OR the apt-get
install kiosk stack, where postinsts trigger update-initramfs which
runs the raspi-firmware hook. The systemctl wrapper + policy-rc.d
parts of the safety net (PR #437) were already working — these two
extras finish the job.

Expected v2.13.7: kiosk install completes cleanly through to the
build-time assertion, image rsyncs successfully.

Refs: #423#433#436 (this and PR #437 close together).
2026-06-01 07:28:50 +02:00
61f773c5e4 fix(rpi-usb): chroot safety net for qemu-arm64 postinsts (closes #436)
v2.13.5 rpi400 build aborted on apt --fix-broken install. Root cause:
in a qemu-arm64 chroot, /run/systemd/system is bind-mounted from the
host so systemctl thinks systemd is running, but it can't reach dbus.
Every postinst calling `systemctl enable/start` fails with
"Failed to connect to bus: Host is down", leaving secubox-core (and
the cascade of secubox-* depending on it) installed-but-not-configured.

Three-part safety net installed right after debootstrap --second-stage
(Step 1.5) and torn down before Step 7's image creation (Step 6.5):

1. **systemctl wrapper** — dpkg-divert /bin/systemctl to
   /bin/systemctl.distrib, install a thin shim that exports
   SYSTEMD_OFFLINE=1 before exec'ing the real binary. Postinsts
   that call `systemctl enable X.service` now succeed (filesystem-only
   operation) instead of failing on dbus.

2. **policy-rc.d** — /usr/sbin/policy-rc.d returns 101 to block
   invoke-rc.d from starting daemons during apt operations.

3. **tmpfs at /boot/firmware** — raspi-firmware's postinst checks
   `mountpoint -q /boot/firmware`. The real BOOT partition is only
   loop-mounted in Step 7, so we bind a 64M tmpfs at that path during
   build; raspi-firmware writes its files there (discarded on umount,
   regenerated by Step 7's actual firmware copy). Without this,
   apt --fix-broken install fails on raspi-firmware before reaching
   the kiosk packages.

Also softens the apt --fix-broken to best-effort (warn instead of
err) — the kiosk install below is now the gate, with `-f` to satisfy
deps. The pre-rsync assertion from #433 stays as the safety net.

Tested locally on v2.13.5 sources : apt --fix-broken now succeeds
(secubox-core configures, cascades complete), kiosk packages install
cleanly, all artefacts present in ROOTFS before rsync.

Expected v2.13.6 outcome: rpi400 image actually ships with kiosk
working out of the box, AND the dpkg state is clean so apt operations
on the running device don't hit broken-deps surprises.

Refs: #423 (kiosk install original) → #433 (silent fail, fail-loud) →
#436 (this, root cause fix).
2026-05-31 09:56:49 +02:00
ccb5d29b1c fix(rpi-usb): kiosk install fail-loud + pre-rsync assertion (closes #433)
Three changes to Step 5.4 of image/build-rpi-usb.sh:

1. **apt --fix-broken install FIRST** — the secubox-* .debs installed
   via dpkg -i in Step 5 (no dep resolution) leave the rootfs with
   broken deps (lxc, debootstrap, python3-cryptography, certbot,
   netdata, ... all unmet). apt refuses any new install while that
   state exists, so chromium/xserver-xorg/openbox installs silently
   failed. fix-broken clears the state (~500 MB extra) BEFORE the
   kiosk install. This is the root cause of #433.

2. **Fail-loud on every step** — was `chroot apt-get ... 2>/dev/null
   || warn "Some kiosk packages may have failed (continuing)"`. The
   `|| warn` swallowed apt failures and the script printed
   `[OK] Kiosk mode installed and enabled` even when nothing was
   actually installed. Now apt errors abort the build (err exits
   non-zero). Silently shipping a no-kiosk image is worse than no
   image — if --kiosk is passed, the user expects kiosk.

3. **Build-time assertion before Step 7 (rsync)** — verifies that
   EVERY kiosk artefact made it into ${ROOTFS}:
   - chromium / startx / openbox binaries
   - secubox-kiosk.sh launcher + .xinitrc
   - /etc/systemd/system/secubox-kiosk.service file
   - /var/lib/secubox/boot-mode == "kiosk"
   - default.target → graphical.target symlink
   - secubox-kiosk.service enabled (graphical.target.wants symlink)

   Any missing artefact aborts the build. No more discovering after
   flash that the .img has no kiosk despite a green CI run.

Also drops the `2>/dev/null` masking on systemctl set-default and
enable — these now fail loud too (and shouldn't fail anymore since
the X stack is properly installed at that point).

Observed v2.13.4: image v2.13.4 shipped with boot-mode="normal",
no chromium, no secubox-kiosk.service, default.target=multi-user.
The CI log claimed "[OK] Kiosk mode installed and enabled". The
apt step had failed loud with "apt --fix-broken install to correct
these" but the warn swallowed it.

Expected v2.13.5: rpi400 image properly ships kiosk-by-default, OR
the CI fails clearly with "kiosk artefacts incomplete — refusing
to publish a broken image" if any prerequisite is missing.
2026-05-31 07:43:55 +02:00
94da816b51 fix(rpi-build): implement --kiosk flag + wire it on rpi400 in CI (closes #423)
The --kiosk flag in image/build-rpi-usb.sh was parsed but never acted on
(INCLUDE_KIOSK toggled but no install block existed), so the rpi400 image
shipped without chromium / X / kiosk service. The boot menu's apply_mode
"kiosk" branch even references a secubox-kiosk.service that was never
created. Adding all the missing pieces:

- New Step 5.4 block (gated by INCLUDE_KIOSK=1):
  - apt install xserver-xorg xinit openbox chromium x11-xserver-utils
  - install image/kiosk/secubox-kiosk.sh → /usr/share/secubox/kiosk/
  - install image/kiosk/xinitrc → /root/.xinitrc
  - create /etc/systemd/system/secubox-kiosk.service (startx on vt7,
    Conflicts with getty@tty7; matches apply_mode's expected unit name)
  - seed /var/lib/secubox/boot-mode = "kiosk" so first boot enters kiosk
  - set default systemd target to graphical.target + enable the unit

- CI build-all-live-usb.yml: add `extra_args: "--kiosk"` to the rpi400
  matrix entry and append `${{ matrix.extra_args }}` to the build invocation.
  Pi 400 = keyboard + HDMI, kiosk-by-default is the obvious user-facing
  shape; other platforms keep their headless default.
2026-05-30 10:04:44 +02:00
efd6a462be feat(rpi400): port SecuBox banner + secubox-status/help + dynamic MOTD
rpi400 v2.12.13 image audit (operator-reported "ancien style et il
manque des tas de seccubox tools"):

  136 secubox-* packages installed ✓
  but only 11 secubox-* binaries on PATH
  /etc/motd was vanilla Debian
  /etc/issue was vanilla Debian "Debian GNU/Linux 12 \n \l"
  no /etc/secubox/build-info.json

build-live-usb.sh creates ~30 secubox-* CLI helpers + the cyber-CRT
boot banner + dynamic MOTD via update-motd.d. None of that was in
build-rpi-usb.sh. Targeted port of the four most-visible blocks
into build-rpi-usb.sh at line ~780 (right after `SecuBox packages
installed`):

  * /etc/issue with cybermind banner + getty `\4` IPv4 escape
  * /etc/update-motd.d/10-secubox with live `hostname -I` substitution
  * /usr/bin/secubox-status (system overview, services, network)
  * /usr/bin/secubox-help (command index)
  * /etc/secubox/build-info.json (version + git commit + builder)

Broader refactor of the four build-*.sh siblings into shared lib/*.sh
is tracked in docs/superpowers/plans/2026-05-26-build-scripts-refactor.md
— this commit is the tactical port to unblock rpi400 operators now.

The MOTD says "RPI400 LIVE" instead of "LIVE USB MODE" so operators
can tell at a glance which platform they're on without `uname -m`.
2026-05-26 12:14:02 +02:00
ebdc5c08c0 fix(rpi-usb): Remove python3-cryptography from debootstrap
python3-cryptography fails to configure under QEMU ARM64 emulation
during debootstrap due to Rust compilation requirements.

It's already installed via pip later in the build process, which
works reliably cross-architecture.

Fixes rpi400 image build failure.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-06 19:32:30 +02:00
46770abee7 fix(image): Add missing Python deps (python-multipart, email-validator)
Services were failing in restart loops due to missing dependencies:
- python-multipart: required for FastAPI file upload endpoints
- email-validator: required for Pydantic email field validation

Updated build scripts:
- build-image.sh: added both packages
- build-rpi-usb.sh: added email-validator (multipart was present)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-05 07:32:47 +02:00
76a2a1fe71 fix(image): Activate .dpkg-new nginx configs after package slipstream
dpkg leaves .dpkg-new suffix on conffiles when installing over existing
configs. This caused nginx API routing to fail as the module configs
(system.conf, etc.) were not loaded.

Added activation step to all build scripts that renames .dpkg-new files
to their proper .conf names after package installation.

Affected scripts:
- build-image.sh
- build-live-usb.sh
- build-rpi-usb.sh

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-04 13:10:06 +02:00
bfe2e9cb98 release: Version 1.9.0
Changes in this release:
- Added comprehensive package dependencies to all build scripts
- Firmware images now fully ready with all deps pre-installed
- Fixed package conflicts (iputils-arping, python3-zmq)
- Build scripts include: Python deps, network tools, security
  services (crowdsec, netdata, glances), X11 packages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-27 17:09:29 +02:00
b4415de8a7 fix(build): Use iputils-arping instead of arping
The 'arping' and 'iputils-arping' packages conflict with each other.
Using iputils-arping which provides the arping command needed by
the network fallback scripts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-27 17:00:32 +02:00
cadd993862 fix(build): Add all missing package dependencies to build scripts
All build scripts now include comprehensive package lists so firmware
images are fully ready with all dependencies pre-installed. No need
for apt --fix-broken install after boot.

Added packages:
- Python deps: python3-fastapi, python3-uvicorn, python3-httpx,
  python3-psutil, python3-aiosqlite, python3-cryptography,
  python3-jinja2, python3-jwt, python3-aiofiles, python3-pil,
  python3-tomli, python3-pydantic, python3-jose, python3-toml,
  python3-netifaces, python3-zmq
- Network tools: bridge-utils, traceroute, dnsutils, whois, mtr-tiny,
  nmap, arping, avahi-daemon, avahi-utils, haproxy, qrencode
- Services: crowdsec, glances, netdata, mosquitto, coturn, lxc
- X11 packages: kbd, xinit, xserver-xorg-core, chromium, unclutter,
  x11-xserver-utils
- Additional pip: pillow, zmq, pyjwt, textual

Files updated:
- image/build-image.sh (main ARM/x64 builder)
- image/build-live-usb.sh (x64 live USB)
- image/build-rpi-usb.sh (Raspberry Pi ARM64)
- image/build-ebin-live-usb.sh (ESPRESSObin ARM64 live)
- image/profiles/x64-live.conf (profile with package lists)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-27 16:51:56 +02:00
8c07f0f90a feat(eye-remote): v1.8.0 - Eye Remote multi-mode USB gadget
- Add 5 USB gadget modes: Normal, Flash, Debug, TTY, Auth
- Add HID keyboard emulation for U-Boot automation
- Add FIDO2/U2F security key mode (Eye Remote)
- Add x64/amd64 live boot support
- Update README.md with Eye Remote documentation
- Update WIKI.md with mode mockups and technical details
- Add INFOGRAPHIC-PROMPT.md for Claude.ai image generation
- Bump version from 1.7.0 to 1.8.0

New files:
- secubox-hid-keyboard.sh: Virtual HID keyboard driver
- INFOGRAPHIC-PROMPT.md: 7 prompts for publicity infographics

Eye Remote transforms the Round UI from a status display
into a full remote control device with debugging, flashing,
and authentication capabilities.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-20 11:33:26 +02:00
f4806bf7fa fix(ci): Fix eMMC image check and RPi multi-initrd copy
- build-all-live-usb.yml: Check for .img.gz first since build-image.sh
  already compresses and removes the .img file
- build-rpi-usb.sh: Handle multiple kernel/initrd files by selecting
  the latest version instead of globbing which breaks cp

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-15 09:22:23 +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
66ad1461ba fix(kiosk): Fix systemd and kiosk launcher bugs (v1.6.7.11)
- Fix StartLimitIntervalSec syntax (was StartLimitInterval)
- Fix platform detection message ("bare-metal" vs "none")
- Fix stale lock file blocking restarts (PID-based cleanup)
- Update kiosk launcher version to v3.2

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-14 07:34:07 +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
35c93406e6 fix(auth): Remove duplicate /auth prefix from login endpoint
- Remove prefix="/auth" from secubox_core/auth.py router definition
- Add prefix="/auth" when including auth_router in hub main.py
- Fixes login endpoint from /auth/auth/login to /auth/login

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-12 21:09:21 +02:00
38988163de fix(live): Plymouth cube theme, auth, flash-disk, netplan
- Plymouth: Integrate secubox-cube theme with 3D rotating module icons
- Auth: Create users.json for portal login (admin/secubox)
- flash-disk: Fix 'local' outside function error on line 236
- netplan: Add br-lan/wan structure for x64-live mode

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-11 17:48:41 +02:00
09526c45fd fix(kiosk): Use IP address and add secubox.local to hosts
- Kiosk URL changed from https://localhost/ to https://127.0.0.1/
  to avoid DNS resolution issues on fresh systems
- Added secubox.local to /etc/hosts in all build scripts
  (build-image.sh, build-live-usb.sh, build-rpi-usb.sh, build-installer-iso.sh)

Fixes kiosk showing "secubox.local" URL that doesn't resolve on real hardware.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-10 21:15:41 +02:00
16cf0eb529 fix: Add nginx cleanup to all build scripts
- Add nginx config cleanup to build-image.sh and build-rpi-usb.sh
- Moves location-only configs from conf.d/sites-enabled to secubox.d/
- Tests nginx configuration after package install
- Matches existing cleanup in build-live-usb.sh

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-08 08:08:45 +02:00
c2f7bc5769 fix: Add complete Python dependencies for SecuBox services
Added missing pip packages required by SecuBox services:
- cryptography (for JWT/TLS operations)
- python-multipart (for FastAPI form handling)
- websockets (for uvicorn websocket support)
- netifaces (for network interface info)
- pydantic, toml, aiofiles (various services)

This fixes the "Failed to start" errors for SecuBox services
that were missing Python dependencies.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-07 14:05:31 +02:00
f1a26d7937 fix: Install kernel BEFORE SecuBox packages to prevent apt breakage
The RPi build was failing because:
1. SecuBox packages installed with dpkg --force-depends
2. apt-get install -f tried to resolve missing deps (python3-fastapi, etc)
3. This broke apt's dependency resolver
4. Kernel install then failed (linux-image-arm64, initramfs-tools)

Fix: Reorganize build steps to install kernel while apt is clean:
- Step 4: Kernel + firmware (before any forced installs)
- Step 5: SecuBox packages (pip provides Python deps)
- Step 6: Bootloader config
- Step 7: Image creation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-07 08:50:46 +02:00
dd46b6e7e7 fix: Generate SSL certs BEFORE SecuBox package install
Package postinst scripts check nginx config which requires SSL certs.
Moving cert generation to before dpkg install prevents postinst failures.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-07 08:09:35 +02:00
5a58dd2bdf fix: Remove head -30 causing SIGPIPE with pipefail in RPi build
The pipeline `dpkg ... | grep | head -30` fails with SIGPIPE when
dpkg continues writing after head exits. With set -o pipefail,
this causes build failure even with || true at end.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-07 07:58:32 +02:00
b047b1e24c fix: Use python3-netifaces from Debian instead of pip
netifaces requires compilation which fails without build-essential.
Use the Debian packaged version instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-07 07:03:46 +02:00
c7bf0b9447 feat: Add Raspberry Pi 400 support with boot menu
- Add rpi400 to default CI builds in build-image.yml
- Create board/rpi400/config.mk with Pi 400 settings
- Add build-image.sh redirect to build-rpi-usb.sh for RPi boards
- Add boot menu system to build-rpi-usb.sh:
  - Normal, Kiosk, Console, Bridge, Minimal modes
  - VT100/DEC PDP-style menu interface
  - Persistent mode selection across reboots
  - systemd integration for early boot
- Fix slipstream in build-rpi-usb.sh:
  - Use dpkg --force-depends (pip provides Python deps)
  - Skip failing apt-get -f install
  - Add more Python dependencies to pip install

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-07 06:32:56 +02:00
e8d169919c fix: Correct boot.scr paths and make initramfs optional
- build-image.sh: Fix boot.scr to load from boot partition (mmc 1:1)
  with files at root level (Image, not /boot/Image)
- build-rpi-usb.sh: Make initramfs generation failure non-fatal
  (Pi can boot without initramfs, just with reduced functionality)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-06 10:33:32 +02:00
592ce34202 feat: Add --slipstream option to build-rpi-usb.sh
Consistent with build-image.sh:
- --slipstream installs packages from output/debs/
- Falls back to cache/repo/pool if not using slipstream
- Installs secubox-core first (dependency)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-06 10:11:14 +02:00
75f0406635 fix: Add parted/dosfstools to RPi 400 image
Include disk partitioning tools (parted, dosfstools, e2fsprogs)
and hardware detection (pciutils, usbutils) in the RPi image
for consistency with other build scripts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-05 09:12:58 +02:00
aeb00ef121 fix(image): Generate SSL certs on host and add TUI mode
- Fix SSL cert generation: run openssl on host, not in chroot
  (chroot lacks /dev/urandom access)
- Add secubox-console-tui for text-based dashboard
- Add TUI mode to kiosk-launcher (x11, wayland, tui)
- Add secubox-console-tui.service
- Copy TUI script in build process

Fixes nginx "localhost refused to connect" in kiosk mode.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-02 10:54:48 +02:00
60e29d5291 fix(image): Pre-generate SSL certificates for nginx
- Add SSL cert generation to build-live-usb.sh for kiosk mode
- Add SSL cert generation to build-rpi-usb.sh
- Add SSL cert generation to build-image.sh
- nginx requires certs at /etc/secubox/tls/ to start
- firstboot.sh will regenerate on first boot with proper hostname

Fixes kiosk "localhost refused to connect" issue in VirtualBox.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-02 10:44:31 +02:00
a8c823b190 fix(image): Fix service enablement and initramfs generation
- Fix service enablement using direct symlinks instead of systemctl
- Fix glob expansion in chroot with bash -c wrapper
- Fix arithmetic expression ((COUNT++)) causing exit with set -e
- Add Python dependencies before SecuBox package installation
- Increase initramfs timeout to 5 minutes for QEMU
- Fix PATH in chroot for mkinitramfs (rm not found)
- Change fatal xinit error to warning for kiosk builds
- Add output/debs fallback for packages not in cache

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-02 10:23:36 +02:00
113458d8ab fix(rpi): Fix debootstrap hang on initramfs generation
The RPi build was hanging during debootstrap second stage because
initramfs-tools was trying to generate an initrd under QEMU emulation
(extremely slow - 30+ minutes).

Fixes:
- Remove linux-image-arm64 from debootstrap packages
- Install kernel AFTER debootstrap completes
- Disable initramfs generation during kernel install
- Add 30-second timeout for optional initrd generation
- Support direct boot without initrd (Pi doesn't require it)
- Dynamically add initramfs line to config.txt only if initrd exists

The Pi can boot directly using root=/dev/mmcblk0p2 without needing
an initramfs, which is faster and avoids QEMU slowness.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-01 10:26:28 +02:00
5425dbc9a8 docs(image): Add comprehensive README for all image scripts
Document all image building and deployment scripts:
- build-image.sh, build-live-usb.sh, build-installer-iso.sh
- build-rpi-usb.sh, build-c3box-clone.sh, export-c3box-clone.sh
- create-vbox-vm.sh, firstboot.sh, preseed-apply.sh
- Helper scripts: secubox-net-detect, secubox-cmdline-handler,
  secubox-kiosk-setup

Includes usage examples, options tables, boot parameters,
default credentials, and troubleshooting guide.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-01 10:04:55 +02:00
befcc3f3a3 fix(rpi): Copy Pi firmware files to boot partition
The raspi-firmware package installs firmware to /usr/lib/raspi-firmware/
but these files (start4.elf, fixup4.dat, DTBs, overlays) were not being
copied to the boot partition, causing "firmware not found" boot failure.

- Copy all .elf, .dat, .bin files from raspi-firmware
- Copy overlays directory
- Copy kernel DTBs (bcm*.dtb)
- Add verification for critical boot files
- Update config.txt with Pi 4/400 specific sections

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-01 07:16:17 +02:00
e81dc12951 fix(build-rpi): Improve boot file copy and cleanup handling
- Add proper error handling for kernel/initrd copy
- Fallback to alternative initramfs generation method
- Fix cleanup order (unmount in reverse order)
- Add verification that initrd exists before proceeding

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-31 15:19:08 +02:00
c51ae2758d feat: Add Plymouth boot splash and fix kiosk mode
- Add Plymouth boot splash theme (VT100/DEC PDP-style green phosphor)
- Boot splash now shows DURING boot, not just at login
- Fix kiosk service: use tty7, proper VT allocation, better env vars
- Add splash parameter to GRUB menu entries
- Add initramfs configuration for Plymouth framebuffer
- RPi build: Plymouth support with ARM64 theme

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 12:28:24 +02:00
f221fa6844 feat(rpi-usb): Add VT100 cyber splash and autologin for RPi 400
- Add HDMI console autologin (getty@tty1)
- Add VT100 DEC PDP-style boot splash
- Add splash to root's bashrc
- Consistent experience with x64 live USB

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 12:01:19 +02:00
85954803a3 feat(image): Add Raspberry Pi 400 image builder
New script build-rpi-usb.sh for arm64:
- Native Pi bootloader (no GRUB)
- QEMU user-static for cross-build
- Serial console autologin
- WiFi firmware included
- SecuBox packages from local cache

Usage: sudo bash image/build-rpi-usb.sh --local-cache

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 08:34:41 +02:00