First upload

This commit is contained in:
sbennell 2019-11-05 08:20:45 +11:00
commit 4657d19d82
10 changed files with 107 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.vagrant
.DS_Store

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
The MIT License
Copyright (c) 2019 kosmonavtika
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

46
README.md Normal file
View File

@ -0,0 +1,46 @@
# pve-patch
Removes subscription dialogs, replaces enterprise repository with non-subscription repository and replaces branding. Tested on PVE 6.0-7.
## Note
Use at your own risk! Read the script before you run it.
## Install
1. Connect to node via SSH
2. Run
```bash
# if root
wget -qO - https://raw.githubusercontent.com/kosmonavtika/pve-patch/master/patch.sh | bash
# if non-root
wget -qO - https://raw.githubusercontent.com/kosmonavtika/pve-patch/master/patch.sh | sudo bash
```
## Restore
Enterprise repository
```
mv /etc/apt/sources.list.d/pve-enterprise.list~ /etc/apt/sources.list.d/pve-enterprise.list
```
Branding
```
cp -f /usr/share/pve-manager/images/favicon.ico~ \
/usr/share/pve-patch/images/favicon.ico && \
cp -f /usr/share/pve-manager/images/logo-128.png~ \
/usr/share/pve-patch/images/logo-128.png && \
cp -f /usr/share/pve-manager/images/proxmox_logo.png~ \
/usr/share/pve-patch/images/proxmox_logo.png && \
/usr/share/pve-patch/scripts/apply.sh
```
## Test
```
vagrant up
```

9
Vagrantfile vendored Normal file
View File

@ -0,0 +1,9 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define "pve-patch"
config.vm.box = "proxmox-ve-amd64"
config.vm.network "private_network", ip: "10.91.0.10"
config.vm.provision "shell", path: "https://raw.githubusercontent.com/kosmonavtika/pve-patch/master/patch.sh"
end

BIN
images/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
images/logo-128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
images/proxmox_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

12
patch.sh Normal file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
mkdir -p /usr/share/pve-patch/{images,scripts}
echo "- patch `pveversion`..."
echo "- download and copy files..."
wget -nc -qP /usr/share/pve-patch/images/ https://github.com/kosmonavtika/pve-patch/raw/master/images/{favicon.ico,logo-128.png,proxmox_logo.png}
rm -f /usr/share/pve-patch/scripts/{90pvepatch,apply.sh}
wget -qP /usr/share/pve-patch/scripts/ https://raw.githubusercontent.com/kosmonavtika/pve-patch/master/scripts/{90pvepatch,apply.sh}
chmod -R a+x /usr/share/pve-patch/scripts
cp -f /usr/share/pve-patch/scripts/90pvepatch /etc/apt/apt.conf.d/90pvepatch
/usr/share/pve-patch/scripts/apply.sh
echo "- done!"

1
scripts/90pvepatch Normal file
View File

@ -0,0 +1 @@
DPkg::Post-Invoke { "/usr/share/pve-patch/scripts/apply.sh"; };

16
scripts/apply.sh Normal file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
DEBIAN_CODENAME=`cat /etc/os-release | grep VERSION_CODENAME | cut -d "=" -f2`
ENTERPRISE_REPO_LIST="/etc/apt/sources.list.d/pve-enterprise.list"
FREE_REPO_LIST="/etc/apt/sources.list.d/pve.list"
FREE_REPO_LINE="deb http://download.proxmox.com/debian/pve $DEBIAN_CODENAME pve-no-subscription"
function pve_patch() {
echo "- apply patch..."
echo $FREE_REPO_LINE > $FREE_REPO_LIST
[ -f $ENTERPRISE_REPO_LIST ] && mv $ENTERPRISE_REPO_LIST $ENTERPRISE_REPO_LIST~
sed -i.bak "s/data.status !== 'Active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
cp --backup /usr/share/pve-patch/images/* /usr/share/pve-manager/images/
}
pve_patch