(Proxmox VE) Persistent automatic nag-removal script

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

arglebargle

H̸̖̅ȩ̸̐l̷̦͋l̴̰̈ỏ̶̱ ̸̢͋W̵͖̌ò̴͚r̴͇̀l̵̼͗d̷͕̈
Jul 15, 2018
657
244
43
Hey all,

I got annoyed manually patching the PVE web gui javascript to remove the "unlicensed node" pop-up across half a dozen machines every time there was an update, so I automated the process. Then I realized I could make pre/post install dpkg hooks for it so it'll fire every time the source packages are updated, so I implemented that and pushed it to github. The goal here is "run it once during Proxmox install and never think about license nags again." ... Or at least until they significantly change the web UI code anyway.

I have it running on four of my systems at the moment and it's been smooth sailing through the last couple of updates. If anyone's interested I'd appreciate a code review and/or feedback.

You can find everything here: foundObjects/pve-nag-buster

Cheers!
 
Last edited:

Monoman

Active Member
Oct 16, 2013
408
160
43
Do you need to reboot for it to start working? I applied your patch, and the nag window is still present.

Code:
proxmox-ve: 5.3-1 (running kernel: 4.15.18-12-pve)
 

arglebargle

H̸̖̅ȩ̸̐l̷̦͋l̴̰̈ỏ̶̱ ̸̢͋W̵͖̌ò̴͚r̴͇̀l̵̼͗d̷͕̈
Jul 15, 2018
657
244
43
Do you need to reboot for it to start working? I applied your patch, and the nag window is still present.

Code:
proxmox-ve: 5.3-1 (running kernel: 4.15.18-12-pve)
No, I don't think so. At least I've always been able to just `systemctl restart pveproxy.service` and have things work after shift-reloading the web UI. Try a shift+refresh on the problem host's web UI to reload the page and skip the cache, see if that does it.

If that fails do `find /usr/share/javascript/proxmox-widget-toolkit/` and see what's there (there should be a .js and .js.orig) and `grep "data.status !==" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js` to see if the nag check has been patched (this should output nothing if the patch has been applied.)
 
  • Like
Reactions: Monoman

Monoman

Active Member
Oct 16, 2013
408
160
43
No, I don't think so. At least I've always been able to just `systemctl restart pveproxy.service` and have things work after shift-reloading the web UI. Try a shift+refresh on the problem host's web UI to reload the page and skip the cache, see if that does it.

If that fails do `find /usr/share/javascript/proxmox-widget-toolkit/` and see what's there (there should be a .js and .js.orig) and `grep "data.status !==" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js` to see if the nag check has been patched (this should output nothing if the patch has been applied.)
I cleared the cache and retested . I'll check the local file once I'm behind a monitor . I honestly didn't dig much, just ran, and tested.
 

BeTeP

Well-Known Member
Mar 23, 2019
653
429
63
I have made my own one-liner script to create the DPkg:: Post-Invoke rule on the same day as they introduced the nag window. I just never published it before
Code:
echo "DPkg::Post-Invoke {\"dpkg -V pve-manager | grep -q '/pvemanagerlib\.js$' || sed -i 's/if (data.status !== \x27Active\x27)/if (false)/' /usr/share/pve-manager/js/pvemanagerlib.js\";};" > /etc/apt/apt.conf.d/99pveman
It worked without changes until they changed the UI a couple releases ago.
 
Last edited:

arglebargle

H̸̖̅ȩ̸̐l̷̦͋l̴̰̈ỏ̶̱ ̸̢͋W̵͖̌ò̴͚r̴͇̀l̵̼͗d̷͕̈
Jul 15, 2018
657
244
43
I have made my own one-liner script to create the DPkg:: Post-Invoke rule on the same day as they introduced the nag window. I just never published it before
Code:
echo "DPkg::Post-Invoke {\"dpkg -V pve-manager | grep -q '/pvemanagerlib\.js$' || sed -i 's/if (data.status !== \x27Active\x27)/if (false)/' /usr/share/pve-manager/js/pvemanagerlib.js\";};" > /etc/apt/apt.conf.d/99pveman
It worked without changes until they changed the UI a couple releases ago.
Thanks, that's actually useful to see. When I'm motivated to hack on this some more I'll look at splitting the code for the two different packages into either separate Pre/Post-Invoke rules or one big ugly all-in-one one-liner. I can definitely eliminate the script in /usr/share, it's just going to be a bit of :effort: to get everything into one or two lines. The chunk of script that produces 'pve-no-subscription.list' really only needs to be run once and probably should be moved to install.sh, every run after that just needs to look for and move/erase pve-enterprise.list.