diff --git a/backend/app/services/spoolbuddy_ssh.py b/backend/app/services/spoolbuddy_ssh.py index d5e3e416f..a4cf0ea24 100644 --- a/backend/app/services/spoolbuddy_ssh.py +++ b/backend/app/services/spoolbuddy_ssh.py @@ -225,7 +225,13 @@ async def perform_ssh_update(device_id: str, ip_address: str, install_path: str await _update_progress("error", f"Service restart failed: {stderr[:200]}") return - # Step 6: Restart kiosk browser to load updated frontend + # Step 6: Clear browser cache and restart kiosk + # Remove Chromium's Service Worker + cache storage to prevent stale frontend + await _run_ssh_command( + ip_address, + "sudo find /home -maxdepth 5 -path '*/chromium/Default/Service Worker' -type d -exec rm -rf {} + 2>/dev/null; true", + private_key, + ) rc, _, stderr = await _run_ssh_command( ip_address, "sudo /usr/bin/systemctl restart getty@tty1.service", diff --git a/spoolbuddy/install/install.sh b/spoolbuddy/install/install.sh index 821e64b29..f8aeeddf8 100755 --- a/spoolbuddy/install/install.sh +++ b/spoolbuddy/install/install.sh @@ -377,6 +377,7 @@ create_spoolbuddy_user() { cat > /etc/sudoers.d/spoolbuddy << 'SUDOERS' spoolbuddy ALL=(root) NOPASSWD: /usr/bin/systemctl restart spoolbuddy.service spoolbuddy ALL=(root) NOPASSWD: /usr/bin/systemctl restart getty@tty1.service +spoolbuddy ALL=(root) NOPASSWD: /usr/bin/find /home -maxdepth 5 * SUDOERS chmod 440 /etc/sudoers.d/spoolbuddy success "Sudoers entries created for service and kiosk restart"