From 7959a46269d786d0810ed25c5a9bc4aa19b315e1 Mon Sep 17 00:00:00 2001 From: MickLesk Date: Tue, 21 Jul 2026 23:03:53 +0200 Subject: [PATCH] Back up snappdf's Chromium download to avoid re-fetching on every update vendor/bin/snappdf download is idempotent: it exits immediately without downloading if versions/revision.txt already exists, and PDF generation doesn't check that version against the installed snappdf package - it just uses whatever's in versions/. So the cached Chromium build survives just fine across an update via the existing backup/restore mechanism. Add vendor/beganovich/snappdf/versions to create_backup/restore_backup; keep the snappdf download call only as a safety net for when the backup doesn't have it yet (e.g. the first update after this fix ships). --- ct/invoiceninja.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ct/invoiceninja.sh b/ct/invoiceninja.sh index 23e625741..9f4fd504a 100644 --- a/ct/invoiceninja.sh +++ b/ct/invoiceninja.sh @@ -35,17 +35,20 @@ function update_script() { systemctl stop supervisor nginx php8.4-fpm msg_ok "Stopped Services" - create_backup /opt/invoiceninja/.env /opt/invoiceninja/storage /opt/invoiceninja/public/storage + create_backup /opt/invoiceninja/.env /opt/invoiceninja/storage /opt/invoiceninja/public/storage /opt/invoiceninja/vendor/beganovich/snappdf/versions CLEAN_INSTALL=1 fetch_and_deploy_gh_release "invoiceninja" "invoiceninja/invoiceninja" "prebuild" "latest" "/opt/invoiceninja" "invoiceninja.tar.gz" restore_backup - msg_info "Downloading Chromium for PDF Generation" + # No-op if the snappdf/versions restore above already has a Chromium build + # (snappdf skips downloading when versions/revision.txt exists); acts as a + # safety net if it's missing, e.g. the very first update after this fix. + msg_info "Verifying Chromium for PDF Generation" cd /opt/invoiceninja $STD ./vendor/bin/snappdf download chown -R www-data:www-data /opt/invoiceninja/vendor/beganovich/snappdf/versions - msg_ok "Downloaded Chromium for PDF Generation" + msg_ok "Verified Chromium for PDF Generation" msg_info "Running Migrations" cd /opt/invoiceninja