diff --git a/Makefile b/Makefile index 17bdc4b..011441b 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ install: @mkdir -p $(DESTDIR)/usr/share/pve-no-subscription @install -m 644 apt-hook $(DESTDIR)/etc/apt/apt.conf.d/99-pve-no-subscription @install -m 755 no-subscription-warning.sh $(DESTDIR)/usr/share/pve-no-subscription - @install -m 644 no-subscription-warning-*.patch $(DESTDIR)/usr/share/pve-no-subscription + @install -m 644 *.patch $(DESTDIR)/usr/share/pve-no-subscription @install -m 644 pve-no-subscription.list $(DESTDIR)/etc/apt/sources.list.d package-clean: diff --git a/no-subscription-warning-ext4.patch b/no-subscription-warning-ext4.patch deleted file mode 100644 index c719756..0000000 --- a/no-subscription-warning-ext4.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- /usr/share/pve-manager/ext4/pvemanagerlib.js.orig 2015-04-28 06:38:55.000000000 +0200 -+++ /usr/share/pve-manager/ext4/pvemanagerlib.js 2015-06-19 17:50:05.856801125 +0200 -@@ -485,7 +485,7 @@ - success: function(response, opts) { - var data = response.result.data; - -- if (data.status !== 'Active') { -+ if (false) { - Ext.Msg.show({ - title: gettext('No valid subscription'), - icon: Ext.Msg.WARNING, diff --git a/no-subscription-warning-ext6.patch b/no-subscription-warning-ext6.patch deleted file mode 100644 index 62ae937..0000000 --- a/no-subscription-warning-ext6.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- /usr/share/pve-manager/ext6/pvemanagerlib.js.orig 2016-04-25 10:47:04.345151970 +0200 -+++ /usr/share/pve-manager/ext6/pvemanagerlib.js 2016-04-25 10:46:35.821675213 +0200 -@@ -275,7 +275,7 @@ - 'p': gettext('Premium') - }, - -- noSubKeyHtml: 'You do not have a valid subscription for this server. Please visit www.proxmox.com to get a list of available options.', -+ noSubKeyHtml: 'This server is receiving updates from the Proxmox VE No-Subscription Repository. Please visit www.proxmox.com to get a list of available options.', - - kvm_ostypes: { - other: gettext('Other OS types'), -@@ -507,7 +507,7 @@ - success: function(response, opts) { - var data = response.result.data; - -+ if (false) { -- if (data.status !== 'Active') { - Ext.Msg.show({ - title: gettext('No valid subscription'), - icon: Ext.Msg.WARNING, -@@ -32662,7 +32662,7 @@ - alias: 'widget.pveDcSupport', - pveGuidePath: '/pve-docs/index.html', - -- invalidHtml: '

No valid subscription

' + PVE.Utils.noSubKeyHtml, -+ invalidHtml: '

Community Edition

' + PVE.Utils.noSubKeyHtml, - - communityHtml: 'Please use the public community forum for any questions.', - diff --git a/no-subscription-warning-js.patch b/no-subscription-warning-js.patch deleted file mode 100644 index b67ba53..0000000 --- a/no-subscription-warning-js.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- /usr/share/pve-manager/js/pvemanagerlib.js.orig 2017-03-09 22:09:23.586006455 +0100 -+++ /usr/share/pve-manager/js/pvemanagerlib.js 2017-03-09 22:19:03.317402857 +0100 -@@ -311,7 +311,7 @@ - 'p': gettext('Premium') - }, - -- noSubKeyHtml: 'You do not have a valid subscription for this server. Please visit www.proxmox.com to get a list of available options.', -+ noSubKeyHtml: 'This server is receiving updates from the Proxmox VE No-Subscription Repository. Please visit www.proxmox.com to get a list of available options.', - - kvm_ostypes: { - other: gettext('Other OS types'), -@@ -799,7 +799,7 @@ - success: function(response, opts) { - var data = response.result.data; - -- if (data.status !== 'Active') { -+ if (false) { - Ext.Msg.show({ - title: gettext('No valid subscription'), - icon: Ext.Msg.WARNING, -@@ -34340,7 +34340,7 @@ - pveGuidePath: '/pve-docs/index.html', - onlineHelp: 'getting_help', - -- invalidHtml: '

No valid subscription

' + PVE.Utils.noSubKeyHtml, -+ invalidHtml: '

Community Edition

' + PVE.Utils.noSubKeyHtml, - - communityHtml: 'Please use the public community forum for any questions.', diff --git a/no-subscription-warning-js2.patch b/no-subscription-warning-js2.patch deleted file mode 100644 index 39eb1c0..0000000 --- a/no-subscription-warning-js2.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js.orig 2018-03-20 21:15:12.881689428 +0100 -+++ /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2018-03-20 21:15:40.006260631 +0100 -@@ -353,7 +353,7 @@ - success: function(response, opts) { - var data = response.result.data; - -- if (data.status !== 'Active') { -+ if (false) { - Ext.Msg.show({ - title: gettext('No valid subscription'), - icon: Ext.Msg.WARNING, - ---- /usr/share/pve-manager/js/pvemanagerlib.js.orig 2018-03-20 21:08:02.704629461 +0100 -+++ /usr/share/pve-manager/js/pvemanagerlib.js 2018-03-20 21:11:08.248537461 +0100 -@@ -327,7 +327,7 @@ - 'p': gettext('Premium') - }, - -- noSubKeyHtml: 'You do not have a valid subscription for this server. Please visit www.proxmox.com to get a list of available options.', -+ noSubKeyHtml: 'This server is receiving updates from the Proxmox VE No-Subscription Repository. Please visit www.proxmox.com to get a list of available options.', - - kvm_ostypes: { - 'Linux': [ -@@ -29941,7 +29941,7 @@ - pveGuidePath: '/pve-docs/index.html', - onlineHelp: 'getting_help', - -- invalidHtml: '

No valid subscription

' + PVE.Utils.noSubKeyHtml, -+ invalidHtml: '

Community Edition

' + PVE.Utils.noSubKeyHtml, - - communityHtml: 'Please use the public community forum for any questions.', diff --git a/no-subscription-warning.sh b/no-subscription-warning.sh index 385b0b6..89781c6 100755 --- a/no-subscription-warning.sh +++ b/no-subscription-warning.sh @@ -1,47 +1,21 @@ -#!/bin/sh +#!/bin/bash -TYPE=unknown +PATCHED=0 -[ -e /usr/share/pve-manager/ext4/pvemanagerlib.js ] && TYPE=ext4 -[ -e /usr/share/pve-manager/ext6/pvemanagerlib.js ] && TYPE=ext6 -[ -e /usr/share/pve-manager/js/pvemanagerlib.js ] && TYPE=js +if [ $( grep -c "if (data.status !== 'Active') {" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js ) -gt 0 ] +then + PATCHED=1 + cd / && patch --no-backup-if-mismatch -l -p0 < /usr/share/pve-no-subscription/proxmoxlib.patch +fi +if [ $( grep -c "

No valid subscription

" /usr/share/pve-manager/js/pvemanagerlib.js ) -gt 0 ] +then + PATCHED=1 + cd / && patch --no-backup-if-mismatch -l -p0 < /usr/share/pve-no-subscription/pvemanagerlib.patch +fi -case "$TYPE" in - ext4) - if [ $( grep -c "if (data.status !== 'Active') {" /usr/share/pve-manager/ext4/pvemanagerlib.js ) -gt 0 ] - then - echo "---------------[ Patching with No-Subscription-Removal-Patch ]----------------" - cd / && patch --no-backup-if-mismatch -l -p0 < /usr/share/pve-no-subscription/no-subscription-warning-ext4.patch - echo "------------------------------------------------------------------------------" - fi - ;; - - ext6) - if [ $( grep -c "if (data.status !== 'Active') {" /usr/share/pve-manager/ext6/pvemanagerlib.js ) -gt 0 ] - then - echo "---------------[ Patching with No-Subscription-Removal-Patch ]----------------" - cd / && patch --no-backup-if-mismatch -l -p0 < /usr/share/pve-no-subscription/no-subscription-warning-ext6.patch - echo "------------------------------------------------------------------------------" - fi - ;; - js) - if [ $( grep -c "if (data.status !== 'Active') {" /usr/share/pve-manager/js/pvemanagerlib.js ) -gt 0 ] - then - echo "---------------[ Patching with No-Subscription-Removal-Patch ]----------------" - cd / && patch --no-backup-if-mismatch -l -p0 < /usr/share/pve-no-subscription/no-subscription-warning-js.patch - echo "------------------------------------------------------------------------------" - fi - - if [ $( grep -c "if (data.status !== 'Active') {" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js ) -gt 0 ] - then - echo "---------------[ Patching with No-Subscription-Removal-Patch ]----------------" - cd / && patch --no-backup-if-mismatch -l -p0 < /usr/share/pve-no-subscription/no-subscription-warning-js2.patch - echo "------------------------------------------------------------------------------" - fi - ;; - - *) - echo "Unknown Type! Sourcefile not found!" - ;; -esac +if [ "$PATCHED" == "1" ] +then + systemctl restart pvedaemon + systemctl restart pveproxy +fi diff --git a/proxmoxlib.patch b/proxmoxlib.patch new file mode 100644 index 0000000..6ca630e --- /dev/null +++ b/proxmoxlib.patch @@ -0,0 +1,11 @@ +--- /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js.orig 2020-05-10 09:43:14.824887009 +0200 ++++ /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2020-05-10 09:43:23.688854213 +0200 +@@ -390,7 +390,7 @@ + success: function(response, opts) { + var data = response.result.data; + +- if (data.status !== 'Active') { ++ if ( false ) { + Ext.Msg.show({ + title: gettext('No valid subscription'), + icon: Ext.Msg.WARNING, diff --git a/pvemanagerlib.patch b/pvemanagerlib.patch new file mode 100644 index 0000000..e9cf8eb --- /dev/null +++ b/pvemanagerlib.patch @@ -0,0 +1,20 @@ +--- /usr/share/pve-manager/js/pvemanagerlib.js.orig 2020-05-10 09:44:21.832501834 +0200 ++++ /usr/share/pve-manager/js/pvemanagerlib.js 2020-05-10 09:44:47.832272641 +0200 +@@ -446,7 +446,7 @@ + 'p': gettext('Premium') + }, + +- noSubKeyHtml: 'You do not have a valid subscription for this server. Please visit www.proxmox.com to get a list of available options.', ++ noSubKeyHtml: 'This server is receiving updates from the Proxmox VE No-Subscription Repository. Please visit www.proxmox.com to get a list of available options.', + + kvm_ostypes: { + 'Linux': [ +@@ -41090,7 +41090,7 @@ + pveGuidePath: '/pve-docs/index.html', + onlineHelp: 'getting_help', + +- invalidHtml: '

No valid subscription

' + PVE.Utils.noSubKeyHtml, ++ invalidHtml: '

Community Edition

' + PVE.Utils.noSubKeyHtml, + + communityHtml: 'Please use the public community forum for any questions.', +