Giter Site home page Giter Site logo

pve-no-subscription's Introduction

Build Status Shellcheck Status FOSSA Status

Proxmox VE No-Subscription Removal

This script removes the 'No valid subscription' warning in Proxmox VE 6 and should only be used in test or demo environments. Please consider buying a subscription and supporting the development of Proxmox VE.

How to install

You can run the removal script one of three ways:

1. Curl

curl into bash like shell:

curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/rickycodes/pve-no-subscription/main/no-subscription-warning.sh | sh

Do not curl blindly ๐Ÿ™ˆ Audit the script before you run it. It's not doing anything terribly surprising, I assure you!

2. With Git

You can also clone the repo with git and run locally if you prefer, but you'll need git (a typical proxmox host doesn't have it installed):

git clone [email protected]:rickycodes/pve-no-subscription.git
cd pve-no-subscription
bash no-subscription-warning.sh
3. Download

Or, you can download the source directly from one of the releases:

wget https://github.com/rickycodes/pve-no-subscription/releases/download/v1.0/source.tar.gz
tar -xf source.tar.gz
bash ./pve-no-subscription/no-subscription-warning.sh

Diagnostic

The script provides stdout and verifies a few things on behalf of the user.

After a successful run, you should see the following result:

subscription status: NotFound
performing replacement in /usr/share/perl5/PVE/API2/Subscription.pm...
restarting services...
all done!

Running the script a second time will produce the following result:

cannot find item. have you already run the replacement?

Running the script on a non pve install will produce:

/usr/share/perl5/PVE/API2/Subscription.pm does not exist! are you sure this is pve?

TL;DR

If you don't care about the above diagnostic feedback and you'd rather yolo, this is the gist of it:

#!/bin/sh
set -ex
sed -i "s/NotFound/Active/g" "/usr/share/perl5/PVE/API2/Subscription.pm"
systemctl restart pvedaemon
systemctl restart pveproxy

Adding apt hook

After updating you may find you need to re-run the script to apply the patch. You can automate this by adding a Post-Invoke apt hook.

First, let's create the script to run (you can put these files anywhere, but I am following pve conventions as best I can).

touch /usr/share/proxmox-ve/pve-apt-post-hook

The above file should look something like this:

#!/usr/bin/env bash
set -ex
curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/rickycodes/pve-no-subscription/main/no-subscription-warning.sh | sh

We'll also need to make the file executable:

chmod +x /usr/share/proxmox-ve/pve-apt-post-hook

Once that's done, we can add the hook. For that we're going to edit an existing file: /etc/apt/apt.conf.d/10pveapthook

Add the following line to the above file:

DPkg::Post-Invoke { "/usr/share/proxmox-ve/pve-apt-post-hook"; };

And that's it! The next time you perform an apt upgrade you should see something like the following (if the patch needs to be applied):

...
Setting up dnsutils (1:9.11.5.P4+dfsg-5.1+deb10u2) ...
Processing triggers for mime-support (3.62) ...
Processing triggers for libc-bin (2.28-10) ...
Processing triggers for rsyslog (8.1901.0-1) ...
Processing triggers for systemd (241-7~deb10u5) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for initramfs-tools (0.133+deb10u1) ...
update-initramfs: Generating /boot/initrd.img-5.4.34-1-pve
Running hook script 'zz-pve-efiboot'..
Re-executing '/etc/kernel/postinst.d/zz-pve-efiboot' in new private mount namespace..
No /etc/kernel/pve-efiboot-uuids found, skipping ESP sync.
Processing triggers for ca-certificates (20200601~deb10u1) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
+ sh
+ curl --proto =https --tlsv1.2 -sSf https://raw.githubusercontent.com/rickycodes/pve-no-subscription/main/no-subscription-warning.sh
		status => "NotFound",
subscription status: NotFound
attempting replacement in /usr/share/perl5/PVE/API2/Subscription.pm...
restarting services...
all done!

You can see the script ran successfully around the + sh part.

Notes

I couldn't get the install steps in pve-no-subscription to work properly and discovered this. This script is a result of that discovery.

pve-nag-buster does the replacement in the web UI source, but that approach also seems to have stopped working? There's an issue here with details on how to get around that).

This is very likely to break in the future. But as of this writing it works for proxmox versions 6.2.x through to 7.3-3

License

MIT License. See the LICENSE file for details.

FOSSA Status

pve-no-subscription's People

Contributors

fossabot avatar ijaron avatar rickycodes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pve-no-subscription's Issues

subscription status: NotFound

On Proxmox 7.2-3, the script gets wrong result:

curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/rickycodes/pve-no-subscription/main/no-subscription-warning.sh | sh
attempting pve-no-subscription patch
                status => "NotFound",
subscription status: NotFound
attempting replacement in /usr/share/perl5/PVE/API2/Subscription.pm...
restart services...
pveversion
pve-manager/7.2-3/c743d6c1 (running kernel: 5.15.35-1-pve)

unexpected operator unrecognized option

On Proxmox 7.2-1, the script crashes:

 curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/rickycodes/pve-no-subscription/main/no-subscription-warning.sh | sh      attempting pve-no-subscription patch                                                            status => "NotFound",                                           sh: 53: [: unexpected operator                                                  unrecognized option

Pve version:

pveversion -v proxmox-ve: 7.2-1 (running kernel: 5.15.30-2-pve) pve-manager: 7.2-3 (running version: 7.2-3/c743d6c1) pve-kernel-helper: 7.2-2 pve-kernel-5.15: 7.2-1 pve-kernel-5.13: 7.1-9 pve-kernel-5.15.30-2-pve: 5.15.30-3 pve-kernel-5.13.19-6-pve: 5.13.19-15 pve-kernel-5.13.19-2-pve: 5.13.19-4 ceph-fuse: 15.2.15-pve1 corosync: 3.1.5-pve2 criu: 3.15-1+pve-1 glusterfs-client: 9.2-1 ifupdown2: 3.1.0-1+pmx3 ksm-control-daemon: 1.4-1 libjs-extjs: 7.0.0-1 libknet1: 1.22-pve2 libproxmox-acme-perl: 1.4.2 libproxmox-backup-qemu0: 1.2.0-1 libpve-access-control: 7.1-8 libpve-apiclient-perl: 3.2-1 libpve-common-perl: 7.1-6 libpve-guest-common-perl: 4.1-2 libpve-http-server-perl: 4.1-1 libpve-storage-perl: 7.2-2 libspice-server1: 0.14.3-2.1 lvm2: 2.03.11-2.1 lxc-pve: 4.0.12-1 lxcfs: 4.0.12-pve1 novnc-pve: 1.3.0-3 proxmox-backup-client: 2.1.8-1 proxmox-backup-file-restore: 2.1.8-1 proxmox-mini-journalreader: 1.3-1 proxmox-widget-toolkit: 3.4-10 pve-cluster: 7.2-1 pve-container: 4.2-1 pve-docs: 7.2-2 pve-edk2-firmware: 3.20210831-2 pve-firewall: 4.2-5 pve-firmware: 3.4-1 pve-ha-manager: 3.3-4 pve-i18n: 2.7-1 pve-qemu-kvm: 6.2.0-5 pve-xtermjs: 4.16.0-1 qemu-server: 7.2-2 smartmontools: 7.2-pve3 spiceterm: 3.2-2 swtpm: 0.7.1~bpo11+1 vncterm: 1.7-1 zfsutils-linux: 2.1.4-pve1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.