diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d9428aad..1595e8a20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,22 @@ 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 +- **Zipline LXC** [(View Source)](https://github.com/tteck/Proxmox/blob/main/install/zipline-install.sh) + - NEW Script + +## 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 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/) diff --git a/ct/collabora.sh b/ct/collabora.sh deleted file mode 100644 index 19f2fbf97..000000000 --- a/ct/collabora.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/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) -# 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="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 /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 "${APP} needs to be behind a proxy (Nginx Proxy Manager)." diff --git a/ct/dashy.sh b/ct/dashy.sh index 96e9b2f8d..55f006027 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}" 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/ct/nginxproxymanager.sh b/ct/nginxproxymanager.sh index fe2f23c80..34f6194e8 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 diff --git a/ct/sabnzbd.sh b/ct/sabnzbd.sh index deed03db5..90c1cbfb8 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 } diff --git a/ct/spoolman.sh b/ct/spoolman.sh index e60ffb8a0..c0371d66d 100644 --- a/ct/spoolman.sh +++ b/ct/spoolman.sh @@ -74,7 +74,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}" diff --git a/ct/tianji.sh b/ct/tianji.sh new file mode 100644 index 000000000..f22eaddb4 --- /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="12" +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/ct/wireguard.sh b/ct/wireguard.sh index 502d7951b..a7eed8e07 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 } 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/collabora-install.sh b/install/collabora-install.sh deleted file mode 100644 index 8b577fb22..000000000 --- a/install/collabora-install.sh +++ /dev/null @@ -1,46 +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 -$STD apt-get install -y wget -$STD apt-get install -y openssh-server -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" diff --git a/install/ersatztv-install.sh b/install/ersatztv-install.sh index 59e1e4dd1..2d1565607 100644 --- a/install/ersatztv-install.sh +++ b/install/ersatztv-install.sh @@ -25,13 +25,29 @@ $STD apt-get install -y openssh-server 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 -rf /etc/apt/sources.list.d/backports.list deb-multimedia-keyring_2016.8.1_all.deb $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-arm64.tar.gz" | tar -xz -C /opt diff --git a/install/frigate-install.sh b/install/frigate-install.sh index 98f3d671e..9ce55b76d 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="arm64" 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 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" diff --git a/install/sabnzbd-install.sh b/install/sabnzbd-install.sh index 415515235..9a76ee786 100644 --- a/install/sabnzbd-install.sh +++ b/install/sabnzbd-install.sh @@ -44,6 +44,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" diff --git a/install/spoolman-install.sh b/install/spoolman-install.sh index 3483d4198..f2974e185 100644 --- a/install/spoolman-install.sh +++ b/install/spoolman-install.sh @@ -45,7 +45,7 @@ unzip -q spoolman.zip -d spoolman rm -rf spoolman.zip cd /opt/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" diff --git a/install/stirling-pdf-install.sh b/install/stirling-pdf-install.sh index 6e40d1594..d7be36b60 100644 --- a/install/stirling-pdf-install.sh +++ b/install/stirling-pdf-install.sh @@ -29,6 +29,7 @@ $STD apt-get install -y \ g++ \ unpaper \ ocrmypdf \ + poppler-utils \ wget \ openssh-server msg_ok "Installed Dependencies" diff --git a/install/tianji-install.sh b/install/tianji-install.sh new file mode 100644 index 000000000..4deea1baa --- /dev/null +++ b/install/tianji-install.sh @@ -0,0 +1,89 @@ +#!/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" +$STD apt-get install -y \ + postgresql \ + build-essential \ + curl \ + sudo \ + git \ + make \ + gnupg \ + ca-certificates \ + mc +msg_ok "Installed Dependencies" + +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 +$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 "Setting up PostgreSQL" +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" + +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@localhost:5432/$DB_NAME?schema=public" +JWT_SECRET="$TIANJI_SECRET" +EOF +cd /opt/tianji +$STD npm install pm2 -g +$STD pm2 install pm2-logrotate +cd src/server +$STD pnpm db:migrate:apply +$STD pm2 start /opt/tianji/src/server/dist/src/server/main.js --name tianji +$STD pm2 save +msg_ok "Installed Tianji" + +motd_ssh +customize + +msg_info "Cleaning up" +rm -R /opt/v${RELEASE}.zip +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" 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 diff --git a/misc/build.func b/misc/build.func index dae66a9c3..460067ffb 100644 --- a/misc/build.func +++ b/misc/build.func @@ -491,7 +491,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 "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 @@ -577,7 +577,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 @@ -589,7 +589,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 diff --git a/misc/update-lxcs-cron.sh b/misc/update-lxcs-cron.sh index 04827734c..ec397b5b8 100644 --- a/misc/update-lxcs-cron.sh +++ b/misc/update-lxcs-cron.sh @@ -5,24 +5,19 @@ # 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" ;; + opensuse) pct exec "$container" -- bash -c "zypper ref && zypper --non-interactive dup" ;; esac } @@ -43,7 +38,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 +48,3 @@ for container in $(pct list | awk '{if(NR>1) print $1}'); do fi done wait - -echo -e "Finished, All Containers Updated. \n" 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 }