there are 2 files that are targeted for modification, i.e:
/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
coming from proxmox-widget-toolkit package/usr/share/perl5/PVE/API2/Subscription.pm
coming from pve-manager package
root@pve:~# grep -n 'notfound' /usr/share/perl5/PVE/API2/Subscription.pm
117: status => "notfound",
root@pve:~# grep -PnB1 -A1 '^\t.*.toLowerCase.*{$' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
513- if (res === null || res === undefined || !res || res
514: .data.status.toLowerCase() !== 'active') {
515- Ext.Msg.show({
by running this below you will get 3 scripts, i.e:
- pve_proxjs_sed.sh
- pve_proxjs_patch.sh
- pve_API2Subs_sed.sh
#!/usr/bin/env bash
# TAGS
# /usr/local/bin/grab_no_hook.sh
# VERSION
# v10.1
# AUTHOR
# [email protected]
# https://github.com/ngadmini
# https://gist.github.com/ngadmini
# TL;DR
# grab 'pve_proxjs_sed.sh, pve_proxjs_patch.sh and pve_API2Sub_sed.sh' from "https://gist.github.com/ngadmini/7f9df377999cc78c1b58e361d5425ac4"
# choose one from above to get rid of nag messages
#+ you may run everytime 'proxmox-widget-toolkit or pve-manager' updated
set -e
PATH=/usr/local/bin:/usr/bin:/bin:${PATH}
_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
_API="https://api.github.com/gists/7f9df377999cc78c1b58e361d5425ac4"
clear
cd "${_DIR}"
printf "\n[INFO] starting %s ...\n" "${0##*/}"
for _x in {pve_proxjs_sed.sh,pve_proxjs_patch.sh,pve_API2Subs_sed.sh}; do
_RAW=$(curl -s "${_API}" | grep -E "\"raw_.*$_x\",$" | awk -F\" '{print $4}')
printf "[INFO] grabbing %s\n" "${_x}"
curl -s "${_RAW}" > "${_x}"
response=$?
if [ $response -ne 0 ]; then
printf "[FAIL] could not download file from %s\n" "${_RAW}"
exit 1
else
chmod +x "${_x}"
fi
done
printf "[DONE] bye!\n\n"
exit 0
by running this below you will get 3 scripts, i.e:
- pve_proxjs_sed_hook.sh
- pve_proxjs_patch_hook.sh
- pve_API2Subs_sed_hook.sh
by APT-invocation :
- script was executed via
sh -c
after the dpkg run - front-ends might call dpkg several times per invocation, which might run the hooks more times than expected
#!/usr/bin/env bash
# TAGS
# /usr/local/bin/grab_hook.sh
# VERSION
# v10.1
# AUTHOR
# [email protected]
# https://github.com/ngadmini
# https://gist.github.com/ngadmini
# TL;DR
# grab pve_proxjs_sed_hook.sh, pve_proxjs_patch_hook.sh and pve_API2Subs_sed_hook.sh from : "https://gist.github.com/ngadmini/7f9df377999cc78c1b58e361d5425ac4"
# choose one from above to get rid of nag messages
set -e
PATH=/usr/local/bin:/usr/bin:/bin:${PATH}
_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
_API="https://api.github.com/gists/7f9df377999cc78c1b58e361d5425ac4"
clear
cd "${_DIR}"
printf "\n[INFO] starting %s ...\n" "${0##*/}"
for _x in {pve_proxjs_sed.sh,pve_proxjs_patch.sh,pve_API2Subs_sed.sh}; do
_RAW=$(curl -s "${_API}" | grep -E "\"raw_.*$_x\",$" | awk -F\" '{print $4}')
HOOK="${_x/./_hook.}"
_tee="tee -a /etc/apt/apt.conf.d/99_${HOOK/.sh/}"
_tag="\/usr\/local\/bin\/${HOOK}" # you can change to another dir location
comment="// remove naging proxmox subscription message"
hook="DPkg::Post-Invoke { \"${_tag/\\/}\"; };"
printf "[INFO] grabbing %s\n" "${HOOK}"
curl -s "${_RAW}" > "${HOOK}"
response=$?
if [ $response -ne 0 ]; then
printf "[FAIL] could not download file from %s\n" "${_RAW}"
exit 1
else
sed -i 's/] starting/] Running hook script/g' "${HOOK}"
sed -i "3s/^.*$/# ${_tag}/;s/\; exit 1$//g;s/#.*NO.*$/# howto:/" "${HOOK}"
sed -i "/.*howto:$/a# ~ echo '${comment}' | ${_tee}" "${HOOK}"
sed -i "/.*echo '.*/a# ~ echo '${hook}' | ${_tee}" "${HOOK}"
sed -i "/.*echo 'D.*/a# ~ mv ${_x} ${_tag/${HOOK}/}" "${HOOK}"
sed -i "/.*mv .*/a# ~ chmod +x ${_tag}" "${HOOK}"
if [[ ${_x} == pve_API2Subs_sed.sh ]]; then
sed -i "/.*chmod .*/a# ~ apt install --reinstall pve-manager" "${HOOK}"
else
sed -i "/.*chmod .*/a# ~ apt install --reinstall proxmox-widget-toolkit" "${HOOK}"
fi
sed -i "/# ~ apt.*/a# ~ apt-config dump | grep '${HOOK}'" "${HOOK}"
fi
done
printf "[HINT] You must create a file in '%s' first,\n" "/etc/apt/apt.conf.d/"
printf "\tto auto-execute one of the following hook-scripts:\n"
printf "\tpve_API2Subs_sed_hook.sh, pve_proxjs_sed_hook.sh, OR pve_proxjs_patch_hook.sh\n"
printf "[HINT] Please see 'TL;DR' section at each script above\n"
printf "[DONE] bye!\n\n"
exit 0
you have four options to revert the changes:
- manually edit proxmoxlib.js or Subscription.pm to undo the changes you made, depending your methode.
- if using pve_proxjs_patch.sh for proxmoxlib.js, run:
patch -R proxmoxlib.js < nag_patch
- restore the backup file *.dpkg-dist from directory:
/usr/share/perl5/PVE/API2/Subscription.pm.dpkg-dist
/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js.dpkg-dist
- if your methode are APT-invocation, delete the appropriate file:
/etc/apt/apt.conf.d/99_pve_*
then runapt-get install --reinstall proxmox-widget-toolkit
orapt-get install --reinstall pve-manager
do it with your own risk
what I am currently still unsure of - should all 3 of these hooks be installed?