Merge branch 'main-upstream'

This commit is contained in:
Sam Heinz
2024-07-01 12:31:43 +10:00
13 changed files with 48 additions and 56 deletions
+8
View File
@@ -9,6 +9,14 @@
- All LXC instances created using this repository come pre-installed with Midnight Commander, which is a command-line tool (`mc`) that offers a user-friendly file and directory management interface for the terminal environment. - All LXC instances created using this repository come pre-installed with Midnight Commander, which is a command-line tool (`mc`) that offers a user-friendly file and directory management interface for the terminal environment.
## 2024-06-30
### Changed
- **All Scripts**
- Requires Proxmox Virtual Environment version 8.1 or later.
## 2024-06-27 ## 2024-06-27
### Changed ### Changed
+3 -17
View File
@@ -60,12 +60,10 @@ function update_script() {
if ! apk -e info newt >/dev/null 2>&1; then if ! apk -e info newt >/dev/null 2>&1; then
apk add -q newt apk add -q newt
fi fi
RELEASE=$(curl -s https://api.github.com/repos/nextcloud/server/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
while true; do while true; do
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SUPPORT" --radiolist --cancel-button Exit-Script "Spacebar = Select" 11 58 3 \ CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SUPPORT" --radiolist --cancel-button Exit-Script "Spacebar = Select" 11 58 3 \
"1" "Update Nextcloud to $RELEASE" OFF \ "1" "Nextcloud Login Credentials" ON \
"2" "Nextcloud Login Credentials" ON \ "2" "Renew Self-signed Certificate" OFF \
"3" "Renew Self-signed Certificate" OFF \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
exit_status=$? exit_status=$?
if [ $exit_status == 1 ]; then if [ $exit_status == 1 ]; then
@@ -75,22 +73,10 @@ function update_script() {
header_info header_info
case $CHOICE in case $CHOICE in
1) 1)
apk update && apk upgrade
if ! apk -e info php82-sodium >/dev/null 2>&1; then
apk add -q php82-sodium
fi
if ! apk -e info php82-bz2 >/dev/null 2>&1; then
apk add -q php82-bz2
fi
su nextcloud -s /bin/sh -c 'php82 /usr/share/webapps/nextcloud/occ upgrade'
su nextcloud -s /bin/sh -c 'php82 /usr/share/webapps/nextcloud/occ db:add-missing-indices'
exit
;;
2)
cat nextcloud.creds cat nextcloud.creds
exit exit
;; ;;
3) 2)
openssl req -x509 -nodes -days 365 -newkey rsa:4096 -keyout /etc/ssl/private/nextcloud-selfsigned.key -out /etc/ssl/certs/nextcloud-selfsigned.crt -subj "/C=US/O=Nextcloud/OU=Domain Control Validated/CN=nextcloud.local" > /dev/null 2>&1 openssl req -x509 -nodes -days 365 -newkey rsa:4096 -keyout /etc/ssl/private/nextcloud-selfsigned.key -out /etc/ssl/certs/nextcloud-selfsigned.crt -subj "/C=US/O=Nextcloud/OU=Domain Control Validated/CN=nextcloud.local" > /dev/null 2>&1
rc-service nginx restart rc-service nginx restart
exit exit
+1 -1
View File
@@ -158,7 +158,7 @@ if [ $PCT_OSTYPE = debian ]; then
TEMPLATE_VARIENT=bookworm TEMPLATE_VARIENT=bookworm
fi fi
elif [ $PCT_OSTYPE = alpine ]; then elif [ $PCT_OSTYPE = alpine ]; then
TEMPLATE_VARIENT=3.20 TEMPLATE_VARIENT=3.19
else else
if [ $PCT_OSVERSION = 20.04 ]; then if [ $PCT_OSVERSION = 20.04 ]; then
TEMPLATE_VARIENT=focal TEMPLATE_VARIENT=focal
+1
View File
@@ -43,6 +43,7 @@ $STD apt-get install -y \
python3-certbot-dns-cloudflare python3-certbot-dns-cloudflare
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
$STD python3 -m venv /opt/certbot/ $STD python3 -m venv /opt/certbot/
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
msg_ok "Installed Python Dependencies" msg_ok "Installed Python Dependencies"
VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)" VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)"
+7 -10
View File
@@ -95,16 +95,13 @@ root_check() {
# This function checks the version of Proxmox Virtual Environment (PVE) and exits if the version is not supported. # This function checks the version of Proxmox Virtual Environment (PVE) and exits if the version is not supported.
pve_check() { pve_check() {
if [ $(pveversion | grep "pve-manager/8" | wc -l) -ne 1 ]; then if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "Proxmox VE 7 Detected" "You are currently using Proxmox VE 7 (EOL 2024-07), refrain from creating Debian 12 LXCs. \nDefault distribution for $APP LXC is ${var_os} ${var_version}" 10 60
fi
if ! pveversion | grep -Eq "pve-manager/(7\.4-(1[3-8])|8\.[1-2])"; then
msg_error "This version of Proxmox Virtual Environment is not supported" msg_error "This version of Proxmox Virtual Environment is not supported"
echo -e "Requires PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later." echo -e "Requires Proxmox Virtual Environment Version 8.1 or later."
echo -e "Exiting..." echo -e "Exiting..."
sleep 2 sleep 2
exit exit
fi fi
} }
# This function checks if the script is running through SSH and prompts the user to confirm if they want to proceed or exit. # This function checks if the script is running through SSH and prompts the user to confirm if they want to proceed or exit.
@@ -617,10 +614,10 @@ EOF
if [ "$var_os" == "alpine" ]; then if [ "$var_os" == "alpine" ]; then
sleep 3 sleep 3
pct exec "$CTID" -- /bin/sh -c 'cat <<EOF >/etc/apk/repositories pct exec "$CTID" -- /bin/sh -c 'cat <<EOF >/etc/apk/repositories
#http://dl-cdn.alpinelinux.org/alpine/latest-stable/main http://dl-cdn.alpinelinux.org/alpine/latest-stable/main
#http://dl-cdn.alpinelinux.org/alpine/latest-stable/community http://dl-cdn.alpinelinux.org/alpine/latest-stable/community
http://dl-cdn.alpinelinux.org/alpine/v3.20/main #http://dl-cdn.alpinelinux.org/alpine/v3.19/main
http://dl-cdn.alpinelinux.org/alpine/v3.20/community #http://dl-cdn.alpinelinux.org/alpine/v3.19/community
EOF' EOF'
pct exec "$CTID" -- ash -c "apk add bash >/dev/null" pct exec "$CTID" -- ash -c "apk add bash >/dev/null"
fi fi
+4 -4
View File
@@ -92,13 +92,13 @@ function check_root() {
} }
function pve_check() { function pve_check() {
if ! pveversion | grep -Eq "pve-manager/(7\.4-(1[3-8])|8\.[1-2])"; then if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then
msg_error "This version of Proxmox Virtual Environment is not supported" msg_error "This version of Proxmox Virtual Environment is not supported"
echo -e "Requires PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later." echo -e "Requires Proxmox Virtual Environment Version 8.1 or later."
echo -e "Exiting..." echo -e "Exiting..."
sleep 2 sleep 2
exit exit
fi fi
} }
function ssh_check() { function ssh_check() {
@@ -360,7 +360,7 @@ fi
msg_ok "Using ${CL}${BL}$STORAGE${CL} ${GN}for Storage Location." msg_ok "Using ${CL}${BL}$STORAGE${CL} ${GN}for Storage Location."
msg_ok "Virtual Machine ID is ${CL}${BL}$VMID${CL}." msg_ok "Virtual Machine ID is ${CL}${BL}$VMID${CL}."
msg_info "Retrieving the URL for the Debian 12 Qcow2 Disk Image" msg_info "Retrieving the URL for the Debian 12 Qcow2 Disk Image"
URL=https://cloud.debian.org/images/cloud/bookworm/20231228-1609/debian-12-nocloud-arm64-20231228-1609.qcow2 URL=https://cloud.debian.org/images/cloud/bookworm/20240507-1740/debian-12-nocloud-arm64-20240507-1740.qcow2
sleep 2 sleep 2
msg_ok "${CL}${BL}${URL}${CL}" msg_ok "${CL}${BL}${URL}${CL}"
wget -q --show-progress $URL wget -q --show-progress $URL
+3 -3
View File
@@ -115,13 +115,13 @@ function check_root() {
} }
function pve_check() { function pve_check() {
if ! pveversion | grep -Eq "pve-manager/(7\.4-(1[3-8])|8\.[1-2])"; then if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then
msg_error "This version of Proxmox Virtual Environment is not supported" msg_error "This version of Proxmox Virtual Environment is not supported"
echo -e "Requires PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later." echo -e "Requires Proxmox Virtual Environment Version 8.1 or later."
echo -e "Exiting..." echo -e "Exiting..."
sleep 2 sleep 2
exit exit
fi fi
} }
function arch_check() { function arch_check() {
+5 -5
View File
@@ -62,11 +62,11 @@ function cleanup() {
} }
TEMP_DIR=$(mktemp -d) TEMP_DIR=$(mktemp -d)
pushd $TEMP_DIR >/dev/null pushd $TEMP_DIR >/dev/null
if ! pveversion | grep -Eq "pve-manager/(7\.4-(1[3-8])|8\.[1-2])"; then if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then
echo "This version of Proxmox Virtual Environment is not supported" msg_error "This version of Proxmox Virtual Environment is not supported"
echo -e "Requires PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later." echo -e "Requires Proxmox Virtual Environment Version 8.1 or later."
echo "Exiting..." echo -e "Exiting..."
sleep 3 sleep 2
exit exit
fi fi
if (whiptail --backtitle "Proxmox VE Helper Scripts" --title "Mikrotik RouterOS CHR VM" --yesno "This will create a New Mikrotik RouterOS CHR VM. Proceed?" 10 58); then if (whiptail --backtitle "Proxmox VE Helper Scripts" --title "Mikrotik RouterOS CHR VM" --yesno "This will create a New Mikrotik RouterOS CHR VM. Proceed?" 10 58); then
+3 -3
View File
@@ -91,13 +91,13 @@ function check_root() {
} }
function pve_check() { function pve_check() {
if ! pveversion | grep -Eq "pve-manager/(7\.4-(1[3-8])|8\.[1-2])"; then if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then
msg_error "This version of Proxmox Virtual Environment is not supported" msg_error "This version of Proxmox Virtual Environment is not supported"
echo -e "Requires PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later." echo -e "Requires Proxmox Virtual Environment Version 8.1 or later."
echo -e "Exiting..." echo -e "Exiting..."
sleep 2 sleep 2
exit exit
fi fi
} }
function arch_check() { function arch_check() {
+4 -4
View File
@@ -157,13 +157,13 @@ function msg_error() {
} }
function pve_check() { function pve_check() {
if ! pveversion | grep -Eq "pve-manager/(7\.4-(1[3-8])|8\.[1-2])"; then if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then
echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported" msg_error "This version of Proxmox Virtual Environment is not supported"
echo -e "Requires PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later." echo -e "Requires Proxmox Virtual Environment Version 8.1 or later."
echo -e "Exiting..." echo -e "Exiting..."
sleep 2 sleep 2
exit exit
fi fi
} }
function ssh_check() { function ssh_check() {
+3 -3
View File
@@ -91,13 +91,13 @@ function check_root() {
} }
function pve_check() { function pve_check() {
if ! pveversion | grep -Eq "pve-manager/(7\.4-(1[3-8])|8\.[1-2])"; then if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then
msg_error "This version of Proxmox Virtual Environment is not supported" msg_error "This version of Proxmox Virtual Environment is not supported"
echo -e "Requires PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later." echo -e "Requires Proxmox Virtual Environment Version 8.1 or later."
echo -e "Exiting..." echo -e "Exiting..."
sleep 2 sleep 2
exit exit
fi fi
} }
function arch_check() { function arch_check() {
+3 -3
View File
@@ -92,13 +92,13 @@ function check_root() {
} }
function pve_check() { function pve_check() {
if ! pveversion | grep -Eq "pve-manager/(7\.4-(1[3-8])|8\.[1-2])"; then if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then
msg_error "This version of Proxmox Virtual Environment is not supported" msg_error "This version of Proxmox Virtual Environment is not supported"
echo -e "Requires PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later." echo -e "Requires Proxmox Virtual Environment Version 8.1 or later."
echo -e "Exiting..." echo -e "Exiting..."
sleep 2 sleep 2
exit exit
fi fi
} }
function ssh_check() { function ssh_check() {
+3 -3
View File
@@ -92,13 +92,13 @@ function check_root() {
} }
function pve_check() { function pve_check() {
if ! pveversion | grep -Eq "pve-manager/(7\.4-(1[3-8])|8\.[1-2])"; then if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then
msg_error "This version of Proxmox Virtual Environment is not supported" msg_error "This version of Proxmox Virtual Environment is not supported"
echo -e "Requires PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later." echo -e "Requires Proxmox Virtual Environment Version 8.1 or later."
echo -e "Exiting..." echo -e "Exiting..."
sleep 2 sleep 2
exit exit
fi fi
} }
function ssh_check() { function ssh_check() {