From 9fc9151d4a93e8c6ae47667fedf439d660bba21e Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Sat, 21 Nov 2026 18:37:46 +0100 Subject: [PATCH] Change Detection: create the SockPuppetBrowser unit whenever it is missing (#18895) * Change Detection: create the SockPuppetBrowser unit whenever it is missing The update wrote sockpuppetbrowser.service only while replacing Browserless, then restarted it unconditionally. A container without browserless.service (installs before 2023-05, or a lost unit) had SockPuppetBrowser deployed and the update stopped with "Unit sockpuppetbrowser.service not found" (exit 5). * ref Removed outdated comments regarding Browserless and SockPuppetBrowser. --- ct/changedetection.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ct/changedetection.sh b/ct/changedetection.sh index c94b6a5b0..492f191c8 100644 --- a/ct/changedetection.sh +++ b/ct/changedetection.sh @@ -93,6 +93,15 @@ function update_script() { rm -rf /opt/browserless /root/.cache/ms-playwright $STD apt purge -y microsoft-edge-stable rm -f /etc/apt/sources.list.d/microsoft-edge-stable.list + sed -i 's/browserless\.service/sockpuppetbrowser.service/g' "$SERVICE_FILE" + sed -i -e '/^WEBDRIVER_URL=/d' \ + -e 's|^PLAYWRIGHT_DRIVER_URL=ws://localhost:3000/chrome.*|PLAYWRIGHT_DRIVER_URL=ws://127.0.0.1:3000/?headful=true\&--window-size=1920,1080|' \ + /opt/changedetection/.env + msg_ok "Replaced Browserless with SockPuppetBrowser" + fi + + if [[ ! -f /etc/systemd/system/sockpuppetbrowser.service ]]; then + msg_info "Creating SockPuppetBrowser Service" cat </etc/systemd/system/sockpuppetbrowser.service [Unit] Description=SockPuppetBrowser @@ -110,13 +119,9 @@ Restart=on-failure [Install] WantedBy=multi-user.target EOF - sed -i 's/browserless\.service/sockpuppetbrowser.service/g' "$SERVICE_FILE" - sed -i -e '/^WEBDRIVER_URL=/d' \ - -e 's|^PLAYWRIGHT_DRIVER_URL=ws://localhost:3000/chrome.*|PLAYWRIGHT_DRIVER_URL=ws://127.0.0.1:3000/?headful=true\&--window-size=1920,1080|' \ - /opt/changedetection/.env systemctl daemon-reload systemctl enable -q sockpuppetbrowser - msg_ok "Replaced Browserless with SockPuppetBrowser" + msg_ok "Created SockPuppetBrowser Service" fi systemctl daemon-reload