From bf4a04528b971288994d38b5fcd5ff468ea20c88 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 23 Apr 2024 06:55:18 -0400 Subject: [PATCH 01/10] Update build.func - Check for spaces and length in passwords - fixes https://github.com/tteck/Proxmox/issues/2843 --- misc/build.func | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/misc/build.func b/misc/build.func index c259eeaac..785fb6a6e 100644 --- a/misc/build.func +++ b/misc/build.func @@ -230,17 +230,24 @@ advanced_settings() { fi done - if PW1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then - if [ -z $PW1 ]; then - PW1="Automatic Login" - PW="" + while true; do + if PW1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then + if [ -z "$PW1" ]; then + PW1="Automatic Login" + PW="" + elif [[ "$PW1" == *" "* ]]; then + whiptail --msgbox "Password cannot contain spaces. Please try again." 8 58 + elif [ "${#PW1}" -lt 5 ]; then + whiptail --msgbox "Password must be at least 5 characters long. Please try again." 8 58 + else + PW="-password $PW1" + echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}" + break + fi else - PW="-password $PW1" + exit-script fi - echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}" - else - exit-script - fi + done if CT_ID=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then if [ -z "$CT_ID" ]; then From cfd4c979a1fb6e1733a53a1c47066d788d27708e Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 23 Apr 2024 07:23:12 -0400 Subject: [PATCH 02/10] Update build.func tweak --- misc/build.func | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/build.func b/misc/build.func index 785fb6a6e..93d99410e 100644 --- a/misc/build.func +++ b/misc/build.func @@ -237,7 +237,7 @@ advanced_settings() { PW="" elif [[ "$PW1" == *" "* ]]; then whiptail --msgbox "Password cannot contain spaces. Please try again." 8 58 - elif [ "${#PW1}" -lt 5 ]; then + elif [ ${#PW1} -ge 1 ] && [ ${#PW1} -lt 5 ]; then whiptail --msgbox "Password must be at least 5 characters long. Please try again." 8 58 else PW="-password $PW1" From c073351b4c9bd91c1fbb7f7172c3b9a79d47de61 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 23 Apr 2024 07:35:57 -0400 Subject: [PATCH 03/10] Update build.func tweak --- misc/build.func | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/misc/build.func b/misc/build.func index 93d99410e..439055fff 100644 --- a/misc/build.func +++ b/misc/build.func @@ -232,15 +232,19 @@ advanced_settings() { while true; do if PW1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then - if [ -z "$PW1" ]; then + if [[ ! -z "$PW1" ]]; then + if [[ "$PW1" == *" "* ]]; then + whiptail --msgbox "Password cannot contain spaces. Please try again." 8 58 + elif [ ${#PW1} -lt 5 ]; then + whiptail --msgbox "Password must be at least 5 characters long. Please try again." 8 58 + else + PW="-password $PW1" + echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}" + break + fi + else PW1="Automatic Login" PW="" - elif [[ "$PW1" == *" "* ]]; then - whiptail --msgbox "Password cannot contain spaces. Please try again." 8 58 - elif [ ${#PW1} -ge 1 ] && [ ${#PW1} -lt 5 ]; then - whiptail --msgbox "Password must be at least 5 characters long. Please try again." 8 58 - else - PW="-password $PW1" echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}" break fi @@ -249,6 +253,7 @@ advanced_settings() { fi done + if CT_ID=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then if [ -z "$CT_ID" ]; then CT_ID="$NEXTID" From dc6c21a85f5f6917fb6f2f90392fa4d260914116 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 23 Apr 2024 10:34:50 -0400 Subject: [PATCH 04/10] Update homepage-install.sh Refactor --- install/homepage-install.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/install/homepage-install.sh b/install/homepage-install.sh index 7e7dc650f..8d2bf3406 100644 --- a/install/homepage-install.sh +++ b/install/homepage-install.sh @@ -17,11 +17,7 @@ msg_info "Installing Dependencies" $STD apt-get install -y curl $STD apt-get install -y sudo $STD apt-get install -y mc -$STD apt-get install -y make -$STD apt-get install -y g++ -$STD apt-get install -y gcc -$STD apt-get install -y ca-certificates -$STD apt-get install -y gnupg +$STD apt-get install -y gpg msg_ok "Installed Dependencies" msg_info "Setting up Node.js Repository" @@ -47,11 +43,12 @@ cd /opt/homepage cp /opt/homepage/src/skeleton/* /opt/homepage/config $STD pnpm install $STD pnpm build +echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Installed Homepage v${RELEASE}" msg_info "Creating Service" -service_path="/etc/systemd/system/homepage.service" -echo "[Unit] +cat </etc/systemd/system/homepage.service +[Unit] Description=Homepage After=network.target StartLimitIntervalSec=0 @@ -63,8 +60,9 @@ User=root WorkingDirectory=/opt/homepage/ ExecStart=pnpm start [Install] -WantedBy=multi-user.target" >$service_path -$STD systemctl enable --now homepage +WantedBy=multi-user.target +EOF +systemctl enable -q --now homepage msg_ok "Created Service" motd_ssh From f20d65a606f6b6cd5f524f3f6151a9045591767d Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 23 Apr 2024 10:36:16 -0400 Subject: [PATCH 05/10] Update homepage.sh Refactor --- ct/homepage.sh | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/ct/homepage.sh b/ct/homepage.sh index 5107f65bd..dca0e9c4d 100644 --- a/ct/homepage.sh +++ b/ct/homepage.sh @@ -55,26 +55,31 @@ function default_settings() { function update_script() { header_info if [[ ! -d /opt/homepage ]]; then msg_error "No ${APP} Installation Found!"; exit; fi - if [[ "$(node -v | cut -d 'v' -f 2)" == "18."* ]]; then - if ! command -v npm >/dev/null 2>&1; then - echo "Installing NPM..." - apt-get install -y npm >/dev/null 2>&1 - echo "Installed NPM..." - fi +if [[ "$(node -v | cut -d 'v' -f 2)" == "18."* ]]; then + if ! command -v npm >/dev/null 2>&1; then + echo "Installing NPM..." + apt-get install -y npm >/dev/null 2>&1 + npm install -g pnpm >/dev/null 2>&1 + echo "Installed NPM..." fi +fi RELEASE=$(curl -s https://api.github.com/repos/gethomepage/homepage/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') -msg_info "Updating Homepage to v${RELEASE} (Patience)" -systemctl stop homepage -wget -q https://github.com/gethomepage/homepage/archive/refs/tags/v${RELEASE}.tar.gz -tar -xzf v${RELEASE}.tar.gz -cp -r homepage-${RELEASE}/* /opt/homepage/ -rm -rf homepage-${RELEASE} -cd /opt/homepage -npx update-browserslist-db@latest -pnpm install -pnpm build -systemctl start homepage -msg_ok "Updated Homepage to v${RELEASE}" +if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then + msg_info "Updating Homepage to v${RELEASE} (Patience)" + systemctl stop homepage + wget -q https://github.com/gethomepage/homepage/archive/refs/tags/v${RELEASE}.tar.gz + tar -xzf v${RELEASE}.tar.gz + cp -r homepage-${RELEASE}/* /opt/homepage/ + rm -rf homepage-${RELEASE} + cd /opt/homepage + npx update-browserslist-db@latest + pnpm install + pnpm build + systemctl start homepage + msg_ok "Updated Homepage to v${RELEASE}" +else + msg_ok "No update required. ${APP} is already at ${RELEASE}" +fi exit } From 3ff48e3dae61fa813f224f61dad9e1d498d43ae8 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 24 Apr 2024 09:11:59 -0400 Subject: [PATCH 06/10] Update build.func Add 8.2 to `pve_check()` --- misc/build.func | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/build.func b/misc/build.func index 439055fff..d23bc2a21 100644 --- a/misc/build.func +++ b/misc/build.func @@ -98,7 +98,7 @@ pve_check() { if [ $(pveversion | grep "pve-manager/8" | wc -l) -ne 1 ]; 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-9]|8.1.[1-9])"; then + if ! pveversion | grep -Eq "pve-manager/(7\.4-(1[3-8])|8\.[0-2])"; then 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 "Exiting..." From 93f791e59246c6805abaaf08747ab7afe94335d8 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 24 Apr 2024 09:43:00 -0400 Subject: [PATCH 07/10] Add PVE 8.2 to `pve_check()` --- misc/build.func | 2 +- vm/debian-vm.sh | 2 +- vm/haos-vm.sh | 2 +- vm/nextcloud-vm.sh | 2 +- vm/openwrt.sh | 2 +- vm/owncloud-vm.sh | 2 +- vm/ubuntu-vm.sh | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/misc/build.func b/misc/build.func index d23bc2a21..8d09d8fa5 100644 --- a/misc/build.func +++ b/misc/build.func @@ -98,7 +98,7 @@ pve_check() { if [ $(pveversion | grep "pve-manager/8" | wc -l) -ne 1 ]; 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\.[0-2])"; then + 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" echo -e "Requires PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later." echo -e "Exiting..." diff --git a/vm/debian-vm.sh b/vm/debian-vm.sh index 3f2db4f64..6a20b717a 100644 --- a/vm/debian-vm.sh +++ b/vm/debian-vm.sh @@ -92,7 +92,7 @@ function check_root() { } function pve_check() { - if ! pveversion | grep -Eq "pve-manager/(7.4-[1][3-9]|8.1.[1-9])"; then + 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" echo -e "Requires PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later." echo -e "Exiting..." diff --git a/vm/haos-vm.sh b/vm/haos-vm.sh index ceb9f0d86..4c82712ae 100644 --- a/vm/haos-vm.sh +++ b/vm/haos-vm.sh @@ -115,7 +115,7 @@ function check_root() { } function pve_check() { - if ! pveversion | grep -Eq "pve-manager/(7.4-[1][3-9]|8.1.[1-9])"; then + 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" echo -e "Requires PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later." echo -e "Exiting..." diff --git a/vm/nextcloud-vm.sh b/vm/nextcloud-vm.sh index ff62c7df5..23cc56062 100644 --- a/vm/nextcloud-vm.sh +++ b/vm/nextcloud-vm.sh @@ -91,7 +91,7 @@ function check_root() { } function pve_check() { - if ! pveversion | grep -Eq "pve-manager/(7.4-[1][3-9]|8.1.[1-9])"; then + 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" echo -e "Requires PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later." echo -e "Exiting..." diff --git a/vm/openwrt.sh b/vm/openwrt.sh index 5ebb5ec4d..0afca1cb3 100644 --- a/vm/openwrt.sh +++ b/vm/openwrt.sh @@ -157,7 +157,7 @@ function msg_error() { } function pve_check() { - if ! pveversion | grep -Eq "pve-manager/(7.4-[1][3-9]|8.1.[1-9])"; then + if ! pveversion | grep -Eq "pve-manager/(7\.4-(1[3-8])|8\.[1-2])"; then echo -e "${CROSS} 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 "Exiting..." diff --git a/vm/owncloud-vm.sh b/vm/owncloud-vm.sh index 7fbe8be6f..006a46499 100644 --- a/vm/owncloud-vm.sh +++ b/vm/owncloud-vm.sh @@ -91,7 +91,7 @@ function check_root() { } function pve_check() { - if ! pveversion | grep -Eq "pve-manager/(7.4-[1][3-9]|8.1.[1-9])"; then + 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" echo -e "Requires PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later." echo -e "Exiting..." diff --git a/vm/ubuntu-vm.sh b/vm/ubuntu-vm.sh index be9edc883..5fffcf0d6 100644 --- a/vm/ubuntu-vm.sh +++ b/vm/ubuntu-vm.sh @@ -92,7 +92,7 @@ function check_root() { } function pve_check() { - if ! pveversion | grep -Eq "pve-manager/(7.4-[1][3-9]|8.1.[1-9])"; then + 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" echo -e "Requires PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later." echo -e "Exiting..." From c828d38ba4611f3483082badc944cb944cd2a47e Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 24 Apr 2024 10:29:14 -0400 Subject: [PATCH 08/10] Create traccar-install.sh --- install/traccar-install.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 install/traccar-install.sh diff --git a/install/traccar-install.sh b/install/traccar-install.sh new file mode 100644 index 000000000..3a9b9eea4 --- /dev/null +++ b/install/traccar-install.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2024 tteck +# Author: tteck (tteckster) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y curl +$STD apt-get install -y sudo +$STD apt-get install -y mc +msg_ok "Installed Dependencies" + +RELEASE=$(curl -s https://api.github.com/repos/traccar/traccar/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') +msg_info "Installing Traccar v${RELEASE}" +wget -q https://github.com/traccar/traccar/releases/download/v${RELEASE}/traccar-linux-64-${RELEASE}.zip +$STD unzip traccar-linux-64-${RELEASE}.zip +$STD ./traccar.run +systemctl enable -q --now traccar +rm -rf README.txt traccar-linux-64-${RELEASE}.zip traccar.run +msg_ok "Installed Traccar v${RELEASE}" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get autoremove +$STD apt-get autoclean +msg_ok "Cleaned" From ef6abf4bd6b20d94d00828e0dc659a976340a540 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 24 Apr 2024 10:30:09 -0400 Subject: [PATCH 09/10] Create traccar.sh --- ct/traccar.sh | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 ct/traccar.sh diff --git a/ct/traccar.sh b/ct/traccar.sh new file mode 100644 index 000000000..1b62939a9 --- /dev/null +++ b/ct/traccar.sh @@ -0,0 +1,69 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func) +# Copyright (c) 2021-2024 tteck +# Author: tteck (tteckster) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE + +function header_info { +clear +cat <<"EOF" + ______ + /_ __/________ _______________ ______ + / / / ___/ __ `/ ___/ ___/ __ `/ ___/ + / / / / / /_/ / /__/ /__/ /_/ / / +/_/ /_/ \__,_/\___/\___/\__,_/_/ + +EOF +} +header_info +echo -e "Loading..." +APP="Traccar" +var_disk="2" +var_cpu="1" +var_ram="1024" +var_os="debian" +var_version="12" +variables +color +catch_errors + +function default_settings() { + CT_TYPE="1" + PW="" + CT_ID=$NEXTID + HN=$NSAPP + DISK_SIZE="$var_disk" + CORE_COUNT="$var_cpu" + RAM_SIZE="$var_ram" + BRG="vmbr0" + NET="dhcp" + GATE="" + APT_CACHER="" + APT_CACHER_IP="" + DISABLEIP6="no" + MTU="" + SD="" + NS="" + MAC="" + VLAN="" + SSH="no" + VERB="no" + echo_default +} + +function update_script() { +header_info +if [[ ! -d /opt/traccar ]]; then msg_error "No ${APP} Installation Found!"; exit; fi +msg_error "There is currently no update path available." +exit +exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${APP} should be reachable by going to the following URL. + ${BL}http://${IP}:8082${CL} \n" From 18bdaad1090a719e99d71b26d8372bf2dfdf30d6 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 24 Apr 2024 11:50:31 -0400 Subject: [PATCH 10/10] Update CHANGELOG.md --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cae79878..f11c828c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,15 @@ - 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. - 🚨 **The scripts in the repository will no longer provide support for Proxmox VE 7 starting from July 2024 (scripts will not execute on PVE7). Subsequent Proxmox VE - Support Lifecycle** +## 2024-04-24 + +### Changed + +- **Traccar LXC** + - NEW Script +- **Calibre-Web LXC** + - NEW Script + ## 2024-04-21 ### Changed