Commit Graph
20 Commits
Author SHA1 Message Date
maziggy a5ea3f599a Minor Spoolbuddy install.sh fixes 2026-03-25 10:24:47 +01:00
maziggy f96b9ded56 Add WiFi safeguard and apt upgrade to SpoolBuddy install script
Install script now runs apt-get upgrade -y after installing system
  packages. A WiFi safeguard (APT hook + helper script) is installed
  first, backing up NetworkManager connections before dpkg and restoring
  them if wiped — prevents headless Pis from losing WiFi during upgrades.
2026-03-25 10:22:22 +01:00
maziggy cb31a6cd33 Add apt upgrade to SpoolBuddy install script
Runs apt-get upgrade -y after installing system packages and the WiFi
  safeguard hook. Ensures the Pi is fully up to date before deploying
  SpoolBuddy, and the WiFi safeguard protects NM connections during
  the upgrade.
2026-03-25 10:14:16 +01:00
maziggy 53da037048 Add WiFi safeguard to SpoolBuddy install script
APT hook backs up NetworkManager WiFi connections before dpkg runs
  and restores them if they get wiped. Prevents headless SpoolBuddy
  Pis from losing WiFi after apt upgrade (observed with Bookworm
  kernel/raspi-config updates clearing system-connections/).
2026-03-25 09:53:14 +01:00
Keybored 6e648804fc [Feature] Spoolbuddy Fixes and Improvements (#787)
[Feature] Spoolbuddy Fixes and Improvements (#787)
2026-03-24 11:56:33 +01:00
maziggy 364b02b8ac Housekeeping 2026-03-23 15:44:49 +01:00
maziggy a922c18a41 ● Disable Chromium disk cache in SpoolBuddy kiosk
After updates, the kiosk browser showed stale frontend assets from
  Chromium's disk cache even after restarting. Added --disk-cache-size=0
  to the launch flags — the kiosk loads a single page from the local
  network so caching provides no benefit.
2026-03-23 14:11:21 +01:00
maziggy db43218785 Fix SpoolBuddy kiosk launching before network is ready
The getty@tty1 autologin had no network dependency, so the labwc/Chromium
  kiosk chain started before connectivity was up — showing a connection
  error for 10-15 seconds. Added After=network-online.target to the
  autologin override so the browser has network when it launches.
2026-03-23 14:04:55 +01:00
maziggy 136ecb7c92 Replace SpoolBuddy self-update with SSH-based updates from Bambuddy
The daemon's self-update mechanism (git fetch/reset on its own code) was
  fragile: .git permission errors, self-modifying code mid-run, hardcoded
  main branch. Bambuddy now SSHes into the SpoolBuddy Pi and drives the
  update remotely — matching its own branch, with step-by-step progress
  via WebSocket. After updating the daemon, the kiosk browser is also
  restarted so it loads the updated frontend.

  SSH key pairing is automatic: Bambuddy generates an ED25519 keypair and
  returns the public key in the registration response. The daemon deploys
  it to authorized_keys on first connect — no manual setup needed.

  Changes:
  - New: backend/app/services/spoolbuddy_ssh.py
  - Rewritten: trigger_daemon_update endpoint (SSH instead of pending_command)
  - New: GET /spoolbuddy/ssh/public-key endpoint
  - Auto SSH key deployment via registration response + daemon
  - Removed: daemon _perform_update() and cmd=="update" handler
  - Install script: bash shell, sudoers for daemon + kiosk restart, .ssh/ setup
  - Dockerfile: added openssh-client
  - Frontend: SSH key display, force update button
  - Fixed: update check compares APP_VERSION, not GitHub releases
  - Fixed: kiosk browser restart after update
2026-03-23 13:46:45 +01:00
maziggy 5e9481859b Replace SpoolBuddy self-update with SSH-based updates from Bambuddy
The daemon's self-update mechanism (git fetch/reset on its own code) was
  fragile: .git permission errors, self-modifying code mid-run, hardcoded
  main branch. Bambuddy now SSHes into the SpoolBuddy Pi and drives the
  update remotely — matching its own branch, with step-by-step progress
  via WebSocket.

  SSH key pairing is automatic: Bambuddy generates an ED25519 keypair and
  returns the public key in the registration response. The daemon deploys
  it to authorized_keys on first connect — no manual setup needed.

  - New: backend/app/services/spoolbuddy_ssh.py (keypair, SSH commands, update orchestration)
  - Rewritten: trigger_daemon_update endpoint uses SSH instead of pending_command
  - New: GET /spoolbuddy/ssh/public-key endpoint for manual pairing
  - Removed: daemon _perform_update() and cmd=="update" heartbeat handler
  - Updated: install.sh — bash shell, sudoers for systemctl restart, .ssh/ setup
  - Updated: Dockerfile — added openssh-client
  - Updated: frontend — SSH key display, force update button
  - Fixed: update check now compares against APP_VERSION, not GitHub releases
2026-03-23 13:32:42 +01:00
maziggy bc1bba078b Replace SpoolBuddy self-update with SSH-based updates from Bambuddy
The daemon's self-update mechanism (git fetch/reset on its own code) was
  fragile: .git permission errors, self-modifying code mid-run, hardcoded
  main branch. Bambuddy now SSHes into the SpoolBuddy Pi and drives the
  update remotely — matching its own branch, with step-by-step progress
  via WebSocket. Install script updated with SSH access, sudoers entry,
  and --ssh-pubkey flag for pairing.
2026-03-23 12:51:21 +01:00
maziggy 628a814271 Redesign SpoolBuddy settings page, add language/time format support
- Redesign settings page with tabbed layout (Device, Display, Scale, Updates)
  - Add screen blank timeout: blanks after touch inactivity, tap to wake
  - Add CSS brightness filter for HDMI displays (no sysfs on HDMI)
  - Add backend `language` field to app settings for server-side persistence
  - Sync UI language from backend on kiosk load (separate Chromium instance)
  - Top bar clock respects user's time format setting (system/12h/24h)
  - Add SpoolBuddy settings translations for all 6 languages (en/de/fr/ja/it/pt-BR)
  - Disable Chromium swipe-to-navigate in kiosk install script
  - Add `video` group for DSI backlight access
2026-03-02 12:44:45 +01:00
maziggy 28fda7b1a0 Display Controls (brightness + blanking)
Root cause: The daemon used wlopm for screen blanking, but wlopm was never installed. Additionally, the daemon runs as the spoolbuddy system user which has no access to
   the Wayland socket, so Wayland-based tools can't work.

  Fix in display_control.py:
  - Replaced wlopm --off/--on with vcgencmd display_power 0/1 — this is a Raspberry Pi firmware-level command that's pre-installed and works without Wayland socket access
  - Added shutil.which("vcgencmd") check at init to avoid repeated failures on non-RPi hardware
  - Added explicit PermissionError handling for brightness writes with a helpful message about the video group

  Fix in install.sh:
  - Added video group to the spoolbuddy service user's groups (was: gpio, spi, i2c → now: gpio, spi, i2c, video), which grants access to both vcgencmd and sysfs backlight
   files

  Scale Tab Numpad

  Root cause: On the 1024x600 kiosk screen (~376px available content height), the weight info card + numpad + action buttons exceeded the space, causing tiny buttons and
  overlapping.

  Fix in SpoolBuddySettingsPage.tsx:
  - Hide the weight info card during weight entry step (calStep !== 'weight'), reclaiming ~70px
  - Compact inline weight reading in the step header (small dot + monospace text) so users can still see the live scale value
  - Larger numpad buttons: min-h-[56px] with text-lg font size (was no min-height, text-sm)
  - Added active:scale-95 for tactile touch feedback
  - mt-auto on action buttons to push them to the bottom, preventing overlap
  - Removed the wrapping card around the calibration flow to save vertical padding
2026-03-02 11:40:45 +01:00
maziggy 9f6acd6e77 Updated Spoolbuddy install script 2026-03-02 09:53:31 +01:00
maziggy 42b07d8bfd Add API key auth support to /auth/me for SpoolBuddy kiosk
When Bambuddy auth is enabled, the SpoolBuddy kiosk gets redirected to
the login page because ProtectedRoute requires a user from GET /auth/me,
which only handled JWT tokens. The kiosk daemon already has an API key
but couldn't use it to satisfy the frontend auth check.

- Backend: /auth/me now accepts API keys (Bearer bb_xxx or X-API-Key)
  and returns a synthetic admin UserResponse with all permissions
- Frontend: AuthContext reads ?token= from URL on first load, stores in
  localStorage, and strips from URL (prevents history/referrer leakage)
- Install script: kiosk URL now includes ?token=${API_KEY}
- Tests: 3 new integration tests (Bearer API key, X-API-Key header,
  invalid key rejection)
2026-02-27 13:34:19 +01:00
maziggy cc13166fea Updated Spoolbuddy install script 2026-02-27 13:33:47 +01:00
maziggy f7e65aa8e3 Updated Spoolbuddy install script to strip down Raspbian 2026-02-27 13:33:47 +01:00
maziggy 414dc4a511 Updated RPI install script 2026-02-23 11:34:43 +01:00
maziggy eba4184097 Updated RPI install script 2026-02-23 11:29:17 +01:00
maziggy 851b039dd8 Added Spoolbuddy RPI install script 2026-02-23 10:30:48 +01:00