mirror of
https://github.com/Jamesits/pve-fake-subscription
synced 2025-12-07 19:42:47 -05:00
Compare commits
No commits in common. "7f8200b83a9bf053b2fd25323f912f8607022be6" and "68fe0600293526a36de6ca53e6dbcbee92947de0" have entirely different histories.
7f8200b83a
...
68fe060029
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,4 @@
|
|||||||
*.deb
|
*.deb
|
||||||
/out/
|
|
||||||
|
|
||||||
# Created by https://www.gitignore.io/api/macos,python,windows,visualstudiocode
|
# Created by https://www.gitignore.io/api/macos,python,windows,visualstudiocode
|
||||||
# Edit at https://www.gitignore.io/?templates=macos,python,windows,visualstudiocode
|
# Edit at https://www.gitignore.io/?templates=macos,python,windows,visualstudiocode
|
||||||
@ -194,3 +193,4 @@ $RECYCLE.BIN/
|
|||||||
*.lnk
|
*.lnk
|
||||||
|
|
||||||
# End of https://www.gitignore.io/api/macos,python,windows,visualstudiocode
|
# End of https://www.gitignore.io/api/macos,python,windows,visualstudiocode
|
||||||
|
|
||||||
|
|||||||
15
README.md
15
README.md
@ -1,7 +1,3 @@
|
|||||||
# pve-fake-subscription
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Disables the "No valid subscription" dialog on all Proxmox products.
|
Disables the "No valid subscription" dialog on all Proxmox products.
|
||||||
|
|
||||||
> I am really poor and I can't afford a license. I just want to get rid of the annoying dialog.
|
> I am really poor and I can't afford a license. I just want to get rid of the annoying dialog.
|
||||||
@ -9,20 +5,18 @@ Disables the "No valid subscription" dialog on all Proxmox products.
|
|||||||
## Features
|
## Features
|
||||||
|
|
||||||
Works for:
|
Works for:
|
||||||
|
|
||||||
- Proxmox VE (5.x or later, tested up to 7.2)
|
- Proxmox VE (5.x or later, tested up to 7.2)
|
||||||
- Proxmox Mail Gateway (5.x or later)
|
- Proxmox Mail Gateway (5.x or later)
|
||||||
- Proxmox Backup Server (1.x)
|
- Proxmox Backup Server (1.x)
|
||||||
|
|
||||||
Highlights:
|
Highlights:
|
||||||
|
|
||||||
- Non-intrusive: zero modification of any system file
|
- Non-intrusive: zero modification of any system file
|
||||||
- Future-proof: persists between system updates & major upgrades
|
- Future-proof: persists between system updates & major upgrades
|
||||||
- Hassle-free: you can uninstall at any time
|
- Hassle-free: you can uninstall at any time
|
||||||
- Comes with standard Debian package, easy to manage and automate
|
- Comes with standard Debian package, easy to manage and automate
|
||||||
- **No JavaScript is involved** in the whole process, as I believe JavaScript is harmful to developers
|
- **No JavaScript is involved** in the whole process, as I believe JavaScript is harmful to developers
|
||||||
|
|
||||||
## Installation / Usage
|
## Installation
|
||||||
|
|
||||||
1. [Download the latest release](https://github.com/Jamesits/pve-fake-subscription/releases/latest)
|
1. [Download the latest release](https://github.com/Jamesits/pve-fake-subscription/releases/latest)
|
||||||
1. Install: run `dpkg -i pve-fake-subscription_*.deb` as root on every node
|
1. Install: run `dpkg -i pve-fake-subscription_*.deb` as root on every node
|
||||||
@ -30,10 +24,11 @@ Highlights:
|
|||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
|
|
||||||
|
The initial run will be scheduled within 1 minute of the installation. If you don't want to wait, you can invoke it immediately by executing `pve-fake-subscription`.
|
||||||
|
|
||||||
After installation, please refrain yourself from clicking the "check" button on the "Subscription" page. It will invalidate the cache and temporary revert your instance into an unlicensed status.
|
After installation, please refrain yourself from clicking the "check" button on the "Subscription" page. It will invalidate the cache and temporary revert your instance into an unlicensed status.
|
||||||
|
|
||||||
The fake subscription status doesn't grant you free access to the enterprise repository. You should switch to the no-subscription repository if not already done. Use the following method:
|
The fake subscription status doesn't grant you free access to the enterprise repository. You should switch to the no-subscription repository if not already done. Use the following method:
|
||||||
|
|
||||||
- [Proxmox VE (PVE)](https://pve.proxmox.com/wiki/Package_Repositories#sysadmin_no_subscription_repo)
|
- [Proxmox VE (PVE)](https://pve.proxmox.com/wiki/Package_Repositories#sysadmin_no_subscription_repo)
|
||||||
- [Proxmox Mail Gateway (PMG)](https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmg_package_repositories)
|
- [Proxmox Mail Gateway (PMG)](https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmg_package_repositories)
|
||||||
- [Proxmox Backup Server (PBS)](https://pbs.proxmox.com/docs/installation.html#proxmox-backup-no-subscription-repository)
|
- [Proxmox Backup Server (PBS)](https://pbs.proxmox.com/docs/installation.html#proxmox-backup-no-subscription-repository)
|
||||||
@ -50,8 +45,10 @@ This will revert your system to a "no subscription key" status.
|
|||||||
|
|
||||||
## Building the Package
|
## Building the Package
|
||||||
|
|
||||||
Install [nFPM](https://nfpm.goreleaser.com/install/), then:
|
Run everything as root on a Debian 10 system:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
apt-get install ruby ruby-dev rubygems build-essential
|
||||||
|
gem install fpm
|
||||||
./package.sh
|
./package.sh
|
||||||
```
|
```
|
||||||
|
|||||||
40
nfpm.yaml
40
nfpm.yaml
@ -1,40 +0,0 @@
|
|||||||
name: "pve-fake-subscription"
|
|
||||||
arch: "all"
|
|
||||||
platform: "linux"
|
|
||||||
version: "0.0.9"
|
|
||||||
version_schema: "semver"
|
|
||||||
version_metadata: "git"
|
|
||||||
|
|
||||||
epoch: 0
|
|
||||||
release: 1
|
|
||||||
section: "admin"
|
|
||||||
priority: "optinal"
|
|
||||||
|
|
||||||
maintainer: "Nobody <nobody@example.com>"
|
|
||||||
|
|
||||||
depends:
|
|
||||||
- python3
|
|
||||||
description: |
|
|
||||||
Pollute the subscription cache of Proxmox VE (>=5.0), Proxmox Mail Gateway (>=5.0) & Proxmox Backup Server (>=1.0) so it won't alert you on dashboard login
|
|
||||||
vendor: "none"
|
|
||||||
homepage: "https://github.com/Jamesits/pve-fake-subscription"
|
|
||||||
license: "GLWTS(Good Luck With That Shit) Public License"
|
|
||||||
|
|
||||||
contents:
|
|
||||||
- src: "./usr/bin/pve-fake-subscription"
|
|
||||||
dst: "/usr/bin/pve-fake-subscription"
|
|
||||||
file_info:
|
|
||||||
mode: 0755
|
|
||||||
- src: "./usr/lib/systemd"
|
|
||||||
dst: "/usr/lib/systemd"
|
|
||||||
file_info:
|
|
||||||
mode: 0644
|
|
||||||
- src: "./usr/share/doc/pve-fake-subscription"
|
|
||||||
dst: "/usr/share/doc/pve-fake-subscription"
|
|
||||||
file_info:
|
|
||||||
mode: 0644
|
|
||||||
|
|
||||||
scripts:
|
|
||||||
postinstall: "./scripts/postinst"
|
|
||||||
preremove: "./scripts/prerm"
|
|
||||||
postremove: "./scripts/postrm"
|
|
||||||
27
package.sh
27
package.sh
@ -2,15 +2,20 @@
|
|||||||
set -Eeuo pipefail
|
set -Eeuo pipefail
|
||||||
cd "$( dirname "${BASH_SOURCE[0]}" )" || exit 1
|
cd "$( dirname "${BASH_SOURCE[0]}" )" || exit 1
|
||||||
|
|
||||||
OUT_DIR="out"
|
fpm -s dir -t deb --force \
|
||||||
|
-n pve-fake-subscription \
|
||||||
|
--description "Pollute the subscription cache of Proxmox VE (>=5.0), Proxmox Mail Gateway (>=5.0) & Proxmox Backup Server (>=1.0) so it won't alert you on dashboard login" \
|
||||||
|
--url "https://github.com/Jamesits/pve-fake-subscription" \
|
||||||
|
-v 0.0.8 \
|
||||||
|
--license "GLWTS(Good Luck With That Shit) Public License" \
|
||||||
|
--depends "python3" \
|
||||||
|
--architecture all \
|
||||||
|
--deb-dist "unstable" \
|
||||||
|
--deb-priority "optional" \
|
||||||
|
--deb-systemd "usr/lib/systemd/system/pve-fake-subscription.timer" \
|
||||||
|
--deb-systemd-enable --deb-systemd-auto-start --deb-systemd-restart-after-upgrade \
|
||||||
|
--after-remove "scripts/purge" \
|
||||||
|
./usr
|
||||||
|
|
||||||
rm -rf "${OUT_DIR}"
|
# temporary removed as of https://github.com/jordansissel/fpm/issues/1472
|
||||||
mkdir -p "${OUT_DIR}"
|
#--deb-after-purge "scripts/purge" \
|
||||||
|
|
||||||
# build package
|
|
||||||
nfpm pkg --packager deb --target "${OUT_DIR}"
|
|
||||||
|
|
||||||
# generate checksum
|
|
||||||
pushd "${OUT_DIR}" >/dev/null
|
|
||||||
sha256sum -b -- * > sha256sum.txt
|
|
||||||
popd >/dev/null
|
|
||||||
|
|||||||
@ -1,48 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
after_upgrade() {
|
|
||||||
:
|
|
||||||
|
|
||||||
systemctl --system daemon-reload >/dev/null || true
|
|
||||||
debsystemctl=$(command -v deb-systemd-invoke || echo systemctl)
|
|
||||||
if ! systemctl is-enabled pve-fake-subscription.timer >/dev/null
|
|
||||||
then
|
|
||||||
: # Ensure this if-clause is not empty. If it were empty, and we had an 'else', then it is an error in shell syntax
|
|
||||||
systemctl preset pve-fake-subscription.timer >/dev/null || true
|
|
||||||
$debsystemctl start pve-fake-subscription.timer >/dev/null || true
|
|
||||||
else
|
|
||||||
$debsystemctl restart pve-fake-subscription.timer >/dev/null || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
pve-fake-subscription
|
|
||||||
}
|
|
||||||
|
|
||||||
after_install() {
|
|
||||||
:
|
|
||||||
|
|
||||||
systemctl --system daemon-reload >/dev/null || true
|
|
||||||
debsystemctl=$(command -v deb-systemd-invoke || echo systemctl)
|
|
||||||
systemctl preset pve-fake-subscription.timer >/dev/null || true
|
|
||||||
$debsystemctl start pve-fake-subscription.timer >/dev/null || true
|
|
||||||
|
|
||||||
pve-fake-subscription
|
|
||||||
}
|
|
||||||
|
|
||||||
if { [ "${1}" = "configure" ] && [ -z "${2}" ]; } || [ "${1}" = "abort-remove" ]; then
|
|
||||||
# "after install" here
|
|
||||||
# "abort-remove" happens when the pre-removal script failed.
|
|
||||||
# In that case, this script, which should be idemptoent, is run
|
|
||||||
# to ensure a clean roll-back of the removal.
|
|
||||||
after_install
|
|
||||||
elif [ "${1}" = "configure" ] && [ -n "${2}" ]; then
|
|
||||||
upgradeFromVersion="${2}"
|
|
||||||
# "after upgrade" here
|
|
||||||
# NOTE: This slot is also used when deb packages are removed,
|
|
||||||
# but their config files aren't, but a newer version of the
|
|
||||||
# package is installed later, called "Config-Files" state.
|
|
||||||
# basically, that still looks a _lot_ like an upgrade to me.
|
|
||||||
after_upgrade "${2}"
|
|
||||||
elif echo "${1}" | grep -E -q "(abort|fail)"; then
|
|
||||||
echo "Failed to install before the post-installation script was run." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
after_remove() {
|
|
||||||
:
|
|
||||||
|
|
||||||
rm -f /etc/subscription
|
|
||||||
rm -f /etc/pmg/subscription
|
|
||||||
rm -f /etc/proxmox-backup/subscription
|
|
||||||
}
|
|
||||||
|
|
||||||
after_purge() {
|
|
||||||
:
|
|
||||||
}
|
|
||||||
|
|
||||||
dummy() {
|
|
||||||
:
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "${1}" = "remove" ] || [ "${1}" = "abort-install" ]; then
|
|
||||||
# "after remove" goes here
|
|
||||||
# "abort-install" happens when the pre-installation script failed.
|
|
||||||
# In that case, this script, which should be idemptoent, is run
|
|
||||||
# to ensure a clean roll-back of the installation.
|
|
||||||
after_remove
|
|
||||||
elif [ "${1}" = "purge" ] && [ -z "${2}" ]; then
|
|
||||||
# like "on remove", but executes after dpkg deletes config files
|
|
||||||
# 'apt-get purge' runs 'on remove' section, then this section.
|
|
||||||
# There is no equivalent in RPM or ARCH.
|
|
||||||
after_purge
|
|
||||||
elif [ "${1}" = "upgrade" ]; then
|
|
||||||
# This represents the case where the old package's postrm is called after
|
|
||||||
# the 'preinst' script is called.
|
|
||||||
# We should ignore this and just use 'preinst upgrade' and
|
|
||||||
# 'postinst configure'. The newly installed package should do the
|
|
||||||
# upgrade, not the uninstalled one, since it can't anticipate what new
|
|
||||||
# things it will have to do to upgrade for the new version.
|
|
||||||
dummy
|
|
||||||
elif echo "${1}" | grep -E -q '(fail|abort)'; then
|
|
||||||
echo "Failed to install before the post-removal script was run." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
before_remove() {
|
|
||||||
:
|
|
||||||
|
|
||||||
debsystemctl=$(command -v deb-systemd-invoke || echo systemctl)
|
|
||||||
$debsystemctl stop pve-fake-subscription.timer >/dev/null || true
|
|
||||||
systemctl disable pve-fake-subscription.timer >/dev/null || true
|
|
||||||
systemctl --system daemon-reload >/dev/null || true
|
|
||||||
}
|
|
||||||
|
|
||||||
dummy() {
|
|
||||||
:
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "${1}" = "remove" ] && [ -z "${2}" ]; then
|
|
||||||
# "before remove" goes here
|
|
||||||
before_remove
|
|
||||||
elif [ "${1}" = "upgrade" ]; then
|
|
||||||
# Executed before the old version is removed
|
|
||||||
# upon upgrade.
|
|
||||||
# We should generally not do anything here. The newly installed package
|
|
||||||
# should do the upgrade, not the uninstalled one, since it can't anticipate
|
|
||||||
# what new things it will have to do to upgrade for the new version.
|
|
||||||
dummy
|
|
||||||
elif echo "${1}" | grep -E -q "(fail|abort)"; then
|
|
||||||
echo "Failed to install before the pre-removal script was run." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
3
scripts/purge
Executable file
3
scripts/purge
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
rm -f /etc/subscription
|
||||||
|
rm -f /etc/pmg/subscription
|
||||||
|
rm -f /etc/proxmox-backup/subscription
|
||||||
@ -1 +0,0 @@
|
|||||||
enable pve-fake-subscription.timer
|
|
||||||
@ -4,3 +4,4 @@ Description=Fake a Proxmox VE subscription
|
|||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/usr/bin/pve-fake-subscription
|
ExecStart=/usr/bin/pve-fake-subscription
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +0,0 @@
|
|||||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
|
||||||
Upstream-Name: pve-fake-subscription
|
|
||||||
Source: https://github.com/Jamesits/pve-fake-subscription
|
|
||||||
|
|
||||||
Files: *
|
|
||||||
Copyright: 2019 Nobody
|
|
||||||
License: GLWTS(Good Luck With That Shit) Public License
|
|
||||||
Loading…
Reference in New Issue
Block a user