วันพุธที่ 1 พฤศจิกายน พ.ศ. 2560

How to remove subscription notification from Proxmox VE 5

How to remove subscription notification from Proxmox VE 5

This guide will show you how to easily remove the “No Valid Subscription” nag from Proxmox VE 5.* that pops up every time you log in.

Introduction and Disclaimer

In order to apply this “hack” to a Proxmox installation, you require SSH or console access with administrative/sudo privileges. This guide assumes that you have the appropriate privileges. (If you’re reading this guide then, let’s face it, you probably do).
By following this guide you agree that you do so at your own risk. I take no responsibility for any damage that occurs as a result of this guide.

Steps

1) Log in to your Proxmox machine via SSH or via the VNC console available from within the web UI.
2) Navigate to the following directory where the PVE manager configuration files are stored
/usr/share/pve-manager/js/
3) Make a backup of the Javascript file pvemanagerlib.js
cp pvemanagerlib.js pvemanagerlib.js.bkp
4) Now open the file you just backed up with your favourite editor and find the following lines of code:
if (data.status === 'Active') {
    Ext.Msg.show({
      title: gettext('No valid subscription'),
      icon: Ext.Msg.WARNING,
      msg: PVE.Utils.noSubKeyHtml,
      buttons: Ext.Msg.OK,
      callback: function(btn) {
          if (btn !== 'ok') {
              return;
          }
          orig_cmd();
      }
    });
} else {
    orig_cmd();
}
5) Replace the first if() string with if(false), like so:
if (false) {
    Ext.Msg.show({
      title: gettext('No valid subscription'),
      icon: Ext.Msg.WARNING,
      msg: PVE.Utils.noSubKeyHtml,
      buttons: Ext.Msg.OK,
      callback: function(btn) {
          if (btn !== 'ok') {
              return;
          }
          orig_cmd();
      }
    });
} else {
    orig_cmd();
}
6) Restart the node – make sure you shut down your running VMs properly first!
7) Navigate back to your web UI (log out first if you’re still logged in) and hard refresh your browser. Log back in, no more nag! Do note that this may be overwritten by subsequent updates. If you update your machine and the nag returns simply follow this guide again.

ไม่มีความคิดเห็น:

แสดงความคิดเห็น