From edbaa1fbdc28d32662f5c5e6a895905bca1dd45b Mon Sep 17 00:00:00 2001 From: Ryan Freeman Date: Mon, 15 Apr 2024 13:27:12 +0100 Subject: [PATCH 1/6] iVentoy - updated (#2790) * Create iventoy.sh * Create iventoy-install.sh --- ct/iventoy.sh | 85 ++++++++++++++++++++++++++++++++++++++ install/iventoy-install.sh | 60 +++++++++++++++++++++++++++ 2 files changed, 145 insertions(+) create mode 100644 ct/iventoy.sh create mode 100644 install/iventoy-install.sh diff --git a/ct/iventoy.sh b/ct/iventoy.sh new file mode 100644 index 000000000..54e3dc6d9 --- /dev/null +++ b/ct/iventoy.sh @@ -0,0 +1,85 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func) +# Copyright (c) 2021-2024 tteck +# Author: tteck (tteckster) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE + +function header_info { +clear +cat <<"EOF" + _ _ __ __ + (_) | / /__ ____ / /_____ __ __ + / /| | / / _ \/ __ \/ __/ __ \/ / / / + / / | |/ / __/ / / / /_/ /_/ / /_/ / +/_/ |___/\___/_/ /_/\__/\____/\__, / + /____/ + +EOF +} +header_info +echo -e "Loading..." +APP="iVentoy" +var_disk="2" +var_cpu="1" +var_ram="512" +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/iventoy ]]; then msg_error "No ${APP} Installation Found!"; exit; fi +msg_info "Stopping ${APP} LXC" +systemctl stop iventoy.service +msg_ok "Stopped ${APP} LXC" + +msg_info "Updating ${APP} LXC" +rm -rf /opt/iventoy +apt-get update &>/dev/null +apt-get -y upgrade &>/dev/null +wget -q $(curl -s https://api.github.com/repos/ventoy/pxe/releases/latest | grep download | grep linux-free | cut -d\" -f4) +tar -C /opt/iventoy -xzf iventoy*.tar.gz +rm -rf iventoy*.tar.gz +msg_ok "Updated ${APP} LXC" + +msg_info "Starting ${APP} LXC" +systemctl start iventoy.service +msg_ok "Started ${APP} LXC" +msg_ok "Updated Successfully" +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}:26000/ ${CL} \n" diff --git a/install/iventoy-install.sh b/install/iventoy-install.sh new file mode 100644 index 000000000..791438e50 --- /dev/null +++ b/install/iventoy-install.sh @@ -0,0 +1,60 @@ +#!/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" + +msg_info "Installing iVentoy" +mkdir -p /opt/iventoy/ + +wget -q $(curl -s https://api.github.com/repos/ventoy/pxe/releases/latest | grep download | grep linux-free | cut -d\" -f4) +tar -C /opt/iventoy -xzf iventoy*.tar.gz +rm -rf iventoy*.tar.gz + +msg_ok "Installed iVentoy" + +msg_info "Creating Service" +service_path="/etc/systemd/system/iventoy.service" +echo "# /etc/systemd/system/iventoy.service +[Unit] +Description=iVentoy PXE Booter +Documentation=https://www.iventoy.com +Wants=network-online.target + +[Service] +Type=forking +Environment=IVENTOY_API_ALL=1 +Environment=IVENTOY_AUTO_RUN=1 +Environment=LIBRARY_PATH=/opt/iventoy/lib/lin64 +Environment=LD_LIBRARY_PATH=/opt/iventoy/lib/lin64 +ExecStart=sh ./iventoy.sh -R start +WorkingDirectory=/opt/iventoy +Restart=on-failure + +[Install] +WantedBy=multi-user.target" >$service_path +systemctl enable --now -q iventoy.service +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get autoremove +$STD apt-get autoclean +msg_ok "Cleaned" From dbe21ab5396ecdba8776cb4cd6334687aa45ab62 Mon Sep 17 00:00:00 2001 From: tteckster Date: Mon, 15 Apr 2024 08:35:06 -0400 Subject: [PATCH 2/6] Update iventoy-install.sh tweak --- install/iventoy-install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install/iventoy-install.sh b/install/iventoy-install.sh index 791438e50..6c48ab460 100644 --- a/install/iventoy-install.sh +++ b/install/iventoy-install.sh @@ -29,8 +29,7 @@ rm -rf iventoy*.tar.gz msg_ok "Installed iVentoy" msg_info "Creating Service" -service_path="/etc/systemd/system/iventoy.service" -echo "# /etc/systemd/system/iventoy.service +cat </etc/systemd/system/iventoy.service [Unit] Description=iVentoy PXE Booter Documentation=https://www.iventoy.com @@ -47,8 +46,9 @@ WorkingDirectory=/opt/iventoy Restart=on-failure [Install] -WantedBy=multi-user.target" >$service_path -systemctl enable --now -q iventoy.service +WantedBy=multi-user.target +EOF +systemctl enable -q --now iventoy.service msg_ok "Created Service" motd_ssh From 6d296e0fdf655ea950faca8bb553386d2b0a23f3 Mon Sep 17 00:00:00 2001 From: tteckster Date: Mon, 15 Apr 2024 08:55:40 -0400 Subject: [PATCH 3/6] Update iventoy-install.sh tweak --- install/iventoy-install.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/install/iventoy-install.sh b/install/iventoy-install.sh index 6c48ab460..d5534e591 100644 --- a/install/iventoy-install.sh +++ b/install/iventoy-install.sh @@ -21,11 +21,10 @@ msg_ok "Installed Dependencies" msg_info "Installing iVentoy" mkdir -p /opt/iventoy/ - wget -q $(curl -s https://api.github.com/repos/ventoy/pxe/releases/latest | grep download | grep linux-free | cut -d\" -f4) -tar -C /opt/iventoy -xzf iventoy*.tar.gz +tar -xzf iventoy*.tar.gz +mv iventoy-* /opt/iventoy rm -rf iventoy*.tar.gz - msg_ok "Installed iVentoy" msg_info "Creating Service" From 22d755d66f25170bb5f6c1d428cf2ccdecc5eebb Mon Sep 17 00:00:00 2001 From: tteckster Date: Mon, 15 Apr 2024 09:00:29 -0400 Subject: [PATCH 4/6] Delete install/iventoy-install.sh non-functional --- install/iventoy-install.sh | 59 -------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 install/iventoy-install.sh diff --git a/install/iventoy-install.sh b/install/iventoy-install.sh deleted file mode 100644 index d5534e591..000000000 --- a/install/iventoy-install.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/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" - -msg_info "Installing iVentoy" -mkdir -p /opt/iventoy/ -wget -q $(curl -s https://api.github.com/repos/ventoy/pxe/releases/latest | grep download | grep linux-free | cut -d\" -f4) -tar -xzf iventoy*.tar.gz -mv iventoy-* /opt/iventoy -rm -rf iventoy*.tar.gz -msg_ok "Installed iVentoy" - -msg_info "Creating Service" -cat </etc/systemd/system/iventoy.service -[Unit] -Description=iVentoy PXE Booter -Documentation=https://www.iventoy.com -Wants=network-online.target - -[Service] -Type=forking -Environment=IVENTOY_API_ALL=1 -Environment=IVENTOY_AUTO_RUN=1 -Environment=LIBRARY_PATH=/opt/iventoy/lib/lin64 -Environment=LD_LIBRARY_PATH=/opt/iventoy/lib/lin64 -ExecStart=sh ./iventoy.sh -R start -WorkingDirectory=/opt/iventoy -Restart=on-failure - -[Install] -WantedBy=multi-user.target -EOF -systemctl enable -q --now iventoy.service -msg_ok "Created Service" - -motd_ssh -customize - -msg_info "Cleaning up" -$STD apt-get autoremove -$STD apt-get autoclean -msg_ok "Cleaned" From 9fc3901444fbbd3f7f1145568127ec9df539f58e Mon Sep 17 00:00:00 2001 From: tteckster Date: Mon, 15 Apr 2024 09:00:55 -0400 Subject: [PATCH 5/6] Delete ct/iventoy.sh non-functional --- ct/iventoy.sh | 85 --------------------------------------------------- 1 file changed, 85 deletions(-) delete mode 100644 ct/iventoy.sh diff --git a/ct/iventoy.sh b/ct/iventoy.sh deleted file mode 100644 index 54e3dc6d9..000000000 --- a/ct/iventoy.sh +++ /dev/null @@ -1,85 +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) -# License: MIT -# https://github.com/tteck/Proxmox/raw/main/LICENSE - -function header_info { -clear -cat <<"EOF" - _ _ __ __ - (_) | / /__ ____ / /_____ __ __ - / /| | / / _ \/ __ \/ __/ __ \/ / / / - / / | |/ / __/ / / / /_/ /_/ / /_/ / -/_/ |___/\___/_/ /_/\__/\____/\__, / - /____/ - -EOF -} -header_info -echo -e "Loading..." -APP="iVentoy" -var_disk="2" -var_cpu="1" -var_ram="512" -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/iventoy ]]; then msg_error "No ${APP} Installation Found!"; exit; fi -msg_info "Stopping ${APP} LXC" -systemctl stop iventoy.service -msg_ok "Stopped ${APP} LXC" - -msg_info "Updating ${APP} LXC" -rm -rf /opt/iventoy -apt-get update &>/dev/null -apt-get -y upgrade &>/dev/null -wget -q $(curl -s https://api.github.com/repos/ventoy/pxe/releases/latest | grep download | grep linux-free | cut -d\" -f4) -tar -C /opt/iventoy -xzf iventoy*.tar.gz -rm -rf iventoy*.tar.gz -msg_ok "Updated ${APP} LXC" - -msg_info "Starting ${APP} LXC" -systemctl start iventoy.service -msg_ok "Started ${APP} LXC" -msg_ok "Updated Successfully" -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}:26000/ ${CL} \n" From 9cfad87e3ba0ba91f6fc324d202af81a42ac76ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20B=C3=A9dard-Couture?= Date: Mon, 15 Apr 2024 12:47:22 -0400 Subject: [PATCH 6/6] Mount frigate video cache into memory to avoid hard drive overheating and overuse (#2795) --- install/frigate-install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install/frigate-install.sh b/install/frigate-install.sh index 98141d858..85b07c87f 100644 --- a/install/frigate-install.sh +++ b/install/frigate-install.sh @@ -106,6 +106,7 @@ cameras: EOF ln -sf /config/config.yml /opt/frigate/config/config.yml sed -i -e 's/^kvm:x:104:$/render:x:104:root,frigate/' -e 's/^render:x:105:root$/kvm:x:105:/' /etc/group +echo "tmpfs /tmp/cache tmpfs defaults 0 0" >> /etc/fstab msg_ok "Installed Frigate $RELEASE" msg_info "Installing Object Detection Models (Resilience)"