Skip to content

Commit

Permalink
Updated to PVE5
Browse files Browse the repository at this point in the history
  • Loading branch information
lnxbil committed Mar 20, 2018
1 parent 05f9987 commit c630b60
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 40 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ debian/files
debian/pve-no-subscription.debhelper.log
debian/pve-no-subscription.substvars
debian/pve-no-subscription/
debian/debhelper-build-stamp
*.deb

6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM debian:stretch

RUN apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get install -qq make dpkg-dev debhelper lintian && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ all:
install:
@mkdir -p $(DESTDIR)/etc/apt/apt.conf.d
@mkdir -p $(DESTDIR)/etc/apt/sources.list.d
@mkdir -p $(DESTDIR)/etc/apt/trusted.gpg.d
@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-ext4.patch $(DESTDIR)/usr/share/pve-no-subscription
@install -m 644 no-subscription-warning-ext6.patch $(DESTDIR)/usr/share/pve-no-subscription
@install -m 644 no-subscription-warning-js.patch $(DESTDIR)/usr/share/pve-no-subscription
@install -m 644 no-subscription-warning-*.patch $(DESTDIR)/usr/share/pve-no-subscription
@install -m 644 pve-no-subscription.list $(DESTDIR)/etc/apt/sources.list.d
@install -m 644 pve-no-subscription.asc $(DESTDIR)/usr/share/pve-no-subscription/proxmox_ve.asc

package-clean:
@rm -f ../$(PACKAGE)_* debian/files debian/$(PACKAGE).substvars debian/$(PACKAGE).debhelper.log
Expand All @@ -27,7 +25,12 @@ package: package-clean
@echo "-------------------------------[ dpkg-buildpackage ] -------------------------"
@env -i PATH=/usr/bin:/bin SHELL=/bin/sh dpkg-buildpackage -I.git -i'\.git/' < /dev/null
@echo "-----------------------------------[ lintian ] -------------------------------"
@lintian
@lintian || true
@echo "-----------------------------------[ package ] -------------------------------"
@ls -1 ../$(PACKAGE)*deb
@mv ../$(PACKAGE)*deb .
@ls -1 $(PACKAGE)*deb

docker-package:
@docker build -t pve-no-subscription .
@docker run -t --rm --user 1000 --volume $(PWD):/tmp/workdir --workdir /tmp/workdir pve-no-subscription make package

11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Proxmox VE No-Subscription Patch

This patch removes the 'No valid subscription' warning in Proxmox VE and should only be used
in test or demo environments. Please consider [buying a subscription](https://www.proxmox.com/en/proxmox-ve/pricing)
and supporting the development of Proxmox VE.


## Technical Implementation

The patch does automatically be invoked after a package update. It is built as
an APT hook that automagically applies the patch if necessary.
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
pve-no-subscription (1.5) UNRELEASED; urgency=low

* Porting APT sources file to Stretch
* Adding patch for new structure found in PVE 5

-- Andreas Steinel <[email protected]> Tue, 20 Mar 2018 21:18:53 +0100

pve-no-subscription (1.4) UNRELEASED; urgency=low

* Adding patch for new file in js
Expand Down
2 changes: 1 addition & 1 deletion debian/compat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7
9
4 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Source: pve-no-subscription
Section: admin
Priority: optional
Build-Depends: debhelper (>= 7)
Build-Depends: debhelper (>= 9)
Build-Depends-Indep: make (>= 3.81)
Maintainer: Andreas Steinel <[email protected]>
Standards-Version: 3.9.6
Standards-Version: 3.9.8
Vcs-Git: https://github.com/lnxbil/pve-no-subscription.git
Vcs-Browser: https://github.com/lnxbil/pve-no-subscription

Expand Down
31 changes: 31 additions & 0 deletions no-subscription-warning-js2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--- /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 <a target="_blank" href="http://www.proxmox.com/products/proxmox-ve/subscription-service-plans">www.proxmox.com</a> to get a list of available options.',
+ noSubKeyHtml: 'This server is receiving updates from the Proxmox VE No-Subscription Repository. Please visit <a target="_blank" href="http://www.proxmox.com/products/proxmox-ve/subscription-service-plans">www.proxmox.com</a> to get a list of available options.',

kvm_ostypes: {
'Linux': [
@@ -29941,7 +29941,7 @@
pveGuidePath: '/pve-docs/index.html',
onlineHelp: 'getting_help',

- invalidHtml: '<h1>No valid subscription</h1>' + PVE.Utils.noSubKeyHtml,
+ invalidHtml: '<h1>Community Edition</h1>' + PVE.Utils.noSubKeyHtml,

communityHtml: 'Please use the public community <a target="_blank" href="http://forum.proxmox.com">forum</a> for any questions.',
8 changes: 8 additions & 0 deletions no-subscription-warning.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ case "$TYPE" in
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!"
;;
Expand Down
30 changes: 0 additions & 30 deletions pve-no-subscription.asc

This file was deleted.

2 changes: 1 addition & 1 deletion pve-no-subscription.list
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
deb [arch=amd64] http://download.proxmox.com/debian jessie pve-no-subscription
deb [arch=amd64] http://download.proxmox.com/debian stretch pve-no-subscription

0 comments on commit c630b60

Please sign in to comment.