Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Sam Heinz
2024-04-25 11:27:36 +10:00
12 changed files with 173 additions and 38 deletions

View File

@@ -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. - 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 <a href='https://forum.proxmox.com/threads/proxmox-ve-support-lifecycle.35755/' target='_blank' rel='noopener noreferrer'>Proxmox VE - Support Lifecycle</a>** - 🚨 **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 <a href='https://forum.proxmox.com/threads/proxmox-ve-support-lifecycle.35755/' target='_blank' rel='noopener noreferrer'>Proxmox VE - Support Lifecycle</a>**
## 2024-04-24
### Changed
- **Traccar LXC**
- NEW Script
- **Calibre-Web LXC**
- NEW Script
## 2024-04-21 ## 2024-04-21
### Changed ### Changed

View File

@@ -55,26 +55,31 @@ function default_settings() {
function update_script() { function update_script() {
header_info header_info
if [[ ! -d /opt/homepage ]]; then msg_error "No ${APP} Installation Found!"; exit; fi if [[ ! -d /opt/homepage ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
if [[ "$(node -v | cut -d 'v' -f 2)" == "18."* ]]; then if [[ "$(node -v | cut -d 'v' -f 2)" == "18."* ]]; then
if ! command -v npm >/dev/null 2>&1; then if ! command -v npm >/dev/null 2>&1; then
echo "Installing NPM..." echo "Installing NPM..."
apt-get install -y npm >/dev/null 2>&1 apt-get install -y npm >/dev/null 2>&1
echo "Installed NPM..." npm install -g pnpm >/dev/null 2>&1
fi echo "Installed NPM..."
fi 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) }') 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)" if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
systemctl stop homepage msg_info "Updating Homepage to v${RELEASE} (Patience)"
wget -q https://github.com/gethomepage/homepage/archive/refs/tags/v${RELEASE}.tar.gz systemctl stop homepage
tar -xzf v${RELEASE}.tar.gz wget -q https://github.com/gethomepage/homepage/archive/refs/tags/v${RELEASE}.tar.gz
cp -r homepage-${RELEASE}/* /opt/homepage/ tar -xzf v${RELEASE}.tar.gz
rm -rf homepage-${RELEASE} cp -r homepage-${RELEASE}/* /opt/homepage/
cd /opt/homepage rm -rf homepage-${RELEASE}
npx update-browserslist-db@latest cd /opt/homepage
pnpm install npx update-browserslist-db@latest
pnpm build pnpm install
systemctl start homepage pnpm build
msg_ok "Updated Homepage to v${RELEASE}" systemctl start homepage
msg_ok "Updated Homepage to v${RELEASE}"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit exit
} }

69
ct/traccar.sh Normal file
View File

@@ -0,0 +1,69 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/asylumexp/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"

View File

@@ -23,6 +23,7 @@ $STD apt-get install -y gcc
$STD apt-get install -y ca-certificates $STD apt-get install -y ca-certificates
$STD apt-get install -y gnupg $STD apt-get install -y gnupg
$STD apt-get install -y wget $STD apt-get install -y wget
$STD apt-get install -y gpg
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Setting up Node.js Repository" msg_info "Setting up Node.js Repository"
@@ -48,11 +49,12 @@ cd /opt/homepage
cp /opt/homepage/src/skeleton/* /opt/homepage/config cp /opt/homepage/src/skeleton/* /opt/homepage/config
$STD pnpm install $STD pnpm install
$STD pnpm build $STD pnpm build
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Installed Homepage v${RELEASE}" msg_ok "Installed Homepage v${RELEASE}"
msg_info "Creating Service" msg_info "Creating Service"
service_path="/etc/systemd/system/homepage.service" cat <<EOF >/etc/systemd/system/homepage.service
echo "[Unit] [Unit]
Description=Homepage Description=Homepage
After=network.target After=network.target
StartLimitIntervalSec=0 StartLimitIntervalSec=0
@@ -64,8 +66,9 @@ User=root
WorkingDirectory=/opt/homepage/ WorkingDirectory=/opt/homepage/
ExecStart=pnpm start ExecStart=pnpm start
[Install] [Install]
WantedBy=multi-user.target" >$service_path WantedBy=multi-user.target
$STD systemctl enable --now homepage EOF
systemctl enable -q --now homepage
msg_ok "Created Service" msg_ok "Created Service"
motd_ssh motd_ssh

View File

@@ -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-arm-${RELEASE}.zip
$STD unzip traccar-linux-arm-${RELEASE}.zip
$STD ./traccar.run
systemctl enable -q --now traccar
rm -rf README.txt traccar-linux-arm-${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"

View File

@@ -98,7 +98,7 @@ pve_check() {
if [ $(pveversion | grep "pve-manager/8" | wc -l) -ne 1 ]; then 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 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 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\.[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 PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later."
echo -e "Exiting..." echo -e "Exiting..."
@@ -220,17 +220,29 @@ advanced_settings() {
fi fi
done 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 while true; do
if [ -z $PW1 ]; then 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
PW1="Automatic Login" if [[ ! -z "$PW1" ]]; then
PW="" 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=""
echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
break
fi
else else
PW="-password $PW1" exit-script
fi fi
echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}" done
else
exit-script
fi
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 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 if [ -z "$CT_ID" ]; then

View File

@@ -92,7 +92,7 @@ function check_root() {
} }
function pve_check() { 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" 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 PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later."
echo -e "Exiting..." echo -e "Exiting..."

View File

@@ -115,7 +115,7 @@ function check_root() {
} }
function pve_check() { 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" 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 PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later."
echo -e "Exiting..." echo -e "Exiting..."

View File

@@ -91,7 +91,7 @@ function check_root() {
} }
function pve_check() { 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" 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 PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later."
echo -e "Exiting..." echo -e "Exiting..."

View File

@@ -157,7 +157,7 @@ function msg_error() {
} }
function pve_check() { 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 "${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 "Requires PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later."
echo -e "Exiting..." echo -e "Exiting..."

View File

@@ -91,7 +91,7 @@ function check_root() {
} }
function pve_check() { 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" 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 PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later."
echo -e "Exiting..." echo -e "Exiting..."

View File

@@ -92,7 +92,7 @@ function check_root() {
} }
function pve_check() { 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" 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 PVE7 Version 7.4-13 or later, or PVE8 Version 8.1.1 or later."
echo -e "Exiting..." echo -e "Exiting..."