From cb31a6cd335d802696b7dc35b71b04ce18a1adaf Mon Sep 17 00:00:00 2001 From: maziggy Date: Wed, 25 Mar 2026 10:14:16 +0100 Subject: [PATCH] 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. --- CHANGELOG.md | 1 + spoolbuddy/install/install.sh | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a4ebe468..d4a7bc750 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ All notable changes to Bambuddy will be documented in this file. ### Improved - **Spool Notes in Assign Spool Modal** ([#793](https://github.com/maziggy/bambuddy/issues/793)) — Spool cards in the Assign Spool modal now show the spool's note as a hover tooltip, making it easier to identify spools by tracking IDs or other metadata stored in notes. Works with both internal inventory and Spoolman-synced spools. Requested by @LegionCanadian. - **WiFi Safeguard for SpoolBuddy Pi** — The install script now drops an APT hook (`/etc/apt/apt.conf.d/80-preserve-wifi`) that backs up NetworkManager WiFi connections before every `apt upgrade` and restores them if they get wiped. Prevents headless SpoolBuddy Pis from losing WiFi connectivity after Raspberry Pi OS package upgrades (observed with Bookworm kernel/raspi-config updates that clear `/etc/NetworkManager/system-connections/`). +- **SpoolBuddy Install Script Now Upgrades System Packages** — The install script now runs `apt-get upgrade -y` after installing required packages and the WiFi safeguard. This ensures the Pi is fully up to date before SpoolBuddy is deployed, and the WiFi safeguard protects connectivity during the upgrade. ### Fixed - **Database Connection Pool Exhaustion on Large Printer Farms** — Users with 100+ printers connected simultaneously experienced `QueuePool limit of size 10 overflow 20 reached, connection timed out` errors. Increased the SQLAlchemy connection pool from 30 total (10 base + 20 overflow) to 220 (20 base + 200 overflow), and raised the SQLite busy_timeout from 5 to 15 seconds to reduce write contention under heavy concurrent MQTT updates. diff --git a/spoolbuddy/install/install.sh b/spoolbuddy/install/install.sh index e329eb25d..40d0c8d85 100755 --- a/spoolbuddy/install/install.sh +++ b/spoolbuddy/install/install.sh @@ -462,6 +462,10 @@ APTEOF success "WiFi safeguard installed (${hook_file})" } +upgrade_system_packages() { + run_with_progress "Upgrading system packages" apt-get upgrade -y +} + # ───────────────────────────────────────────────────────────────────────────── # SpoolBuddy Installation # ───────────────────────────────────────────────────────────────────────────── @@ -1335,6 +1339,7 @@ main() { # ── Step 2: System packages ─────────────────────────────────────────── install_system_packages install_wifi_safeguard + upgrade_system_packages detect_python || error "Failed to install Python 3.10+" echo ""