From 9a87261823ebca68666fead1e4134a74be9b908e Mon Sep 17 00:00:00 2001 From: Maarten Date: Mon, 2 Mar 2026 16:53:32 +0100 Subject: [PATCH] Fix nag detection: PVE 9 effectively disabled the subscription popup PVE 9.1 changed the JS condition to check for 'NoMoreNagging' status (case-sensitive compare after toLowerCase), which never matches. The subscription API returns status "notfound" which is truthy, so the nag dialog condition is always false. Detect PVE major version and skip nag check for PVE >= 9. Co-Authored-By: Claude Opus 4.6 --- hetzner/proxmox-setup | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/hetzner/proxmox-setup b/hetzner/proxmox-setup index e3cad15..8106a51 100755 --- a/hetzner/proxmox-setup +++ b/hetzner/proxmox-setup @@ -419,11 +419,17 @@ if grep -rq 'pve-no-subscription' /etc/apt/sources.list.d/ 2>/dev/null; then fi echo "$nosub" echo '---NAG_PATCHED---' -# Check if the subscription nag popup has been patched -# PVE 8: void({ replaces Ext.Msg.show -# PVE 9: same pattern or similar -if grep -q 'void({' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2>/dev/null; then - echo 'yes' +# Check if the subscription nag popup needs patching. +# PVE 9.x changed the JS logic so the nag never triggers even without +# patching (the condition checks for 'NoMoreNagging' which never matches). +# PVE 8.x needs the void({ patch to suppress it. +pve_major=$(pvesh get /version --output-format json 2>/dev/null \ + | python3 -c 'import sys,json; print(json.load(sys.stdin)["version"].split(".")[0])' 2>/dev/null \ + || echo '8') +if [ "$pve_major" -ge 9 ] 2>/dev/null; then + echo 'yes' # PVE 9+ nag is effectively disabled +elif grep -q 'void({' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2>/dev/null; then + echo 'yes' # PVE 8 with JS patch applied elif ! grep -q "No valid subscription" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2>/dev/null; then echo 'yes' # nag text removed entirely else