foundObjects / pve-nag-buster

Persistent license nag removal for Proxmox VE 5.x+
GNU General Public License v2.0
773 stars 77 forks source link

Stopped working #3

Closed horus1963 closed 3 years ago

horus1963 commented 3 years ago

Just wanted to update you that it stopped working in 6.2-15

mrees64028 commented 3 years ago

The case for "Active" in the NAGTOKEN variable has changed. "Active" is now 'active', so grep in the script is not locating the line that needs to change to "false". Hope this helps

mrees64028 commented 3 years ago

NAGTOKEN="data.status.toLowerCase !== 'active'"

jameski83 commented 3 years ago

same issue here, the above fix didn't work on my install. Version 6.2-15

cyr123 commented 3 years ago

NAGTOKEN="data.status.toLowerCase() !== 'active'"

mrees64028 commented 3 years ago

Yes, the above is correct, cyr123. Sorry about that. I somehow lost the parenthesis () in my copy and paste.

foundObjects commented 3 years ago

Hey all; I'm working on this now. I'd like to handle all of the cases we've seen since the Proxmox folks started making changes in PVE 6.2 rather than just patching current but I'll put some effort into getting it out ASAP.

CRCinAU commented 3 years ago

In: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js line 448 - before Proxmox.Utils.API2Request ( add:

orig_cmd();
return;
pconwell commented 3 years ago

Just to clarify for anyone who comes across this - to use the temporary fix as supplied by @mrees64028 and @cyr123, here is step-by-step to temporarily fix the issue until @foundObjects issued an official patch:

  1. Go into shell (or ssh) for your proxmox node
  2. sed -i 's/NAGTOKEN="data.status !== \x27Active\x27"/NAGTOKEN="data.status.toLowerCase() !== \x27active\x27"/g' /usr/share/pve-nag-buster.sh
  3. bash /usr/share/pve-nag-buster.sh

You will likely need to log out and close your browser. The next time you log in it should be working.

Protocol73 commented 3 years ago

Just to clarify for anyone who comes across this - to use the temporary fix as supplied by @mrees64028 and @cyr123, here is step-by-step to temporarily fix the issue until @foundObjects issued an official patch:

Thanks, @pconwell ! Just wanted to note this worked on three Proxmox Servers running 6.3-2. @foundObjects Thanks again for all the work you put into this.

rati0nal commented 3 years ago

Followed @pconwell's instructions, but still not working for me, running 6.3-2.

pconwell commented 3 years ago

@rati0nal what does your /usr/share/pve-nag-buster.sh look like? Specifically the NAGTOKEN= line.

rati0nal commented 3 years ago

@pconwell Just the line:

NAGTOKEN="data.status !== 'active'"

I an post the whole file if you like?

pconwell commented 3 years ago

Once you apply the patch, the line should look like:

NAGTOKEN="data.status.toLowerCase() !== 'active'"

The original source should look like NAGTOKEN="data.status !== 'Active'" (notice the uppercase A), which is what the patch looks for. If I had to speculate, you attempted to manually fix the file at some point and changed Active to active - but I'm totally guessing. Either way, either change active back to Active and rerun the patch OR just manually change the line to NAGTOKEN="data.status.toLowerCase() !== 'active'".

After the line is fixed via your preferred method, rerun the file with bash /usr/share/pve-nag-buster.sh and you should be good to go.

rati0nal commented 3 years ago

@pconwell You're exactly right, I tried to fix it myself from an older thread. Changed it back to 'Active' and re-ran the patch and the nag has disappeared.

Thank you.

FuzzyMistborn commented 3 years ago

Back to not working again FYI. Latest patches on 6.3-3

pconwell commented 3 years ago

I'm on 6.3-3 and it's still working for me. Did you make any manual changes to the various files?

CRCinAU commented 3 years ago

https://link.crc.id.au/proxmox - look at the nag removal part.

FuzzyMistborn commented 3 years ago

I'm on 6.3-3 and it's still working for me. Did you make any manual changes to the various files?

Nope, no changes. At least none that I can recall that should have had an impact (just LXC config files and downloading templates from pveam).

FuzzyMistborn commented 3 years ago

Weird. Did a fresh install because of other reasons and it all seems good. Sorry about that.

foundObjects commented 3 years ago

Hey everyone, sorry for the extremely long wait on this. I've pushed the new patch for v6.3+ now.

CRCinAU commented 3 years ago

I got sick of the massive breakfest that using sed gives - rewrite to use patch - which is much more flexible.... Also added some logic around systemctl to make it work on Proxmox Mail Gateway too....

#!/bin/bash
cd /usr/share/javascript/proxmox-widget-toolkit/

cat << EOF | patch -p1 --forward --reject-file /dev/null
diff --git a/proxmoxlib.js.orig b/proxmoxlib.js
index 4245059..5083967 100644
--- a/proxmoxlib.js.orig
+++ b/proxmoxlib.js
@@ -457,6 +457,8 @@ utilities: {
     },

     checked_command: function(orig_cmd) {
+    orig_cmd();
+    return;
     Proxmox.Utils.API2Request(
         {
         url: '/nodes/localhost/subscription',
EOF

if [ -f /usr/lib/systemd/system/pveproxy.service ]; then
    systemctl restart pveproxy
fi
if [ -f /lib/systemd/system/pmgproxy.service ]; then
    systemctl restart pmgproxy
fi
foundObjects commented 3 years ago

@CRCinAU Patch isn't a bad idea, I've thought about it before but with the previous token replacement patch was prone to the same breakage as sed.

Your method to skip the API subscription call is definitely better and should allow patch to fuzz that in even if the file changes a bit. I'll play around with this a bit and get it working, probably with an actual patch file living in /usr/share/proxmox-nagbuster/ or somewhere similar, and look at adding PMG and PBS support too.