diff --git a/CHANGELOG.md b/CHANGELOG.md index 1595e8a20..54ded381c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,15 @@ 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-10-03 + +### Changed + +- **Home Assistant Core LXC** [(Commit)](https://github.com/tteck/Proxmox/commit/f2937febe69b2bad8b3a14eb84aa562a8f14cc6a) [(Commit)](https://github.com/tteck/Proxmox/commit/f2966ced7f457fd506f865f7f5b70ea12c4b0049) + - Refactor Code + - Breaking Change + - Home Assistant has transitioned to using `uv` for managing the virtual environment and installing additional modules. + ## 2024-09-16 ### Changed diff --git a/ct/homeassistant-core.sh b/ct/homeassistant-core.sh index b193ac1b7..ad00c43ac 100644 --- a/ct/homeassistant-core.sh +++ b/ct/homeassistant-core.sh @@ -85,7 +85,7 @@ function update_script() { msg_info "Updating Home Assistant" source /srv/homeassistant/bin/activate - pip install ${BR}--upgrade homeassistant &>/dev/null + uv pip install ${BR}--upgrade homeassistant &>/dev/null msg_ok "Updated Home Assistant" msg_info "Starting Home Assistant" diff --git a/ct/k0s.sh b/ct/k0s.sh deleted file mode 100644 index 77847f952..000000000 --- a/ct/k0s.sh +++ /dev/null @@ -1,69 +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) -# License: MIT -# https://github.com/tteck/Proxmox/raw/main/LICENSE - -function header_info { -clear -cat <<"EOF" - __ ____ __ __ __ __ - / /__/ __ \_____ / //_/_ __/ /_ ___ _________ ___ / /____ _____ - / //_/ / / / ___/ / ,< / / / / __ \/ _ \/ ___/ __ \/ _ \/ __/ _ \/ ___/ - / ,< / /_/ (__ ) / /| / /_/ / /_/ / __/ / / / / / __/ /_/ __(__ ) -/_/|_|\____/____/ /_/ |_\__,_/_.___/\___/_/ /_/ /_/\___/\__/\___/____/ - -EOF -} -header_info -echo -e "Loading..." -APP="k0s" -var_disk="4" -var_cpu="2" -var_ram="2048" -var_os="debian" -var_version="11" -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 /etc/k0s/k0s.yaml ]]; 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 Successfully" -exit -} - -start -build_container -description - -msg_ok "Completed Successfully!\n" diff --git a/ct/keycloak.sh b/ct/keycloak.sh index 58fb1c5ca..fe590eb4a 100644 --- a/ct/keycloak.sh +++ b/ct/keycloak.sh @@ -57,8 +57,32 @@ function update_script() { header_info if [[ ! -f /etc/systemd/system/keycloak.service ]]; then msg_error "No ${APP} Installation Found!"; exit; fi msg_info "Updating ${APP} LXC" + +msg_info "Updating packages" apt-get update &>/dev/null apt-get -y upgrade &>/dev/null + +RELEASE=$(curl -s https://api.github.com/repos/keycloak/keycloak/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') +msg_info "Downloading Keycloak v$RELEASE" +cd /opt +wget -q https://github.com/keycloak/keycloak/releases/download/$RELEASE/keycloak-$RELEASE.tar.gz +$STD tar -xvf keycloak-$RELEASE.tar.gz + +msg_info "Merging configuration files" +cp -r keycloak/conf keycloak-$RELEASE +cp -r keycloak/providers keycloak-$RELEASE +cp -r keycloak/themes keycloak-$RELEASE + +msg_info "Updating Keycloak" +mv keycloak keycloak.old +mv keycloak-$RELEASE keycloak + +msg_info "Delete temporary installation files" +rm keycloak-$RELEASE.tar.gz +rm -rf keycloak.old + +msg_info "Restating Keycloak" +systemctl restart keycloak msg_ok "Updated Successfully" exit } diff --git a/ct/nginxproxymanager.sh b/ct/nginxproxymanager.sh index 34f6194e8..70a4077d6 100644 --- a/ct/nginxproxymanager.sh +++ b/ct/nginxproxymanager.sh @@ -168,6 +168,7 @@ EOF msg_info "Starting Services" sed -i 's/user npm/user root/g; s/^pid/#pid/g' /usr/local/openresty/nginx/conf/nginx.conf + sed -i 's/su npm npm/su root root/g' /etc/logrotate.d/nginx-proxy-manager sed -i 's/include-system-site-packages = false/include-system-site-packages = true/g' /opt/certbot/pyvenv.cfg systemctl enable -q --now openresty systemctl enable -q --now npm diff --git a/ct/spoolman.sh b/ct/spoolman.sh index c0371d66d..20e479ffb 100644 --- a/ct/spoolman.sh +++ b/ct/spoolman.sh @@ -71,7 +71,7 @@ if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_v rm -rf spoolman_bak mv spoolman spoolman_bak wget -q https://github.com/Donkie/Spoolman/releases/download/${RELEASE}/spoolman.zip - unzip -q spoolman.zip -d spoolman + unzip -q spoolman.zip -d spoolman cd spoolman pip3 install -r requirements.txt >/dev/null 2>&1 wget -q https://raw.githubusercontent.com/Donkie/Spoolman/master/.env.example -O .env diff --git a/ct/traefik.sh b/ct/traefik.sh index a6a5c7796..469029d49 100644 --- a/ct/traefik.sh +++ b/ct/traefik.sh @@ -62,6 +62,7 @@ if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP} tar -C /tmp -xzf traefik*.tar.gz mv /tmp/traefik /usr/bin/ rm -rf traefik*.tar.gz + systemctl restart traefik.service msg_ok "Updated $APP LXC" else msg_ok "No update required. ${APP} is already at ${RELEASE}" diff --git a/ct/whoogle.sh b/ct/whoogle.sh index a9f55a5b4..b56bb0f21 100644 --- a/ct/whoogle.sh +++ b/ct/whoogle.sh @@ -57,6 +57,7 @@ header_info if [[ ! -f /usr/local/bin/whoogle-search ]]; then msg_error "No ${APP} Installation Found!"; exit; fi msg_info "Updating ${APP} LXC" pip3 install whoogle-search --upgrade &>/dev/null +systemctl restart whoogle.service msg_ok "Updated Successfully" exit } diff --git a/install/frigate-install.sh b/install/frigate-install.sh index 9ce55b76d..63301212b 100644 --- a/install/frigate-install.sh +++ b/install/frigate-install.sh @@ -171,8 +171,6 @@ msg_ok "Installed Coral Object Detection Model" msg_info "Building Nginx with Custom Modules" $STD /opt/frigate/docker/main/build_nginx.sh sed -e '/s6-notifyoncheck/ s/^#*/#/' -i /opt/frigate/docker/main/rootfs/etc/s6-overlay/s6-rc.d/nginx/run -sed -i 's/error_log \/dev\/stdout warn\;/error_log \/dev\/shm\/logs\/nginx\/current warn\;/' /usr/local/nginx/conf/nginx.conf -sed -i 's/access_log \/dev\/stdout main\;/access_log \/dev\/shm\/logs\/nginx\/current main\;/' /usr/local/nginx/conf/nginx.conf ln -sf /usr/local/nginx/sbin/nginx /usr/local/bin/nginx msg_ok "Built Nginx" diff --git a/install/homeassistant-core-install.sh b/install/homeassistant-core-install.sh index dc779e294..a099c4730 100644 --- a/install/homeassistant-core-install.sh +++ b/install/homeassistant-core-install.sh @@ -14,21 +14,24 @@ network_check update_os msg_info "Installing Dependencies (Patience)" -$STD apt-get install -y {git,curl,sudo,mc,bluez,libffi-dev,libssl-dev,libjpeg-dev,zlib1g-dev,autoconf,build-essential,libopenjp2-7,libturbojpeg0-dev,ffmpeg,liblapack3,liblapack-dev,dbus-broker,libpcap-dev,libavdevice-dev,libavformat-dev,libavcodec-dev,libavutil-dev,libavfilter-dev,libmariadb-dev-compat,libatlas-base-dev,python3-pip,python3.12-venv,wget,openssh-server} +$STD apt-get install -y git curl sudo mc bluez libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libturbojpeg0-dev ffmpeg liblapack3 liblapack-dev dbus-broker libpcap-dev libavdevice-dev libavformat-dev libavcodec-dev libavutil-dev libavfilter-dev libmariadb-dev-compat libatlas-base-dev pip python3.12-dev wget openssh-server msg_ok "Installed Dependencies" -msg_info "Installing Home Assistant-Core" +msg_info "Installing UV" +$STD pip install uv +msg_ok "Installed UV" + +msg_info "Setting up Home Assistant-Core environment" mkdir /srv/homeassistant cd /srv/homeassistant -python3 -m venv . +uv venv . &>/dev/null source bin/activate -$STD pip install webrtcvad -$STD python3 -m pip install wheel -$STD pip install homeassistant -$STD pip install mysqlclient -$STD pip install psycopg2-binary +msg_ok "Created virtual environment with UV" + +msg_info "Installing Home Assistant-Core and packages" +$STD uv pip install webrtcvad wheel homeassistant mysqlclient psycopg2-binary isal mkdir -p /root/.homeassistant -msg_ok "Installed Home Assistant-Core" +msg_ok "Installed Home Assistant-Core and required packages" msg_info "Creating Service" cat </etc/systemd/system/homeassistant.service @@ -38,7 +41,8 @@ After=network-online.target [Service] Type=simple WorkingDirectory=/root/.homeassistant -ExecStart=/srv/homeassistant/bin/hass -c "/root/.homeassistant" +Environment="PATH=/srv/homeassistant/bin:/usr/local/bin:/usr/bin:/usr/local/bin/uv" +ExecStart=/srv/homeassistant/bin/python3 -m homeassistant --config /root/.homeassistant Restart=always RestartForceExitStatus=100 [Install] diff --git a/install/k0s-install.sh b/install/k0s-install.sh deleted file mode 100644 index 1f0aa0d97..000000000 --- a/install/k0s-install.sh +++ /dev/null @@ -1,45 +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 -$STD apt-get install -y git -$STD apt-get install -y wget -$STD apt-get install -y openssh-server -msg_ok "Installed Dependencies" - -msg_info "Installing k0s Kubernetes" -$STD bash <(curl -sSLf https://get.k0s.sh) -$STD k0s install controller --single -$STD k0s start -mkdir -p /etc/k0s -k0s config create > /etc/k0s/k0s.yaml -msg_ok "Installed k0s Kubernetes" - -read -r -p "Would you like to add Helm Package Manager? " prompt -if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then -msg_info "Installing Helm" -$STD bash <(curl -sSLf https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3) -msg_ok "Installed Helm" -fi -motd_ssh -customize - -msg_info "Cleaning up" -$STD apt-get -y autoremove -$STD apt-get -y autoclean -msg_ok "Cleaned" diff --git a/install/nginxproxymanager-install.sh b/install/nginxproxymanager-install.sh index 1cdebd2d0..6e0575b00 100644 --- a/install/nginxproxymanager-install.sh +++ b/install/nginxproxymanager-install.sh @@ -38,11 +38,10 @@ $STD apt-get install -y \ python3-dev \ python3-pip \ python3-venv \ - python3-cffi \ - python3-certbot \ - python3-certbot-dns-cloudflare -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED + python3-cffi +$STD pip3 install certbot certbot-dns-multi $STD python3 -m venv /opt/certbot/ +ln -s /usr/local/bin/certbot /usr/bin/certbot rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED msg_ok "Installed Python Dependencies" diff --git a/install/paperless-ngx-install.sh b/install/paperless-ngx-install.sh index 807ec9dcd..34a8abc44 100644 --- a/install/paperless-ngx-install.sh +++ b/install/paperless-ngx-install.sh @@ -66,7 +66,7 @@ $STD apt-get install -y --no-install-recommends \ msg_ok "Installed OCR Dependencies" msg_info "Installing JBIG2" -$STD git clone https://github.com/agl/jbig2enc /opt/jbig2enc +$STD git clone https://github.com/ie13/jbig2enc /opt/jbig2enc cd /opt/jbig2enc $STD bash ./autogen.sh $STD bash ./configure diff --git a/install/spoolman-install.sh b/install/spoolman-install.sh index f2974e185..a1351d00c 100644 --- a/install/spoolman-install.sh +++ b/install/spoolman-install.sh @@ -38,7 +38,6 @@ rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED msg_ok "Installed Python3" msg_info "Installing Spoolman" -cd /opt RELEASE=$(wget -q https://github.com/Donkie/Spoolman/releases/latest -O - | grep "title>Release" | cut -d " " -f 4) wget -q https://github.com/Donkie/Spoolman/releases/download/$RELEASE/spoolman.zip unzip -q spoolman.zip -d spoolman