Browse Source

Housekeeping

maziggy 2 months ago
parent
commit
364b02b8ac
2 changed files with 8 additions and 1 deletions
  1. 7 1
      backend/app/services/spoolbuddy_ssh.py
  2. 1 0
      spoolbuddy/install/install.sh

+ 7 - 1
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]}")
             await _update_progress("error", f"Service restart failed: {stderr[:200]}")
             return
             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(
         rc, _, stderr = await _run_ssh_command(
             ip_address,
             ip_address,
             "sudo /usr/bin/systemctl restart getty@tty1.service",
             "sudo /usr/bin/systemctl restart getty@tty1.service",

+ 1 - 0
spoolbuddy/install/install.sh

@@ -377,6 +377,7 @@ create_spoolbuddy_user() {
     cat > /etc/sudoers.d/spoolbuddy << 'SUDOERS'
     cat > /etc/sudoers.d/spoolbuddy << 'SUDOERS'
 spoolbuddy ALL=(root) NOPASSWD: /usr/bin/systemctl restart spoolbuddy.service
 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/systemctl restart getty@tty1.service
+spoolbuddy ALL=(root) NOPASSWD: /usr/bin/find /home -maxdepth 5 *
 SUDOERS
 SUDOERS
     chmod 440 /etc/sudoers.d/spoolbuddy
     chmod 440 /etc/sudoers.d/spoolbuddy
     success "Sudoers entries created for service and kiosk restart"
     success "Sudoers entries created for service and kiosk restart"