(Proxmox VE) Persistent automatic nag-removal script

Discussion in 'Linux Admins, Storage and Virtualization' started by arglebargle, Apr 15, 2019.

  1. arglebargle

    arglebargle H̸̖̅ȩ̸̐l̷̦͋l̴̰̈ỏ̶̱ ̸̢͋W̵͖̌ò̴͚r̴͇̀l̵̼͗d̷͕̈

    Joined:
    Jul 15, 2018
    Messages:
    634
    Likes Received:
    203
    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!
     
    #1
    Last edited: Apr 15, 2019
    Ouraing, vudu, dawsonkm and 2 others like this.
  2. zxv

    zxv The more I C, the less I see.

    Joined:
    Sep 10, 2017
    Messages:
    152
    Likes Received:
    46
    The code looks good to me.
     
    #2
  3. Monoman

    Monoman Active Member

    Joined:
    Oct 16, 2013
    Messages:
    314
    Likes Received:
    84
    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)
     
    #3
  4. arglebargle

    arglebargle H̸̖̅ȩ̸̐l̷̦͋l̴̰̈ỏ̶̱ ̸̢͋W̵͖̌ò̴͚r̴͇̀l̵̼͗d̷͕̈

    Joined:
    Jul 15, 2018
    Messages:
    634
    Likes Received:
    203
    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.)
     
    #4
    Monoman likes this.
  5. Monoman

    Monoman Active Member

    Joined:
    Oct 16, 2013
    Messages:
    314
    Likes Received:
    84
    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.
     
    #5
  6. BeTeP

    BeTeP Member

    Joined:
    Mar 23, 2019
    Messages:
    81
    Likes Received:
    12
    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.
     
    #6
    Last edited: Apr 16, 2019
  7. arglebargle

    arglebargle H̸̖̅ȩ̸̐l̷̦͋l̴̰̈ỏ̶̱ ̸̢͋W̵͖̌ò̴͚r̴͇̀l̵̼͗d̷͕̈

    Joined:
    Jul 15, 2018
    Messages:
    634
    Likes Received:
    203
    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.
     
    #7
  8. Monoman

    Monoman Active Member

    Joined:
    Oct 16, 2013
    Messages:
    314
    Likes Received:
    84
    it does work now, thanks.
     

    Attached Files:

    #8
Similar Threads: (Proxmox Persistent
Forum Title Date
Linux Admins, Storage and Virtualization NVMe devices and CentOS Persistent Naming Mar 29, 2016

Share This Page