From 2d78d58fe19aa11392d7132bedbe9b4edab2f154 Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Sat, 24 Oct 2026 19:40:04 +0200 Subject: [PATCH] post-pmg-install: hide the subscription nag in the PMG 9 mobile quarantine PMG 9 replaced pmgmanagerlib-mobile.js with the Yew/WASM app in pmg-mobile-quarantine-ui, so the mobile hook no longer found its file. The status check is compiled into the WASM, so the helper now injects a fetch wrapper into the mobile index template that reports the subscription as active to the app. The API response itself is unchanged. All patches move into /usr/local/bin/pmg-remove-nag.sh behind a single apt hook. "no" now also removes the mobile hook and the helper, and the reinstall covers pmg-mobile-quarantine-ui so its template is restored. Fixes #16217 --- tools/pve/post-pmg-install.sh | 44 +++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/tools/pve/post-pmg-install.sh b/tools/pve/post-pmg-install.sh index 3fd90ba5e..9cfc0a266 100644 --- a/tools/pve/post-pmg-install.sh +++ b/tools/pve/post-pmg-install.sh @@ -314,21 +314,51 @@ EOF whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "Support Subscriptions" \ "Supporting the software's development team is essential.\nPlease consider buying a subscription." 10 58 msg_info "Disabling subscription nag" - cat >/etc/apt/apt.conf.d/no-nag-script <<'EOF' -DPkg::Post-Invoke { "if [ -s /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js ] && ! grep -q -F 'NoMoreNagging' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; then sed -i '/data\.status/{s/\!//;s/active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; fi"; }; -EOF + mkdir -p /usr/local/bin + cat >/usr/local/bin/pmg-remove-nag.sh <<'EOF' +#!/bin/sh +WEB_JS=/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js +if [ -s "$WEB_JS" ] && ! grep -q NoMoreNagging "$WEB_JS"; then + sed -i '/data\.status/{s/\!//;s/active/NoMoreNagging/}' "$WEB_JS" +fi - cat >/etc/apt/apt.conf.d/no-nag-script-pmgmanagerlib-mobile <<'EOF' -DPkg::Post-Invoke { "if [ -s /usr/share/javascript/pmg-gui/js/pmgmanagerlib-mobile.js ] && ! grep -q -F 'NoMoreNagging' /usr/share/javascript/pmg-gui/js/pmgmanagerlib-mobile.js; then sed -i '/data\.status/{s/\!//;s/active/NoMoreNagging/}' /usr/share/javascript/pmg-gui/js/pmgmanagerlib-mobile.js; fi"; }; +MOBILE_JS=/usr/share/javascript/pmg-gui/js/pmgmanagerlib-mobile.js +if [ -s "$MOBILE_JS" ] && ! grep -q NoMoreNagging "$MOBILE_JS"; then + sed -i '/data\.status/{s/\!//;s/active/NoMoreNagging/}' "$MOBILE_JS" +fi + +MOBILE_TPL=/usr/share/pmg-mobile-quarantine-ui/pmg-mobile-index.html.tt +if [ -s "$MOBILE_TPL" ] && ! grep -q NoMoreNagging "$MOBILE_TPL"; then + sed -i '//r /dev/stdin' "$MOBILE_TPL" <<'HTML' + +HTML +fi EOF + chmod 755 /usr/local/bin/pmg-remove-nag.sh + + cat >/etc/apt/apt.conf.d/no-nag-script <<'EOF' +DPkg::Post-Invoke { "/usr/local/bin/pmg-remove-nag.sh"; }; +EOF + rm -f /etc/apt/apt.conf.d/no-nag-script-pmgmanagerlib-mobile msg_ok "Disabled subscription nag (clear browser cache!)" ;; no) msg_error "Selected no to Disabling subscription nag" - rm -f /etc/apt/apt.conf.d/no-nag-script 2>/dev/null + rm -f /etc/apt/apt.conf.d/no-nag-script /etc/apt/apt.conf.d/no-nag-script-pmgmanagerlib-mobile /usr/local/bin/pmg-remove-nag.sh ;; esac - apt --reinstall install proxmox-widget-toolkit pmg-gui &>/dev/null || msg_error "Widget toolkit reinstall failed" + apt --reinstall install proxmox-widget-toolkit pmg-gui pmg-mobile-quarantine-ui &>/dev/null || msg_error "Widget toolkit reinstall failed" # ---- UPDATE ---- CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "UPDATE" --menu \