From b129cb1767f6c97f9e3cfb9cb9d0e97424cf5a03 Mon Sep 17 00:00:00 2001 From: tteckster Date: Thu, 5 Sep 2024 06:07:26 -0400 Subject: [PATCH 01/39] Update update-lxcs-cron.sh tweak --- misc/update-lxcs-cron.sh | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/misc/update-lxcs-cron.sh b/misc/update-lxcs-cron.sh index 04827734c..50daedb52 100644 --- a/misc/update-lxcs-cron.sh +++ b/misc/update-lxcs-cron.sh @@ -5,24 +5,18 @@ # License: MIT # https://github.com/tteck/Proxmox/raw/main/LICENSE -echo "$(date)" +echo -e "\n $(date)" excluded_containers=("$@") function update_container() { container=$1 name=$(pct exec "$container" hostname) + echo -e "\n [Info] Updating $container : $name \n" os=$(pct config "$container" | awk '/^ostype/ {print $2}') - if [[ "$os" == "ubuntu" || "$os" == "debian" ]]; then - disk_info=$(pct exec "$container" df /boot | awk 'NR==2{gsub("%","",$5); printf "%s %.1fG %.1fG %.1fG", $5, $3/1024/1024, $2/1024/1024, $4/1024/1024 }') - read -ra disk_info_array <<<"$disk_info" - echo -e "\n[Info] Updating $container : $name - Boot Disk: ${disk_info_array[0]}% full [${disk_info_array[1]}/${disk_info_array[2]} used, ${disk_info_array[3]} free]" - else - echo -e "\n[Info] Updating $container : $name - [No disk info for ${os}]" - fi case "$os" in alpine) pct exec "$container" -- ash -c "apk update && apk upgrade" ;; archlinux) pct exec "$container" -- bash -c "pacman -Syyu --noconfirm" ;; fedora | rocky | centos | alma) pct exec "$container" -- bash -c "dnf -y update && dnf -y upgrade" ;; - ubuntu | debian | devuan) pct exec "$container" -- bash -c "apt-get update 2>/dev/null | grep 'packages.*upgraded'; apt-get upgrade --dry-run && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" dist-upgrade -y; rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED" ;; + ubuntu | debian | devuan) pct exec "$container" -- bash -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" dist-upgrade -y; rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED" ;; esac } @@ -43,7 +37,6 @@ for container in $(pct list | awk '{if(NR>1) print $1}'); do if [ "$template" == "false" ] && [ "$status" == "status: stopped" ]; then echo -e "[Info] Starting $container" pct start $container - echo -e "[Info] Waiting For $container To Start" sleep 5 update_container $container echo -e "[Info] Shutting down $container" @@ -54,5 +47,3 @@ for container in $(pct list | awk '{if(NR>1) print $1}'); do fi done wait - -echo -e "Finished, All Containers Updated. \n" From 4d9d7a82425ce2eebe29e452fed8b703b3e71dc2 Mon Sep 17 00:00:00 2001 From: tteckster Date: Thu, 5 Sep 2024 10:16:14 -0400 Subject: [PATCH 02/39] Update pull_request_template.md tweak --- .github/pull_request_template.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 39173ba08..02d33ee1b 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,18 +1,20 @@ -## I wanted to make you aware that I am meticulous when it comes to merging code into the main branch, so please don't take it personally if I reject your request. +> [!NOTE] +I am meticulous when it comes to merging code into the main branch, so please understand that I may reject pull requests that do not meet the project's standards. It's never personal. Also, game-related scripts have a lower chance of being merged. ## Description -Please include a summary of the change and/or which issue is fixed. +Provide a summary of the changes made and/or reference the issue being addressed. Fixes # (issue) ## Type of change -Please delete options that are not relevant. +Please check the relevant option(s): + +- [ ] Bug fix (non-breaking change that resolves an issue) +- [ ] New feature (non-breaking change that adds functionality) +- [ ] Breaking change (a fix or feature that would cause existing functionality to change unexpectedly) +- [ ] New script (a fully functional and thoroughly tested script or set of scripts.) +- [ ] Self-review performed (I have reviewed my code, ensuring it follows established patterns and conventions) +- [ ] Documentation update required (this change requires an update to the documentation) -- [ ] Bug fix (non-breaking change which fixes an issue) -- [ ] New feature (non-breaking change which adds functionality) -- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) -- [ ] New Script (Develop a new script or set of scripts that are fully functional and thoroughly tested) -- [ ] I have performed a self-review of my code, adhering to established codebase patterns and conventions. -- [ ] This change requires a documentation update From 4cddfa3b12b1ac9f7b49f6755d5bead378dd8a40 Mon Sep 17 00:00:00 2001 From: tteckster Date: Thu, 5 Sep 2024 11:44:26 -0400 Subject: [PATCH 03/39] Update collabora.sh adjust resources --- ct/collabora.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/collabora.sh b/ct/collabora.sh index 56c3a977b..871f84a29 100644 --- a/ct/collabora.sh +++ b/ct/collabora.sh @@ -21,7 +21,7 @@ header_info echo -e "Loading..." APP="Collabora" var_disk="12" -var_cpu="1" +var_cpu="2" var_ram="1024" var_os="debian" var_version="12" From 1e5f4b152e17dbc9289ccb7e9dce1398f1bd5e66 Mon Sep 17 00:00:00 2001 From: tteckster Date: Fri, 6 Sep 2024 03:04:44 -0400 Subject: [PATCH 04/39] Update sabnzbd-install.sh add version.txt --- install/sabnzbd-install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install/sabnzbd-install.sh b/install/sabnzbd-install.sh index efeb7c0f3..55f640355 100644 --- a/install/sabnzbd-install.sh +++ b/install/sabnzbd-install.sh @@ -41,6 +41,7 @@ $STD tar zxvf <(curl -fsSL https://github.com/sabnzbd/sabnzbd/releases/download/ mv SABnzbd-${RELEASE} /opt/sabnzbd cd /opt/sabnzbd $STD python3 -m pip install -r requirements.txt +echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Installed SABnzbd" msg_info "Creating Service" From 6d89c2de129de2189ca9d8f5435b5cfb2d6ae8e0 Mon Sep 17 00:00:00 2001 From: towerhand <42445253+towerhand@users.noreply.github.com> Date: Fri, 6 Sep 2024 02:05:57 -0500 Subject: [PATCH 05/39] Update sabnzbd only if a new version is available. (#3664) --- ct/sabnzbd.sh | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/ct/sabnzbd.sh b/ct/sabnzbd.sh index c6d0aa263..d0656d6b8 100644 --- a/ct/sabnzbd.sh +++ b/ct/sabnzbd.sh @@ -55,16 +55,21 @@ function default_settings() { function update_script() { header_info if [[ ! -d /opt/sabnzbd ]]; then msg_error "No ${APP} Installation Found!"; exit; fi -msg_info "Updating $APP" -systemctl stop sabnzbd.service RELEASE=$(curl -s https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') -tar zxvf <(curl -fsSL https://github.com/sabnzbd/sabnzbd/releases/download/$RELEASE/SABnzbd-${RELEASE}-src.tar.gz) &>/dev/null -\cp -r SABnzbd-${RELEASE}/* /opt/sabnzbd &>/dev/null -rm -rf SABnzbd-${RELEASE} -cd /opt/sabnzbd -python3 -m pip install -r requirements.txt &>/dev/null -systemctl start sabnzbd.service -msg_ok "Updated $APP" +if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then + msg_info "Updating $APP to ${RELEASE}" + systemctl stop sabnzbd.service + tar zxvf <(curl -fsSL https://github.com/sabnzbd/sabnzbd/releases/download/$RELEASE/SABnzbd-${RELEASE}-src.tar.gz) &>/dev/null + \cp -r SABnzbd-${RELEASE}/* /opt/sabnzbd &>/dev/null + rm -rf SABnzbd-${RELEASE} + cd /opt/sabnzbd + python3 -m pip install -r requirements.txt &>/dev/null + echo "${RELEASE}" >/opt/${APP}_version.txt + systemctl start sabnzbd.service + msg_ok "Updated ${APP} to ${RELEASE}" +else + msg_info "No update required. ${APP} is already at ${RELEASE}" +fi exit } From 73eaf2e6a5c1a39e7c0a50f8be300df6c247f9af Mon Sep 17 00:00:00 2001 From: tteckster Date: Sat, 7 Sep 2024 22:11:14 -0400 Subject: [PATCH 06/39] Update collabora.sh https://github.com/tteck/Proxmox/discussions/3651 --- ct/{collabora.sh => collabora-online.sh} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename ct/{collabora.sh => collabora-online.sh} (95%) diff --git a/ct/collabora.sh b/ct/collabora-online.sh similarity index 95% rename from ct/collabora.sh rename to ct/collabora-online.sh index 871f84a29..720673c36 100644 --- a/ct/collabora.sh +++ b/ct/collabora-online.sh @@ -68,4 +68,4 @@ build_container description msg_ok "Completed Successfully!\n" -echo -e "${APP} needs to be behind a proxy (Nginx Proxy Manager)." +echo -e "https://github.com/tteck/Proxmox/discussions/3651" From 30850b67f943e8d64fc9f62ff4ae8c7414b5e116 Mon Sep 17 00:00:00 2001 From: Volodymyr Lavrynovych Date: Mon, 9 Sep 2024 13:12:35 +0300 Subject: [PATCH 07/39] Guide about Docker and Portainer was added (#3680) --- USER_SUBMITTED_GUIDES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/USER_SUBMITTED_GUIDES.md b/USER_SUBMITTED_GUIDES.md index e3c8ffdde..ff89b37dc 100644 --- a/USER_SUBMITTED_GUIDES.md +++ b/USER_SUBMITTED_GUIDES.md @@ -38,3 +38,5 @@ [Proxmox + NetData]() [Proxmox Homelab Series]() + +[The fastest installation of Docker and Portainer on Proxmox VE](https://lavr.site/en-fastest-install-docker-portainer-proxmox/) From c502e413de7225e8ac8020fe7747f644ff0208ef Mon Sep 17 00:00:00 2001 From: Loren Burkholder <55629213+LorenDB@users.noreply.github.com> Date: Mon, 9 Sep 2024 14:15:31 -0400 Subject: [PATCH 08/39] Add openSUSE support to LXC update scripts (#3683) --- misc/update-lxcs-cron.sh | 1 + misc/update-lxcs.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/misc/update-lxcs-cron.sh b/misc/update-lxcs-cron.sh index 50daedb52..ec397b5b8 100644 --- a/misc/update-lxcs-cron.sh +++ b/misc/update-lxcs-cron.sh @@ -17,6 +17,7 @@ function update_container() { archlinux) pct exec "$container" -- bash -c "pacman -Syyu --noconfirm" ;; fedora | rocky | centos | alma) pct exec "$container" -- bash -c "dnf -y update && dnf -y upgrade" ;; ubuntu | debian | devuan) pct exec "$container" -- bash -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" dist-upgrade -y; rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED" ;; + opensuse) pct exec "$container" -- bash -c "zypper ref && zypper --non-interactive dup" ;; esac } diff --git a/misc/update-lxcs.sh b/misc/update-lxcs.sh index 1ad3b5cd9..c4ea80f92 100644 --- a/misc/update-lxcs.sh +++ b/misc/update-lxcs.sh @@ -68,6 +68,7 @@ function update_container() { archlinux) pct exec "$container" -- bash -c "pacman -Syyu --noconfirm" ;; fedora | rocky | centos | alma) pct exec "$container" -- bash -c "dnf -y update && dnf -y upgrade" ;; ubuntu | debian | devuan) pct exec "$container" -- bash -c "apt-get update 2>/dev/null | grep 'packages.*upgraded'; apt list --upgradable && apt-get -yq dist-upgrade 2>&1; rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED" ;; + opensuse) pct exec "$container" -- bash -c "zypper ref && zypper --non-interactive dup" ;; esac } From 389b03568d9742aa070585be077c7e680954e1de Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 11 Sep 2024 12:07:46 -0400 Subject: [PATCH 09/39] Update spoolman.sh tweak --- ct/spoolman.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ct/spoolman.sh b/ct/spoolman.sh index dadff3bfc..191b5cc38 100644 --- a/ct/spoolman.sh +++ b/ct/spoolman.sh @@ -75,7 +75,6 @@ if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_v unzip -q spoolman.zip -d spoolman cd spoolman pip3 install -r requirements.txt >/dev/null 2>&1 - cp .env.example .env echo "${RELEASE}" >/opt/${APP}_version.txt msg_ok "Updated ${APP} to ${RELEASE}" From 0ee61aa092ae72c10047a658a03bba9a7666a8a0 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 11 Sep 2024 12:22:23 -0400 Subject: [PATCH 10/39] Update spoolman.sh revert tweak --- ct/spoolman.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ct/spoolman.sh b/ct/spoolman.sh index 191b5cc38..dadff3bfc 100644 --- a/ct/spoolman.sh +++ b/ct/spoolman.sh @@ -75,6 +75,7 @@ if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_v unzip -q spoolman.zip -d spoolman cd spoolman pip3 install -r requirements.txt >/dev/null 2>&1 + cp .env.example .env echo "${RELEASE}" >/opt/${APP}_version.txt msg_ok "Updated ${APP} to ${RELEASE}" From 07df1c8373e103ce54abf4d137108af6766637b3 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 11 Sep 2024 13:22:38 -0400 Subject: [PATCH 11/39] Update spoolman.sh fix `.env` path fixes https://github.com/tteck/Proxmox/issues/3712 --- ct/spoolman.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/spoolman.sh b/ct/spoolman.sh index dadff3bfc..464ced307 100644 --- a/ct/spoolman.sh +++ b/ct/spoolman.sh @@ -75,7 +75,7 @@ if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_v unzip -q spoolman.zip -d spoolman cd spoolman pip3 install -r requirements.txt >/dev/null 2>&1 - cp .env.example .env + wget -q https://raw.githubusercontent.com/Donkie/Spoolman/master/.env.example -O .env echo "${RELEASE}" >/opt/${APP}_version.txt msg_ok "Updated ${APP} to ${RELEASE}" From b14a33ffac4015fc14918300bdbfe833d869f8e9 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 11 Sep 2024 13:23:48 -0400 Subject: [PATCH 12/39] Update spoolman-install.sh fix `.env` path --- install/spoolman-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/spoolman-install.sh b/install/spoolman-install.sh index dc2bc31dd..d4d69da34 100644 --- a/install/spoolman-install.sh +++ b/install/spoolman-install.sh @@ -44,7 +44,7 @@ unzip -q spoolman.zip -d spoolman rm -rf spoolman.zip cd spoolman $STD pip3 install -r requirements.txt -cp .env.example .env +wget -q https://raw.githubusercontent.com/Donkie/Spoolman/master/.env.example -O .env echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Installed Spoolman" From dc1adaba0116e21766b825f09484453e616f3f37 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 11 Sep 2024 13:43:15 -0400 Subject: [PATCH 13/39] Update nginxproxymanager.sh comment out `export NODE_OPTIONS=--openssl-legacy-provider` --- ct/nginxproxymanager.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/nginxproxymanager.sh b/ct/nginxproxymanager.sh index 759697167..688038a75 100644 --- a/ct/nginxproxymanager.sh +++ b/ct/nginxproxymanager.sh @@ -61,7 +61,7 @@ function update_script() { fi if ! command -v pnpm &> /dev/null; then msg_info "Installing pnpm" - export NODE_OPTIONS=--openssl-legacy-provider + #export NODE_OPTIONS=--openssl-legacy-provider npm install -g pnpm@8.15 &>/dev/null msg_ok "Installed pnpm" fi From 3bd32110d9028855ea427b11d1123bd2742a9b70 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Fri, 13 Sep 2024 23:35:36 +0200 Subject: [PATCH 14/39] Add new LXC: Tianji (#3726) --- ct/tianji.sh | 97 ++++++++++++++++++++++++++++++++++++ install/tianji-install.sh | 102 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 199 insertions(+) create mode 100644 ct/tianji.sh create mode 100644 install/tianji-install.sh diff --git a/ct/tianji.sh b/ct/tianji.sh new file mode 100644 index 000000000..449104df5 --- /dev/null +++ b/ct/tianji.sh @@ -0,0 +1,97 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func) +# Copyright (c) 2021-2024 tteck +# Author: tteck +# Co-Author: MickLesk (Canbiz) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE + +function header_info { +clear +cat <<"EOF" + _______ _ _ + /_ __(_)___ _____ (_|_) + / / / / __ `/ __ \ / / / + / / / / /_/ / / / / / / / +/_/ /_/\__,_/_/ /_/_/ /_/ + /___/ +EOF +} +header_info +echo -e "Loading..." +APP="Tianji" +var_disk="7" +var_cpu="4" +var_ram="4096" +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/tianji ]]; then msg_error "No ${APP} Installation Found!"; exit; fi +if (( $(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80 )); then + read -r -p "Warning: Storage is dangerously low, continue anyway? " prompt + [[ ${prompt,,} =~ ^(y|yes)$ ]] || exit +fi +RELEASE=$(curl -s https://api.github.com/repos/msgbyte/tianji/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') +if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then + + msg_info "Stopping ${APP} Service" + pm2 stop tianji >/dev/null 2>&1 + msg_ok "Stopped ${APP} Service" + + msg_info "Updating ${APP} to ${RELEASE}" + cd /opt/tianji + git checkout -q v${RELEASE} + pnpm db:migrate:apply >/dev/null 2>&1 + echo "${RELEASE}" >/opt/${APP}_version.txt + msg_ok "Updated ${APP} to ${RELEASE}" + + msg_info "Starting ${APP}" + pm2 start tianji >/dev/null 2>&1 + msg_ok "Started ${APP}" + msg_ok "Updated Successfully" +else + msg_ok "No update required. ${APP} is already at ${RELEASE}." +fi +exit +} + +start +build_container +description + +msg_info "Setting Container to Normal Resources" +pct set $CTID -memory 1024 +pct set $CTID -cores 1 +msg_ok "Set Container to Normal Resources" + +msg_ok "Completed Successfully!\n" +echo -e "${APP} Setup should be reachable by going to the following URL. + ${BL}http://${IP}:12345${CL} \n" diff --git a/install/tianji-install.sh b/install/tianji-install.sh new file mode 100644 index 000000000..d7d73c177 --- /dev/null +++ b/install/tianji-install.sh @@ -0,0 +1,102 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2024 tteck +# Author: tteck +# Co-Author: MickLesk (Canbiz) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE +# Source: https://github.com/msgbyte/tianji + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies (Patience)" +$STD apt-get install -y \ + postgresql \ + build-essential \ + curl \ + sudo \ + git \ + make \ + gnupg \ + ca-certificates \ + mc +msg_ok "Installed Dependencies" + +msg_info "Setting up Node.js Repository" +mkdir -p /etc/apt/keyrings +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list +$STD apt-get update +msg_ok "Set up Repositories" + +msg_info "Installing Node.js, pnpm & pm2" +$STD apt-get install -y nodejs +$STD npm install -g pnpm@9.7.1 +$STD npm install -g pm2 +msg_ok "Installed Node.js, pnpm & pm2" + + +msg_info "Setup Tianji (Patience)" +cd /opt +RELEASE=$(curl -s https://api.github.com/repos/msgbyte/tianji/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') +wget -q "https://github.com/msgbyte/tianji/archive/refs/tags/v${RELEASE}.zip" +unzip -q v${RELEASE}.zip +mv tianji-${RELEASE} /opt/tianji +cd tianji +export NODE_OPTIONS=--max_old_space_size=4096 +$STD pnpm install +$STD pnpm build +echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" +msg_ok "Initial Setup complete" + +msg_info "Setting up Database" +DB_NAME=tianji_db +DB_USER=tianji +DB_PASS="$(openssl rand -base64 18 | cut -c1-13)" +TIANJI_SECRET="$(openssl rand -base64 32 | cut -c1-24)" +$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME;" +$STD sudo -u postgres psql -c "CREATE USER $DB_USER WITH PASSWORD '$DB_PASS';" +$STD sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE $DB_NAME TO $DB_USER;" +$STD sudo -u postgres psql -c "ALTER DATABASE $DB_NAME OWNER TO $DB_USER;" +$STD sudo -u postgres psql -c "ALTER USER $DB_USER WITH SUPERUSER;" +echo "" >>~/tianji.creds +echo -e "Tianji Database User: $DB_USER" >>~/tianji.creds +echo -e "Tianji Database Password: $DB_PASS" >>~/tianji.creds +echo -e "Tianji Database Name: $DB_NAME" >>~/tianji.creds +echo -e "Tianji Secret: $TIANJI_SECRET" >>~/tianji.creds +msg_ok "Set up PostgreSQL database" + +msg_info "Setting up Tianji Env" +cat </opt/tianji/src/server/.env +DATABASE_URL="postgresql://$DB_USER:$DB_PASS@127.0.0.1:5432/$DB_NAME?schema=public" +JWT_SECRET="$TIANJI_SECRET" +EOF +msg_ok ".env successfully set up" + +msg_info "Initialize Application" +cd /opt/tianji +$STD npm install pm2 -g +$STD pm2 install pm2-logrotate +cd src/server +$STD pnpm db:migrate:apply +msg_ok "Application Initialized" + +msg_info "Activate PM2 Service" +$STD pm2 start /opt/tianji/src/server/dist/src/server/main.js --name tianji +$STD pm2 save +msg_ok "Service activated" + +motd_ssh +customize + +msg_info "Cleaning up" +rm -R /opt/v${RELEASE}.zip +$STD apt-get autoremove -y +$STD apt-get autoclean -y +msg_ok "Cleaned" From b6890ccfbeaf41c73e1c37b84e1354489c48e81e Mon Sep 17 00:00:00 2001 From: tteckster Date: Fri, 13 Sep 2024 17:38:04 -0400 Subject: [PATCH 15/39] Update CHANGELOG.md --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d9428aad..d03219032 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,13 @@ Be cautious of copycat or coat-tailing sites that exploit the project's populari > [!NOTE] 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-09-13 + +### Changed + +- **Tianji LXC** [(View Source)](https://github.com/tteck/Proxmox/blob/main/install/tianji-install.sh) + - NEW Script + ## 2024-08-21 ### Changed From 80feaf6fa51a5a24887b833b3238e67736aa45b4 Mon Sep 17 00:00:00 2001 From: tteckster Date: Sat, 14 Sep 2024 16:06:43 -0400 Subject: [PATCH 16/39] Update tianji.sh increase storage --- ct/tianji.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/tianji.sh b/ct/tianji.sh index 449104df5..f22eaddb4 100644 --- a/ct/tianji.sh +++ b/ct/tianji.sh @@ -20,7 +20,7 @@ EOF header_info echo -e "Loading..." APP="Tianji" -var_disk="7" +var_disk="12" var_cpu="4" var_ram="4096" var_os="debian" From 1fd51141837bce61fa5ef251f901aeffbc007e0c Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 15 Sep 2024 08:05:19 -0400 Subject: [PATCH 17/39] Update tianji-install.sh - refactor - fixes https://github.com/tteck/Proxmox/issues/3729 --- install/tianji-install.sh | 51 +++++++++++++++------------------------ 1 file changed, 19 insertions(+), 32 deletions(-) diff --git a/install/tianji-install.sh b/install/tianji-install.sh index d7d73c177..4deea1baa 100644 --- a/install/tianji-install.sh +++ b/install/tianji-install.sh @@ -15,7 +15,7 @@ setting_up_container network_check update_os -msg_info "Installing Dependencies (Patience)" +msg_info "Installing Dependencies" $STD apt-get install -y \ postgresql \ build-essential \ @@ -28,34 +28,17 @@ $STD apt-get install -y \ mc msg_ok "Installed Dependencies" -msg_info "Setting up Node.js Repository" +msg_info "Installing Node.js, pnpm & pm2" mkdir -p /etc/apt/keyrings curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list $STD apt-get update -msg_ok "Set up Repositories" - -msg_info "Installing Node.js, pnpm & pm2" $STD apt-get install -y nodejs $STD npm install -g pnpm@9.7.1 $STD npm install -g pm2 msg_ok "Installed Node.js, pnpm & pm2" - -msg_info "Setup Tianji (Patience)" -cd /opt -RELEASE=$(curl -s https://api.github.com/repos/msgbyte/tianji/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') -wget -q "https://github.com/msgbyte/tianji/archive/refs/tags/v${RELEASE}.zip" -unzip -q v${RELEASE}.zip -mv tianji-${RELEASE} /opt/tianji -cd tianji -export NODE_OPTIONS=--max_old_space_size=4096 -$STD pnpm install -$STD pnpm build -echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" -msg_ok "Initial Setup complete" - -msg_info "Setting up Database" +msg_info "Setting up PostgreSQL" DB_NAME=tianji_db DB_USER=tianji DB_PASS="$(openssl rand -base64 18 | cut -c1-13)" @@ -70,33 +53,37 @@ echo -e "Tianji Database User: $DB_USER" >>~/tianji.creds echo -e "Tianji Database Password: $DB_PASS" >>~/tianji.creds echo -e "Tianji Database Name: $DB_NAME" >>~/tianji.creds echo -e "Tianji Secret: $TIANJI_SECRET" >>~/tianji.creds -msg_ok "Set up PostgreSQL database" +msg_ok "Set up PostgreSQL" -msg_info "Setting up Tianji Env" +msg_info "Installing Tianji (Extreme Patience)" +cd /opt +RELEASE=$(curl -s https://api.github.com/repos/msgbyte/tianji/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') +wget -q "https://github.com/msgbyte/tianji/archive/refs/tags/v${RELEASE}.zip" +unzip -q v${RELEASE}.zip +mv tianji-${RELEASE} /opt/tianji +cd tianji +export NODE_OPTIONS=--max_old_space_size=4096 +$STD pnpm install +$STD pnpm build +echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" cat </opt/tianji/src/server/.env -DATABASE_URL="postgresql://$DB_USER:$DB_PASS@127.0.0.1:5432/$DB_NAME?schema=public" +DATABASE_URL="postgresql://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME?schema=public" JWT_SECRET="$TIANJI_SECRET" EOF -msg_ok ".env successfully set up" - -msg_info "Initialize Application" cd /opt/tianji $STD npm install pm2 -g $STD pm2 install pm2-logrotate cd src/server $STD pnpm db:migrate:apply -msg_ok "Application Initialized" - -msg_info "Activate PM2 Service" $STD pm2 start /opt/tianji/src/server/dist/src/server/main.js --name tianji $STD pm2 save -msg_ok "Service activated" +msg_ok "Installed Tianji" motd_ssh customize msg_info "Cleaning up" rm -R /opt/v${RELEASE}.zip -$STD apt-get autoremove -y -$STD apt-get autoclean -y +$STD apt-get -y autoremove +$STD apt-get -y autoclean msg_ok "Cleaned" From 02468cc44db7d0880fb49336e4ac2df1fdbbcac8 Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 15 Sep 2024 10:56:25 -0400 Subject: [PATCH 18/39] Remove Frigate - Removed from website - Nonfunctional --- ct/{frigate.sh => frigate-test.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ct/{frigate.sh => frigate-test.sh} (100%) diff --git a/ct/frigate.sh b/ct/frigate-test.sh similarity index 100% rename from ct/frigate.sh rename to ct/frigate-test.sh From fe3b17b59dfba4fc3594ca17626ea85a45c73d7e Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 15 Sep 2024 10:56:35 -0400 Subject: [PATCH 19/39] Update CHANGELOG.md --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d03219032..5ca4e16bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,14 @@ Be cautious of copycat or coat-tailing sites that exploit the project's populari > [!NOTE] 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-09-14 + +### Changed + +- **Frigate LXC** + - Removed from website + - Nonfunctional + ## 2024-09-13 ### Changed From a773864a1a9676fae59e76007520b55452600273 Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 15 Sep 2024 10:59:24 -0400 Subject: [PATCH 20/39] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ca4e16bc..bcffa7d8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ Be cautious of copycat or coat-tailing sites that exploit the project's populari > [!NOTE] 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-09-14 +## 2024-09-15 ### Changed From 27bfa24cfe10cf095562b9e025e025d4e8187833 Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 15 Sep 2024 13:46:41 -0400 Subject: [PATCH 21/39] Update frigate-install.sh fix `install_deps.sh` --- install/frigate-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/frigate-install.sh b/install/frigate-install.sh index b04dd94f0..32ec43373 100644 --- a/install/frigate-install.sh +++ b/install/frigate-install.sh @@ -62,7 +62,7 @@ $STD pip3 wheel --wheel-dir=/wheels -r /opt/frigate/docker/main/requirements-whe cp -a /opt/frigate/docker/main/rootfs/. / export TARGETARCH="amd64" echo 'libc6 libraries/restart-without-asking boolean true' | debconf-set-selections -wget -q -O /opt/frigate/docker/main/install_deps.sh https://raw.githubusercontent.com/blakeblackshear/frigate/dev/docker/main/install_deps.sh +#wget -q -O /opt/frigate/docker/main/install_deps.sh https://raw.githubusercontent.com/blakeblackshear/frigate/dev/docker/main/install_deps.sh $STD /opt/frigate/docker/main/install_deps.sh $STD apt update $STD ln -svf /usr/lib/btbn-ffmpeg/bin/ffmpeg /usr/local/bin/ffmpeg From c567efe3740e9916a2fff62597dc1e978f72880c Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 15 Sep 2024 13:57:50 -0400 Subject: [PATCH 22/39] Add Frigate Add back to website --- ct/{frigate-test.sh => frigate.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ct/{frigate-test.sh => frigate.sh} (100%) diff --git a/ct/frigate-test.sh b/ct/frigate.sh similarity index 100% rename from ct/frigate-test.sh rename to ct/frigate.sh From e4d342c8196c541d673ebffce53eb80297c78130 Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 15 Sep 2024 13:58:15 -0400 Subject: [PATCH 23/39] Update CHANGELOG.md --- CHANGELOG.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcffa7d8e..d03219032 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,14 +13,6 @@ Be cautious of copycat or coat-tailing sites that exploit the project's populari > [!NOTE] 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-09-15 - -### Changed - -- **Frigate LXC** - - Removed from website - - Nonfunctional - ## 2024-09-13 ### Changed From fa2e4786affc5feff8809bb4589eeafbab23beef Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 15 Sep 2024 17:00:13 -0400 Subject: [PATCH 24/39] Update dashy.sh make update verbose --- ct/dashy.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ct/dashy.sh b/ct/dashy.sh index 60ea57db0..2193d580e 100644 --- a/ct/dashy.sh +++ b/ct/dashy.sh @@ -76,8 +76,8 @@ if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP} mkdir -p /opt/dashy wget -qO- https://github.com/Lissy93/dashy/archive/refs/tags/${RELEASE}.tar.gz | tar -xz -C /opt/dashy --strip-components=1 cd /opt/dashy - npm install &>/dev/null - npm run build &>/dev/null + npm install + npm run build echo "${RELEASE}" >/opt/${APP}_version.txt msg_ok "Updated ${APP} to ${RELEASE}" From 620b65286412d7a15459b190334a682a11b59efe Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 15 Sep 2024 17:13:03 -0400 Subject: [PATCH 25/39] Update frigate-install.sh tweak --- install/frigate-install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install/frigate-install.sh b/install/frigate-install.sh index 32ec43373..16887b2bb 100644 --- a/install/frigate-install.sh +++ b/install/frigate-install.sh @@ -62,7 +62,6 @@ $STD pip3 wheel --wheel-dir=/wheels -r /opt/frigate/docker/main/requirements-whe cp -a /opt/frigate/docker/main/rootfs/. / export TARGETARCH="amd64" echo 'libc6 libraries/restart-without-asking boolean true' | debconf-set-selections -#wget -q -O /opt/frigate/docker/main/install_deps.sh https://raw.githubusercontent.com/blakeblackshear/frigate/dev/docker/main/install_deps.sh $STD /opt/frigate/docker/main/install_deps.sh $STD apt update $STD ln -svf /usr/lib/btbn-ffmpeg/bin/ffmpeg /usr/local/bin/ffmpeg From 8ace2241384c61d854ebbef48ca50d398af841b7 Mon Sep 17 00:00:00 2001 From: tteckster Date: Mon, 16 Sep 2024 03:14:42 -0400 Subject: [PATCH 26/39] Update wireguard.sh create update path --- ct/wireguard.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ct/wireguard.sh b/ct/wireguard.sh index a183c6bb3..dbb15b7fa 100644 --- a/ct/wireguard.sh +++ b/ct/wireguard.sh @@ -54,7 +54,11 @@ function default_settings() { function update_script() { if [[ ! -d /etc/wireguard ]]; then msg_error "No ${APP} Installation Found!"; exit; fi -msg_error "Update WireGuard via apt" +apt-get update +apt-get -y upgrade +sleep 2 +cd /etc/wgdashboard/src +./wgd.sh update exit } From abe337e52d43636f1d3afc6001d789e489ae0f6c Mon Sep 17 00:00:00 2001 From: tteckster Date: Mon, 16 Sep 2024 03:28:45 -0400 Subject: [PATCH 27/39] Cleanup --- ct/collabora-online.sh | 71 ------------------------------------ install/collabora-install.sh | 44 ---------------------- 2 files changed, 115 deletions(-) delete mode 100644 ct/collabora-online.sh delete mode 100644 install/collabora-install.sh diff --git a/ct/collabora-online.sh b/ct/collabora-online.sh deleted file mode 100644 index 720673c36..000000000 --- a/ct/collabora-online.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/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) -# Co-Author: remz1337 -# License: MIT -# https://github.com/tteck/Proxmox/raw/main/LICENSE - -function header_info { -clear -cat <<"EOF" - ______ ____ __ - / ____/___ / / /___ _/ /_ ____ _________ _ - / / / __ \/ / / __ `/ __ \/ __ \/ ___/ __ `/ -/ /___/ /_/ / / / /_/ / /_/ / /_/ / / / /_/ / -\____/\____/_/_/\__,_/_.___/\____/_/ \__,_/ - -EOF -} -header_info -echo -e "Loading..." -APP="Collabora" -var_disk="12" -var_cpu="2" -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 [[ ! -f /lib/systemd/system/coolwsd.service ]]; then msg_error "No ${APP} Installation Found!"; exit; fi - msg_info "Updating ${APP} LXC" - apt-get update &>/dev/null - apt-get -y upgrade &>/dev/null - msg_ok "Updated ${APP} LXC" - exit -} - -start -build_container -description - -msg_ok "Completed Successfully!\n" -echo -e "https://github.com/tteck/Proxmox/discussions/3651" diff --git a/install/collabora-install.sh b/install/collabora-install.sh deleted file mode 100644 index 570d6ae80..000000000 --- a/install/collabora-install.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2021-2024 tteck -# Author: tteck (tteckster) -# Co-Author: remz1337 -# 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" - -msg_info "Installing Collabora Online" -wget -q -O /usr/share/keyrings/collaboraonline-release-keyring.gpg https://collaboraoffice.com/downloads/gpg/collaboraonline-release-keyring.gpg -cat </etc/apt/sources.list.d/collaboraonline.sources -Types: deb -URIs: https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-deb -Suites: ./ -Signed-By: /usr/share/keyrings/collaboraonline-release-keyring.gpg -EOF -$STD apt update -$STD apt install -y coolwsd code-brand collaboraoffice* -sed -i 's|true|false|g' /etc/coolwsd/coolwsd.xml -sed -i 's|false|true|g' /etc/coolwsd/coolwsd.xml -systemctl restart coolwsd -msg_ok "Installed Collabora Online" - -motd_ssh -customize - -msg_info "Cleaning up" -$STD apt-get -y autoremove -$STD apt-get -y autoclean -msg_ok "Cleaned" From 93ed909fff808a3fa2392003c7bdb6c94b30e123 Mon Sep 17 00:00:00 2001 From: tteckster Date: Mon, 16 Sep 2024 04:11:54 -0400 Subject: [PATCH 28/39] Update build.func add warning --- misc/build.func | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/build.func b/misc/build.func index b650a6c00..2f23be534 100644 --- a/misc/build.func +++ b/misc/build.func @@ -503,7 +503,7 @@ install_script() { start() { if command -v pveversion >/dev/null 2>&1; then - if ! (whiptail --backtitle "Proxmox VE Helper Scripts" --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + if ! (whiptail --backtitle "Proxmox VE Helper Scripts" --title "${APP} LXC" --yesno "If this link isn't from https://tteck.github.io/Proxmox/, you may be exposing your system to malicious code. \n \n This will create a New ${APP} LXC. Proceed?" 10 62); then clear echo -e "⚠ User exited script \n" exit From 695793a151a7d2793ad6f3ef237c5f8b82f2d962 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 16 Sep 2024 13:18:55 +0200 Subject: [PATCH 29/39] Add new LXC: HomeBox (#3734) --- ct/homebox.sh | 94 ++++++++++++++++++++++++++++++++++++++ install/homebox-install.sh | 55 ++++++++++++++++++++++ 2 files changed, 149 insertions(+) create mode 100644 ct/homebox.sh create mode 100644 install/homebox-install.sh diff --git a/ct/homebox.sh b/ct/homebox.sh new file mode 100644 index 000000000..5038f7820 --- /dev/null +++ b/ct/homebox.sh @@ -0,0 +1,94 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func) +# Copyright (c) 2021-2024 tteck +# Author: tteck +# Co-Author: MickLesk (Canbiz) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE + +function header_info { +clear +cat <<"EOF" + __ __ ____ + / / / /___ ____ ___ ___ / __ )____ _ __ + / /_/ / __ \/ __ `__ \/ _ \/ __ / __ \| |/_/ + / __ / /_/ / / / / / / __/ /_/ / /_/ /> < +/_/ /_/\____/_/ /_/ /_/\___/_____/\____/_/|_| + +EOF +} +header_info +echo -e "Loading..." +APP="HomeBox" +var_disk="4" +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 [[ ! -f /opt/homebox ]]; then msg_error "No ${APP} Installation Found!"; exit; fi +if (( $(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80 )); then + read -r -p "Warning: Storage is dangerously low, continue anyway? " prompt + [[ ${prompt,,} =~ ^(y|yes)$ ]] || exit +fi +RELEASE=$(curl -s https://api.github.com/repos/sysadminsmedia/homebox/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') +if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then + msg_info "Stopping ${APP}" + systemctl stop homebox + msg_ok "${APP} Stopped" + + msg_info "Updating ${APP} to ${RELEASE}" + cd /opt + rm -rf homebox_bak + mv homebox homebox_bak + wget -qO- https://github.com/sysadminsmedia/homebox/releases/download/${RELEASE}/homebox_Linux_x86_64.tar.gz | tar -xzf - -C /opt + chmod +x /opt/homebox + echo "${RELEASE}" >/opt/${APP}_version.txt + msg_ok "Updated Homebox" + + msg_info "Starting ${APP}" + systemctl start homebox + msg_ok "Started ${APP}" + + msg_ok "Updated Successfully" +else + msg_ok "No update required. ${APP} is already at ${RELEASE}" +fi +exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${APP} Setup should be reachable by going to the following URL. + ${BL}http://${IP}:7745${CL} \n" diff --git a/install/homebox-install.sh b/install/homebox-install.sh new file mode 100644 index 000000000..43969234b --- /dev/null +++ b/install/homebox-install.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2024 tteck +# Author: tteck +# Co-Author: MickLesk (Canbiz) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE +# Source: https://github.com/sysadminsmedia/homebox + +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 \ + sudo \ + mc +msg_ok "Installed Dependencies" + +msg_info "Installing Homebox" +RELEASE=$(curl -s https://api.github.com/repos/sysadminsmedia/homebox/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') +wget -qO- https://github.com/sysadminsmedia/homebox/releases/download/${RELEASE}/homebox_Linux_x86_64.tar.gz | tar -xzf - -C /opt +chmod +x /opt/homebox +echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" +msg_ok "Installed Homebox" + +msg_info "Creating Service" +cat </etc/systemd/system/homebox.service +[Unit] +Description=Start Homebox Service +After=network.target + +[Service] +WorkingDirectory=/opt +ExecStart=/opt/homebox +Restart=on-failure + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now homebox.service +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" From 9543941d077fc4c69c31aa0570d2f4424bc267da Mon Sep 17 00:00:00 2001 From: tteckster Date: Mon, 16 Sep 2024 07:21:47 -0400 Subject: [PATCH 30/39] Update CHANGELOG.md --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d03219032..794e9f822 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,13 @@ Be cautious of copycat or coat-tailing sites that exploit the project's populari > [!NOTE] 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-09-16 + +### Changed + +- **HomeBox LXC** [(View Source)](https://github.com/tteck/Proxmox/blob/main/install/homebox-install.sh) + - NEW Script + ## 2024-09-13 ### Changed From 085f1965a3ba6affc3e62e7d67a38a1e69c79630 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 16 Sep 2024 22:04:30 +0200 Subject: [PATCH 31/39] Add new LXC: Zipline (#3735) --- ct/zipline.sh | 101 +++++++++++++++++++++++++++++++++++++ install/zipline-install.sh | 96 +++++++++++++++++++++++++++++++++++ 2 files changed, 197 insertions(+) create mode 100644 ct/zipline.sh create mode 100644 install/zipline-install.sh diff --git a/ct/zipline.sh b/ct/zipline.sh new file mode 100644 index 000000000..095cdbc7c --- /dev/null +++ b/ct/zipline.sh @@ -0,0 +1,101 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func) +# Copyright (c) 2021-2024 tteck +# Author: tteck +# Co-Author: MickLesk (Canbiz) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE + +function header_info { +clear +cat <<"EOF" + _____ _ ___ +/__ / (_)___ / (_)___ ___ + / / / / __ \/ / / __ \/ _ \ + / /__/ / /_/ / / / / / / __/ +/____/_/ .___/_/_/_/ /_/\___/ + /_/ +EOF +} +header_info +echo -e "Loading..." +APP="Zipline" +var_disk="5" +var_cpu="2" +var_ram="2048" +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/zipline ]]; then msg_error "No ${APP} Installation Found!"; exit; fi +if (( $(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80 )); then + read -r -p "Warning: Storage is dangerously low, continue anyway? " prompt + [[ ${prompt,,} =~ ^(y|yes)$ ]] || exit +fi +RELEASE=$(curl -s https://api.github.com/repos/diced/zipline/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') +if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then + msg_info "Stopping ${APP}" + systemctl stop zipline + msg_ok "${APP} Stopped" + + msg_info "Updating ${APP} to ${RELEASE}" + cp /opt/zipline/.env /opt/ + rm -R /opt/zipline + wget -q "https://github.com/diced/zipline/archive/refs/tags/v${RELEASE}.zip" + unzip -q v${RELEASE}.zip + mv zipline-${RELEASE} /opt/zipline + cd /opt/zipline + mv /opt/.env /opt/zipline/.env + yarn install &>/dev/null + yarn build &>/dev/null + echo "${RELEASE}" >/opt/${APP}_version.txt + msg_ok "Updated ${APP}" + + msg_info "Starting ${APP}" + systemctl start zipline + msg_ok "Started ${APP}" + + msg_info "Cleaning Up" + rm -rf v${RELEASE}.zip + msg_ok "Cleaned" + msg_ok "Updated Successfully" +else + msg_ok "No update required. ${APP} is already at ${RELEASE}" +fi +exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${APP} Setup should be reachable by going to the following URL. + ${BL}http://${IP}:3000${CL} \n" \ No newline at end of file diff --git a/install/zipline-install.sh b/install/zipline-install.sh new file mode 100644 index 000000000..1c444f8e3 --- /dev/null +++ b/install/zipline-install.sh @@ -0,0 +1,96 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2024 tteck +# Author: tteck +# Co-Author: MickLesk (Canbiz) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE +# Source: https://github.com/diced/zipline + +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 \ + postgresql \ + gpg \ + curl \ + sudo \ + mc +msg_ok "Installed Dependencies" + +msg_info "Setting up Node.js Repository" +mkdir -p /etc/apt/keyrings +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list +msg_ok "Set up Node.js Repository" + +msg_info "Installing Node.js" +$STD apt-get update +$STD apt-get install -y nodejs +$STD npm install -g yarn +msg_ok "Installed Node.js" + +msg_info "Setting up PostgreSQL" +DB_NAME=ziplinedb +DB_USER=zipline +DB_PASS="$(openssl rand -base64 18 | cut -c1-13)" +SECRET_KEY="$(openssl rand -base64 32 | cut -c1-24)" +$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';" +$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;" +$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';" +$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';" +$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'" +echo "" >>~/zipline.creds +echo -e "Zipline Database User: $DB_USER" >>~/zipline.creds +echo -e "Zipline Database Password: $DB_PASS" >>~/zipline.creds +echo -e "Zipline Database Name: $DB_NAME" >>~/zipline.creds +echo -e "Zipline Secret: $SECRET_KEY" >>~/zipline.creds +msg_ok "Set up PostgreSQL" + +msg_info "Installing Zipline (Patience)" +cd /opt +RELEASE=$(curl -s https://api.github.com/repos/diced/zipline/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') +wget -q "https://github.com/diced/zipline/archive/refs/tags/v${RELEASE}.zip" +unzip -q v${RELEASE}.zip +mv zipline-${RELEASE} /opt/zipline +cd /opt/zipline +mv .env.local.example .env +sudo sed -i "s|CORE_SECRET=.*|CORE_SECRET=\"$SECRET_KEY\"|" /opt/zipline/.env +sudo sed -i "s|CORE_RETURN_HTTPS=.*|CORE_RETURN_HTTPS=false|" /opt/zipline/.env +sudo sed -i "s|CORE_DATABASE_URL=.*|CORE_DATABASE_URL=\"postgres://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME\"|" /opt/zipline/.env +CORE_RETURN_HTTPS=false +$STD yarn install +$STD yarn build +echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" +msg_ok "Installed Zipline" + +msg_info "Creating Service" +cat </etc/systemd/system/zipline.service +[Unit] +Description=Zipline Service +After=network.target + +[Service] +WorkingDirectory=/opt/zipline +ExecStart=/usr/bin/yarn start +Restart=on-failure + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now zipline.service +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" \ No newline at end of file From 72d3d64a48897f9c63493da452a605e3ac4f7a8b Mon Sep 17 00:00:00 2001 From: tteckster Date: Mon, 16 Sep 2024 16:06:00 -0400 Subject: [PATCH 32/39] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 794e9f822..1595e8a20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ All LXC instances created using this repository come pre-installed with Midnight - **HomeBox LXC** [(View Source)](https://github.com/tteck/Proxmox/blob/main/install/homebox-install.sh) - NEW Script +- **Zipline LXC** [(View Source)](https://github.com/tteck/Proxmox/blob/main/install/zipline-install.sh) + - NEW Script ## 2024-09-13 From 1ea00c4775dfae289a8724a56592571d6a0f5779 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 17 Sep 2024 05:08:55 -0400 Subject: [PATCH 33/39] Update ersatztv-install.sh fixes https://github.com/tteck/Proxmox/issues/3741 --- install/ersatztv-install.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/install/ersatztv-install.sh b/install/ersatztv-install.sh index 939880f39..28984bed3 100644 --- a/install/ersatztv-install.sh +++ b/install/ersatztv-install.sh @@ -22,10 +22,15 @@ $STD apt-get install -y mc msg_ok "Installed Dependencies" msg_info "Installing FFmpeg (Patience)" -echo "deb http://deb.debian.org/debian/ sid main" >/etc/apt/sources.list.d/sid.list +wget -q https://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.8.1_all.deb +$STD dpkg -i deb-multimedia-keyring_2016.8.1_all.deb +cat </etc/apt/sources.list.d/backports.list +deb https://www.deb-multimedia.org bookworm main non-free +deb https://www.deb-multimedia.org bookworm-backports main +EOF $STD apt update -DEBIAN_FRONTEND=noninteractive $STD apt install -t sid ffmpeg -y -rm /etc/apt/sources.list.d/sid.list +DEBIAN_FRONTEND=noninteractive $STD apt-get install -t bookworm-backports ffmpeg -y +rm /etc/apt/sources.list.d/backports.list $STD apt update msg_ok "Installed FFmpeg" From ae7217048fee6681a022db88b7675786804c18dc Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 17 Sep 2024 05:24:31 -0400 Subject: [PATCH 34/39] Update ersatztv-install.sh tweak --- install/ersatztv-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/ersatztv-install.sh b/install/ersatztv-install.sh index 28984bed3..d07d01b54 100644 --- a/install/ersatztv-install.sh +++ b/install/ersatztv-install.sh @@ -30,7 +30,7 @@ deb https://www.deb-multimedia.org bookworm-backports main EOF $STD apt update DEBIAN_FRONTEND=noninteractive $STD apt-get install -t bookworm-backports ffmpeg -y -rm /etc/apt/sources.list.d/backports.list +rm -rf /etc/apt/sources.list.d/backports.list deb-multimedia-keyring_2016.8.1_all.deb $STD apt update msg_ok "Installed FFmpeg" From da30cd5c1e2fc231dd759d6d1411f9fd1068b785 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 17 Sep 2024 15:41:27 -0400 Subject: [PATCH 35/39] 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 2f23be534..dcb289e08 100644 --- a/misc/build.func +++ b/misc/build.func @@ -503,7 +503,7 @@ install_script() { start() { if command -v pveversion >/dev/null 2>&1; then - if ! (whiptail --backtitle "Proxmox VE Helper Scripts" --title "${APP} LXC" --yesno "If this link isn't from https://tteck.github.io/Proxmox/, you may be exposing your system to malicious code. \n \n This will create a New ${APP} LXC. Proceed?" 10 62); then + if ! (whiptail --backtitle "Proxmox VE Helper Scripts" --title "${APP} LXC" --yesno "To ensure the safety of your system, please only use https://tteck.github.io/Proxmox/\n\nThis will create a New ${APP} LXC. Proceed?" 10 58); then clear echo -e "⚠ User exited script \n" exit From 649590eea71ed690e9107fcba9c50e9e5c0a0479 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 18 Sep 2024 14:59:21 -0400 Subject: [PATCH 36/39] Update build.func add ErsatzTV to VAAPI hardware transcoding group --- misc/build.func | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/build.func b/misc/build.func index dcb289e08..0cd98eeb5 100644 --- a/misc/build.func +++ b/misc/build.func @@ -588,7 +588,7 @@ EOF fi if [ "$CT_TYPE" == "0" ]; then - if [[ "$APP" == "Channels" || "$APP" == "Emby" || "$APP" == "Frigate" || "$APP" == "Jellyfin" || "$APP" == "Plex" || "$APP" == "Scrypted" || "$APP" == "Tdarr" || "$APP" == "Unmanic" ]]; then + if [[ "$APP" == "Channels" || "$APP" == "Emby" || "$APP" == "ErsatzTV" || "$APP" == "Frigate" || "$APP" == "Jellyfin" || "$APP" == "Plex" || "$APP" == "Scrypted" || "$APP" == "Tdarr" || "$APP" == "Unmanic" ]]; then cat <>$LXC_CONFIG # VAAPI hardware transcoding lxc.cgroup2.devices.allow: c 226:0 rwm @@ -600,7 +600,7 @@ lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,creat EOF fi else - if [[ "$APP" == "Channels" || "$APP" == "Emby" || "$APP" == "Frigate" || "$APP" == "Jellyfin" || "$APP" == "Plex" || "$APP" == "Scrypted" || "$APP" == "Tdarr" || "$APP" == "Unmanic" ]]; then + if [[ "$APP" == "Channels" || "$APP" == "Emby" || "$APP" == "ErsatzTV" || "$APP" == "Frigate" || "$APP" == "Jellyfin" || "$APP" == "Plex" || "$APP" == "Scrypted" || "$APP" == "Tdarr" || "$APP" == "Unmanic" ]]; then if [[ -e "/dev/dri/renderD128" ]]; then if [[ -e "/dev/dri/card0" ]]; then cat <>$LXC_CONFIG From 61b0ca67cc4c2507ffdc6838fa50a03b8d36c6a7 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 18 Sep 2024 15:00:53 -0400 Subject: [PATCH 37/39] Update ersatztv-install.sh add Hardware Acceleration --- install/ersatztv-install.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/install/ersatztv-install.sh b/install/ersatztv-install.sh index d07d01b54..2d258a653 100644 --- a/install/ersatztv-install.sh +++ b/install/ersatztv-install.sh @@ -21,6 +21,17 @@ $STD apt-get install -y sudo $STD apt-get install -y mc msg_ok "Installed Dependencies" +msg_info "Setting Up Hardware Acceleration" +$STD apt-get -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools} +if [[ "$CTTYPE" == "0" ]]; then + chgrp video /dev/dri + chmod 755 /dev/dri + chmod 660 /dev/dri/* + $STD adduser $(id -u -n) video + $STD adduser $(id -u -n) render +fi +msg_ok "Set Up Hardware Acceleration" + msg_info "Installing FFmpeg (Patience)" wget -q https://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.8.1_all.deb $STD dpkg -i deb-multimedia-keyring_2016.8.1_all.deb From e140642b1fcd0b2ca73b379f0672f7ae7af20f0c Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 18 Sep 2024 15:02:48 -0400 Subject: [PATCH 38/39] Update ersatztv-install.sh tweak --- install/ersatztv-install.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/install/ersatztv-install.sh b/install/ersatztv-install.sh index 2d258a653..125f8652a 100644 --- a/install/ersatztv-install.sh +++ b/install/ersatztv-install.sh @@ -21,17 +21,6 @@ $STD apt-get install -y sudo $STD apt-get install -y mc msg_ok "Installed Dependencies" -msg_info "Setting Up Hardware Acceleration" -$STD apt-get -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools} -if [[ "$CTTYPE" == "0" ]]; then - chgrp video /dev/dri - chmod 755 /dev/dri - chmod 660 /dev/dri/* - $STD adduser $(id -u -n) video - $STD adduser $(id -u -n) render -fi -msg_ok "Set Up Hardware Acceleration" - msg_info "Installing FFmpeg (Patience)" wget -q https://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.8.1_all.deb $STD dpkg -i deb-multimedia-keyring_2016.8.1_all.deb @@ -45,6 +34,17 @@ rm -rf /etc/apt/sources.list.d/backports.list deb-multimedia-keyring_2016.8.1_al $STD apt update msg_ok "Installed FFmpeg" +msg_info "Setting Up Hardware Acceleration" +$STD apt-get -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools} +if [[ "$CTTYPE" == "0" ]]; then + chgrp video /dev/dri + chmod 755 /dev/dri + chmod 660 /dev/dri/* + $STD adduser $(id -u -n) video + $STD adduser $(id -u -n) render +fi +msg_ok "Set Up Hardware Acceleration" + msg_info "Installing ErsatzTV" RELEASE=$(curl -s https://api.github.com/repos/ErsatzTV/ErsatzTV/releases | grep -oP '"tag_name": "\K[^"]+' | head -n 1) wget -qO- "https://github.com/ErsatzTV/ErsatzTV/releases/download/${RELEASE}/ErsatzTV-${RELEASE}-linux-x64.tar.gz" | tar -xz -C /opt From 6a02ba1335d9eb81b2c2cee19d2aad20df5e383b Mon Sep 17 00:00:00 2001 From: tteckster Date: Thu, 19 Sep 2024 13:10:24 -0400 Subject: [PATCH 39/39] Update stirling-pdf-install.sh fixes https://github.com/tteck/Proxmox/issues/3756 --- install/stirling-pdf-install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install/stirling-pdf-install.sh b/install/stirling-pdf-install.sh index 88456a66d..40accb5cb 100644 --- a/install/stirling-pdf-install.sh +++ b/install/stirling-pdf-install.sh @@ -28,7 +28,8 @@ $STD apt-get install -y \ make \ g++ \ unpaper \ - ocrmypdf + ocrmypdf \ + poppler-utils msg_ok "Installed Dependencies" msg_info "Installing LibreOffice Components"