Commit Graph

53 Commits

Author SHA1 Message Date
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
2ddb28d2dc fix(net-detect): no empty br-lan when LAN ifaces list is empty
secubox-net-detect.service runs on first boot (gated by
!/var/lib/secubox/.net-configured) and REWRITES /etc/netplan/00-secubox.yaml
based on the detected board layout. The "no LAN interfaces" branch
in generate_netplan() was emitting an empty br-lan bridge with a
static 192.168.1.1/24 address. On single-NIC live USB hardware that
made systemd-networkd happily honour the phantom bridge while the
real WAN NIC fell off the DHCP path — the operator saw a working
br-lan in `ip a` but no upstream IP and no internet.

Same shape of bug as the v2.12.7 build-live-usb.sh static-in-DHCP
regression (commit a88c1773): a useless static IP on a non-routing
interface confused networkd into "I'm done, no DHCP needed". Fix:
when there are no LAN interfaces, emit NO bridges block at all.
Operators wire br-lan later via secubox-net-* tools once they've
decided the box is a router vs an endpoint.
2026-05-26 11:56:28 +02:00
930a885f04 fix(kiosk): --no-block start so firstboot.sh's enable doesn't deadlock
Live USB v2.12.4 boot showed `secubox-kiosk-setup enable --x11` running
for 5+ minutes while the kiosk.service stayed `inactive (dead)`. The
synchronous `systemctl start secubox-kiosk.service` at the end of
enable_kiosk was hanging.

Root cause: secubox-kiosk.service declares
  Conflicts=getty@tty7.service
  TTYPath=/dev/tty7

systemd waits for tty7 to be released and for the conflicting unit's
JobsToStart to clear before kiosk's ExecStart can fire. When the call
comes from a process running inside the tty1 autologin shell (which
is what firstboot.sh's `secubox-kiosk-setup enable --x11` safety net
does), systemd deadlocks itself waiting on a tty operation the caller
can't unblock. The kiosk service appears to start fine when triggered
manually from SSH (proven during debug — once the stuck setup PID was
killed, `systemctl start secubox-kiosk.service` returned in <1s and
the service activated cleanly).

Fix: pass --no-block so systemctl returns as soon as the job is
queued, regardless of the tty wait. systemd then runs the start in
the background after the parent autologin shell exits, breaking the
loop. The exit-code branch is preserved for legitimate failures.
2026-05-25 08:59:28 +02:00
CyberMind
e0e3a335d4
fix(kiosk): always pass --no-sandbox on Debian 12 AppArmor (closes #224) (#225)
On bare-metal x86_64 with the v2.10.0 image, chromium's zygote crashes
in a restart loop:

  ERROR:content/browser/zygote_host/zygote_host_impl_linux.cc(...):
  ... disabled unprivileged user namespaces with AppArmor,
  ... you can try using --no-sandbox.

Debian 12 ships AppArmor with the `unprivileged_userns` profile that
restricts the unprivileged user namespace creation chromium's zygote
needs to set up its renderer sandbox. The kernel sysctl
`kernel.unprivileged_userns_clone` is `1`, but the AppArmor profile
whitelists only known binaries — chromium launched as the
`secubox-kiosk` user doesn't match.

`secubox-kiosk-launcher:443-451` only passed `--no-sandbox` for VM
targets (`systemd-detect-virt` non-`none`). On bare metal it omitted
the flag, so the zygote died on every launch → systemd restart loop
until MAX_FAILURES=3 disabled the kiosk and left X11 stranded on VT7.

Drop `--no-sandbox` from both branches. The SecuBox kiosk runs as a
dedicated unprivileged user on a single VT, AppArmor still enforces
its per-process chromium profile, and the appliance sits behind its
own WAF — chromium's internal sandbox provides marginal additional
security here while breaking the kiosk entirely.

Validated path: VBox kiosk continues to work; bare-metal x86_64 will
reach the SecuBox login form after this fix.

Co-authored-by: CyberMind-FR <gandalf@Gk2.net>
2026-05-19 13:16:51 +02:00
8a0aa57f70 fix(net-detect): Separate VirtualBox VM handling from baremetal x64
VMs with multiple interfaces (NAT + host-only) now correctly configure
all interfaces with DHCP instead of creating a br-lan bridge that
conflicts with VBox's host-only DHCP server.

Changes:
- Add dedicated x64-vm case in get_interface_config()
- Set profile="vm" for VMs to trigger single mode (no bridge)
- In generate_netplan(), detect x64-vm board and configure ALL
  physical interfaces with DHCP instead of WAN-only
- VM profile forces mode="single" in main() to skip bridge creation

This fixes host-only network access for VirtualBox VMs while
preserving router/bridge functionality for baremetal deployments.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-01 17:33:31 +02:00
254b9df528 feat(live-usb): Improve kiosk launcher and network detection
- Fix vm_type variable sanitization in kiosk launcher
- Enhance network detection for AMD64 hardware
- Improve build-live-usb service configuration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-01 09:29:58 +02:00
106fd61af3 fix(network): Fix x64-live netplan for real AMD64 hardware
Problem: IP assignment failures on bare metal AMD64 due to broken
netplan wildcard syntax - using wan0: with match: name: "e*" but
no set-name: directive caused conflicts on multi-interface systems.

Solution:
- Split single e* pattern into separate en* and eth* matches
- Different route metrics (100/200) for deterministic routing
- Added br-lan bridge pre-definition for router mode
- Enhanced secubox-net-detect with better logging and patterns
- New secubox-net-reset utility for forcing re-detection

Changes:
- board/x64-live/netplan/00-secubox.yaml: Fixed bootstrap config
- image/build-live-usb.sh: Updated embedded netplan with same fix
- image/sbin/secubox-net-detect: Enhanced interface detection
- image/sbin/secubox-net-reset: New utility script
- CLAUDE.md: Added Debian shell scripting guidelines

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-01 06:44:08 +02:00
c4b7ac0f7f feat(eye-remote): Add multi-mode display system v1.9.0
Eye Remote Interactive UI enhancements:
- TTY mode: Serial terminal display from /dev/ttyGS0
- Flash mode: Progress bar with speed/ETA for USB transfers
- Auth mode: QR code generation for backup authentication
- Mode detection via /etc/secubox/gadget-mode

Hub service VM compatibility fix:
- Changed from Unix socket to TCP port 8001
- Updated nginx configs for TCP proxy
- Fixes 502 errors in VirtualBox VMs

Also includes:
- FAQ/Troubleshooting wiki page with GitHub issue links
- Kiosk launcher --no-sandbox fix for VMs
- Profile Generator GUI mockup

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-29 10:24:02 +02:00
3240e441c7 fix(ebin): EspressoBin eMMC boot fixes
- secubox-haproxy: Remove ReadWritePaths sandboxing causing NAMESPACE errors
- secubox-net-fallback: Skip lan* interfaces (DSA downstream ports)
- netplan: Add dummy0 with 10.55.255.1/24 to all board configs
- flash-emmc: Fix eMMC detection using boot0 partition
- flash-emmc.cmd: Support multiple image filenames

Fixes issues encountered when booting SecuBox from EspressoBin V7 eMMC.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-20 07:59:42 +02:00
76cd7c0d96 feat(remote-ui): Add HyperPixel 2.1 Round dashboard for RPi Zero W
Complete Remote UI implementation for SecuBox status display:

- Python/PIL dashboard with direct framebuffer rendering (no Chromium)
- KMS overlay support (vc4-kms-dpi-hyperpixel2r) - tested working
- USB OTG composite gadget (CDC-ECM + CDC-ACM) for host connection
- 6 concentric rings showing CPU, MEM, DISK, LOAD, TEMP, WiFi metrics
- Auto-start systemd service (secubox-dashboard.service)
- install_zerow.sh for SD card preparation with all fixes

Key fixes discovered during debugging:
- Use KMS overlay, not non-KMS (GPIO conflicts on Bookworm)
- Framebuffer is RGB565 (16-bit), not BGRA
- RPi OS Bookworm requires userconf file for SSH credentials
- NetworkManager ignores ifupdown; use direct IP config

Files:
- secubox_dashboard.py: PIL-based live metrics dashboard
- install_zerow.sh: SD card flasher with KMS overlay
- secubox-dashboard.service: Auto-start systemd unit
- 24 module icons (AUTH/WALL/BOOT/MIND/ROOT/MESH)

Tested on: RPi Zero W + HyperPixel 2.1 Round 480x480

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-15 17:54:09 +02:00
d5fd350e88 fix(kiosk): Skip X11 config on bare metal in kiosk launcher too
Same fix as build-live-usb.sh X11 setup - the kiosk launcher was also
creating X11 config files that corrupted on bare metal.

- Skip config creation entirely for bare metal (vm_type=none)
- Intel/AMD/NVIDIA auto-detection works perfectly without configs
- Sanitize gpu_info for VMs (remove special chars)
- Only create explicit driver configs for VMs that need them

Fixes: "M2G_" parse error in /etc/X11/xorg.conf.d/10-kiosk.conf

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-15 10:09:09 +02:00
0f970bb8de fix(kiosk): Add VirtualBox VMSVGA graphics driver support (v1.6.7.14)
- Create secubox-x11-setup.service for boot-time VM/driver detection
- VirtualBox VMSVGA controller requires vmware X11 driver (not modesetting)
- Add driver selection: VBox+VMSVGA→vmware, VBox+VBoxVGA→modesetting
- Update secubox-kiosk.service to depend on x11-setup service
- Update secubox-kiosk-launcher v3.3 to defer to setup service
- Change SLIPSTREAM_DEBS default to 1 (126 packages by default)
- Fix EspressoBin live USB boot partition sizing for embedded images

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-15 09:16:37 +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
3ee3931a89 feat(ui): Phase 11 version display & boot mode indicators (v1.7.0)
- Dashboard footer: version, boot mode, auth mode, uptime
- Login page: auth mode badge + version display
- Plymouth splash: version v1.7.0 + boot mode indicator
- GRUB menu: descriptive echo messages for each boot option
- New API endpoints: /boot_mode, /auth_mode, /public/info
- Version bump to 1.7.0 across all components

Phase 11 tasks completed: P11-01 through P11-04, P11-07 through P11-09

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-14 11:52:38 +02:00
670e71418f fix(kiosk): VirtualBox X11 detection using systemd-detect-virt (v1.6.7.13)
Problem: VirtualBox with VMSVGA shows as "VMware SVGA" in lspci,
causing wrong driver selection and X11 failure.

Fix: Use systemd-detect-virt as primary VM detection:
- "oracle" → VirtualBox → vboxvideo driver
- "vmware" → VMware → vmware driver
- "kvm"/"qemu" → KVM/QEMU → modesetting driver
- Fall back to lspci for bare metal

Also loads vboxsf module for shared folders support.

Addresses #27

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-14 10:07:29 +02:00
6735b7f40a fix(install): Lenovo Error 1962 boot fix + wiki updates (v1.6.7.12)
Fixes:
- Add fallback EFI bootloader at /EFI/BOOT/BOOTX64.EFI for Lenovo/HP/Dell
- Add --slipstream flag to build-live-usb.sh (CI fix)
- Fix banner alignment in secubox-flash-disk
- Update kiosk launcher to v1.6.7.12

Wiki:
- Use generic /releases/latest/download/ URLs (no more hardcoded versions)
- Fix script paths (scripts/ → image/)
- Update all languages (EN, FR, DE, ZH)

Tested: Lenovo hardware install - PASSED

Closes #26

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-14 10:05:03 +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
e27d6e9266 feat(kiosk): Add zenity progress splash before Chromium (v1.6.7.5)
- Add zenity + feh packages for splash display
- secubox-x11-splash: New progress bar with stage indicators
  - X11 Display Server OK
  - Network check
  - nginx check
  - Chromium launch
- Graceful fallback chain: zenity → feh → xmessage → color gradient
- Kiosk launcher integrates splash before Chromium starts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-13 10:16:14 +02:00
f201558649 fix(boot): Remove graphical.target that blocked input (v1.6.7.4)
Root cause: GRUB Kiosk entry used systemd.unit=graphical.target
but no display manager was installed. systemd waited forever
for graphical.target → getty never started → no keyboard input.

Fixes:
- Remove systemd.unit=graphical.target from Kiosk GRUB entry
- Revert getty Type=idle to simple service (v1.6.7.3)
- Enable backup TTYs (tty2-6) for emergency access

Closes #24

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-13 10:01:56 +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
71787e94f5 fix(auth): Add portal users.json reset in firstboot
- Create /etc/secubox/users.json with admin user on firstboot
- Default password: secubox (instead of random)
- SHA256 hash password same as portal expects
- Hide Chromium --ignore-certificate-errors warning with --test-type

Credentials: admin / secubox

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-12 18:36:45 +02:00
b8db604ef1 fix(kiosk): Rewrite X11 startup to fix VT switching issue
- Start Xorg as root directly (required for VT allocation)
- Add proper Xauthority setup with magic cookie
- Explicit chvt 7 to switch to graphical VT
- Wait for X11 socket before launching session
- Run session as kiosk user with correct environment
- Add extensive debug logging

Tested in QEMU: Xorg starts, Chromium runs fullscreen
Version: v1.6.6

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-12 18:21:01 +02:00
f8d8bacce1 fix(live): v1.6.5 remove sandbox warning, fix input devices, restore splash
- Remove --no-sandbox from Chromium to eliminate warning banner
- Add --disable-infobars to hide any remaining info bars
- Add X11 InputClass sections for libinput keyboard/pointer/touchpad
- Set AutoAddDevices=true, AllowEmptyInput=false in ServerFlags
- Restore 'splash' to kernel cmdline for Plymouth boot splash
- Update version strings to 1.6.5

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-12 16:56:37 +02:00
aae1e2c73a feat(live): v1.6.3 Plymouth 3D theme + kiosk fix
Plymouth:
- New secubox-3d theme with nested cubes + triple lemniscate
- 3 cubes (outer/middle/inner) with desync rotation
- AUTH/MIND/MESH colored lemniscates with glowing heads
- SecuBox color palette integration

Kiosk:
- Fix session script: use --start-fullscreen (not --kiosk)
- Allows Ctrl+Alt+Fn VT switching
- Clean exec chromium (no background process issues)
- Consistent session between build script and launcher

Build:
- Version bump to 1.6.3
- Plymouth theme set to secubox-3d

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-12 15:55:18 +02:00
5dcc0619ed fix(boot): Improve GRUB install and netplan DHCP
secubox-flash-disk:
- Add efibootmgr verification after GRUB EFI install
- Show manual fix instructions if EFI entry not created
- Mount /dev/pts for chroot compatibility
- Pass target device to grub-install
- Better error handling and summary

netplan (x64-live):
- Remove invalid routes (via: 0.0.0.0)
- Add dhcp4-overrides for proper DNS/routes
- Rename wan to wan0 to avoid conflicts

Fixes Error 1962 on Lenovo ThinkCentre M710q

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-12 08:02:57 +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
a179969b97 feat(x64): Add disk flasher for x64 live USB
- Create secubox-flash-disk tool for flashing to internal storage
  - Smart device detection (NVMe, SATA, eMMC, VirtIO)
  - Safety checks to prevent flashing boot device
  - Interactive device selection with disk info
  - Progress display with pv or dd status
  - Optional root partition resize to fill disk
  - Checksum verification support

- Update secubox-console-tui with x64 flash support
  - Add is_live_x64() detection function
  - Add flash_disk() function calling secubox-flash-disk
  - Show 'd' key option when running x64 live

- Update build-live-usb.sh with --embed-image option
  - Bundle target image in /secubox/ for disk installation
  - Auto-generate checksum if not present

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-11 10:45:30 +02:00
087e94467c feat(ebin): Add live USB flasher for EspressoBin V7 eMMC
New components for bootable live USB with eMMC flashing capability:

- image/build-ebin-live-usb.sh: Build script for ARM64 live USB
  - SquashFS-based live filesystem
  - Cross-compilation support via QEMU
  - Optional embedded eMMC image for flashing
  - Distroboot configuration for U-Boot

- image/sbin/secubox-flash-emmc: Interactive eMMC flasher
  - Safety checks (won't flash if running from eMMC)
  - Progress display and checksum verification
  - Auto mode for unattended installation
  - Dry-run option for testing

- board/espressobin-v7/boot-live-usb.cmd: U-Boot boot script
  - USB boot priority configuration
  - Live-boot kernel parameters

- board/espressobin-v7/extlinux/extlinux.conf: Distroboot menu
  - Live, To-RAM, Flash, and Rescue boot options

- Updated secubox-console-tui with "Flash to eMMC" menu option

Usage:
  # Build eMMC image first
  sudo bash image/build-image.sh --board espressobin-v7

  # Build live USB with embedded image
  sudo bash image/build-ebin-live-usb.sh \
    --embed-image output/secubox-espressobin-v7-bookworm.img.gz

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-11 10:24:40 +02:00
da7d148a66 fix(kiosk): Use localhost URL for network-independent operation
- Change kiosk URL from 192.168.255.1:9443 to https://localhost/
- Kiosk now works without network (localhost always available)
- Remove port 9443 (nginx listens on 443 internally)
- Update URL priority: localhost first, then 127.0.0.1

Fixes kiosk white screen on real hardware (Lenovo) where
dummy0 interface may not be configured.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-10 12:48:05 +02:00
ac7f8a0d7e feat: Add QEMU/VBox launcher scripts + fix kiosk log bug
New scripts:
- scripts/run-qemu.sh: Launch SecuBox in QEMU with port forwarding
- scripts/run-vbox.sh: Create and launch SecuBox VM in VirtualBox

Port forwarding (both scripts):
- SSH:   localhost:2222 → guest:22
- HTTPS: localhost:9443 → guest:443
- HTTP:  localhost:8080 → guest:80

Bug fix:
- secubox-kiosk-launcher: log() now writes to stderr
- Fixes URL corruption when log messages were captured by
  command substitution in determine_url()

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-10 12:02:25 +02:00
acde1344aa fix: Remove :9443 from internal kiosk URLs
The kiosk scripts were using port 9443 for internal connections,
but nginx listens on port 443 inside the VM. Port 9443 is only
used for host port forwarding (QEMU/VirtualBox NAT).

URLs changed:
- https://192.168.255.1:9443/https://192.168.255.1/
- https://localhost:9443/https://localhost/
- https://127.0.0.1:9443/https://127.0.0.1/

This fixes the kiosk "connection refused" error in VM environments.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-10 11:30:38 +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
df8c984bb8 fix(boot): TUI mode now properly overrides kiosk
- cmdline-handler: Use systemctl mask to prevent kiosk startup
- cmdline-handler: Kill X11/Chromium if already running
- cmdline-handler: Create generator drop-in for correct target
- kiosk.service: Wait for cmdline handler before starting
- tui.service: Wait for cmdline handler before starting

Fixes: TUI boot menu option was loading Kiosk GUI instead

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-04 17:47:08 +02:00
a2fd0e0cd6 feat(boot): CRT-style banners with colors and emoji indicators
Boot Banner Improvements:
- /etc/issue: Gold ASCII art pre-login banner with credentials
- /etc/motd: Colorful LIVE USB banner with access info
- secubox-status: New command showing system overview with CRT colors
- secubox-help: Quick reference for all secubox commands
- secubox-logs: Live security log viewer shortcut
- profile.d: Login status display with mode/service/IP indicators

Mode Switching:
- cmdline-handler: Fixed TUI mode to start (not just enable) service
- secubox-mode: Updated with CRT colors and emoji status indicators

GRUB Menu:
- Kiosk GUI is now default when --kiosk flag used
- All entries have emoji indicators (🖼️📟🌉🛡️💾🚀🔧🚨🐛)
- CRT-style menu colors (cyan on black, yellow highlights)

CI Workflows:
- build-live-usb.yml: Updated boot options and credentials in release notes
- release.yml: Updated to 93 packages, new boot options, correct credentials

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-04 12:16:40 +02:00
e0569f4082 feat(live): Add disk installer to live USB image
- Add secubox-install script for interactive disk installation
- Add "Install SecuBox to Disk" GRUB menu entry
- Add secubox.install=1 kernel parameter support
- Auto-launch installer when booted with install option

The installer:
- Lists available disks with size and model
- Asks for confirmation before wiping
- Creates GPT partitions (ESP + root + data)
- Copies live filesystem to disk
- Installs GRUB bootloader (UEFI + BIOS)
- Generates proper fstab

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-04 11:44:00 +02:00
0f13c6b108 fix(kiosk): Enable mouse auto-detection in X11
Change AutoAddDevices and AutoEnableDevices to true so that
VirtualBox mouse integration and USB tablet are properly detected
by libinput.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-03 08:30:21 +02:00
1c6010040d fix(kiosk): Add HTTP fallback for localhost kiosk mode
- Add HTTP server block in nginx for localhost/127.0.0.1/192.168.255.1
- Change kiosk default URL from https:// to http:// (avoids SSL issues)
- Add fallback index.html creation in build script
- Ensures nginx has content to serve even if packages fail to install

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-02 12:13:58 +02:00
220d566503 feat(image): Add mode switcher and TUI support
- Add secubox-mode script to switch between kiosk/tui/console
- Add secubox.mode= kernel parameter support (tui, console)
- Add "SecuBox Live (Console TUI)" GRUB menu entry
- TUI mode is secondary, kiosk mode is default

Boot parameter examples:
  secubox.mode=tui     - Start with console TUI
  secubox.mode=console - Drop to login shell
  (default)            - Kiosk GUI mode

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-02 11:08:54 +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
362c47272a fix(kiosk): Use https://localhost/ as default kiosk URL
- Changed default KIOSK_URL from https://192.168.255.1:9443/ to https://localhost/
- nginx listens on localhost, so this is more reliable
- Fallback URL updated to https://127.0.0.1:9443/
- Applies to both kiosk-launcher script and build-live-usb.sh template

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-01 16:45:50 +02:00
9aa8740bef fix(kiosk): Add VMSVGA support and HTTP fallback for VirtualBox
- Detect VirtualBox VMSVGA graphics adapter and use vmware X11 driver
- Add HTTP URL fallbacks when HTTPS is not available
- Remove problematic fbdev fallback config in VMs (causes conflicts)
- Improve VM graphics detection (vmsvga vs vboxvga)

Tested with VirtualBox 7.x + VMSVGA + Chromium kiosk mode.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-01 16:10:07 +02:00
93475f93a7 fix(kiosk): Fix race conditions and startup failures
Major kiosk mode rewrite to fix boot failures on both VMs and hardware:

New secubox-kiosk-launcher script that handles:
- Dynamic UID detection (no more hardcoded UID 1000)
- Proper dependency waiting (nginx, network, dummy0)
- User creation if missing
- Fallback URL handling (primary -> localhost)
- VT setup without race conditions

Fixed systemd services:
- Added proper After= dependencies (nginx, networkd, firstboot)
- Removed problematic chvt command (let X11 handle VT)
- Increased TimeoutStartSec to 180s for slow hardware
- Added StartLimitInterval/Burst for restart protection

Simplified xinitrc/start-kiosk.sh:
- Removed redundant wait loops (launcher handles this)
- Added error suppression for headless environments
- Added logging via logger

Build script updates:
- Copy kiosk-launcher and wayland service to images
- Removed inline service definition (use systemd/ files)

Fixes: Kiosk blank screen, race conditions, UID mismatch,
       missing dependencies, VT switching failures

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-01 10:11:34 +02:00
39791d4259 fix(console): Fix BoardHeader import in SOC screens
Replace non-existent SecuBoxHeader with BoardHeader in SOC screens.
Remove unused get_board_colors import.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-01 07:14:54 +02:00
d7e835412c fix(kiosk): Add Xwrapper.config for X11 systemd service
- X server requires 'allowed_users=anybody' when started from systemd
- Without this, error: "Only console users are allowed to run the X server"
- Added to both secubox-kiosk-setup and build-live-usb.sh

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-31 10:52:14 +02:00
13415524b1 fix(kiosk): Switch default from Wayland to X11 for VM compatibility
- Cage/Wayland fails on VirtualBox/VMware with "Basic output test failed"
- X11/startx mode works reliably on VMs and most hardware
- secubox-kiosk-setup now supports --x11 (default) and --wayland flags
- Added secubox-kiosk-wayland.service for native Wayland users
- Updated build-live-usb.sh to use X11 kiosk with .xinitrc
- Mode saved in /var/lib/secubox/.kiosk-mode

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-31 10:30:57 +02:00
ea772a95cb fix(kiosk): Start kiosk service explicitly after creating marker
Systemd evaluates ConditionPathExists before the cmdline handler
creates .kiosk-enabled, causing service to fail. Now explicitly
starts the service after setup.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 16:46:17 +02:00
ba02a422a2 fix(live-usb): Fix hanging boot services
- Add 10s timeout to secubox-cmdline.service
- Add 5s timeout to netplan apply
- Remove pipefail to allow graceful failures
- Scripts now continue on non-critical errors

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 11:23:45 +02:00
9cb679c221 fix(network): Add dummy interface and DHCP fallback for kiosk
- Add dummy0 interface with fixed IP 192.168.255.1/24
- Always available for kiosk/local access regardless of DHCP
- Add optional: true to DHCP config to prevent boot blocking
- Add secubox-net-fallback service for link-local IP fallback
- Update kiosk URL to use dummy interface IP
- Fix build-all-local.sh arithmetic expression bug

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 06:28:53 +02:00
2fb00d05c8 fix(kiosk): Use native Wayland via --ozone-platform=wayland
Chromium now runs in native Wayland mode instead of Xwayland,
reducing dependencies and improving performance.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-29 09:23:26 +02:00