From 246936dfcfc74cb02494364869a0d8536f28f991 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 3 Jun 2025 16:06:28 +0200 Subject: [PATCH 01/66] Update build.func --- misc/build.func | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/misc/build.func b/misc/build.func index 531ca1a0341..00cfcf54919 100644 --- a/misc/build.func +++ b/misc/build.func @@ -2,7 +2,7 @@ # Author: tteck (tteckster) # Co-Author: MickLesk # Co-Author: michelroegl-brunner -# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/python_to_uv/LICENSE variables() { NSAPP=$(echo "${APP,,}" | tr -d ' ') # This function sets the NSAPP variable by converting the value of the APP variable to lowercase and removing any spaces. @@ -14,7 +14,7 @@ variables() { RANDOM_UUID="$(cat /proc/sys/kernel/random/uuid)" # generates a random UUID and sets it to the RANDOM_UUID variable. } -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/api.func) # This function sets various color variables using ANSI escape codes for formatting text in the terminal. color() { @@ -70,7 +70,7 @@ catch_errors() { # This function is called when an error occurs. It receives the exit code, line number, and command that caused the error, and displays an error message. error_handler() { - source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) + source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/api.func) if [ -n "$SPINNER_PID" ] && ps -p "$SPINNER_PID" >/dev/null; then kill "$SPINNER_PID" >/dev/null; fi printf "\e[?25h" local exit_code="$?" @@ -276,7 +276,7 @@ update_motd_ip() { # Function to download & save header files get_header() { local app_name=$(echo "${APP,,}" | tr -d ' ') - local header_url="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/headers/${app_name}" + local header_url="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/ct/headers/${app_name}" local local_header_path="/usr/local/community-scripts/headers/${app_name}" mkdir -p "$(dirname "$local_header_path")" @@ -952,7 +952,7 @@ install_script() { header_info echo -e "${INFO}${HOLD} ${GN}Using Config File on node $PVEHOST_NAME${CL}" METHOD="config_file" - source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/config-file.func) + source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/config-file.func) config_file break ;; @@ -1025,7 +1025,7 @@ check_container_storage() { } start() { - source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) + source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/tools.func) 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 clear @@ -1086,9 +1086,9 @@ build_container() { TEMP_DIR=$(mktemp -d) pushd "$TEMP_DIR" >/dev/null if [ "$var_os" == "alpine" ]; then - export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/alpine-install.func)" + export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/alpine-install.func)" else - export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/install.func)" + export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/install.func)" fi export RANDOM_UUID="$RANDOM_UUID" export CACHER="$APT_CACHER" @@ -1122,7 +1122,7 @@ build_container() { $PW " # This executes create_lxc.sh and creates the container and .conf file - bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/create_lxc.sh)" $? + bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/ct/create_lxc.sh)" $? LXC_CONFIG=/etc/pve/lxc/${CTID}.conf if [ "$CT_TYPE" == "0" ]; then @@ -1191,7 +1191,7 @@ http://dl-cdn.alpinelinux.org/alpine/latest-stable/community EOF' pct exec "$CTID" -- ash -c "apk add bash >/dev/null" fi - lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/"$var_install".sh)" $? + lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/install/"$var_install".sh)" $? } @@ -1204,7 +1204,7 @@ description() { cat < - Logo + Logo

${APP} LXC

From 5551c2757cfa69be4a37434d194a9c0a74587905 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 3 Jun 2025 16:07:15 +0200 Subject: [PATCH 02/66] fix testing preparation --- ct/create_lxc.sh | 2 +- misc/install.func | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ct/create_lxc.sh b/ct/create_lxc.sh index 7d0779919c2..0fd4a38a6b7 100644 --- a/ct/create_lxc.sh +++ b/ct/create_lxc.sh @@ -4,7 +4,7 @@ # Author: tteck (tteckster) # Co-Author: MickLesk # License: MIT -# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# https://github.com/community-scripts/ProxmoxVE/raw/python_to_uv/LICENSE # This sets verbose mode if the global variable is set to "yes" # if [ "$VERBOSE" == "yes" ]; then set -x; fi diff --git a/misc/install.func b/misc/install.func index 842ed4a97d0..a7c8eee86ea 100644 --- a/misc/install.func +++ b/misc/install.func @@ -2,7 +2,7 @@ # Author: tteck (tteckster) # Co-Author: MickLesk # License: MIT -# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# https://github.com/community-scripts/ProxmoxVE/raw/python_to_uv/LICENSE # This function sets color variables for formatting output in the terminal color() { @@ -69,7 +69,7 @@ catch_errors() { # This function handles errors error_handler() { - source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) + source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/api.func) if [ -n "$SPINNER_PID" ] && ps -p "$SPINNER_PID" >/dev/null; then kill "$SPINNER_PID" >/dev/null; fi printf "\e[?25h" local exit_code="$?" @@ -216,7 +216,7 @@ EOF msg_info "Installing core dependencies" $STD apt-get update $STD apt-get install -y sudo curl mc gnupg2 - source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) + source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/tools.func) msg_ok "Core dependencies installed" } @@ -267,7 +267,7 @@ EOF systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//') msg_ok "Customized Container" fi - echo "bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/${app}.sh)\"" >/usr/bin/update + echo "bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/ct/${app}.sh)\"" >/usr/bin/update chmod +x /usr/bin/update if [[ -n "${SSH_AUTHORIZED_KEY}" ]]; then From 44c98dda24cba4cdd2c34c27a705878a02c82941 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 3 Jun 2025 16:18:24 +0200 Subject: [PATCH 03/66] migrations --- ct/octoprint.sh | 42 ++++++++++++++++----------------- install/adventurelog-install.sh | 15 +++++++----- install/octoprint-install.sh | 25 ++++++++------------ install/sabnzbd-install.sh | 6 ++--- install/web-check-install.sh | 7 ++---- install/wger-install.sh | 14 +++++------ 6 files changed, 50 insertions(+), 59 deletions(-) diff --git a/ct/octoprint.sh b/ct/octoprint.sh index 01a5b36bd4d..ac3d912c6b5 100644 --- a/ct/octoprint.sh +++ b/ct/octoprint.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: tteck (tteckster) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -20,27 +20,27 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/octoprint ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Stopping OctoPrint" - systemctl stop octoprint - msg_ok "Stopped OctoPrint" + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/octoprint ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_info "Stopping OctoPrint" + systemctl stop octoprint + msg_ok "Stopped OctoPrint" - msg_info "Updating OctoPrint" - source /opt/octoprint/bin/activate - $STD pip3 install octoprint --upgrade - msg_ok "Updated OctoPrint" + msg_info "Updating OctoPrint" + source /opt/octoprint/bin/activate + $STD pip3 install octoprint --upgrade + msg_ok "Updated OctoPrint" - msg_info "Starting OctoPrint" - systemctl start octoprint - msg_ok "Started OctoPrint" - msg_ok "Updated Successfully" - exit + msg_info "Starting OctoPrint" + systemctl start octoprint + msg_ok "Started OctoPrint" + msg_ok "Updated Successfully" + exit } start @@ -50,4 +50,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5000${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5000${CL}" diff --git a/install/adventurelog-install.sh b/install/adventurelog-install.sh index a56cd6949f2..f906b09137d 100644 --- a/install/adventurelog-install.sh +++ b/install/adventurelog-install.sh @@ -23,6 +23,7 @@ $STD apt-get install -y \ python3-pip msg_ok "Installed Dependencies" +setup_uv NODE_VERSION="22" NODE_MODULE="pnpm@latest" install_node_and_modules PG_VERSION="16" PG_MODULES="postgis" install_postgresql @@ -79,11 +80,13 @@ DISABLE_REGISTRATION=False EOF cd /opt/adventurelog/backend/server mkdir -p /opt/adventurelog/backend/server/media -$STD pip install --upgrade pip -$STD pip install -r requirements.txt -$STD python3 manage.py collectstatic --noinput -$STD python3 manage.py migrate -$STD python3 manage.py download-countries +$STD uv venv /opt/adventurelog/backend/server/venv +source /opt/adventurelog/backend/server/venv/bin/activate +$STD uv pip install --upgrade pip +$STD uv pip install -r requirements.txt +$STD uv python3 manage.py collectstatic --noinput +$STD uv python3 manage.py migrate +$STD uv python3 manage.py download-countries cat </opt/adventurelog/frontend/.env PUBLIC_SERVER_URL=http://$LOCAL_IP:8000 BODY_SIZE_LIMIT=Infinity @@ -96,7 +99,7 @@ echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" msg_ok "Installed AdventureLog" msg_info "Setting up Django Admin" -$STD python3 /opt/adventurelog/backend/server/manage.py shell </etc/apt/sources.list.d/non-free.list diff --git a/install/web-check-install.sh b/install/web-check-install.sh index 6ad50f6cfb6..3556c381fd5 100644 --- a/install/web-check-install.sh +++ b/install/web-check-install.sh @@ -35,13 +35,10 @@ $STD apt-get -y install --no-install-recommends \ x11-apps msg_ok "Installed Dependencies" +setup_uv +$STD uv python install NODE_VERSION="22" NODE_MODULE="yarn@latest" install_node_and_modules -msg_info "Setup Python3" -$STD apt-get install -y python3 -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -msg_ok "Setup Python3" - msg_info "Installing Chromium" curl -fsSL https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /etc/apt/trusted.gpg.d/google-archive.gpg echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >/etc/apt/sources.list.d/google.list diff --git a/install/wger-install.sh b/install/wger-install.sh index 69eccaabda6..a70f8589bfb 100644 --- a/install/wger-install.sh +++ b/install/wger-install.sh @@ -20,11 +20,8 @@ $STD apt-get install -y \ libapache2-mod-wsgi-py3 msg_ok "Installed Dependencies" -msg_info "Installing Python" -$STD apt-get install -y python3-pip -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -msg_ok "Installed Python" - +setup_uv +$STD uv python install NODE_VERSION="22" NODE_MODULE="yarn@latest,sass" install_node_and_modules msg_info "Setting up wger" @@ -42,13 +39,14 @@ curl -fsSL "https://github.com/wger-project/wger/archive/refs/tags/$RELEASE.tar. tar xzf $RELEASE.tar.gz mv wger-$RELEASE /home/wger/src cd /home/wger/src -$STD pip install -r requirements_prod.txt -$STD pip install -e . +$STD uv venv /home/wger/.venv +$STD uv pip install -r requirements_prod.txt --python=/home/wger/.venv +$STD uv pip install -e . --python=/home/wger/.venv $STD wger create-settings --database-path /home/wger/db/database.sqlite sed -i "s#home/wger/src/media#home/wger/media#g" /home/wger/src/settings.py sed -i "/MEDIA_ROOT = '\/home\/wger\/media'/a STATIC_ROOT = '/home/wger/static'" /home/wger/src/settings.py $STD wger bootstrap -$STD python3 manage.py collectstatic +$STD uv python3 manage.py collectstatic echo "${RELEASE}" >/opt/wger_version.txt msg_ok "Finished setting up wger" From ddb01f602adce5298f28237a1e438c55dfd1fa59 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 3 Jun 2025 16:38:41 +0200 Subject: [PATCH 04/66] PYTHON_VERSION="3.12" setup_uv --- install/adventurelog-install.sh | 19 ++++++++----------- install/octoprint-install.sh | 7 +------ install/sabnzbd-install.sh | 2 +- install/wger-install.sh | 3 +-- misc/tools.func | 14 ++++++++++++++ 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/install/adventurelog-install.sh b/install/adventurelog-install.sh index f906b09137d..210b965935d 100644 --- a/install/adventurelog-install.sh +++ b/install/adventurelog-install.sh @@ -18,12 +18,10 @@ msg_info "Installing Dependencies" $STD apt-get install -y \ gdal-bin \ libgdal-dev \ - git \ - python3-venv \ - python3-pip + git msg_ok "Installed Dependencies" -setup_uv +PYTHON_VERSION="3.12" setup_uv NODE_VERSION="22" NODE_MODULE="pnpm@latest" install_node_and_modules PG_VERSION="16" PG_MODULES="postgis" install_postgresql @@ -80,13 +78,12 @@ DISABLE_REGISTRATION=False EOF cd /opt/adventurelog/backend/server mkdir -p /opt/adventurelog/backend/server/media -$STD uv venv /opt/adventurelog/backend/server/venv -source /opt/adventurelog/backend/server/venv/bin/activate +$STD uv venv --python $UV_PYTHON_VERSION /opt/adventurelog/backend/server/venv $STD uv pip install --upgrade pip $STD uv pip install -r requirements.txt -$STD uv python3 manage.py collectstatic --noinput -$STD uv python3 manage.py migrate -$STD uv python3 manage.py download-countries +$STD uv run python manage.py collectstatic --noinput +$STD uv run python manage.py migrate +$STD uv run python manage.py download-countries cat </opt/adventurelog/frontend/.env PUBLIC_SERVER_URL=http://$LOCAL_IP:8000 BODY_SIZE_LIMIT=Infinity @@ -99,7 +96,7 @@ echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" msg_ok "Installed AdventureLog" msg_info "Setting up Django Admin" -$STD uv python3 /opt/adventurelog/backend/server/manage.py shell </etc/apt/sources.list.d/non-free.list diff --git a/install/wger-install.sh b/install/wger-install.sh index a70f8589bfb..78e66215df0 100644 --- a/install/wger-install.sh +++ b/install/wger-install.sh @@ -20,8 +20,7 @@ $STD apt-get install -y \ libapache2-mod-wsgi-py3 msg_ok "Installed Dependencies" -setup_uv -$STD uv python install +PYTHON_VERSION="3.12" setup_uv NODE_VERSION="22" NODE_MODULE="yarn@latest,sass" install_node_and_modules msg_info "Setting up wger" diff --git a/misc/tools.func b/misc/tools.func index 430ff02757a..341a82159e0 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -1065,6 +1065,20 @@ function setup_uv() { # set path ensure_usr_local_bin_persist msg_ok "uv installed/updated to $LATEST_VERSION" + + if [[ -n "$PYTHON_VERSION" ]]; then + $STD msg_info "Ensuring Python $PYTHON_VERSION is available via uv..." + if ! uv python list | grep -q "cpython-${PYTHON_VERSION}-linux"; then + msg_error "Python version $PYTHON_VERSION not available via uv" + return 1 + fi + if ! uv python list | grep -q "cpython-${PYTHON_VERSION}-linux.*.local/share/uv/python"; then + $STD uv python install "$PYTHON_VERSION" + msg_ok "Installed Python $PYTHON_VERSION via uv" + else + $STD msg_ok "Python $PYTHON_VERSION already installed via uv" + fi + fi } # ------------------------------------------------------------------------------ From 128c84a79ad5b5fe658e78e828a6576df4241982 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 3 Jun 2025 16:44:45 +0200 Subject: [PATCH 05/66] more uv migrations --- install/tautulli-install.sh | 16 +++++----------- install/tianji-install.sh | 1 - install/unmanic-install.sh | 8 +++++--- install/web-check-install.sh | 3 +-- install/wger-install.sh | 12 ++++++------ 5 files changed, 17 insertions(+), 23 deletions(-) diff --git a/install/tautulli-install.sh b/install/tautulli-install.sh index 63734ddd3f6..9723018b568 100644 --- a/install/tautulli-install.sh +++ b/install/tautulli-install.sh @@ -15,22 +15,16 @@ update_os msg_info "Installing Dependencies" $STD apt-get install -y git -$STD apt-get install -y pip msg_ok "Installed Dependencies" -msg_info "Setup Python3" -$STD apt-get install -y \ - python3 \ - python3-dev \ - python3-pip -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -msg_ok "Setup Python3" +PYTHON_VERSION="3.12" setup_uv msg_info "Installing Tautulli" cd /opt $STD git clone https://github.com/Tautulli/Tautulli.git -$STD pip install -q -r /opt/Tautulli/requirements.txt -$STD pip install pyopenssl +$STD uv venv /opt/Tautulli/venv +$STD /opt/Tautulli/venv/bin/uv pip install -r /opt/Tautulli/requirements.txt +$STD /opt/Tautulli/venv/bin/uv pip install pyopenssl msg_ok "Installed Tautulli" msg_info "Creating Service" @@ -44,7 +38,7 @@ WorkingDirectory=/opt/Tautulli/ Restart=on-failure RestartSec=5 Type=simple -ExecStart=/usr/bin/python3 /opt/Tautulli/Tautulli.py +ExecStart=/opt/Tautulli/venv/bin/python /opt/Tautulli/Tautulli.py KillSignal=SIGINT TimeoutStopSec=20 SyslogIdentifier=tautulli diff --git a/install/tianji-install.sh b/install/tianji-install.sh index 56d079a38fa..af2c02d4c5c 100644 --- a/install/tianji-install.sh +++ b/install/tianji-install.sh @@ -16,7 +16,6 @@ update_os msg_info "Installing Dependencies" $STD apt-get install -y \ - python3 \ cmake \ g++ \ build-essential \ diff --git a/install/unmanic-install.sh b/install/unmanic-install.sh index 48d5da7d51b..90152be2ade 100644 --- a/install/unmanic-install.sh +++ b/install/unmanic-install.sh @@ -15,9 +15,10 @@ update_os msg_info "Installing Dependencies (Patience)" $STD apt-get install -y ffmpeg -$STD apt-get install -y python3-pip msg_ok "Installed Dependencies" +PYTHON_VERSION="3.12" setup_uv + if [[ "$CTTYPE" == "0" ]]; then msg_info "Setting Up Hardware Acceleration" $STD apt-get -y install \ @@ -33,7 +34,8 @@ if [[ "$CTTYPE" == "0" ]]; then fi msg_info "Installing Unmanic" -$STD pip3 install unmanic +uv venv /opt/unmanic/venv +/opt/unmanic/venv/bin/uv pip install unmanic sed -i -e 's/^sgx:x:104:$/render:x:104:root/' -e 's/^render:x:106:root$/sgx:x:106:/' /etc/group msg_ok "Installed Unmanic" @@ -47,7 +49,7 @@ StartLimitBurst=3 [Service] Type=simple -ExecStart=/usr/local/bin/unmanic +ExecStart=/opt/unmanic/venv/bin/unmanic Restart=always RestartSec=30 diff --git a/install/web-check-install.sh b/install/web-check-install.sh index 3556c381fd5..c6434e5715a 100644 --- a/install/web-check-install.sh +++ b/install/web-check-install.sh @@ -35,8 +35,7 @@ $STD apt-get -y install --no-install-recommends \ x11-apps msg_ok "Installed Dependencies" -setup_uv -$STD uv python install +PYTHON_VERSION="3.12" setup_uv NODE_VERSION="22" NODE_MODULE="yarn@latest" install_node_and_modules msg_info "Installing Chromium" diff --git a/install/wger-install.sh b/install/wger-install.sh index 78e66215df0..6686c6e5374 100644 --- a/install/wger-install.sh +++ b/install/wger-install.sh @@ -39,13 +39,13 @@ tar xzf $RELEASE.tar.gz mv wger-$RELEASE /home/wger/src cd /home/wger/src $STD uv venv /home/wger/.venv -$STD uv pip install -r requirements_prod.txt --python=/home/wger/.venv -$STD uv pip install -e . --python=/home/wger/.venv -$STD wger create-settings --database-path /home/wger/db/database.sqlite +$STD /home/wger/.venv/bin/uv pip install -r requirements_prod.txt +$STD /home/wger/.venv/bin/uv pip install -e . +$STD /home/wger/.venv/bin/wger create-settings --database-path /home/wger/db/database.sqlite sed -i "s#home/wger/src/media#home/wger/media#g" /home/wger/src/settings.py sed -i "/MEDIA_ROOT = '\/home\/wger\/media'/a STATIC_ROOT = '/home/wger/static'" /home/wger/src/settings.py -$STD wger bootstrap -$STD uv python3 manage.py collectstatic +$STD /home/wger/.venv/bin/wger bootstrap +$STD /home/wger/.venv/bin/uv run python manage.py collectstatic echo "${RELEASE}" >/opt/wger_version.txt msg_ok "Finished setting up wger" @@ -89,7 +89,7 @@ After=network.target [Service] Type=simple User=root -ExecStart=/usr/local/bin/wger start -a 0.0.0.0 -p 3000 +ExecStart=/home/wger/.venv/bin/wger start -a 0.0.0.0 -p 3000 Restart=always [Install] From 96511db9efea6ae7ca3b394cf304498791cebeb9 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 3 Jun 2025 16:52:02 +0200 Subject: [PATCH 06/66] next migrations --- install/stirling-pdf-install.sh | 11 +++++------ install/tandoor-install.sh | 26 ++++++++++---------------- install/tasmocompiler-install.sh | 18 +++++++----------- 3 files changed, 22 insertions(+), 33 deletions(-) diff --git a/install/stirling-pdf-install.sh b/install/stirling-pdf-install.sh index c058ab7bea0..a26327b9d8e 100644 --- a/install/stirling-pdf-install.sh +++ b/install/stirling-pdf-install.sh @@ -40,12 +40,11 @@ $STD apt-get install -y \ python3-uno msg_ok "Installed LibreOffice Components" -msg_info "Installing Python Dependencies" -$STD apt-get install -y \ - python3 \ - python3-pip -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -$STD pip3 install \ +PYTHON_VERSION="3.12" setup_uv + +msg_info "Installing Python Dependencies via uv" +uv venv /opt/stirling/venv +$STD /opt/stirling/venv/bin/uv pip install \ uno \ opencv-python-headless \ unoconv \ diff --git a/install/tandoor-install.sh b/install/tandoor-install.sh index 3673e301382..e514d17ba7a 100644 --- a/install/tandoor-install.sh +++ b/install/tandoor-install.sh @@ -32,25 +32,19 @@ $STD apt-get install -y --no-install-recommends \ libxmlsec1-openssl msg_ok "Installed Dependencies" -msg_info "Setup Python3" -$STD apt-get install -y \ - python3 \ - python3-dev \ - python3-setuptools \ - python3-pip \ - python3-xmlsec -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -msg_ok "Setup Python3" - +PYTHON_VERSION="3.12" setup_uv NODE_VERSION="20" NODE_MODULE="yarn@latest" install_node_and_modules msg_info "Installing Tandoor (Patience)" $STD git clone https://github.com/TandoorRecipes/recipes -b master /opt/tandoor mkdir -p /opt/tandoor/{config,api,mediafiles,staticfiles} -$STD pip3 install -r /opt/tandoor/requirements.txt +$STD uv venv /opt/tandoor/venv +$STD /opt/tandoor/venv/bin/uv pip install -r /opt/tandoor/requirements.txt + cd /opt/tandoor/vue $STD yarn install $STD yarn build + curl -fsSL "https://raw.githubusercontent.com/TandoorRecipes/recipes/develop/.env.template" -o "/opt/tandoor/.env" DB_NAME=db_recipes DB_USER=tandoor @@ -65,7 +59,7 @@ sed -i -e "s|SECRET_KEY=.*|SECRET_KEY=$secret_key|g" \ -e "s|POSTGRES_USER=.*|POSTGRES_USER=$DB_USER|g" \ -e "\$a\STATIC_URL=/staticfiles/" /opt/tandoor/.env cd /opt/tandoor -$STD python3 version.py +$STD /opt/tandoor/venv/bin/uv run python version.py msg_ok "Installed Tandoor" msg_info "Install/Set up PostgreSQL Database" @@ -83,9 +77,9 @@ echo -e "Tandoor Database Name: \e[32m$DB_NAME\e[0m" >>~/tandoor.creds echo -e "Tandoor Database User: \e[32m$DB_USER\e[0m" >>~/tandoor.creds echo -e "Tandoor Database Password: \e[32m$DB_PASS\e[0m" >>~/tandoor.creds export $(cat /opt/tandoor/.env | grep "^[^#]" | xargs) -/usr/bin/python3 /opt/tandoor/manage.py migrate >/dev/null 2>&1 -/usr/bin/python3 /opt/tandoor/manage.py collectstatic --no-input >/dev/null 2>&1 -/usr/bin/python3 /opt/tandoor/manage.py collectstatic_js_reverse >/dev/null 2>&1 +$STD /opt/tandoor/venv/bin/uv run python manage.py migrate +$STD /opt/tandoor/venv/bin/uv run python manage.py collectstatic --no-input +$STD /opt/tandoor/venv/bin/uv run python manage.py collectstatic_js_reverse msg_ok "Set up PostgreSQL Database" msg_info "Creating Services" @@ -100,7 +94,7 @@ Restart=always RestartSec=3 WorkingDirectory=/opt/tandoor EnvironmentFile=/opt/tandoor/.env -ExecStart=/usr/local/bin/gunicorn --error-logfile /tmp/gunicorn_err.log --log-level debug --capture-output --bind unix:/opt/tandoor/tandoor.sock recipes.wsgi:application +ExecStart=/opt/tandoor/venv/bin/gunicorn --error-logfile /tmp/gunicorn_err.log --log-level debug --capture-output --bind unix:/opt/tandoor/tandoor.sock recipes.wsgi:application [Install] WantedBy=multi-user.target diff --git a/install/tasmocompiler-install.sh b/install/tasmocompiler-install.sh index 1ba241f0bb8..a4ad1015855 100644 --- a/install/tasmocompiler-install.sh +++ b/install/tasmocompiler-install.sh @@ -14,19 +14,15 @@ network_check update_os msg_info "Installing Dependencies. Patience" -$STD apt-get install -y \ - git +$STD apt-get install -y git msg_ok "Installed Dependencies" -msg_info "Setup Python3" -$STD apt-get install -y python3-venv -msg_ok "Setup Python3" - +PYTHON_VERSION="3.12" setup_uv NODE_VERSION="22" NODE_MODULE="yarn@latest" install_node_and_modules msg_info "Setup Platformio" -curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -$STD python3 get-platformio.py +uv venv /opt/tasmocompiler/venv +$STD /opt/tasmocompiler/venv/bin/uv pip install platformio msg_ok "Setup Platformio" msg_info "Setup TasmoCompiler" @@ -42,9 +38,9 @@ export NODE_OPTIONS=--openssl-legacy-provider $STD npm i $STD yarn build mkdir -p /usr/local/bin -ln -s ~/.platformio/penv/bin/platformio /usr/local/bin/platformio -ln -s ~/.platformio/penv/bin/pio /usr/local/bin/pio -ln -s ~/.platformio/penv/bin/piodebuggdb /usr/local/bin/piodebuggdb +ln -sf /opt/tasmocompiler/venv/bin/platformio /usr/local/bin/platformio +ln -sf /opt/tasmocompiler/venv/bin/pio /usr/local/bin/pio +ln -sf /opt/tasmocompiler/venv/bin/piodebuggdb /usr/local/bin/piodebuggdb echo "${RELEASE}" >"/opt/tasmocompiler_version.txt" msg_ok "Setup TasmoCompiler" From 5965a426ff9fce04e49fb7a394f32ef49e656141 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 3 Jun 2025 17:04:15 +0200 Subject: [PATCH 07/66] more uv migrations --- install/paperless-ngx-install.sh | 21 ++++++--------------- install/prometheus-pve-exporter-install.sh | 11 +++-------- install/radicale-install.sh | 22 +++++++++------------- install/searxng-install.sh | 19 ++++++------------- install/slskd-install.sh | 16 +++++++--------- install/spoolman-install.sh | 17 +++++++---------- 6 files changed, 38 insertions(+), 68 deletions(-) diff --git a/install/paperless-ngx-install.sh b/install/paperless-ngx-install.sh index 541aa4b2abf..d4ad4cba9f5 100644 --- a/install/paperless-ngx-install.sh +++ b/install/paperless-ngx-install.sh @@ -35,17 +35,9 @@ $STD apt-get install -y \ libleptonica-dev msg_ok "Installed Dependencies" +PYTHON_VERSION="3.12" setup_uv PG_VERSION="16" install_postgresql -msg_info "Setup Python3" -$STD apt-get install -y \ - python3 \ - python3-pip \ - python3-dev \ - python3-setuptools \ - python3-wheel -msg_ok "Setup Python3" - msg_info "Installing OCR Dependencies (Patience)" $STD apt-get install -y \ unpaper \ @@ -85,8 +77,7 @@ $STD tar -xf "paperless-ngx-$Paperlessngx.tar.xz" -C /opt/ mv paperless-ngx paperless rm "paperless-ngx-$Paperlessngx.tar.xz" cd /opt/paperless -$STD pip install --upgrade pip -$STD pip install -r requirements.txt +$STD uv sync curl -fsSL "https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/paperless.conf.example" -o /opt/paperless/paperless.conf mkdir -p {consume,data,media,static} sed -i -e 's|#PAPERLESS_REDIS=redis://localhost:6379|PAPERLESS_REDIS=redis://localhost:6379|' /opt/paperless/paperless.conf @@ -98,7 +89,7 @@ echo "${Paperlessngx}" >/opt/"${APPLICATION}"_version.txt msg_ok "Installed Paperless-ngx" msg_info "Installing Natural Language Toolkit (Patience)" -$STD python3 -m nltk.downloader -d /usr/share/nltk_data all +$STD /opt/paperless/.venv/bin/python -m nltk.downloader -d /usr/share/nltk_data all msg_ok "Installed Natural Language Toolkit" msg_info "Setting up PostgreSQL database" @@ -122,7 +113,7 @@ sed -i -e "s|#PAPERLESS_DBUSER=paperless|PAPERLESS_DBUSER=$DB_USER|" /opt/paperl sed -i -e "s|#PAPERLESS_DBPASS=paperless|PAPERLESS_DBPASS=$DB_PASS|" /opt/paperless/paperless.conf sed -i -e "s|#PAPERLESS_SECRET_KEY=change-me|PAPERLESS_SECRET_KEY=$SECRET_KEY|" /opt/paperless/paperless.conf cd /opt/paperless/src -$STD python3 manage.py migrate +$STD /opt/paperless/.venv/bin/python manage.py migrate msg_ok "Set up PostgreSQL database" read -r -p "${TAB3}Would you like to add Adminer? " prompt @@ -144,7 +135,7 @@ fi msg_info "Setting up admin Paperless-ngx User & Password" ## From https://github.com/linuxserver/docker-paperless-ngx/blob/main/root/etc/cont-init.d/99-migrations -cat </opt/prometheus-pve-exporter/pve.yml default: @@ -42,7 +37,7 @@ After=syslog.target network.target User=root Restart=always Type=simple -ExecStart=pve_exporter \ +ExecStart=/usr/local/bin/uv run pve_exporter \ --config.file=/opt/prometheus-pve-exporter/pve.yml \ --web.listen-address=0.0.0.0:9221 ExecReload=/bin/kill -HUP \$MAINPID diff --git a/install/radicale-install.sh b/install/radicale-install.sh index bed34b116ea..c8e374c1196 100644 --- a/install/radicale-install.sh +++ b/install/radicale-install.sh @@ -15,17 +15,16 @@ update_os msg_info "Installing Dependencies" $STD apt-get install -y \ - apache2-utils \ - python3-pip \ - python3.11-venv + apache2-utils msg_ok "Installed Dependencies" +PYTHON_VERSION="3.12" setup_uv + msg_info "Setting up Radicale" -python3 -m venv /opt/radicale -source /opt/radicale/bin/activate -$STD python3 -m pip install --upgrade https://github.com/Kozea/Radicale/archive/master.tar.gz +$STD uv venv /opt/radicale +$STD /opt/radicale/bin/uv pip install --upgrade https://github.com/Kozea/Radicale/archive/master.tar.gz RNDPASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) -$STD htpasswd -c -b -5 /opt/radicale/users admin $RNDPASS +$STD htpasswd -c -b -5 /opt/radicale/users admin "$RNDPASS" { echo "Radicale Credentials" echo "Admin User: admin" @@ -34,16 +33,15 @@ $STD htpasswd -c -b -5 /opt/radicale/users admin $RNDPASS msg_ok "Done setting up Radicale" msg_info "Setup Service" - cat </opt/radicale/start.sh #!/usr/bin/env bash -source /opt/radicale/bin/activate -python3 -m radicale --storage-filesystem-folder=/var/lib/radicale/collections --hosts 0.0.0.0:5232 --auth-type htpasswd --auth-htpasswd-filename /opt/radicale/users --auth-htpasswd-encryption sha512 +/opt/radicale/bin/uv run -m radicale --storage-filesystem-folder=/var/lib/radicale/collections --hosts 0.0.0.0:5232 --auth-type htpasswd --auth-htpasswd-filename /opt/radicale/users --auth-htpasswd-encryption sha512 EOF chmod +x /opt/radicale/start.sh cat </etc/systemd/system/radicale.service +[Unit] Description=A simple CalDAV (calendar) and CardDAV (contact) server After=network.target Requires=network.target @@ -51,13 +49,11 @@ Requires=network.target [Service] ExecStart=/opt/radicale/start.sh Restart=on-failure -# User=radicale -# Deny other users access to the calendar data -# UMask=0027 [Install] WantedBy=multi-user.target EOF + systemctl enable -q --now radicale msg_ok "Created Service" diff --git a/install/searxng-install.sh b/install/searxng-install.sh index 0d955cb2026..e3a4fc97260 100644 --- a/install/searxng-install.sh +++ b/install/searxng-install.sh @@ -22,13 +22,7 @@ $STD apt-get install -y \ git msg_ok "Installed Dependencies" -msg_info "Setup Python3" -$STD apt-get install -y \ - python3 \ - python3-{pip,venv,yaml,dev} -$STD pip install --upgrade pip setuptools wheel -$STD pip install pyyaml -msg_ok "Setup Python3" +PYTHON_VERSION="3.12" setup_uv msg_info "Setup SearXNG" mkdir -p /usr/local/searxng /etc/searxng @@ -36,11 +30,10 @@ useradd -d /etc/searxng searxng chown searxng:searxng /usr/local/searxng /etc/searxng $STD git clone https://github.com/searxng/searxng.git /usr/local/searxng/searxng-src cd /usr/local/searxng/ -sudo -u searxng python3 -m venv /usr/local/searxng/searx-pyenv -source /usr/local/searxng/searx-pyenv/bin/activate -$STD pip install --upgrade pip setuptools wheel -$STD pip install pyyaml -$STD pip install --use-pep517 --no-build-isolation -e /usr/local/searxng/searxng-src +$STD uv venv /usr/local/searxng/searx-pyenv +$STD /usr/local/searxng/searx-pyenv/bin/uv pip install --upgrade pip setuptools wheel pyyaml +$STD /usr/local/searxng/searx-pyenv/bin/uv pip install --use-pep517 --no-build-isolation -e /usr/local/searxng/searxng-src + SECRET_KEY=$(openssl rand -hex 32) cat </etc/searxng/settings.yml # SearXNG settings @@ -94,7 +87,7 @@ Type=simple User=searxng Group=searxng Environment="SEARXNG_SETTINGS_PATH=/etc/searxng/settings.yml" -ExecStart=/usr/local/searxng/searx-pyenv/bin/python -m searx.webapp +ExecStart=/usr/local/searxng/searx-pyenv/bin/uv run -m searx.webapp WorkingDirectory=/usr/local/searxng/searxng-src Restart=always diff --git a/install/slskd-install.sh b/install/slskd-install.sh index b4b3d8b129a..d064fb7cbc3 100644 --- a/install/slskd-install.sh +++ b/install/slskd-install.sh @@ -13,10 +13,7 @@ setting_up_container network_check update_os -msg_info "Installing Dependencies" -$STD apt-get install -y \ - python3-pip -msg_ok "Installed Dependencies" +PYTHON_VERSION="3.12" setup_uv msg_info "Setup ${APPLICATION}" tmp_file=$(mktemp) @@ -40,13 +37,13 @@ sed -i \ msg_ok "Setup ${APPLICATION}" msg_info "Installing Soularr" -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED cd /tmp curl -fsSL -o main.zip https://github.com/mrusse/soularr/archive/refs/heads/main.zip $STD unzip main.zip mv soularr-main /opt/soularr cd /opt/soularr -$STD pip install -r requirements.txt +$STD uv venv /opt/soularr/venv +$STD /opt/soularr/venv/bin/uv pip install -r requirements.txt sed -i \ -e "\|[Slskd]|,\|host_url|s|yourslskdapikeygoeshere|$SLSKD_API_KEY|" \ -e "/host_url/s/slskd/localhost/" \ @@ -54,7 +51,7 @@ sed -i \ sed -i \ -e "/#This\|#Default\|INTERVAL/{N;d;}" \ -e "/while\|#Pass/d" \ - -e "\|python|s|app|opt/soularr|; s|python|python3|" \ + -e "\|python|s|app|opt/soularr|; s|python|/opt/soularr/venv/bin/python3|" \ -e "/dt/,+2d" \ /opt/soularr/run.sh sed -i -E "/(soularr.py)/s/.{5}$//; /if/,/fi/s/.{4}//" /opt/soularr/run.sh @@ -106,6 +103,7 @@ ExecStart=/bin/bash -c /opt/soularr/run.sh [Install] WantedBy=multi-user.target EOF + systemctl enable -q --now ${APPLICATION} systemctl enable -q soularr.timer msg_ok "Created Services" @@ -114,8 +112,8 @@ motd_ssh customize msg_info "Cleaning up" -rm -rf $tmp_file -rm -rf /tmp/main.zip +rm -f $tmp_file +rm -f /tmp/main.zip $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned" diff --git a/install/spoolman-install.sh b/install/spoolman-install.sh index 4a70725bfa3..beee29ed21c 100644 --- a/install/spoolman-install.sh +++ b/install/spoolman-install.sh @@ -22,22 +22,17 @@ $STD apt-get install -y \ ca-certificates msg_ok "Installed Dependencies" -msg_info "Setup Python3" -$STD apt-get install -y \ - python3-dev \ - python3-setuptools \ - python3-wheel \ - python3-pip -msg_ok "Setup Python3" +PYTHON_VERSION="3.12" setup_uv msg_info "Installing Spoolman" RELEASE=$(curl -fsSL https://github.com/Donkie/Spoolman/releases/latest | grep "title>Release" | cut -d " " -f 4) cd /opt curl -fsSL "https://github.com/Donkie/Spoolman/releases/download/$RELEASE/spoolman.zip" -o "spoolman.zip" $STD unzip spoolman.zip -d spoolman -rm -rf spoolman.zip +rm -f spoolman.zip cd spoolman -$STD pip3 install -r requirements.txt +$STD uv venv /opt/spoolman/venv +$STD /opt/spoolman/venv/bin/uv pip install -r requirements.txt curl -fsSL "https://raw.githubusercontent.com/Donkie/Spoolman/master/.env.example" -o ".env" echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Installed Spoolman" @@ -47,13 +42,15 @@ cat </etc/systemd/system/spoolman.service [Unit] Description=Spoolman After=network.target + [Service] Type=simple WorkingDirectory=/opt/spoolman EnvironmentFile=/opt/spoolman/.env -ExecStart=uvicorn spoolman.main:app --host 0.0.0.0 --port 7912 +ExecStart=/opt/spoolman/venv/bin/uvicorn spoolman.main:app --host 0.0.0.0 --port 7912 Restart=always User=root + [Install] WantedBy=multi-user.target EOF From a7f4bf28430cd4f10d6c3179b333e3dc8872556c Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 3 Jun 2025 17:11:04 +0200 Subject: [PATCH 08/66] more uv mig --- install/archivebox-install.sh | 40 +++++++++++++++++------------------ install/pialert-install.sh | 25 ++++++++++------------ 2 files changed, 31 insertions(+), 34 deletions(-) diff --git a/install/archivebox-install.sh b/install/archivebox-install.sh index d1700cab2e0..b7ef3827d51 100644 --- a/install/archivebox-install.sh +++ b/install/archivebox-install.sh @@ -25,34 +25,33 @@ $STD apt-get install -y \ ripgrep msg_ok "Installed Dependencies" -msg_info "Installing Python Dependencies" -$STD apt-get install -y \ - python3-pip \ - python3-ldap \ - python3-msgpack \ - python3-regex -msg_ok "Installed Python Dependencies" - NODE_VERSION="22" install_node_and_modules -msg_info "Installing Playwright" -$STD pip install playwright -$STD playwright install-deps chromium -msg_ok "Installed Playwright" - -msg_info "Installing Chromium and ArchiveBox" +msg_info "Installing ArchiveBox Python Environment" mkdir -p /opt/archivebox/{data,.npm,.cache,.local} -$STD adduser --system --shell /bin/bash --gecos 'Archive Box User' --group --disabled-password --home /home/archivebox archivebox +adduser --system --shell /bin/bash --gecos 'Archive Box User' --group --disabled-password --home /home/archivebox archivebox chown -R archivebox:archivebox /opt/archivebox/{data,.npm,.cache,.local} chmod -R 755 /opt/archivebox/data -$STD pip install archivebox + +cd /opt/archivebox +PYTHON_VERSION="3.12" setup_uv + +msg_info "Installing ArchiveBox & Playwright (Patience)" cd /opt/archivebox/data +cp /opt/archivebox/uv.lock . || true +$STD /opt/archivebox/.venv/bin/uv sync +sudo -u archivebox /opt/archivebox/.venv/bin/playwright install-deps chromium +msg_ok "Installed ArchiveBox & Playwright" + +msg_info "Initial ArchiveBox Setup" expect </etc/systemd/system/archivebox.service @@ -79,12 +78,13 @@ After=network.target [Service] User=archivebox WorkingDirectory=/opt/archivebox/data -ExecStart=/usr/local/bin/archivebox server 0.0.0.0:8000 +ExecStart=/opt/archivebox/.venv/bin/archivebox server 0.0.0.0:8000 Restart=always [Install] WantedBy=multi-user.target EOF + systemctl enable -q --now archivebox msg_ok "Created Service" diff --git a/install/pialert-install.sh b/install/pialert-install.sh index 3bd6c555a8d..c5c4c057a8a 100644 --- a/install/pialert-install.sh +++ b/install/pialert-install.sh @@ -42,17 +42,14 @@ $STD lighttpd-enable-mod fastcgi-php service lighttpd force-reload msg_ok "Installed PHP Dependencies" +PYTHON_VERSION="3.12" setup_uv + msg_info "Installing Python Dependencies" -$STD apt-get -y install \ - python3-pip \ - python3-requests \ - python3-tz \ - python3-tzlocal -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -$STD pip3 install mac-vendor-lookup -$STD pip3 install fritzconnection -$STD pip3 install cryptography -$STD pip3 install pyunifi +source /opt/pialert/.venv/bin/activate +$STD uv pip install mac-vendor-lookup +$STD uv pip install fritzconnection +$STD uv pip install cryptography +$STD uv pip install pyunifi msg_ok "Installed Python Dependencies" msg_info "Installing Pi.Alert" @@ -75,7 +72,7 @@ done sed -i 's#PIALERT_PATH\s*=\s*'\''/home/pi/pialert'\''#PIALERT_PATH = '\''/opt/pialert'\''#' /opt/pialert/config/pialert.conf sed -i 's/$HOME/\/opt/g' /opt/pialert/install/pialert.cron crontab /opt/pialert/install/pialert.cron -echo "python3 /opt/pialert/back/pialert.py 1" >/usr/bin/scan +echo "/opt/pialert/.venv/bin/python /opt/pialert/back/pialert.py 1" >/usr/bin/scan chmod +x /usr/bin/scan echo "/opt/pialert/back/pialert-cli set_permissions --lxc" >/usr/bin/permissions chmod +x /usr/bin/permissions @@ -84,9 +81,9 @@ chmod +x /usr/bin/sudoers msg_ok "Installed Pi.Alert" msg_info "Start Pi.Alert Scan (Patience)" -$STD python3 /opt/pialert/back/pialert.py update_vendors -$STD python3 /opt/pialert/back/pialert.py internet_IP -$STD python3 /opt/pialert/back/pialert.py 1 +$STD /opt/pialert/.venv/bin/python /opt/pialert/back/pialert.py update_vendors +$STD /opt/pialert/.venv/bin/python /opt/pialert/back/pialert.py internet_IP +$STD /opt/pialert/.venv/bin/python /opt/pialert/back/pialert.py 1 msg_ok "Finished Pi.Alert Scan" motd_ssh From 594dc3c9d5fb9c495724affe3d8c00b29177c634 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 3 Jun 2025 17:14:13 +0200 Subject: [PATCH 09/66] Update netbox-install.sh --- install/netbox-install.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/install/netbox-install.sh b/install/netbox-install.sh index 6a3499c4cbb..8522682e6b4 100644 --- a/install/netbox-install.sh +++ b/install/netbox-install.sh @@ -27,14 +27,7 @@ $STD apt-get install -y \ msg_ok "Installed Dependencies" PG_VERSION="16" install_postgresql - -msg_info "Installing Python" -$STD apt-get install -y \ - python3 \ - python3-pip \ - python3-venv \ - python3-dev -msg_ok "Installed Python" +PYTHON_VERSION="3.12" setup_uv msg_info "Setting up PostgreSQL" DB_NAME=netbox @@ -64,7 +57,7 @@ chown --recursive netbox /opt/netbox/netbox/scripts/ mv /opt/netbox/netbox/netbox/configuration_example.py /opt/netbox/netbox/netbox/configuration.py -SECRET_KEY=$(python3 /opt/netbox/netbox/generate_secret_key.py) +SECRET_KEY=$(/opt/netbox/.venv/bin/python /opt/netbox/netbox/generate_secret_key.py) ESCAPED_SECRET_KEY=$(printf '%s\n' "$SECRET_KEY" | sed 's/[&/\]/\\&/g') sed -i 's/ALLOWED_HOSTS = \[\]/ALLOWED_HOSTS = ["*"]/' /opt/netbox/netbox/netbox/configuration.py @@ -95,7 +88,7 @@ DJANGO_USER=Admin DJANGO_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13) source /opt/netbox/venv/bin/activate -$STD python3 /opt/netbox/netbox/manage.py shell < Date: Wed, 4 Jun 2025 08:28:27 +0200 Subject: [PATCH 10/66] more uv migs --- install/babybuddy-install.sh | 13 ++++++------- install/bazarr-install.sh | 13 ++++--------- install/changedetection-install.sh | 19 +++++++------------ 3 files changed, 17 insertions(+), 28 deletions(-) diff --git a/install/babybuddy-install.sh b/install/babybuddy-install.sh index 424edaa119f..7fb7cf46c05 100644 --- a/install/babybuddy-install.sh +++ b/install/babybuddy-install.sh @@ -19,11 +19,10 @@ $STD apt-get install -y \ uwsgi-plugin-python3 \ libopenjp2-7-dev \ libpq-dev \ - nginx \ - python3 + nginx msg_ok "Installed Dependencies" -setup_uv +PYTHON_VERSION="3.12" setup_uv msg_info "Installing Babybuddy" RELEASE=$(curl -fsSL https://api.github.com/repos/babybuddy/babybuddy/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') @@ -33,8 +32,8 @@ curl -fsSL "https://github.com/babybuddy/babybuddy/archive/refs/tags/v${RELEASE} tar zxf "$temp_file" --strip-components=1 -C /opt/babybuddy cd /opt/babybuddy $STD uv venv .venv -$STD source .venv/bin/activate -$STD uv pip install -r requirements.txt +$STD .venv/bin/uv pip install -r requirements.txt + cp babybuddy/settings/production.example.py babybuddy/settings/production.py SECRET_KEY=$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-32) ALLOWED_HOSTS=$(hostname -I | tr ' ' ',' | sed 's/,$//')",127.0.0.1,localhost" @@ -44,7 +43,7 @@ sed -i \ babybuddy/settings/production.py export DJANGO_SETTINGS_MODULE=babybuddy.settings.production -$STD python manage.py migrate +$STD /opt/babybuddy/.venv/bin/python manage.py migrate chown -R www-data:www-data /opt/data chmod 640 /opt/data/db.sqlite3 chmod 750 /opt/data @@ -93,7 +92,7 @@ server { EOF ln -sf /etc/nginx/sites-available/babybuddy /etc/nginx/sites-enabled/babybuddy -rm /etc/nginx/sites-enabled/default +rm -f /etc/nginx/sites-enabled/default systemctl enable -q --now nginx service nginx reload msg_ok "Configured NGINX" diff --git a/install/bazarr-install.sh b/install/bazarr-install.sh index 7837b815384..cdf17e8c749 100755 --- a/install/bazarr-install.sh +++ b/install/bazarr-install.sh @@ -13,20 +13,15 @@ setting_up_container network_check update_os -msg_info "Setup Python3" -$STD apt-get install -y \ - python3 \ - python3-dev \ - python3-pip -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -msg_ok "Setup Python3" +PYTHON_VERSION="3.12" setup_uv msg_info "Installing Bazarr" mkdir -p /var/lib/bazarr/ curl -fsSL "https://github.com/morpheus65535/bazarr/releases/latest/download/bazarr.zip" -o "bazarr.zip" $STD unzip bazarr -d /opt/bazarr chmod 775 /opt/bazarr /var/lib/bazarr/ -$STD python3 -m pip install -q -r /opt/bazarr/requirements.txt +cd /opt/bazarr +$STD /opt/bazarr/.venv/bin/uv pip install -r requirements.txt msg_ok "Installed Bazarr" msg_info "Creating Service" @@ -41,7 +36,7 @@ UMask=0002 Restart=on-failure RestartSec=5 Type=simple -ExecStart=/usr/bin/python3 /opt/bazarr/bazarr.py +ExecStart=/opt/bazarr/.venv/bin/python /opt/bazarr/bazarr.py KillSignal=SIGINT TimeoutStopSec=20 SyslogIdentifier=bazarr diff --git a/install/changedetection-install.sh b/install/changedetection-install.sh index 976b6159d7a..245a05c05af 100644 --- a/install/changedetection-install.sh +++ b/install/changedetection-install.sh @@ -43,24 +43,19 @@ $STD apt-get install -y \ ca-certificates msg_ok "Installed Dependencies" -msg_info "Setup Python3" -$STD apt-get install -y \ - python3 \ - python3-dev \ - python3-pip -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -msg_ok "Setup Python3" - +PYTHON_VERSION="3.12" setup_uv NODE_VERSION="22" install_node_and_modules msg_info "Installing Change Detection" -mkdir /opt/changedetection -$STD pip3 install changedetection.io +mkdir -p /opt/changedetection +cd /opt/changedetection +$STD uv venv .venv +$STD /opt/changedetection/.venv/bin/uv pip install changedetection.io msg_ok "Installed Change Detection" msg_info "Installing Browserless & Playwright" mkdir /opt/browserless -$STD python3 -m pip install playwright +$STD /opt/paperless/.venv/bin/uv pip install playwright $STD git clone https://github.com/browserless/chrome /opt/browserless $STD npm install --prefix /opt/browserless $STD /opt/browserless/node_modules/playwright-core/cli.js install --with-deps &>/dev/null @@ -117,7 +112,7 @@ Type=simple WorkingDirectory=/opt/changedetection Environment=WEBDRIVER_URL=http://127.0.0.1:4444/wd/hub Environment=PLAYWRIGHT_DRIVER_URL=ws://localhost:3000/chrome?launch={"defaultViewport":{"height":720,"width":1280},"headless":false,"stealth":true}&blockAds=true -ExecStart=changedetection.io -d /opt/changedetection -p 5000 +ExecStart=/opt/changedetection/.venv/bin/changedetection.io -d /opt/changedetection -p 5000 [Install] WantedBy=multi-user.target EOF From 9d9b810480b1e9e9d24b0c4e6afcf177af93c448 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 08:48:00 +0200 Subject: [PATCH 11/66] more migrations --- install/calibre-web-install.sh | 15 ++++++-------- install/crafty-controller-install.sh | 21 +++++++------------ install/deluge-install.sh | 31 ++++++++++++++-------------- install/metube-install.sh | 19 ++++++----------- install/motioneye-install.sh | 14 ++++++------- install/mylar3-install.sh | 12 +++++------ install/openwebui-install.sh | 12 ++++------- install/paperless-ai-install.sh | 12 +++++------ 8 files changed, 54 insertions(+), 82 deletions(-) diff --git a/install/calibre-web-install.sh b/install/calibre-web-install.sh index ff4d47dd79b..905cd6324b9 100644 --- a/install/calibre-web-install.sh +++ b/install/calibre-web-install.sh @@ -15,13 +15,10 @@ network_check update_os msg_info "Installing Dependencies" -$STD apt-get install -y imagemagick +$STD apt-get install -y imagemagick calibre msg_ok "Installed Dependencies" -msg_info "Installing Python Dependencies" -$STD apt-get -y install python3-pip -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -msg_ok "Installed Python Dependencies" +PYTHON_VERSION="3.12" setup_uv msg_info "Installing Kepubify" mkdir -p /opt/kepubify @@ -32,10 +29,10 @@ msg_ok "Installed Kepubify" msg_info "Installing Calibre-Web" mkdir -p /opt/calibre-web -$STD apt-get install -y calibre $STD curl -fsSL https://github.com/janeczku/calibre-web/raw/master/library/metadata.db -o /opt/calibre-web/metadata.db -$STD pip install calibreweb -$STD pip install jsonschema +cd /opt/calibre-web +$STD uv venv .venv +$STD .venv/bin/uv pip install calibreweb jsonschema msg_ok "Installed Calibre-Web" msg_info "Creating Service" @@ -47,7 +44,7 @@ After=network.target [Service] Type=simple WorkingDirectory=/opt/calibre-web -ExecStart=/usr/local/bin/cps +ExecStart=/opt/calibre-web/.venv/bin/cps TimeoutStopSec=20 KillMode=process Restart=on-failure diff --git a/install/crafty-controller-install.sh b/install/crafty-controller-install.sh index d12e9ae6fd7..7273a7af355 100644 --- a/install/crafty-controller-install.sh +++ b/install/crafty-controller-install.sh @@ -13,7 +13,7 @@ setting_up_container network_check update_os -msg_info "Installing Dependencies (a lot of patience)" +msg_info "Installing Dependencies (Patience)" $STD apt-get install -y \ git \ sed \ @@ -32,20 +32,13 @@ $STD apt-get install -y temurin-{8,11,17,21}-jre sudo update-alternatives --set java /usr/lib/jvm/temurin-21-jre-amd64/bin/java msg_ok "Installed TemurinJDK" -msg_info "Setup Python3" -$STD apt-get install -y \ - python3 \ - python3-dev \ - python3-pip \ - python3-venv -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -msg_ok "Setup Python3" +PYTHON_VERSION="3.12" setup_uv msg_info "Installing Craty-Controller (Patience)" useradd crafty -m -s /bin/bash cd /opt mkdir -p /opt/crafty-controller/crafty /opt/crafty-controller/server -RELEASE=$(curl -fsSL "https://gitlab.com/api/v4/projects/20430749/releases" | grep -o '"tag_name":"v[^"]*"' | head -n 1 | sed 's/"tag_name":"v//;s/"//') +RELEASE=$(curl -fsSL "https://gitlab.com/api/v4/projects/20430749/releases" | grep -o '"tag_name":"v[^\"]*"' | head -n 1 | sed 's/"tag_name":"v//;s/"//') echo "${RELEASE}" >"/opt/crafty-controller_version.txt" curl -fsSL "https://gitlab.com/crafty-controller/crafty-4/-/archive/v${RELEASE}/crafty-4-v${RELEASE}.zip" -o "crafty-4-v${RELEASE}.zip" $STD unzip crafty-4-v${RELEASE}.zip @@ -53,12 +46,12 @@ cp -a crafty-4-v${RELEASE}/. /opt/crafty-controller/crafty/crafty-4/ rm -rf crafty-4-v${RELEASE} cd /opt/crafty-controller/crafty -python3 -m venv .venv +$STD uv venv .venv chown -R crafty:crafty /opt/crafty-controller/ $STD sudo -u crafty bash -c ' source /opt/crafty-controller/crafty/.venv/bin/activate cd /opt/crafty-controller/crafty/crafty-4 - pip3 install --no-cache-dir -r requirements.txt + /opt/crafty-controller/crafty/.venv/bin/uv pip install --no-cache-dir -r requirements.txt ' msg_ok "Installed Craft-Controller and dependencies" @@ -83,8 +76,8 @@ $STD systemctl enable -q --now crafty-controller sleep 10 { echo "Crafty-Controller-Credentials" - echo "Username: $(grep -oP '(?<="username": ")[^"]*' /opt/crafty-controller/crafty/crafty-4/app/config/default-creds.txt)" - echo "Password: $(grep -oP '(?<="password": ")[^"]*' /opt/crafty-controller/crafty/crafty-4/app/config/default-creds.txt)" + echo "Username: $(grep -oP '(?<="username": \")[^\"]*' /opt/crafty-controller/crafty/crafty-4/app/config/default-creds.txt)" + echo "Password: $(grep -oP '(?<="password": \")[^\"]*' /opt/crafty-controller/crafty/crafty-4/app/config/default-creds.txt)" } >>~/crafty-controller.creds msg_ok "Crafty-Controller service started" diff --git a/install/deluge-install.sh b/install/deluge-install.sh index f8ebab68154..21cac7b5b29 100644 --- a/install/deluge-install.sh +++ b/install/deluge-install.sh @@ -17,21 +17,18 @@ msg_info "Installing Dependencies" $STD apt-get install -y python3-libtorrent msg_ok "Installed Dependencies" -msg_info "Setup Python3" -$STD apt-get install -y \ - python3 \ - python3-dev \ - python3-pip -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -msg_ok "Setup Python3" +PYTHON_VERSION="3.12" setup_uv msg_info "Installing Deluge" -$STD pip install deluge[all] +mkdir -p /opt/deluge +$STD uv venv /opt/deluge/.venv +source /opt/deluge/.venv/bin/activate +$STD /opt/deluge/.venv/bin/uv pip install deluge[all] msg_ok "Installed Deluge" msg_info "Creating Service" -service_path="/etc/systemd/system/deluged.service" -echo "[Unit] +cat </etc/systemd/system/deluged.service +[Unit] Description=Deluge Bittorrent Client Daemon Documentation=man:deluged After=network-online.target @@ -39,15 +36,16 @@ After=network-online.target [Service] Type=simple UMask=007 -ExecStart=/usr/local/bin/deluged -d +ExecStart=/opt/deluge/.venv/bin/deluged -d Restart=on-failure TimeoutStopSec=300 [Install] -WantedBy=multi-user.target" >$service_path +WantedBy=multi-user.target +EOF -service_path="/etc/systemd/system/deluge-web.service" -echo "[Unit] +cat </etc/systemd/system/deluge-web.service +[Unit] Description=Deluge Bittorrent Client Web Interface Documentation=man:deluge-web After=deluged.service @@ -56,11 +54,12 @@ Wants=deluged.service [Service] Type=simple UMask=027 -ExecStart=/usr/local/bin/deluge-web -d +ExecStart=/opt/deluge/.venv/bin/deluge-web -d Restart=on-failure [Install] -WantedBy=multi-user.target" >$service_path +WantedBy=multi-u + systemctl enable --now -q deluged.service systemctl enable --now -q deluge-web.service msg_ok "Created Service" diff --git a/install/metube-install.sh b/install/metube-install.sh index 34910d44914..bf1bc2ecce2 100644 --- a/install/metube-install.sh +++ b/install/metube-install.sh @@ -1,8 +1,7 @@ #!/usr/bin/env bash # Copyright (c) 2021-2025 tteck -# Author: tteck -# Co-Author: MickLesk (Canbiz) +# Author: MickLesk (Canbiz) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://github.com/alexta69/metube @@ -28,14 +27,7 @@ $STD apt-get install -y --no-install-recommends \ ca-certificates msg_ok "Installed Dependencies" -msg_info "Setup Python3" -$STD apt-get install -y \ - python3 \ - python3-dev \ - python3-pip \ - python3-venv -msg_ok "Setup Python3" - +PYTHON_VERSION="3.12" setup_uv NODE_VERSION="22" install_node_and_modules msg_info "Installing MeTube" @@ -44,8 +36,9 @@ cd /opt/metube/ui $STD npm install $STD node_modules/.bin/ng build cd /opt/metube -$STD pip3 install pipenv -$STD pipenv install +$STD uv venv .venv +$STD .venv/bin/uv pip install pipenv +$STD .venv/bin/pipenv install mkdir -p /opt/metube_downloads /opt/metube_downloads/.metube /opt/metube_downloads/music /opt/metube_downloads/videos cat </opt/metube/.env DOWNLOAD_DIR=/opt/metube_downloads @@ -65,7 +58,7 @@ After=network.target Type=simple WorkingDirectory=/opt/metube EnvironmentFile=/opt/metube/.env -ExecStart=/usr/local/bin/pipenv run python3 app/main.py +ExecStart=/opt/metube/.venv/bin/pipenv run python3 app/main.py Restart=always User=root diff --git a/install/motioneye-install.sh b/install/motioneye-install.sh index 47b6f8ff7bb..d7e69ccf4c4 100644 --- a/install/motioneye-install.sh +++ b/install/motioneye-install.sh @@ -18,13 +18,7 @@ $STD apt-get install -y git $STD apt-get install -y cifs-utils msg_ok "Installed Dependencies" -msg_info "Setup Python3" -$STD apt-get install -y \ - python3 \ - python3-dev \ - python3-pip -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -msg_ok "Setup Python3" +PYTHON_VERSION="3.12" setup_uv msg_info "Installing Motion" $STD apt-get install -y motion @@ -38,7 +32,9 @@ msg_ok "Installed FFmpeg" msg_info "Installing MotionEye" $STD apt-get update -$STD pip install git+https://github.com/motioneye-project/motioneye.git@dev +$STD uv venv /opt/motioneye/.venv +$STD /opt/motioneye/.venv/bin/uv pip install git+https://github.com/motioneye-project/motioneye.git@dev + mkdir -p /etc/motioneye chown -R root:root /etc/motioneye chmod -R 777 /etc/motioneye @@ -48,6 +44,8 @@ msg_ok "Installed MotionEye" msg_info "Creating Service" curl -fsSL "https://raw.githubusercontent.com/motioneye-project/motioneye/dev/motioneye/extra/motioneye.systemd" -o "/etc/systemd/system/motioneye.service" +sed -i 's|^ExecStart=.*|ExecStart=/opt/motioneye/.venv/bin/meyectl startserver -c /etc/motioneye/motioneye.conf|' /etc/systemd/system/motioneye.service +systemctl daemon-reexec systemctl enable -q --now motioneye msg_ok "Created Service" diff --git a/install/mylar3-install.sh b/install/mylar3-install.sh index cab578fbb2f..6bfa4aa5da0 100644 --- a/install/mylar3-install.sh +++ b/install/mylar3-install.sh @@ -21,18 +21,16 @@ $STD apt-get install -y unrar rm /etc/apt/sources.list.d/non-free.list msg_ok "Installed Dependencies" -msg_info "Setup Python3" -$STD apt-get install -y python3-pip -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -$STD pip install -U --no-cache-dir pip -msg_ok "Setup Python3" +PYTHON_VERSION="3.12" setup_uv msg_info "Installing ${APPLICATION}" mkdir -p /opt/mylar3 mkdir -p /opt/mylar3-data RELEASE=$(curl -fsSL https://api.github.com/repos/mylar3/mylar3/releases/latest | jq -r '.tag_name') curl -fsSL "https://github.com/mylar3/mylar3/archive/refs/tags/${RELEASE}.tar.gz" | tar -xz --strip-components=1 -C /opt/mylar3 -$STD pip install --no-cache-dir -r /opt/mylar3/requirements.txt +cd /opt/mylar3 +$STD uv venv .venv +$STD .venv/bin/uv pip install --no-cache-dir -r requirements.txt echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Installed ${APPLICATION}" @@ -43,7 +41,7 @@ Description=Mylar3 Service After=network-online.target [Service] -ExecStart=/usr/bin/python3 /opt/mylar3/Mylar.py --daemon --nolaunch --datadir=/opt/mylar3-data +ExecStart=/opt/mylar3/.venv/bin/python /opt/mylar3/Mylar.py --daemon --nolaunch --datadir=/opt/mylar3-data GuessMainPID=no Type=forking Restart=on-failure diff --git a/install/openwebui-install.sh b/install/openwebui-install.sh index 5f2908a7de9..4d1949d7a56 100644 --- a/install/openwebui-install.sh +++ b/install/openwebui-install.sh @@ -20,19 +20,15 @@ $STD apt-get install -y \ ffmpeg msg_ok "Installed Dependencies" -msg_info "Setup Python3" -$STD apt-get install -y --no-install-recommends \ - python3 \ - python3-pip -msg_ok "Setup Python3" - +PYTHON_VERSION="3.12" setup_uv NODE_VERSION="22" install_node_and_modules msg_info "Installing Open WebUI (Patience)" $STD git clone https://github.com/open-webui/open-webui.git /opt/open-webui cd /opt/open-webui/backend -$STD pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu -$STD pip3 install -r requirements.txt -U +$STD uv venv /opt/open-webui/.venv +$STD /opt/open-webui/.venv/bin/uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu +$STD /opt/open-webui/.venv/bin/uv pip install -r requirements.txt -U cd /opt/open-webui cp .env.example .env cat </opt/open-webui/.env diff --git a/install/paperless-ai-install.sh b/install/paperless-ai-install.sh index f4972ef4665..4520b3ef863 100644 --- a/install/paperless-ai-install.sh +++ b/install/paperless-ai-install.sh @@ -18,12 +18,9 @@ $STD apt-get install -y \ build-essential msg_ok "Installed Dependencies" -msg_info "Installing Python3" -$STD apt-get install -y \ - python3-pip -msg_ok "Installed Python3" +PYTHON_VERSION="3.12" setup_uv -install_node_and_modules +NODE_VERSION="22" install_node_and_modules msg_info "Setup Paperless-AI" cd /opt @@ -32,7 +29,8 @@ curl -fsSL "https://github.com/clusterzx/paperless-ai/archive/refs/tags/v${RELEA $STD unzip v${RELEASE}.zip mv paperless-ai-${RELEASE} /opt/paperless-ai cd /opt/paperless-ai -$STD pip install --no-cache-dir -r requirements.txt +$STD uv venv .venv +$STD .venv/bin/uv pip install --no-cache-dir -r requirements.txt mkdir -p data/chromadb $STD npm install mkdir -p /opt/paperless-ai/data @@ -87,7 +85,7 @@ After=network.target [Service] WorkingDirectory=/opt/paperless-ai -ExecStart=/usr/bin/python3 main.py --host 0.0.0.0 --port 8000 --initialize +ExecStart=/opt/paperless-ai/.venv/bin/python main.py --host 0.0.0.0 --port 8000 --initialize Restart=always [Install] From a8ddfaddf0aaec8b9b98e4544f37f81df35bea97 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 09:12:36 +0200 Subject: [PATCH 12/66] more uv migrations --- install/documenso-install.sh | 10 ++++++---- install/esphome-install.sh | 25 +++++++++++-------------- install/grist-install.sh | 25 +++++++++++++------------ install/homeassistant-install.sh | 17 ++--------------- install/homer-install.sh | 7 +++---- install/immich-install.sh | 28 ++++++++++++++-------------- 6 files changed, 49 insertions(+), 63 deletions(-) diff --git a/install/documenso-install.sh b/install/documenso-install.sh index 861f3f40e30..142765c857f 100644 --- a/install/documenso-install.sh +++ b/install/documenso-install.sh @@ -23,13 +23,12 @@ $STD apt-get install -y \ libc6 \ make \ cmake \ - jq \ - python3 \ - python3-bcrypt + jq msg_ok "Installed Dependencies" NODE_VERSION="22" NODE_MODULE="turbo@1.9.3" install_node_and_modules PG_VERSION="16" install_postgresql +PYTHON_VERSION="3.12" setup_uv msg_info "Setting up PostgreSQL" DB_NAME="documenso_db" @@ -55,6 +54,9 @@ curl -fsSL "https://github.com/documenso/documenso/archive/refs/tags/v${RELEASE} $STD unzip v${RELEASE}.zip mv documenso-${RELEASE} /opt/documenso cd /opt/documenso +$STD uv venv /opt/documenso/.venv +source /opt/documenso/.venv/bin/activate +$STD /opt/documenso/.venv/bin/uv pip install bcrypt mv .env.example /opt/documenso/.env sed -i \ -e "s|^NEXTAUTH_SECRET=.*|NEXTAUTH_SECRET='$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-32)'|" \ @@ -78,7 +80,7 @@ echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" msg_ok "Installed Documenso" msg_info "Create User" -PASSWORD_HASH=$(python3 -c "import bcrypt; print(bcrypt.hashpw(b'helper-scripts', bcrypt.gensalt(rounds=12)).decode())") +PASSWORD_HASH=$(/opt/documenso/.venv/bin/python3 -c "import bcrypt; print(bcrypt.hashpw(b'helper-scripts', bcrypt.gensalt(rounds=12)).decode())") $STD sudo -u postgres psql -d documenso_db -c "INSERT INTO \"User\" (name, email, \"emailVerified\", password, \"identityProvider\", roles, \"createdAt\", \"lastSignedIn\", \"updatedAt\", \"customerId\") VALUES ('helper-scripts', 'helper-scripts@local.com', '2025-01-20 17:14:45.058', '$PASSWORD_HASH', 'DOCUMENSO', ARRAY['USER', 'ADMIN']::\"Role\"[], '2025-01-20 16:04:05.543', '2025-01-20 16:14:55.249', '2025-01-20 16:14:55.25', NULL) RETURNING id;" $STD npm run prisma:migrate-deploy msg_ok "User created" diff --git a/install/esphome-install.sh b/install/esphome-install.sh index 37e2d71d095..2ceaaf40770 100644 --- a/install/esphome-install.sh +++ b/install/esphome-install.sh @@ -17,34 +17,31 @@ msg_info "Installing Dependencies" $STD apt-get install -y git msg_ok "Installed Dependencies" -msg_info "Setup Python3" -$STD apt-get install -y \ - python3 \ - python3-dev \ - python3-pip \ - python3-venv -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -msg_ok "Setup Python3" - -msg_info "Installing ESPHome" -mkdir /root/config -$STD pip install esphome tornado esptool -msg_ok "Installed ESPHome" +PYTHON_VERSION="3.12" setup_uv + +msg_info "Setting up Virtual Environment" +mkdir -p /opt/esphome +$STD uv venv /opt/esphome/.venv +source /opt/esphome/.venv/bin/activate +$STD /opt/esphome/.venv/bin/uv pip install esphome tornado esptool +msg_ok "Setup and Installed ESPHome" msg_info "Creating Service" +mkdir -p /root/config cat </etc/systemd/system/esphomeDashboard.service [Unit] Description=ESPHome Dashboard After=network.target [Service] -ExecStart=/usr/local/bin/esphome dashboard /root/config/ +ExecStart=/opt/esphome/.venv/bin/esphome dashboard /root/config/ Restart=always User=root [Install] WantedBy=multi-user.target EOF + systemctl enable -q --now esphomeDashboard msg_ok "Created Service" diff --git a/install/grist-install.sh b/install/grist-install.sh index 9649accf4c7..9c239e84ae6 100644 --- a/install/grist-install.sh +++ b/install/grist-install.sh @@ -14,12 +14,10 @@ network_check update_os msg_info "Installing Dependencies" -$STD apt-get install -y \ - make \ - ca-certificates \ - python3.11-venv +$STD apt-get install -y make ca-certificates msg_ok "Installed Dependencies" +PYTHON_VERSION="3.12" setup_uv NODE_VERSION="22" NODE_MODULE="yarn@latest" install_node_and_modules msg_info "Installing Grist" @@ -28,20 +26,22 @@ export CYPRESS_INSTALL_BINARY=0 export NODE_OPTIONS="--max-old-space-size=2048" cd /opt curl -fsSL "https://github.com/gristlabs/grist-core/archive/refs/tags/v${RELEASE}.zip" -o "v${RELEASE}.zip" -$STD unzip v$RELEASE.zip -mv grist-core-${RELEASE} grist -cd grist +$STD unzip "v${RELEASE}.zip" +mv "grist-core-${RELEASE}" /opt/grist +cd /opt/grist +$STD uv venv /opt/grist/sandbox_venv3 +$STD /opt/grist/sandbox_venv3/bin/uv pip install -r sandbox/requirements.txt $STD yarn install $STD yarn run build:prod -$STD yarn run install:python +ln -sf /opt/grist/sandbox_venv3/bin/python3 /opt/grist/sandbox_venv3/bin/python cat </opt/grist/.env NODE_ENV=production GRIST_HOST=0.0.0.0 EOF -echo "${RELEASE}" >/opt/${APPLICATION}_version.txt +echo "${RELEASE}" >/opt/grist_version.txt msg_ok "Installed Grist" -msg_info "Create Service" +msg_info "Creating Service" cat </etc/systemd/system/grist.service [Unit] Description=Grist @@ -49,9 +49,10 @@ After=network.target [Service] Type=exec -WorkingDirectory=/opt/grist +WorkingDirectory=/opt/grist ExecStart=/usr/bin/yarn run start:prod EnvironmentFile=-/opt/grist/.env +Restart=always [Install] WantedBy=multi-user.target @@ -64,7 +65,7 @@ motd_ssh customize msg_info "Cleaning up" -rm -rf /opt/v${RELEASE}.zip +rm -rf "/opt/v${RELEASE}.zip" $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned" diff --git a/install/homeassistant-install.sh b/install/homeassistant-install.sh index e041e72fcb4..6111c033d08 100644 --- a/install/homeassistant-install.sh +++ b/install/homeassistant-install.sh @@ -13,19 +13,6 @@ setting_up_container network_check update_os -msg_info "Setup Python3" -$STD apt-get install -y \ - python3 \ - python3-dev \ - python3-pip \ - python3-venv -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -msg_ok "Setup Python3" - -msg_info "Installing runlike" -$STD pip install runlike -msg_ok "Installed runlike" - get_latest_release() { curl -fsSL https://api.github.com/repos/$1/releases/latest | grep '"tag_name":' | cut -d'"' -f4 } @@ -36,8 +23,8 @@ PORTAINER_LATEST_VERSION=$(get_latest_release "portainer/portainer") msg_info "Installing Docker $DOCKER_LATEST_VERSION" DOCKER_CONFIG_PATH='/etc/docker/daemon.json' -mkdir -p $(dirname $DOCKER_CONFIG_PATH) -echo -e '{\n "log-driver": "journald"\n}' >/etc/docker/daemon.json +mkdir -p $(dirname "$DOCKER_CONFIG_PATH") +echo -e '{\n "log-driver": "journald"\n}' >"$DOCKER_CONFIG_PATH" $STD sh <(curl -fsSL https://get.docker.com) msg_ok "Installed Docker $DOCKER_LATEST_VERSION" diff --git a/install/homer-install.sh b/install/homer-install.sh index 525dd3a4f38..3c0b6ab0750 100644 --- a/install/homer-install.sh +++ b/install/homer-install.sh @@ -13,12 +13,11 @@ setting_up_container network_check update_os -msg_info "Installing Dependencies" -$STD apt-get install -y pip -msg_ok "Installed Dependencies" +PYTHON_VERSION="3.12" setup_uv msg_info "Installing Homer" mkdir -p /opt/homer +$STD uv venv /opt/homer/.venv cd /opt/homer curl -fsSL "https://github.com/bastienwirtz/homer/releases/latest/download/homer.zip" -o "homer.zip" $STD unzip homer.zip @@ -34,7 +33,7 @@ After=network-online.target [Service] Type=simple WorkingDirectory=/opt/homer -ExecStart=python3 -m http.server 8010 +ExecStart=/opt/homer/.venv/bin/python3 -m http.server 8010 [Install] WantedBy=multi-user.target EOF diff --git a/install/immich-install.sh b/install/immich-install.sh index ae766de0527..f85d05a864c 100644 --- a/install/immich-install.sh +++ b/install/immich-install.sh @@ -13,6 +13,8 @@ setting_up_container network_check update_os +PYTHON_VERSION="3.12" setup_uv + msg_info "Configuring apt and installing dependencies" echo "deb http://deb.debian.org/debian testing main contrib" >/etc/apt/sources.list.d/immich.list cat </etc/apt/preferences.d/immich @@ -27,8 +29,6 @@ $STD apt-get install --no-install-recommends -y \ redis \ autoconf \ build-essential \ - python3-venv \ - python3-dev \ cmake \ jq \ libbrotli-dev \ @@ -304,25 +304,25 @@ cp LICENSE "$APP_DIR" msg_ok "Installed Immich Web Components" cd "$SRC_DIR"/machine-learning -$STD python3 -m venv "$ML_DIR/ml-venv" +$STD uv venv "$ML_DIR/.venv" +$ML_DIR/.venv/bin/uv pip install --upgrade uv +$ML_DIR/.venv/bin/uv sync --no-cache +cd "$SRC_DIR"/machine-learning +$STD uv venv "$ML_DIR/.venv" +$ML_DIR/.venv/bin/uv pip install --upgrade uv + if [[ -f ~/.openvino ]]; then msg_info "Installing HW-accelerated machine-learning" - ( - source "$ML_DIR"/ml-venv/bin/activate - $STD pip3 install uv - uv -q sync --extra openvino --no-cache --active - ) - patchelf --clear-execstack "$ML_DIR"/ml-venv/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-311-x86_64-linux-gnu.so + $STD "$ML_DIR/.venv/bin/uv" sync --no-cache --extra openvino + patchelf --clear-execstack "$ML_DIR/.venv/lib/python3.12/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-312-x86_64-linux-gnu.so" msg_ok "Installed HW-accelerated machine-learning" + else msg_info "Installing machine-learning" - ( - source "$ML_DIR"/ml-venv/bin/activate - $STD pip3 install uv - uv -q sync --extra cpu --no-cache --active - ) + $STD "$ML_DIR/.venv/bin/uv" sync --no-cache --extra cpu msg_ok "Installed machine-learning" fi + cd "$SRC_DIR" cp -a machine-learning/{ann,immich_ml} "$ML_DIR" if [[ -f ~/.openvino ]]; then From 647af55b408679b0b8f45a3950c2358e9cd133e3 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 09:18:06 +0200 Subject: [PATCH 13/66] more uv migs --- install/jupyternotebook-install.sh | 18 +++++++-------- install/kometa-install.sh | 33 +++++++++++++-------------- install/lazylibrarian-install.sh | 36 +++++++++++++----------------- 3 files changed, 41 insertions(+), 46 deletions(-) diff --git a/install/jupyternotebook-install.sh b/install/jupyternotebook-install.sh index 843921187ac..30749a1154c 100644 --- a/install/jupyternotebook-install.sh +++ b/install/jupyternotebook-install.sh @@ -13,15 +13,14 @@ setting_up_container network_check update_os -msg_info "Installing Dependencies" -$STD apt-get install -y \ - python3 \ - python3-pip -msg_ok "Installed Dependencies" +PYTHON_VERSION="3.12" setup_uv -msg_info "Setting up Jupyter Notebook" -$STD pip3 install jupyter -msg_ok "Setup Jupyter Notebook" +msg_info "Installing Jupyter" +mkdir -p /opt/jupyter +cd /opt/jupyter +$STD uv venv .venv +$STD .venv/bin/uv pip install jupyter +msg_ok "Installed Jupyter" msg_info "Creating Service" cat </etc/systemd/system/jupyternotebook.service @@ -31,7 +30,7 @@ After=network.target [Service] Type=simple -ExecStart=jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root +WorkingDirectory=/opt/jupyter Restart=always RestartSec=10 @@ -39,6 +38,7 @@ RestartSec=10 WantedBy=multi-user.target EOF systemctl enable -q --now jupyternotebook +msg_ok "Created Service" motd_ssh customize diff --git a/install/kometa-install.sh b/install/kometa-install.sh index 8c9634188eb..9368c199769 100644 --- a/install/kometa-install.sh +++ b/install/kometa-install.sh @@ -13,28 +13,27 @@ setting_up_container network_check update_os -msg_info "Setup Python 3" -$STD apt-get install python3-pip -y -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -msg_ok "Setup Python 3" +PYTHON_VERSION="3.12" setup_uv -msg_info "Setup Kometa" -temp_file=$(mktemp) +msg_info "Installing Kometa" +tmp_file=$(mktemp) RELEASE=$(curl -fsSL https://api.github.com/repos/Kometa-Team/Kometa/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') -curl -fsSL "https://github.com/Kometa-Team/Kometa/archive/refs/tags/v${RELEASE}.tar.gz" -o """$temp_file""" -tar -xzf "$temp_file" -mv Kometa-"${RELEASE}" /opt/kometa +curl -fsSL "https://github.com/Kometa-Team/Kometa/archive/refs/tags/v${RELEASE}.tar.gz" -o "$tmp_file" +tar -xzf "$tmp_file" +mv "Kometa-${RELEASE}" /opt/kometa cd /opt/kometa -$STD pip install -r requirements.txt --ignore-installed + +$STD uv venv .venv +$STD .venv/bin/uv pip install -r requirements.txt mkdir -p config/assets cp config/config.yml.template config/config.yml -echo "${RELEASE}" >/opt/kometa_version.txt -msg_ok "Setup Kometa" +echo "$RELEASE" >/opt/kometa_version.txt +msg_ok "Installed Kometa" -read -p "${TAB3}nter your TMDb API key: " TMDBKEY +read -p "${TAB3}Enter your TMDb API key: " TMDBKEY read -p "${TAB3}Enter your Plex URL: " PLEXURL read -p "${TAB3}Enter your Plex token: " PLEXTOKEN -sed -i -e "s#url: http://192.168.1.12:32400#url: $PLEXURL #g" /opt/kometa/config/config.yml +sed -i -e "s#url: http://192.168.1.12:32400#url: $PLEXURL#g" /opt/kometa/config/config.yml sed -i -e "s/token: ####################/token: $PLEXTOKEN/g" /opt/kometa/config/config.yml sed -i -e "s/apikey: ################################/apikey: $TMDBKEY/g" /opt/kometa/config/config.yml @@ -47,21 +46,21 @@ After=network-online.target [Service] Type=simple WorkingDirectory=/opt/kometa -ExecStart=/usr/bin/python3 kometa.py +ExecStart=/opt/kometa/.venv/bin/python kometa.py Restart=always RestartSec=30 [Install] WantedBy=multi-user.target EOF -systemctl enable --now -q kometa +systemctl enable -q --now kometa msg_ok "Created Service" motd_ssh customize msg_info "Cleaning up" -rm -f "$temp_file" +rm -f "$tmp_file" $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned" diff --git a/install/lazylibrarian-install.sh b/install/lazylibrarian-install.sh index 7749ae6bc38..2374cd6f1f7 100644 --- a/install/lazylibrarian-install.sh +++ b/install/lazylibrarian-install.sh @@ -14,29 +14,22 @@ setting_up_container network_check update_os +PYTHON_VERSION="3.12" setup_uv + msg_info "Installing Dependencies" $STD apt-get install -y \ - git \ - libpng-dev \ - libjpeg-dev \ - libtiff-dev \ - imagemagick + git \ + libpng-dev \ + libjpeg-dev \ + libtiff-dev \ + imagemagick msg_ok "Installed Dependencies" -msg_info "Setup Python3" -$STD apt-get install -y \ - pip \ - python3-irc -$STD pip install jaraco.stream -$STD pip install python-Levenshtein -$STD pip install soupsieve -$STD pip install pypdf -msg_ok "Setup Python3" - msg_info "Installing LazyLibrarian" $STD git clone https://gitlab.com/LazyLibrarian/LazyLibrarian /opt/LazyLibrarian cd /opt/LazyLibrarian -$STD pip install . +$STD uv venv .venv +$STD .venv/bin/uv pip install . jaraco.stream python-Levenshtein soupsieve pypdf msg_ok "Installed LazyLibrarian" msg_info "Creating Service" @@ -44,17 +37,20 @@ cat </etc/systemd/system/lazylibrarian.service [Unit] Description=LazyLibrarian Daemon After=syslog.target network.target + [Service] -UMask=0002 Type=simple -ExecStart=/usr/bin/python3 /opt/LazyLibrarian/LazyLibrarian.py +WorkingDirectory=/opt/LazyLibrarian +ExecStart=/opt/LazyLibrarian/.venv/bin/python LazyLibrarian.py +UMask=0002 +Restart=on-failure TimeoutStopSec=20 KillMode=process -Restart=on-failure + [Install] WantedBy=multi-user.target EOF -systemctl enable --now -q lazylibrarian +systemctl enable -q --now lazylibrarian msg_ok "Created Service" motd_ssh From 7e8083f98ce6421d4b0b2b1b310843306002a5a9 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 09:19:28 +0200 Subject: [PATCH 14/66] more uv migs --- install/medusa-install.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/install/medusa-install.sh b/install/medusa-install.sh index e46ececb7d2..5726df0c125 100644 --- a/install/medusa-install.sh +++ b/install/medusa-install.sh @@ -14,6 +14,8 @@ setting_up_container network_check update_os +PYTHON_VERSION="3.12" setup_uv + msg_info "Installing Dependencies" $STD apt-get install -y \ git-core \ @@ -29,6 +31,9 @@ msg_ok "Installed Dependencies" msg_info "Installing Medusa" $STD git clone https://github.com/pymedusa/Medusa.git /opt/medusa +cd /opt/medusa +$STD uv venv .venv +$STD .venv/bin/uv pip install . msg_ok "Installed Medusa" msg_info "Creating Service" @@ -39,7 +44,8 @@ After=network.target [Service] Type=simple -ExecStart=/usr/bin/python3 /opt/medusa/start.py -q --nolaunch --datadir=/opt/medusa +WorkingDirectory=/opt/medusa +ExecStart=/opt/medusa/.venv/bin/python start.py -q --nolaunch --datadir=/opt/medusa TimeoutStopSec=25 KillMode=process Restart=on-failure From 2da5f5e84251a0b1a8ef014337be099b5dfd3865 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 09:21:38 +0200 Subject: [PATCH 15/66] Update slskd-install.sh --- install/slskd-install.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/install/slskd-install.sh b/install/slskd-install.sh index d064fb7cbc3..737a0960c62 100644 --- a/install/slskd-install.sh +++ b/install/slskd-install.sh @@ -18,8 +18,8 @@ PYTHON_VERSION="3.12" setup_uv msg_info "Setup ${APPLICATION}" tmp_file=$(mktemp) RELEASE=$(curl -s https://api.github.com/repos/slskd/slskd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') -curl -fsSL "https://github.com/slskd/slskd/releases/download/${RELEASE}/slskd-${RELEASE}-linux-x64.zip" -o $tmp_file -$STD unzip $tmp_file -d /opt/${APPLICATION} +curl -fsSL "https://github.com/slskd/slskd/releases/download/${RELEASE}/slskd-${RELEASE}-linux-x64.zip" -o "$tmp_file" +$STD unzip "$tmp_file" -d /opt/${APPLICATION} echo "${RELEASE}" >/opt/${APPLICATION}_version.txt JWT_KEY=$(openssl rand -base64 44) SLSKD_API_KEY=$(openssl rand -base64 44) @@ -42,8 +42,8 @@ curl -fsSL -o main.zip https://github.com/mrusse/soularr/archive/refs/heads/main $STD unzip main.zip mv soularr-main /opt/soularr cd /opt/soularr -$STD uv venv /opt/soularr/venv -$STD /opt/soularr/venv/bin/uv pip install -r requirements.txt +$STD uv venv /opt/soularr/.venv +$STD /opt/soularr/.venv/bin/uv pip install -r requirements.txt sed -i \ -e "\|[Slskd]|,\|host_url|s|yourslskdapikeygoeshere|$SLSKD_API_KEY|" \ -e "/host_url/s/slskd/localhost/" \ @@ -51,7 +51,7 @@ sed -i \ sed -i \ -e "/#This\|#Default\|INTERVAL/{N;d;}" \ -e "/while\|#Pass/d" \ - -e "\|python|s|app|opt/soularr|; s|python|/opt/soularr/venv/bin/python3|" \ + -e "\|python|s|app|opt/soularr|; s|python|/opt/soularr/.venv/bin/python3|" \ -e "/dt/,+2d" \ /opt/soularr/run.sh sed -i -E "/(soularr.py)/s/.{5}$//; /if/,/fi/s/.{4}//" /opt/soularr/run.sh @@ -82,7 +82,6 @@ RefuseManualStop=no [Timer] Persistent=true -# run every 5 minutes OnCalendar=*-*-* *:0/5:00 Unit=soularr.service @@ -104,7 +103,7 @@ ExecStart=/bin/bash -c /opt/soularr/run.sh WantedBy=multi-user.target EOF -systemctl enable -q --now ${APPLICATION} +systemctl enable -q --now soularr systemctl enable -q soularr.timer msg_ok "Created Services" @@ -112,8 +111,7 @@ motd_ssh customize msg_info "Cleaning up" -rm -f $tmp_file -rm -f /tmp/main.zip +rm -f "$tmp_file" /tmp/main.zip $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned" From a151d2652761abd7d93fcfbd943b5d53c85bf230 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 09:45:33 +0200 Subject: [PATCH 16/66] Update nginxproxymanager-install.sh --- install/nginxproxymanager-install.sh | 148 ++++++++++----------------- 1 file changed, 55 insertions(+), 93 deletions(-) diff --git a/install/nginxproxymanager-install.sh b/install/nginxproxymanager-install.sh index ae8c1384bac..d03a0bb6f6d 100644 --- a/install/nginxproxymanager-install.sh +++ b/install/nginxproxymanager-install.sh @@ -13,85 +13,45 @@ setting_up_container network_check update_os +PYTHON_VERSION="3.12" setup_uv +NODE_VERSION="20" NODE_MODULE="yarn@latest" install_node_and_modules + msg_info "Installing Dependencies" $STD apt-get update -$STD apt-get -y install \ - ca-certificates \ - apache2-utils \ - logrotate \ +$STD apt-get install -y \ build-essential \ - git + make gcc g++ git curl \ + apache2-utils logrotate \ + libffi-dev msg_ok "Installed Dependencies" -msg_info "Installing Python Dependencies" -$STD apt-get install -y \ - python3 \ - python3-dev \ - python3-pip \ - python3-venv \ - python3-cffi \ - python3-certbot \ - python3-certbot-dns-cloudflare -$STD pip3 install certbot-dns-multi -$STD python3 -m venv /opt/certbot/ -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -msg_ok "Installed Python Dependencies" +msg_info "Setting up certbot" +$STD apt-get install -y libaugeas0 +$STD uv venv /opt/certbot/.venv +$STD /opt/certbot/.venv/bin/uv pip install certbot certbot-dns-cloudflare certbot-dns-multi +ln -sf /opt/certbot/.venv/bin/certbot /usr/bin/certbot +msg_ok "Set up certbot" +msg_info "Installing OpenResty" VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)" - -msg_info "Installing Openresty" -curl -fsSL "https://openresty.org/package/pubkey.gpg" | gpg --dearmor -o /etc/apt/trusted.gpg.d/openresty-archive-keyring.gpg -echo -e "deb http://openresty.org/package/debian bullseye openresty" >/etc/apt/sources.list.d/openresty.list +curl -fsSL https://openresty.org/package/pubkey.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/openresty.gpg +echo "deb http://openresty.org/package/debian $VERSION openresty" >/etc/apt/sources.list.d/openresty.list $STD apt-get update -$STD apt-get -y install openresty -msg_ok "Installed Openresty" - -msg_info "Installing Node.js" -$STD bash <(curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh) -source ~/.bashrc -$STD nvm install 16.20.2 -ln -sf /root/.nvm/versions/node/v16.20.2/bin/node /usr/bin/node -msg_ok "Installed Node.js" - -msg_info "Installing pnpm" -$STD npm install -g pnpm@8.15 -msg_ok "Installed pnpm" - -RELEASE=$(curl -fsSL https://api.github.com/repos/NginxProxyManager/nginx-proxy-manager/releases/latest | - grep "tag_name" | - awk '{print substr($2, 3, length($2)-4) }') - -read -r -p "${TAB3}Would you like to install an older version (v2.10.4)? " prompt -if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then - msg_info "Downloading Nginx Proxy Manager v2.10.4" - curl -fsSL "https://codeload.github.com/NginxProxyManager/nginx-proxy-manager/tar.gz/v2.10.4" | tar -xz - cd ./nginx-proxy-manager-2.10.4 - msg_ok "Downloaded Nginx Proxy Manager v2.10.4" -else - msg_info "Downloading Nginx Proxy Manager v${RELEASE}" - curl -fsSL "https://codeload.github.com/NginxProxyManager/nginx-proxy-manager/tar.gz/v${RELEASE}" | tar -xz - cd ./nginx-proxy-manager-"${RELEASE}" - msg_ok "Downloaded Nginx Proxy Manager v${RELEASE}" -fi -msg_info "Setting up Environment" -ln -sf /usr/bin/python3 /usr/bin/python -ln -sf /usr/bin/certbot /opt/certbot/bin/certbot +$STD apt-get install -y openresty ln -sf /usr/local/openresty/nginx/sbin/nginx /usr/sbin/nginx -ln -sf /usr/local/openresty/nginx/ /etc/nginx -if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then - sed -i "s|\"version\": \"0.0.0\"|\"version\": \"2.10.4\"|" backend/package.json - sed -i "s|\"version\": \"0.0.0\"|\"version\": \"2.10.4\"|" frontend/package.json -else - sed -i "s|\"version\": \"0.0.0\"|\"version\": \"$RELEASE\"|" backend/package.json - sed -i "s|\"version\": \"0.0.0\"|\"version\": \"$RELEASE\"|" frontend/package.json -fi -sed -i 's|"fork-me": ".*"|"fork-me": "Proxmox VE Helper-Scripts"|' frontend/js/i18n/messages.json -sed -i "s|https://github.com.*source=nginx-proxy-manager|https://helper-scripts.com|g" frontend/js/app/ui/footer/main.ejs -sed -i 's+^daemon+#daemon+g' docker/rootfs/etc/nginx/nginx.conf -NGINX_CONFS=$(find "$(pwd)" -type f -name "*.conf") -for NGINX_CONF in $NGINX_CONFS; do - sed -i 's+include conf.d+include /etc/nginx/conf.d+g' "$NGINX_CONF" -done +ln -sf /usr/local/openresty/nginx /etc/nginx +msg_ok "Installed OpenResty" + +RELEASE=$(curl -fsSL https://api.github.com/repos/NginxProxyManager/nginx-proxy-manager/releases/latest | grep "tag_name" | awk -F'"' '{print $4}') +msg_info "Downloading Nginx Proxy Manager v${RELEASE}" +curl -fsSL "https://codeload.github.com/NginxProxyManager/nginx-proxy-manager/tar.gz/refs/tags/v${RELEASE}" | tar -xz +cd ./nginx-proxy-manager-${RELEASE} +msg_ok "Downloaded Nginx Proxy Manager" + +msg_info "Setting up Nginx Proxy Manager" +sed -i "s|\"version\": \"0.0.0\"|\"version\": \"${RELEASE}\"|" backend/package.json frontend/package.json +sed -i 's|^daemon|#daemon|' docker/rootfs/etc/nginx/nginx.conf +find . -type f -name "*.conf" -exec sed -i 's|include conf.d|include /etc/nginx/conf.d|g' {} \; mkdir -p /var/www/html /etc/nginx/logs cp -r docker/rootfs/var/www/html/* /var/www/html/ @@ -100,7 +60,9 @@ cp docker/rootfs/etc/letsencrypt.ini /etc/letsencrypt.ini cp docker/rootfs/etc/logrotate.d/nginx-proxy-manager /etc/logrotate.d/nginx-proxy-manager ln -sf /etc/nginx/nginx.conf /etc/nginx/conf/nginx.conf rm -f /etc/nginx/conf.d/dev.conf +msg_ok "Set up Nginx Proxy Manager" +msg_info "Preparing Runtime Environment" mkdir -p /tmp/nginx/body \ /run/nginx \ /data/nginx \ @@ -120,31 +82,29 @@ mkdir -p /tmp/nginx/body \ chmod -R 777 /var/cache/nginx chown root /tmp/nginx - echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf);" >/etc/nginx/conf.d/include/resolvers.conf - if [ ! -f /data/nginx/dummycert.pem ] || [ ! -f /data/nginx/dummykey.pem ]; then - openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 -subj "/O=Nginx Proxy Manager/OU=Dummy Certificate/CN=localhost" -keyout /data/nginx/dummykey.pem -out /data/nginx/dummycert.pem &>/dev/null + openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 \ + -subj "/O=Nginx Proxy Manager/OU=Dummy Certificate/CN=localhost" \ + -keyout /data/nginx/dummykey.pem \ + -out /data/nginx/dummycert.pem &>/dev/null fi - -mkdir -p /app/global /app/frontend/images -cp -r backend/* /app -cp -r global/* /app/global -msg_ok "Set up Environment" +msg_ok "Prepared Runtime Environment" msg_info "Building Frontend" cd ./frontend -$STD pnpm install -$STD pnpm upgrade -$STD pnpm run build +$STD yarn install --frozen-lockfile +$STD yarn upgrade +$STD yarn run build cp -r dist/* /app/frontend cp -r app-images/* /app/frontend/images msg_ok "Built Frontend" msg_info "Initializing Backend" +cd ../backend rm -rf /app/config/default.json -if [ ! -f /app/config/production.json ]; then - cat <<'EOF' >/app/config/production.json +mkdir -p /app/config +cat </app/config/production.json { "database": { "engine": "knex-native", @@ -157,13 +117,16 @@ if [ ! -f /app/config/production.json ]; then } } EOF -fi +cd .. +mkdir -p /app/global /app/frontend/images +cp -r backend/* /app +cp -r global/* /app/global cd /app -$STD pnpm install +$STD yarn install --frozen-lockfile msg_ok "Initialized Backend" -msg_info "Creating Service" -cat <<'EOF' >/lib/systemd/system/npm.service +msg_info "Creating Systemd Service" +cat </etc/systemd/system/npm.service [Unit] Description=Nginx Proxy Manager After=network.target @@ -180,22 +143,21 @@ Restart=on-failure [Install] WantedBy=multi-user.target EOF -msg_ok "Created Service" +msg_ok "Created Systemd Service" motd_ssh customize msg_info "Starting Services" -sed -i 's/user npm/user root/g; s/^pid/#pid/g' /usr/local/openresty/nginx/conf/nginx.conf -sed -r -i 's/^([[:space:]]*)su npm npm/\1#su npm npm/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 +sed -i 's/user npm/user root/g; s/^pid/#pid/' /usr/local/openresty/nginx/conf/nginx.conf +sed -r -i 's/^([[:space:]]*)su npm npm/\1#su npm npm/' /etc/logrotate.d/nginx-proxy-manager +sed -i 's/include-system-site-packages = false/include-system-site-packages = true/' /opt/certbot/.venv/pyvenv.cfg systemctl enable -q --now openresty systemctl enable -q --now npm msg_ok "Started Services" -msg_info "Cleaning up" +msg_info "Cleaning Up" rm -rf ../nginx-proxy-manager-* -systemctl restart openresty $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned" From e08247874d9f1e3dd4e61e7752da39c8832d8725 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 09:45:46 +0200 Subject: [PATCH 17/66] more uv --- install/jupyternotebook-install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install/jupyternotebook-install.sh b/install/jupyternotebook-install.sh index 30749a1154c..2c3162a68c9 100644 --- a/install/jupyternotebook-install.sh +++ b/install/jupyternotebook-install.sh @@ -31,6 +31,7 @@ After=network.target [Service] Type=simple WorkingDirectory=/opt/jupyter +ExecStart=/opt/jupyter/.venv/bin/jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root Restart=always RestartSec=10 From 3b912745e7a37666cf3a2a3ead332b9c6a364dc4 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 10:03:36 +0200 Subject: [PATCH 18/66] AdventureLog: Full UV Mig --- ct/adventurelog.sh | 18 +++++++++++++----- install/adventurelog-install.sh | 4 ++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ct/adventurelog.sh b/ct/adventurelog.sh index 966afb2e4c7..c9cb7441c32 100644 --- a/ct/adventurelog.sh +++ b/ct/adventurelog.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: MickLesk (Canbiz) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -27,6 +27,8 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi + PYTHON_VERSION="3.12" setup_uv + RELEASE=$(curl -fsSL https://api.github.com/repos/seanmorley15/AdventureLog/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 Services" @@ -43,10 +45,16 @@ function update_script() { mv /opt/adventurelog-backup/backend/server/.env /opt/adventurelog/backend/server/.env mv /opt/adventurelog-backup/backend/server/media /opt/adventurelog/backend/server/media cd /opt/adventurelog/backend/server - $STD pip install --upgrade pip - $STD pip install -r requirements.txt - $STD python3 manage.py collectstatic --noinput - $STD python3 manage.py migrate + $STD uv venv --python "$UV_PYTHON_VERSION" .venv + if grep -q "ExecStart=.*python3 manage.py runserver" /etc/systemd/system/adventurelog-backend.service; then + sed -i "s|ExecStart=.*python3 manage.py runserver|ExecStart=$(pwd)/.venv/bin/python manage.py runserver|" /etc/systemd/system/adventurelog-backend.service + systemctl daemon-reload + fi + + $STD uv pip install --upgrade pip --python=.venv/bin/python + $STD uv pip install -r requirements.txt --python=.venv/bin/python + $STD uv run --python=.venv/bin/python python manage.py collectstatic --noinput + $STD uv run --python=.venv/bin/python python manage.py migrate mv /opt/adventurelog-backup/frontend/.env /opt/adventurelog/frontend/.env cd /opt/adventurelog/frontend diff --git a/install/adventurelog-install.sh b/install/adventurelog-install.sh index 210b965935d..1dbccf1105e 100644 --- a/install/adventurelog-install.sh +++ b/install/adventurelog-install.sh @@ -78,7 +78,7 @@ DISABLE_REGISTRATION=False EOF cd /opt/adventurelog/backend/server mkdir -p /opt/adventurelog/backend/server/media -$STD uv venv --python $UV_PYTHON_VERSION /opt/adventurelog/backend/server/venv +$STD uv venv --python $UV_PYTHON_VERSION /opt/adventurelog/backend/server/.venv $STD uv pip install --upgrade pip $STD uv pip install -r requirements.txt $STD uv run python manage.py collectstatic --noinput @@ -120,7 +120,7 @@ After=network.target postgresql.service [Service] WorkingDirectory=/opt/adventurelog/backend/server -ExecStart=/opt/adventurelog/backend/server/venv/bin/python manage.py runserver 0.0.0.0:8000 +ExecStart=/opt/adventurelog/backend/server/.venv/bin/python manage.py runserver 0.0.0.0:8000 Restart=always EnvironmentFile=/opt/adventurelog/backend/server/.env From cd4a9d4b55b2e0bc22e5966880b63f3dfc8c5cc3 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 10:07:08 +0200 Subject: [PATCH 19/66] Archivebox: UV Migration --- ct/archivebox.sh | 64 ++++++++++++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 24 deletions(-) diff --git a/ct/archivebox.sh b/ct/archivebox.sh index d3289a75df7..52cef18c6e6 100644 --- a/ct/archivebox.sh +++ b/ct/archivebox.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: tteck # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -20,29 +20,45 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/archivebox ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Stopping ${APP}" - systemctl stop archivebox - msg_ok "Stopped ${APP}" - - msg_info "Updating ${APP}" - cd /opt/archivebox/data - pip install --upgrade --ignore-installed archivebox - sudo -u archivebox archivebox init - msg_ok "Updated ${APP}" - - msg_info "Starting ${APP}" - systemctl start archivebox - msg_ok "Started ${APP}" - - msg_ok "Updated Successfully" + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/archivebox ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + msg_info "Stopping ${APP}" + systemctl stop archivebox + msg_ok "Stopped ${APP}" + + msg_info "Updating ${APP}" + cd /opt/archivebox + $STD uv venv --python "$UV_PYTHON_VERSION" .venv + + if [[ -f /opt/archivebox/uv.lock ]]; then + cp /opt/archivebox/uv.lock /opt/archivebox/data/ || true + fi + + cd /opt/archivebox/data + $STD ../.venv/bin/uv sync + + msg_info "Running ArchiveBox Setup" + sudo -u archivebox ../.venv/bin/playwright install-deps chromium + sudo -u archivebox ../.venv/bin/playwright install chromium + sudo -u archivebox ../.venv/bin/archivebox init + msg_ok "ArchiveBox Updated" + + if grep -q "ExecStart=/usr/local/bin/archivebox" /etc/systemd/system/archivebox.service; then + sed -i "s|ExecStart=/usr/local/bin/archivebox|ExecStart=/opt/archivebox/.venv/bin/archivebox|" /etc/systemd/system/archivebox.service + systemctl daemon-reload + fi + + msg_info "Starting ${APP}" + systemctl start archivebox + msg_ok "Started ${APP}" + + msg_ok "Updated Successfully" + exit } start @@ -52,4 +68,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8000/admin/login${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8000/admin/login${CL}" From 2cc17f4028686b7df9d6c5f61731c7050a652f70 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 10:46:40 +0200 Subject: [PATCH 20/66] optimize uv python install --- misc/tools.func | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/misc/tools.func b/misc/tools.func index 341a82159e0..643229cc4a3 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -1068,17 +1068,23 @@ function setup_uv() { if [[ -n "$PYTHON_VERSION" ]]; then $STD msg_info "Ensuring Python $PYTHON_VERSION is available via uv..." - if ! uv python list | grep -q "cpython-${PYTHON_VERSION}-linux"; then - msg_error "Python version $PYTHON_VERSION not available via uv" + + FULL_PYTHON=$(uv python list | grep -E "^cpython-${PYTHON_VERSION//./\\.}\.[0-9]+-linux.*" | sort -V | tail -n1 | awk '{print $1}') + + if [[ -z "$FULL_PYTHON" ]]; then + msg_error "No matching Python $PYTHON_VERSION.x version found via uv" return 1 fi - if ! uv python list | grep -q "cpython-${PYTHON_VERSION}-linux.*.local/share/uv/python"; then - $STD uv python install "$PYTHON_VERSION" - msg_ok "Installed Python $PYTHON_VERSION via uv" + + # check if already installed + if uv python list | grep -q "$FULL_PYTHON.*uv/python"; then + $STD msg_ok "Python ${FULL_PYTHON#cpython-} already installed via uv" else - $STD msg_ok "Python $PYTHON_VERSION already installed via uv" + $STD uv python install "${FULL_PYTHON#cpython-}" + msg_ok "Installed Python ${FULL_PYTHON#cpython-} via uv" fi fi + } # ------------------------------------------------------------------------------ From 2cfaaa4cace9fc05c4ceb981dae42c917014737d Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 10:55:55 +0200 Subject: [PATCH 21/66] fix python install for uv --- misc/tools.func | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/misc/tools.func b/misc/tools.func index 643229cc4a3..ade1ee7ba8e 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -1064,24 +1064,21 @@ function setup_uv() { # set path ensure_usr_local_bin_persist - msg_ok "uv installed/updated to $LATEST_VERSION" + msg_ok "uv $LATEST_VERSION installed " if [[ -n "$PYTHON_VERSION" ]]; then $STD msg_info "Ensuring Python $PYTHON_VERSION is available via uv..." + VERSION_MATCH=$(uv python list --only-downloads | grep -E "^cpython-${PYTHON_VERSION//./\\.}\.[0-9]+-linux" | cut -d'-' -f2 | sort -V | tail -n1) - FULL_PYTHON=$(uv python list | grep -E "^cpython-${PYTHON_VERSION//./\\.}\.[0-9]+-linux.*" | sort -V | tail -n1 | awk '{print $1}') - - if [[ -z "$FULL_PYTHON" ]]; then + if [[ -z "$VERSION_MATCH" ]]; then msg_error "No matching Python $PYTHON_VERSION.x version found via uv" return 1 fi - - # check if already installed - if uv python list | grep -q "$FULL_PYTHON.*uv/python"; then - $STD msg_ok "Python ${FULL_PYTHON#cpython-} already installed via uv" + if uv python list | grep -q "cpython-${VERSION_MATCH}-linux.*uv/python"; then + $STD msg_ok "Python ${VERSION_MATCH} already installed via uv" else - $STD uv python install "${FULL_PYTHON#cpython-}" - msg_ok "Installed Python ${FULL_PYTHON#cpython-} via uv" + $STD uv python install "${VERSION_MATCH}" + msg_ok "Installed Python ${VERSION_MATCH} via uv" fi fi From dbd08c7735959dab9a940df96d088f00f07ad21f Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:02:51 +0200 Subject: [PATCH 22/66] various improvements on uv setup --- misc/tools.func | 92 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 60 insertions(+), 32 deletions(-) diff --git a/misc/tools.func b/misc/tools.func index ade1ee7ba8e..065bed5d972 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -1008,80 +1008,108 @@ function download_with_progress() { # ------------------------------------------------------------------------------ # Installs or upgrades uv (Python package manager) from GitHub releases. -# -# Description: -# - Downloads architecture-specific tarball -# - Places binary in /usr/local/bin +# - Downloads platform-specific tarball (no install.sh!) +# - Extracts uv binary +# - Places it in /usr/local/bin +# - Optionally installs a specific Python version via uv # ------------------------------------------------------------------------------ function setup_uv() { $STD msg_info "Checking uv installation..." - UV_BIN="/usr/local/bin/uv" + local UV_BIN="/usr/local/bin/uv" + local TMP_DIR TMP_DIR=$(mktemp -d) + + # Determine system architecture + local ARCH ARCH=$(uname -m) + local UV_TAR - if [[ "$ARCH" == "x86_64" ]]; then - UV_TAR="uv-x86_64-unknown-linux-gnu.tar.gz" - elif [[ "$ARCH" == "aarch64" ]]; then - UV_TAR="uv-aarch64-unknown-linux-gnu.tar.gz" - else + case "$ARCH" in + x86_64) UV_TAR="uv-x86_64-unknown-linux-gnu.tar.gz" ;; + aarch64) UV_TAR="uv-aarch64-unknown-linux-gnu.tar.gz" ;; + *) msg_error "Unsupported architecture: $ARCH" rm -rf "$TMP_DIR" return 1 - fi + ;; + esac + + # Get latest version from GitHub + local LATEST_VERSION + LATEST_VERSION=$(curl -fsSL https://api.github.com/repos/astral-sh/uv/releases/latest | + grep '"tag_name":' | cut -d '"' -f4 | sed 's/^v//') - # get current github version - LATEST_VERSION=$(curl -s https://api.github.com/repos/astral-sh/uv/releases/latest | grep '"tag_name":' | cut -d '"' -f4 | sed 's/^v//') if [[ -z "$LATEST_VERSION" ]]; then msg_error "Could not fetch latest uv version from GitHub." rm -rf "$TMP_DIR" return 1 fi - # check if uv exists + # Check if uv is already up to date if [[ -x "$UV_BIN" ]]; then + local INSTALLED_VERSION INSTALLED_VERSION=$($UV_BIN -V | awk '{print $2}') if [[ "$INSTALLED_VERSION" == "$LATEST_VERSION" ]]; then $STD msg_ok "uv is already at the latest version ($INSTALLED_VERSION)" rm -rf "$TMP_DIR" - # set path - if [[ ":$PATH:" != *":/usr/local/bin:"* ]]; then - export PATH="/usr/local/bin:$PATH" - fi + [[ ":$PATH:" != *":/usr/local/bin:"* ]] && export PATH="/usr/local/bin:$PATH" return 0 else $STD msg_info "Updating uv from $INSTALLED_VERSION to $LATEST_VERSION" fi else - $STD msg_info "uv not found. Installing version $LATEST_VERSION" + $STD msg_info "Installing uv $LATEST_VERSION" fi - # install or update uv - curl -fsSL "https://github.com/astral-sh/uv/releases/latest/download/${UV_TAR}" -o "$TMP_DIR/uv.tar.gz" - tar -xzf "$TMP_DIR/uv.tar.gz" -C "$TMP_DIR" - install -m 755 "$TMP_DIR"/*/uv "$UV_BIN" - rm -rf "$TMP_DIR" + # Download and install manually + local UV_URL="https://github.com/astral-sh/uv/releases/latest/download/${UV_TAR}" + if ! curl -fsSL "$UV_URL" -o "$TMP_DIR/uv.tar.gz"; then + msg_error "Failed to download $UV_URL" + rm -rf "$TMP_DIR" + return 1 + fi + + if ! tar -xzf "$TMP_DIR/uv.tar.gz" -C "$TMP_DIR"; then + msg_error "Failed to extract uv archive" + rm -rf "$TMP_DIR" + return 1 + fi + + install -m 755 "$TMP_DIR"/*/uv "$UV_BIN" || { + msg_error "Failed to install uv binary" + rm -rf "$TMP_DIR" + return 1 + } - # set path + rm -rf "$TMP_DIR" ensure_usr_local_bin_persist - msg_ok "uv $LATEST_VERSION installed " + msg_ok "uv $LATEST_VERSION installed" - if [[ -n "$PYTHON_VERSION" ]]; then + # Optional: install specific Python version + if [[ -n "${PYTHON_VERSION:-}" ]]; then $STD msg_info "Ensuring Python $PYTHON_VERSION is available via uv..." - VERSION_MATCH=$(uv python list --only-downloads | grep -E "^cpython-${PYTHON_VERSION//./\\.}\.[0-9]+-linux" | cut -d'-' -f2 | sort -V | tail -n1) + + local VERSION_MATCH + VERSION_MATCH=$(uv python list --only-downloads | + grep -E "^cpython-${PYTHON_VERSION//./\\.}\.[0-9]+-linux" | + cut -d'-' -f2 | sort -V | tail -n1) if [[ -z "$VERSION_MATCH" ]]; then msg_error "No matching Python $PYTHON_VERSION.x version found via uv" return 1 fi + if uv python list | grep -q "cpython-${VERSION_MATCH}-linux.*uv/python"; then - $STD msg_ok "Python ${VERSION_MATCH} already installed via uv" + $STD msg_ok "Python $VERSION_MATCH already installed via uv" else - $STD uv python install "${VERSION_MATCH}" - msg_ok "Installed Python ${VERSION_MATCH} via uv" + if ! $STD uv python install "$VERSION_MATCH"; then + msg_error "Failed to install Python $VERSION_MATCH via uv" + return 1 + fi + msg_ok "Installed Python $VERSION_MATCH via uv" fi fi - } # ------------------------------------------------------------------------------ From 506ce07bf45690b524f75f82629df05d9c311359 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:06:32 +0200 Subject: [PATCH 23/66] fixes --- install/adventurelog-install.sh | 2 +- install/octoprint-install.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install/adventurelog-install.sh b/install/adventurelog-install.sh index 1dbccf1105e..c5b342404cc 100644 --- a/install/adventurelog-install.sh +++ b/install/adventurelog-install.sh @@ -78,7 +78,7 @@ DISABLE_REGISTRATION=False EOF cd /opt/adventurelog/backend/server mkdir -p /opt/adventurelog/backend/server/media -$STD uv venv --python $UV_PYTHON_VERSION /opt/adventurelog/backend/server/.venv +$STD uv venv --python $PYTHON_VERSION /opt/adventurelog/backend/server/.venv $STD uv pip install --upgrade pip $STD uv pip install -r requirements.txt $STD uv run python manage.py collectstatic --noinput diff --git a/install/octoprint-install.sh b/install/octoprint-install.sh index 86a1a9335f4..b887910051a 100644 --- a/install/octoprint-install.sh +++ b/install/octoprint-install.sh @@ -32,7 +32,7 @@ msg_info "Installing OctoPrint" $STD sudo -u octoprint bash < Date: Wed, 4 Jun 2025 11:16:13 +0200 Subject: [PATCH 24/66] Update archivebox-install.sh --- install/archivebox-install.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/install/archivebox-install.sh b/install/archivebox-install.sh index b7ef3827d51..692e9e75e67 100644 --- a/install/archivebox-install.sh +++ b/install/archivebox-install.sh @@ -25,21 +25,17 @@ $STD apt-get install -y \ ripgrep msg_ok "Installed Dependencies" +PYTHON_VERSION="3.12" setup_uv NODE_VERSION="22" install_node_and_modules -msg_info "Installing ArchiveBox Python Environment" +msg_info "Installing ArchiveBox" mkdir -p /opt/archivebox/{data,.npm,.cache,.local} adduser --system --shell /bin/bash --gecos 'Archive Box User' --group --disabled-password --home /home/archivebox archivebox chown -R archivebox:archivebox /opt/archivebox/{data,.npm,.cache,.local} chmod -R 755 /opt/archivebox/data - -cd /opt/archivebox -PYTHON_VERSION="3.12" setup_uv - -msg_info "Installing ArchiveBox & Playwright (Patience)" -cd /opt/archivebox/data -cp /opt/archivebox/uv.lock . || true -$STD /opt/archivebox/.venv/bin/uv sync +$STD uv venv --python "$PYTHON_VERSION" /opt/archivebox/.venv +$STD /opt/archivebox/.venv/bin/uv pip install --all-extras archivebox +$STD /opt/archivebox/.venv/bin/uv pip install playwright sudo -u archivebox /opt/archivebox/.venv/bin/playwright install-deps chromium msg_ok "Installed ArchiveBox & Playwright" From 130af1a447bf6e2731c8d6b3e231954a15f2e3b8 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:23:24 +0200 Subject: [PATCH 25/66] change paths for testing --- ct/babybuddy.sh | 2 +- ct/bazarr.sh | 26 +++++------ ct/calibre-web.sh | 4 +- ct/changedetection.sh | 4 +- ct/crafty-controller.sh | 2 +- ct/deluge.sh | 26 +++++------ ct/documenso.sh | 2 +- ct/esphome.sh | 4 +- ct/grist.sh | 2 +- ct/homeassistant.sh | 2 +- ct/homer.sh | 68 ++++++++++++++-------------- ct/immich.sh | 2 +- ct/jupyternotebook.sh | 22 ++++----- ct/kometa.sh | 84 +++++++++++++++++------------------ ct/lazylibrarian.sh | 44 +++++++++--------- ct/medusa.sh | 4 +- ct/metube.sh | 4 +- ct/motioneye.sh | 24 +++++----- ct/mylar3.sh | 6 +-- ct/netbox.sh | 2 +- ct/nginxproxymanager.sh | 2 +- ct/openwebui.sh | 2 +- ct/paperless-ai.sh | 2 +- ct/paperless-ngx.sh | 2 +- ct/pialert.sh | 20 ++++----- ct/prometheus-pve-exporter.sh | 40 ++++++++--------- ct/radicale.sh | 40 ++++++++--------- ct/sabnzbd.sh | 73 +++++++++++++++--------------- ct/searxng.sh | 2 +- ct/slskd.sh | 2 +- ct/spoolman.sh | 2 +- ct/stirling-pdf.sh | 2 +- ct/tandoor.sh | 2 +- ct/tasmocompiler.sh | 74 +++++++++++++++--------------- ct/tautulli.sh | 26 +++++------ ct/tianji.sh | 2 +- ct/unmanic.sh | 4 +- ct/web-check.sh | 20 ++++----- ct/wger.sh | 2 +- 39 files changed, 326 insertions(+), 327 deletions(-) diff --git a/ct/babybuddy.sh b/ct/babybuddy.sh index 741dbc84f48..8aedeb7ff7a 100644 --- a/ct/babybuddy.sh +++ b/ct/babybuddy.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: MickLesk (CanbiZ) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/ct/bazarr.sh b/ct/bazarr.sh index d32aaa5206b..16d3af8a205 100755 --- a/ct/bazarr.sh +++ b/ct/bazarr.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: tteck (tteckster) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -20,18 +20,18 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /var/lib/bazarr/ ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Updating $APP LXC" - $STD apt-get update - $STD apt-get -y upgrade - msg_ok "Updated $APP LXC" + header_info + check_container_storage + check_container_resources + if [[ ! -d /var/lib/bazarr/ ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + msg_info "Updating $APP LXC" + $STD apt-get update + $STD apt-get -y upgrade + msg_ok "Updated $APP LXC" + exit } start @@ -41,4 +41,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:6767${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:6767${CL}" diff --git a/ct/calibre-web.sh b/ct/calibre-web.sh index 8a319618cc4..87d2d18045a 100644 --- a/ct/calibre-web.sh +++ b/ct/calibre-web.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: tteck (tteckster) | Co-Author: remz1337 # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -135,4 +135,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8083${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8083${CL}" diff --git a/ct/changedetection.sh b/ct/changedetection.sh index 0f1bdeeeb68..3bd14ee001b 100644 --- a/ct/changedetection.sh +++ b/ct/changedetection.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: tteck (tteckster) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -74,4 +74,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5000${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5000${CL}" diff --git a/ct/crafty-controller.sh b/ct/crafty-controller.sh index dfa6d413faa..363c9451e37 100644 --- a/ct/crafty-controller.sh +++ b/ct/crafty-controller.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 community-scripts # Author: CrazyWolf13 # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/ct/deluge.sh b/ct/deluge.sh index 374efc777b3..95e1f448c63 100644 --- a/ct/deluge.sh +++ b/ct/deluge.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: tteck (tteckster) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -20,18 +20,18 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -f /etc/systemd/system/deluged.service ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Updating $APP LXC" - $STD apt-get update - pip3 install deluge[all] --upgrade - msg_ok "Updated $APP LXC" + header_info + check_container_storage + check_container_resources + if [[ ! -f /etc/systemd/system/deluged.service ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + msg_info "Updating $APP LXC" + $STD apt-get update + pip3 install deluge[all] --upgrade + msg_ok "Updated $APP LXC" + exit } start @@ -41,4 +41,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8112${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8112${CL}" diff --git a/ct/documenso.sh b/ct/documenso.sh index 2d0b1bc5fad..7b557b9d6f6 100644 --- a/ct/documenso.sh +++ b/ct/documenso.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: MickLesk (CanbiZ) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/ct/esphome.sh b/ct/esphome.sh index f9b086a62bb..52f726fada5 100644 --- a/ct/esphome.sh +++ b/ct/esphome.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: tteck (tteckster) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -52,4 +52,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:6052${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:6052${CL}" diff --git a/ct/grist.sh b/ct/grist.sh index 0e395a32b8d..e276f87f5f1 100644 --- a/ct/grist.sh +++ b/ct/grist.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Source: https://github.com/gristlabs/grist-core APP="Grist" diff --git a/ct/homeassistant.sh b/ct/homeassistant.sh index 6201915b919..8f33e4ab61c 100644 --- a/ct/homeassistant.sh +++ b/ct/homeassistant.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: tteck (tteckster) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/ct/homer.sh b/ct/homer.sh index 44c380e40ab..58fc3b8d378 100644 --- a/ct/homer.sh +++ b/ct/homer.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: tteck (tteckster) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -20,44 +20,44 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/homer ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Stopping ${APP}" - systemctl stop homer - msg_ok "Stopped ${APP}" + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/homer ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_info "Stopping ${APP}" + systemctl stop homer + msg_ok "Stopped ${APP}" - msg_info "Backing up assets directory" - cd ~ - mkdir -p assets-backup - cp -R /opt/homer/assets/. assets-backup - msg_ok "Backed up assets directory" + msg_info "Backing up assets directory" + cd ~ + mkdir -p assets-backup + cp -R /opt/homer/assets/. assets-backup + msg_ok "Backed up assets directory" - msg_info "Updating ${APP}" - rm -rf /opt/homer/* - cd /opt/homer - curl -fsSL "https://github.com/bastienwirtz/homer/releases/latest/download/homer.zip" -o $(basename "https://github.com/bastienwirtz/homer/releases/latest/download/homer.zip") - $STD unzip homer.zip - msg_ok "Updated ${APP}" + msg_info "Updating ${APP}" + rm -rf /opt/homer/* + cd /opt/homer + curl -fsSL "https://github.com/bastienwirtz/homer/releases/latest/download/homer.zip" -o $(basename "https://github.com/bastienwirtz/homer/releases/latest/download/homer.zip") + $STD unzip homer.zip + msg_ok "Updated ${APP}" - msg_info "Restoring assets directory" - cd ~ - cp -Rf assets-backup/. /opt/homer/assets/ - msg_ok "Restored assets directory" + msg_info "Restoring assets directory" + cd ~ + cp -Rf assets-backup/. /opt/homer/assets/ + msg_ok "Restored assets directory" - msg_info "Cleaning" - rm -rf assets-backup /opt/homer/homer.zip - msg_ok "Cleaned" + msg_info "Cleaning" + rm -rf assets-backup /opt/homer/homer.zip + msg_ok "Cleaned" - msg_info "Starting ${APP}" - systemctl start homer - msg_ok "Started ${APP}" - msg_ok "Updated Successfully" - exit + msg_info "Starting ${APP}" + systemctl start homer + msg_ok "Started ${APP}" + msg_ok "Updated Successfully" + exit } start diff --git a/ct/immich.sh b/ct/immich.sh index c925c52b00e..1a38bbd9beb 100644 --- a/ct/immich.sh +++ b/ct/immich.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: vhsdream # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/ct/jupyternotebook.sh b/ct/jupyternotebook.sh index 2baf5baa8be..bca25ce7d39 100644 --- a/ct/jupyternotebook.sh +++ b/ct/jupyternotebook.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: Dave-code-creater (Tan Dat, Ta) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -20,16 +20,16 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources + header_info + check_container_storage + check_container_resources - msg_info "Updating ${APP} LXC" - $STD apt-get update - $STD apt-get install -y upgrade - $STD pip3 install jupyter --upgrade - msg_ok "Updated Successfully" - exit + msg_info "Updating ${APP} LXC" + $STD apt-get update + $STD apt-get install -y upgrade + $STD pip3 install jupyter --upgrade + msg_ok "Updated Successfully" + exit } start @@ -39,4 +39,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8888${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8888${CL}" diff --git a/ct/kometa.sh b/ct/kometa.sh index ece16d5e9ae..00328c7d870 100644 --- a/ct/kometa.sh +++ b/ct/kometa.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: Slaviša Arežina (tremor021) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -20,51 +20,51 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources + header_info + check_container_storage + check_container_resources - if [[ ! -f "/opt/kometa/kometa.py" ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - RELEASE=$(curl -fsSL https://api.github.com/repos/Kometa-Team/Kometa/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat /opt/kometa_version.txt)" ]] || [[ ! -f /opt/kometa_version.txt ]]; then - msg_info "Updating $APP" - msg_info "Stopping $APP" - systemctl stop kometa - msg_ok "Stopped $APP" + if [[ ! -f "/opt/kometa/kometa.py" ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + RELEASE=$(curl -fsSL https://api.github.com/repos/Kometa-Team/Kometa/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') + if [[ "${RELEASE}" != "$(cat /opt/kometa_version.txt)" ]] || [[ ! -f /opt/kometa_version.txt ]]; then + msg_info "Updating $APP" + msg_info "Stopping $APP" + systemctl stop kometa + msg_ok "Stopped $APP" - msg_info "Updating $APP to ${RELEASE}" - cd /tmp - temp_file=$(mktemp) - RELEASE=$(curl -fsSL https://api.github.com/repos/Kometa-Team/Kometa/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') -curl -fsSL "https://github.com/Kometa-Team/Kometa/archive/refs/tags/v${RELEASE}.tar.gz" -o ""$temp_file"" - tar -xzf "$temp_file" - cp /opt/kometa/config/config.yml /opt - rm -rf /opt/kometa - mv Kometa-${RELEASE} /opt/kometa - cd /opt/kometa - rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED - $STD pip install -r requirements.txt --ignore-installed - mkdir -p config/assets - cp /opt/config.yml config/config.yml - echo "${RELEASE}" >/opt/kometa_version.txt - msg_ok "Updated $APP to ${RELEASE}" + msg_info "Updating $APP to ${RELEASE}" + cd /tmp + temp_file=$(mktemp) + RELEASE=$(curl -fsSL https://api.github.com/repos/Kometa-Team/Kometa/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') + curl -fsSL "https://github.com/Kometa-Team/Kometa/archive/refs/tags/v${RELEASE}.tar.gz" -o ""$temp_file"" + tar -xzf "$temp_file" + cp /opt/kometa/config/config.yml /opt + rm -rf /opt/kometa + mv Kometa-${RELEASE} /opt/kometa + cd /opt/kometa + rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED + $STD pip install -r requirements.txt --ignore-installed + mkdir -p config/assets + cp /opt/config.yml config/config.yml + echo "${RELEASE}" >/opt/kometa_version.txt + msg_ok "Updated $APP to ${RELEASE}" - msg_info "Starting $APP" - systemctl start kometa - msg_ok "Started $APP" + msg_info "Starting $APP" + systemctl start kometa + msg_ok "Started $APP" - msg_info "Cleaning Up" - rm -f $temp_file - msg_ok "Cleanup Completed" + msg_info "Cleaning Up" + rm -f $temp_file + msg_ok "Cleanup Completed" - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" - fi - exit + msg_ok "Update Successful" + else + msg_ok "No update required. ${APP} is already at ${RELEASE}" + fi + exit } start @@ -74,4 +74,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access the LXC at following IP address:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}${IP}${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}${IP}${CL}" diff --git a/ct/lazylibrarian.sh b/ct/lazylibrarian.sh index 478629771a8..e4f1d0755e7 100644 --- a/ct/lazylibrarian.sh +++ b/ct/lazylibrarian.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: tteck | Co-Author: MountyMapleSyrup (MountyMapleSyrup) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -20,27 +20,27 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/LazyLibrarian/ ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Stopping LazyLibrarian" - systemctl stop lazylibrarian - msg_ok "LazyLibrarian Stopped" - - msg_info "Updating $APP LXC" - $STD git -C /opt/LazyLibrarian pull origin master - msg_ok "Updated $APP LXC" - - msg_info "Starting LazyLibrarian" - systemctl start lazylibrarian - msg_ok "Started LazyLibrarian" - - msg_ok "Updated Successfully" + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/LazyLibrarian/ ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + msg_info "Stopping LazyLibrarian" + systemctl stop lazylibrarian + msg_ok "LazyLibrarian Stopped" + + msg_info "Updating $APP LXC" + $STD git -C /opt/LazyLibrarian pull origin master + msg_ok "Updated $APP LXC" + + msg_info "Starting LazyLibrarian" + systemctl start lazylibrarian + msg_ok "Started LazyLibrarian" + + msg_ok "Updated Successfully" + exit } start @@ -50,4 +50,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5299${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5299${CL}" diff --git a/ct/medusa.sh b/ct/medusa.sh index 6c8299a3874..6ad32e7864e 100644 --- a/ct/medusa.sh +++ b/ct/medusa.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: tteck (tteckster) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -53,4 +53,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8081${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8081${CL}" diff --git a/ct/metube.sh b/ct/metube.sh index 287ea264ec6..85c2c48cb76 100644 --- a/ct/metube.sh +++ b/ct/metube.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: MickLesk (Canbiz) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -66,4 +66,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8081${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8081${CL}" diff --git a/ct/motioneye.sh b/ct/motioneye.sh index 778717ddda4..06d1224fa4b 100644 --- a/ct/motioneye.sh +++ b/ct/motioneye.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: tteck (tteckster) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -20,17 +20,17 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -f /etc/systemd/system/motioneye.service ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Updating ${APP} LXC" - $STD pip install motioneye --upgrade - msg_ok "Updated Successfully" + header_info + check_container_storage + check_container_resources + if [[ ! -f /etc/systemd/system/motioneye.service ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + msg_info "Updating ${APP} LXC" + $STD pip install motioneye --upgrade + msg_ok "Updated Successfully" + exit } start @@ -40,4 +40,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8765${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8765${CL}" diff --git a/ct/mylar3.sh b/ct/mylar3.sh index 218f4e1587b..1cae52b444e 100644 --- a/ct/mylar3.sh +++ b/ct/mylar3.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: davalanche # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -29,7 +29,7 @@ function update_script() { if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then msg_info "Updating ${APP} to ${RELEASE}" rm -rf /opt/mylar3/* /opt/mylar3/.* -curl -fsSL "https://github.com/mylar3/mylar3/archive/refs/tags/${RELEASE}.tar.gz" | tar -xz --strip-components=1 -C /opt/mylar3 + curl -fsSL "https://github.com/mylar3/mylar3/archive/refs/tags/${RELEASE}.tar.gz" | tar -xz --strip-components=1 -C /opt/mylar3 systemctl restart mylar3 echo "${RELEASE}" >/opt/${APP}_version.txt msg_ok "Updated ${APP} to ${RELEASE}" @@ -46,4 +46,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8090${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8090${CL}" diff --git a/ct/netbox.sh b/ct/netbox.sh index e5dd28d8ecc..d0d348deffd 100644 --- a/ct/netbox.sh +++ b/ct/netbox.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: bvdberg01 # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/ct/nginxproxymanager.sh b/ct/nginxproxymanager.sh index d5b2323be2a..246f8b85dc4 100644 --- a/ct/nginxproxymanager.sh +++ b/ct/nginxproxymanager.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: tteck (tteckster) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/ct/openwebui.sh b/ct/openwebui.sh index 0824a797779..7904f2a6fca 100644 --- a/ct/openwebui.sh +++ b/ct/openwebui.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: havardthom # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/ct/paperless-ai.sh b/ct/paperless-ai.sh index ac9fe430b98..778a5f65b7c 100644 --- a/ct/paperless-ai.sh +++ b/ct/paperless-ai.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: MickLesk (CanbiZ) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/ct/paperless-ngx.sh b/ct/paperless-ngx.sh index d3904274b92..e959118a2ca 100644 --- a/ct/paperless-ngx.sh +++ b/ct/paperless-ngx.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: tteck (tteckster) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/ct/pialert.sh b/ct/pialert.sh index 032944bb154..d61ccebac5f 100644 --- a/ct/pialert.sh +++ b/ct/pialert.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: tteck (tteckster) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -20,16 +20,16 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/pialert ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - bash -c "$(curl -fsSL https://github.com/leiweibau/Pi.Alert/raw/main/install/pialert_update.sh)" -s --lxc - msg_ok "Updated $APP" + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/pialert ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + bash -c "$(curl -fsSL https://github.com/leiweibau/Pi.Alert/raw/main/install/pialert_update.sh)" -s --lxc + msg_ok "Updated $APP" + exit } start diff --git a/ct/prometheus-pve-exporter.sh b/ct/prometheus-pve-exporter.sh index 34c1b2611b5..8fbe7610e02 100644 --- a/ct/prometheus-pve-exporter.sh +++ b/ct/prometheus-pve-exporter.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: Andy Grunwald (andygrunwald) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -20,26 +20,26 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -f /etc/systemd/system/prometheus-pve-exporter.service ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Stopping ${APP}" - systemctl stop prometheus-pve-exporter - msg_ok "Stopped ${APP}" + header_info + check_container_storage + check_container_resources + if [[ ! -f /etc/systemd/system/prometheus-pve-exporter.service ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_info "Stopping ${APP}" + systemctl stop prometheus-pve-exporter + msg_ok "Stopped ${APP}" - msg_info "Updating ${APP}" - $STD pip install prometheus-pve-exporter --default-timeout=300 --upgrade --root-user-action=ignore - msg_ok "Updated ${APP}" + msg_info "Updating ${APP}" + $STD pip install prometheus-pve-exporter --default-timeout=300 --upgrade --root-user-action=ignore + msg_ok "Updated ${APP}" - msg_info "Starting ${APP}" - systemctl start prometheus-pve-exporter - msg_ok "Started ${APP}" - msg_ok "Updated Successfully" - exit + msg_info "Starting ${APP}" + systemctl start prometheus-pve-exporter + msg_ok "Started ${APP}" + msg_ok "Updated Successfully" + exit } start @@ -49,4 +49,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9221${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9221${CL}" diff --git a/ct/radicale.sh b/ct/radicale.sh index 00c851342dc..dada46ceeec 100644 --- a/ct/radicale.sh +++ b/ct/radicale.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: tremor021 # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -20,25 +20,25 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/radicale ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - msg_info "Updating ${APP}" - python3 -m venv /opt/radicale - source /opt/radicale/bin/activate - python3 -m pip install --upgrade https://github.com/Kozea/Radicale/archive/master.tar.gz - msg_ok "Updated ${APP}" - - msg_info "Starting Service" - systemctl enable -q --now radicale - msg_ok "Started Service" - + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/radicale ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + + msg_info "Updating ${APP}" + python3 -m venv /opt/radicale + source /opt/radicale/bin/activate + python3 -m pip install --upgrade https://github.com/Kozea/Radicale/archive/master.tar.gz + msg_ok "Updated ${APP}" + + msg_info "Starting Service" + systemctl enable -q --now radicale + msg_ok "Started Service" + + exit } start @@ -48,4 +48,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5232${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5232${CL}" diff --git a/ct/sabnzbd.sh b/ct/sabnzbd.sh index 01d51679774..910baa65925 100644 --- a/ct/sabnzbd.sh +++ b/ct/sabnzbd.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: tteck (tteckster) | Co-Author: MickLesk (CanbiZ) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -20,44 +20,44 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources + header_info + check_container_storage + check_container_resources - if [[ ! -d /opt/sabnzbd ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - setup_uv - RELEASE=$(curl -fsSL https://api.github.com/repos/sabnzbd/sabnzbd/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_ok "No update required. ${APP} is already at ${RELEASE}" - exit - fi - msg_info "Updating $APP to ${RELEASE}" - systemctl stop sabnzbd - cp -r /opt/sabnzbd /opt/sabnzbd_backup_$(date +%s) - temp_file=$(mktemp) - curl -fsSL "https://github.com/sabnzbd/sabnzbd/releases/download/${RELEASE}/SABnzbd-${RELEASE}-src.tar.gz" -o "$temp_file" - tar -xzf "$temp_file" -C /opt/sabnzbd --strip-components=1 - rm -f "$temp_file" - if [[ ! -d /opt/sabnzbd/venv ]]; then - msg_info "Migrating SABnzbd to uv virtual environment" - $STD uv venv /opt/sabnzbd/venv - msg_ok "Created uv venv at /opt/sabnzbd/venv" + if [[ ! -d /opt/sabnzbd ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + setup_uv + RELEASE=$(curl -fsSL https://api.github.com/repos/sabnzbd/sabnzbd/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_ok "No update required. ${APP} is already at ${RELEASE}" + exit + fi + msg_info "Updating $APP to ${RELEASE}" + systemctl stop sabnzbd + cp -r /opt/sabnzbd /opt/sabnzbd_backup_$(date +%s) + temp_file=$(mktemp) + curl -fsSL "https://github.com/sabnzbd/sabnzbd/releases/download/${RELEASE}/SABnzbd-${RELEASE}-src.tar.gz" -o "$temp_file" + tar -xzf "$temp_file" -C /opt/sabnzbd --strip-components=1 + rm -f "$temp_file" + if [[ ! -d /opt/sabnzbd/venv ]]; then + msg_info "Migrating SABnzbd to uv virtual environment" + $STD uv venv /opt/sabnzbd/venv + msg_ok "Created uv venv at /opt/sabnzbd/venv" - if grep -q "ExecStart=python3 SABnzbd.py" /etc/systemd/system/sabnzbd.service; then - sed -i "s|ExecStart=python3 SABnzbd.py|ExecStart=/opt/sabnzbd/venv/bin/python SABnzbd.py|" /etc/systemd/system/sabnzbd.service - systemctl daemon-reload - msg_ok "Updated SABnzbd service to use uv venv" - fi + if grep -q "ExecStart=python3 SABnzbd.py" /etc/systemd/system/sabnzbd.service; then + sed -i "s|ExecStart=python3 SABnzbd.py|ExecStart=/opt/sabnzbd/venv/bin/python SABnzbd.py|" /etc/systemd/system/sabnzbd.service + systemctl daemon-reload + msg_ok "Updated SABnzbd service to use uv venv" fi - $STD uv pip install --upgrade pip --python=/opt/sabnzbd/venv/bin/python - $STD uv pip install -r /opt/sabnzbd/requirements.txt --python=/opt/sabnzbd/venv/bin/python - echo "${RELEASE}" >/opt/${APP}_version.txt - systemctl start sabnzbd - msg_ok "Updated ${APP} to ${RELEASE}" - exit + fi + $STD uv pip install --upgrade pip --python=/opt/sabnzbd/venv/bin/python + $STD uv pip install -r /opt/sabnzbd/requirements.txt --python=/opt/sabnzbd/venv/bin/python + echo "${RELEASE}" >/opt/${APP}_version.txt + systemctl start sabnzbd + msg_ok "Updated ${APP} to ${RELEASE}" + exit } start @@ -68,4 +68,3 @@ msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7777${CL}" - diff --git a/ct/searxng.sh b/ct/searxng.sh index 7d9df8d60ba..e2ac0558131 100644 --- a/ct/searxng.sh +++ b/ct/searxng.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: MickLesk (Canbiz) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/ct/slskd.sh b/ct/slskd.sh index 3b8c305bc14..5eec537f67f 100644 --- a/ct/slskd.sh +++ b/ct/slskd.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: vhsdream # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/ct/spoolman.sh b/ct/spoolman.sh index 71ca777775a..d15abba6850 100644 --- a/ct/spoolman.sh +++ b/ct/spoolman.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: MickLesk (Canbiz) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/ct/stirling-pdf.sh b/ct/stirling-pdf.sh index d94ae6f2993..ef05b41d73f 100644 --- a/ct/stirling-pdf.sh +++ b/ct/stirling-pdf.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: tteck (tteckster) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/ct/tandoor.sh b/ct/tandoor.sh index 085b28f17e7..20998998c0a 100644 --- a/ct/tandoor.sh +++ b/ct/tandoor.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: MickLesk (Canbiz) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/ct/tasmocompiler.sh b/ct/tasmocompiler.sh index a791c3098a5..74ea7b55dd4 100644 --- a/ct/tasmocompiler.sh +++ b/ct/tasmocompiler.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: Slaviša Arežina (tremor021) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -20,43 +20,43 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/tasmocompiler ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - RELEASE=$(curl -fsSL https://api.github.com/repos/benzino77/tasmocompiler/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 tasmocompiler - msg_ok "Stopped $APP" - msg_info "Updating $APP to v${RELEASE}" - cd /opt - rm -rf /opt/tasmocompiler - RELEASE=$(curl -fsSL https://api.github.com/repos/benzino77/tasmocompiler/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - curl -fsSL "https://github.com/benzino77/tasmocompiler/archive/refs/tags/v${RELEASE}.tar.gz" -o $(basename "https://github.com/benzino77/tasmocompiler/archive/refs/tags/v${RELEASE}.tar.gz") - tar xzf v${RELEASE}.tar.gz - mv tasmocompiler-${RELEASE}/ /opt/tasmocompiler/ - cd /opt/tasmocompiler - $STD yarn install - export NODE_OPTIONS=--openssl-legacy-provider - $STD npm i - $STD yarn build - msg_ok "Updated $APP to v${RELEASE}" - msg_info "Starting $APP" - systemctl start tasmocompiler - msg_ok "Started $APP" - echo "${RELEASE}" >/opt/${APP}_version.txt - msg_info "Cleaning up" - rm -r "/opt/v${RELEASE}.tar.gz" - msg_ok "Cleaned" - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" - fi + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/tasmocompiler ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + RELEASE=$(curl -fsSL https://api.github.com/repos/benzino77/tasmocompiler/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 tasmocompiler + msg_ok "Stopped $APP" + msg_info "Updating $APP to v${RELEASE}" + cd /opt + rm -rf /opt/tasmocompiler + RELEASE=$(curl -fsSL https://api.github.com/repos/benzino77/tasmocompiler/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') + curl -fsSL "https://github.com/benzino77/tasmocompiler/archive/refs/tags/v${RELEASE}.tar.gz" -o $(basename "https://github.com/benzino77/tasmocompiler/archive/refs/tags/v${RELEASE}.tar.gz") + tar xzf v${RELEASE}.tar.gz + mv tasmocompiler-${RELEASE}/ /opt/tasmocompiler/ + cd /opt/tasmocompiler + $STD yarn install + export NODE_OPTIONS=--openssl-legacy-provider + $STD npm i + $STD yarn build + msg_ok "Updated $APP to v${RELEASE}" + msg_info "Starting $APP" + systemctl start tasmocompiler + msg_ok "Started $APP" + echo "${RELEASE}" >/opt/${APP}_version.txt + msg_info "Cleaning up" + rm -r "/opt/v${RELEASE}.tar.gz" + msg_ok "Cleaned" + msg_ok "Update Successful" + else + msg_ok "No update required. ${APP} is already at v${RELEASE}" + fi + exit } start diff --git a/ct/tautulli.sh b/ct/tautulli.sh index 263dc6193a1..2609eb31d9f 100644 --- a/ct/tautulli.sh +++ b/ct/tautulli.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: tteck (tteckster) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -20,18 +20,18 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/Tautulli/ ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Updating $APP LXC" - $STD apt-get update - $STD apt-get -y upgrade - msg_ok "Updated $APP LXC" + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/Tautulli/ ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + msg_info "Updating $APP LXC" + $STD apt-get update + $STD apt-get -y upgrade + msg_ok "Updated $APP LXC" + exit } start @@ -41,4 +41,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8181${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8181${CL}" diff --git a/ct/tianji.sh b/ct/tianji.sh index ed89d07d225..031ad8d529c 100644 --- a/ct/tianji.sh +++ b/ct/tianji.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: MickLesk (Canbiz) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/ct/unmanic.sh b/ct/unmanic.sh index b0329cb748e..6fd0b99dd53 100644 --- a/ct/unmanic.sh +++ b/ct/unmanic.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: tteck (tteckster) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -41,4 +41,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8888${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8888${CL}" diff --git a/ct/web-check.sh b/ct/web-check.sh index 635ebac48e9..0942fc1c720 100644 --- a/ct/web-check.sh +++ b/ct/web-check.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: CrazyWolf13 # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -20,15 +20,15 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/web-check ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_error "Currently we don't provide an update function for this ${APP}." + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/web-check ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + msg_error "Currently we don't provide an update function for this ${APP}." + exit } start @@ -38,4 +38,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" diff --git a/ct/wger.sh b/ct/wger.sh index cd0e4d26775..ad952a34fcb 100644 --- a/ct/wger.sh +++ b/ct/wger.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: Slaviša Arežina (tremor021) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE From 90e8a73219a8a4b59b3141d21b1755a2ef4318f0 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:24:19 +0200 Subject: [PATCH 26/66] Update adventurelog-install.sh --- install/adventurelog-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/adventurelog-install.sh b/install/adventurelog-install.sh index c5b342404cc..cea09b61095 100644 --- a/install/adventurelog-install.sh +++ b/install/adventurelog-install.sh @@ -78,7 +78,7 @@ DISABLE_REGISTRATION=False EOF cd /opt/adventurelog/backend/server mkdir -p /opt/adventurelog/backend/server/media -$STD uv venv --python $PYTHON_VERSION /opt/adventurelog/backend/server/.venv +$STD uv venv --python /opt/adventurelog/backend/server/.venv $STD uv pip install --upgrade pip $STD uv pip install -r requirements.txt $STD uv run python manage.py collectstatic --noinput From 31006e290afa21995e07e9a7dd9fe8253a10833a Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:27:56 +0200 Subject: [PATCH 27/66] Update archivebox-install.sh --- install/archivebox-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/archivebox-install.sh b/install/archivebox-install.sh index 692e9e75e67..f1bbbf69de8 100644 --- a/install/archivebox-install.sh +++ b/install/archivebox-install.sh @@ -33,7 +33,7 @@ mkdir -p /opt/archivebox/{data,.npm,.cache,.local} adduser --system --shell /bin/bash --gecos 'Archive Box User' --group --disabled-password --home /home/archivebox archivebox chown -R archivebox:archivebox /opt/archivebox/{data,.npm,.cache,.local} chmod -R 755 /opt/archivebox/data -$STD uv venv --python "$PYTHON_VERSION" /opt/archivebox/.venv +$STD uv venv /opt/archivebox/.venv $STD /opt/archivebox/.venv/bin/uv pip install --all-extras archivebox $STD /opt/archivebox/.venv/bin/uv pip install playwright sudo -u archivebox /opt/archivebox/.venv/bin/playwright install-deps chromium From 97e87756166a1ae8631846ae0d33ff69043e4fff Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:30:50 +0200 Subject: [PATCH 28/66] Update tools.func --- misc/tools.func | 4 ---- 1 file changed, 4 deletions(-) diff --git a/misc/tools.func b/misc/tools.func index 065bed5d972..bd80b58ac4c 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -164,11 +164,7 @@ install_postgresql() { msg_info "Stopping PostgreSQL service" systemctl stop postgresql fi - - msg_info "Removing pgdg repo and old GPG key" rm -f /etc/apt/sources.list.d/pgdg.list /etc/apt/trusted.gpg.d/postgresql.gpg - - msg_info "Adding PostgreSQL PGDG repository" curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg From 792313297280dd2dc3427497b57d4f66d67ef49c Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:31:14 +0200 Subject: [PATCH 29/66] Update adventurelog-install.sh --- install/adventurelog-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/adventurelog-install.sh b/install/adventurelog-install.sh index cea09b61095..1da60cfa3f7 100644 --- a/install/adventurelog-install.sh +++ b/install/adventurelog-install.sh @@ -78,7 +78,7 @@ DISABLE_REGISTRATION=False EOF cd /opt/adventurelog/backend/server mkdir -p /opt/adventurelog/backend/server/media -$STD uv venv --python /opt/adventurelog/backend/server/.venv +$STD uv venv /opt/adventurelog/backend/server/.venv $STD uv pip install --upgrade pip $STD uv pip install -r requirements.txt $STD uv run python manage.py collectstatic --noinput From 581cbae64e74244ac2f293b6c6509682d00008c1 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:35:39 +0200 Subject: [PATCH 30/66] Update archivebox-install.sh --- install/archivebox-install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install/archivebox-install.sh b/install/archivebox-install.sh index f1bbbf69de8..869ce3379d9 100644 --- a/install/archivebox-install.sh +++ b/install/archivebox-install.sh @@ -34,8 +34,9 @@ adduser --system --shell /bin/bash --gecos 'Archive Box User' --group --disabled chown -R archivebox:archivebox /opt/archivebox/{data,.npm,.cache,.local} chmod -R 755 /opt/archivebox/data $STD uv venv /opt/archivebox/.venv -$STD /opt/archivebox/.venv/bin/uv pip install --all-extras archivebox -$STD /opt/archivebox/.venv/bin/uv pip install playwright +$STD /opt/archivebox/.venv/bin/python -m pip install --upgrade pip +$STD /opt/archivebox/.venv/bin/python -m pip install --all-extras archivebox +$STD /opt/archivebox/.venv/bin/python -m pip install playwright sudo -u archivebox /opt/archivebox/.venv/bin/playwright install-deps chromium msg_ok "Installed ArchiveBox & Playwright" From 961464e1e288fc54db8242f2333a9caf543d390b Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:36:49 +0200 Subject: [PATCH 31/66] Update adventurelog-install.sh --- install/adventurelog-install.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install/adventurelog-install.sh b/install/adventurelog-install.sh index 1da60cfa3f7..26154153def 100644 --- a/install/adventurelog-install.sh +++ b/install/adventurelog-install.sh @@ -79,11 +79,11 @@ EOF cd /opt/adventurelog/backend/server mkdir -p /opt/adventurelog/backend/server/media $STD uv venv /opt/adventurelog/backend/server/.venv -$STD uv pip install --upgrade pip -$STD uv pip install -r requirements.txt -$STD uv run python manage.py collectstatic --noinput -$STD uv run python manage.py migrate -$STD uv run python manage.py download-countries +$STD /opt/adventurelog/backend/server/.venv/bin/python -m pip install --upgrade pip +$STD /opt/adventurelog/backend/server/.venv/bin/python -m pip install -r requirements.txt +$STD /opt/adventurelog/backend/server/.venv/bin/python manage.py collectstatic --noinput +$STD /opt/adventurelog/backend/server/.venv/bin/python manage.py migrate +$STD /opt/adventurelog/backend/server/.venv/bin/python manage.py download-countries cat </opt/adventurelog/frontend/.env PUBLIC_SERVER_URL=http://$LOCAL_IP:8000 BODY_SIZE_LIMIT=Infinity From 68b4ff652af078c7b6413e02ec8753d8eea80c6a Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:59:21 +0200 Subject: [PATCH 32/66] fix uv install --- install/archivebox-install.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/install/archivebox-install.sh b/install/archivebox-install.sh index 869ce3379d9..06f2c0b051d 100644 --- a/install/archivebox-install.sh +++ b/install/archivebox-install.sh @@ -34,9 +34,8 @@ adduser --system --shell /bin/bash --gecos 'Archive Box User' --group --disabled chown -R archivebox:archivebox /opt/archivebox/{data,.npm,.cache,.local} chmod -R 755 /opt/archivebox/data $STD uv venv /opt/archivebox/.venv -$STD /opt/archivebox/.venv/bin/python -m pip install --upgrade pip -$STD /opt/archivebox/.venv/bin/python -m pip install --all-extras archivebox -$STD /opt/archivebox/.venv/bin/python -m pip install playwright +$STD uv pip install "[all]" +$STD uv pip install playwright sudo -u archivebox /opt/archivebox/.venv/bin/playwright install-deps chromium msg_ok "Installed ArchiveBox & Playwright" From 88cae8982fb6d280dadd441b1e985f6ab0c20b30 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 13:06:17 +0200 Subject: [PATCH 33/66] some fixes with venv --- install/bazarr-install.sh | 1 + install/calibre-web-install.sh | 4 ++-- install/changedetection-install.sh | 2 +- install/crafty-controller-install.sh | 6 +++--- install/deluge-install.sh | 1 - install/documenso-install.sh | 1 - install/esphome-install.sh | 1 - misc/tools.func | 2 +- 8 files changed, 8 insertions(+), 10 deletions(-) diff --git a/install/bazarr-install.sh b/install/bazarr-install.sh index cdf17e8c749..f7727d5526e 100755 --- a/install/bazarr-install.sh +++ b/install/bazarr-install.sh @@ -21,6 +21,7 @@ curl -fsSL "https://github.com/morpheus65535/bazarr/releases/latest/download/baz $STD unzip bazarr -d /opt/bazarr chmod 775 /opt/bazarr /var/lib/bazarr/ cd /opt/bazarr +$STD uv venv /opt/bazarr/.venv $STD /opt/bazarr/.venv/bin/uv pip install -r requirements.txt msg_ok "Installed Bazarr" diff --git a/install/calibre-web-install.sh b/install/calibre-web-install.sh index 905cd6324b9..ea91a38ee3c 100644 --- a/install/calibre-web-install.sh +++ b/install/calibre-web-install.sh @@ -31,8 +31,8 @@ msg_info "Installing Calibre-Web" mkdir -p /opt/calibre-web $STD curl -fsSL https://github.com/janeczku/calibre-web/raw/master/library/metadata.db -o /opt/calibre-web/metadata.db cd /opt/calibre-web -$STD uv venv .venv -$STD .venv/bin/uv pip install calibreweb jsonschema +$STD uv venv /opt/calibre-web/.venv +$STD /opt/calibre-web/.venv/bin/uv pip install calibreweb jsonschema msg_ok "Installed Calibre-Web" msg_info "Creating Service" diff --git a/install/changedetection-install.sh b/install/changedetection-install.sh index 245a05c05af..3f1bc855df9 100644 --- a/install/changedetection-install.sh +++ b/install/changedetection-install.sh @@ -49,7 +49,7 @@ NODE_VERSION="22" install_node_and_modules msg_info "Installing Change Detection" mkdir -p /opt/changedetection cd /opt/changedetection -$STD uv venv .venv +$STD uv venv /opt/changedetection/.venv $STD /opt/changedetection/.venv/bin/uv pip install changedetection.io msg_ok "Installed Change Detection" diff --git a/install/crafty-controller-install.sh b/install/crafty-controller-install.sh index 7273a7af355..a88757492ab 100644 --- a/install/crafty-controller-install.sh +++ b/install/crafty-controller-install.sh @@ -23,6 +23,8 @@ $STD apt-get install -y \ software-properties-common msg_ok "Installed Dependencies" +PYTHON_VERSION="3.12" setup_uv + msg_info "Setting up TemurinJDK" mkdir -p /etc/apt/keyrings curl -fsSL "https://packages.adoptium.net/artifactory/api/gpg/key/public" | tee /etc/apt/keyrings/adoptium.asc @@ -32,8 +34,6 @@ $STD apt-get install -y temurin-{8,11,17,21}-jre sudo update-alternatives --set java /usr/lib/jvm/temurin-21-jre-amd64/bin/java msg_ok "Installed TemurinJDK" -PYTHON_VERSION="3.12" setup_uv - msg_info "Installing Craty-Controller (Patience)" useradd crafty -m -s /bin/bash cd /opt @@ -46,7 +46,7 @@ cp -a crafty-4-v${RELEASE}/. /opt/crafty-controller/crafty/crafty-4/ rm -rf crafty-4-v${RELEASE} cd /opt/crafty-controller/crafty -$STD uv venv .venv +$STD uv venv /opt/crafty-controller/crafty/.venv chown -R crafty:crafty /opt/crafty-controller/ $STD sudo -u crafty bash -c ' source /opt/crafty-controller/crafty/.venv/bin/activate diff --git a/install/deluge-install.sh b/install/deluge-install.sh index 21cac7b5b29..375954ad908 100644 --- a/install/deluge-install.sh +++ b/install/deluge-install.sh @@ -22,7 +22,6 @@ PYTHON_VERSION="3.12" setup_uv msg_info "Installing Deluge" mkdir -p /opt/deluge $STD uv venv /opt/deluge/.venv -source /opt/deluge/.venv/bin/activate $STD /opt/deluge/.venv/bin/uv pip install deluge[all] msg_ok "Installed Deluge" diff --git a/install/documenso-install.sh b/install/documenso-install.sh index 142765c857f..ac0c943202c 100644 --- a/install/documenso-install.sh +++ b/install/documenso-install.sh @@ -55,7 +55,6 @@ $STD unzip v${RELEASE}.zip mv documenso-${RELEASE} /opt/documenso cd /opt/documenso $STD uv venv /opt/documenso/.venv -source /opt/documenso/.venv/bin/activate $STD /opt/documenso/.venv/bin/uv pip install bcrypt mv .env.example /opt/documenso/.env sed -i \ diff --git a/install/esphome-install.sh b/install/esphome-install.sh index 2ceaaf40770..892ed16d522 100644 --- a/install/esphome-install.sh +++ b/install/esphome-install.sh @@ -22,7 +22,6 @@ PYTHON_VERSION="3.12" setup_uv msg_info "Setting up Virtual Environment" mkdir -p /opt/esphome $STD uv venv /opt/esphome/.venv -source /opt/esphome/.venv/bin/activate $STD /opt/esphome/.venv/bin/uv pip install esphome tornado esptool msg_ok "Setup and Installed ESPHome" diff --git a/misc/tools.func b/misc/tools.func index bd80b58ac4c..03e58a2b3fa 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -1103,7 +1103,7 @@ function setup_uv() { msg_error "Failed to install Python $VERSION_MATCH via uv" return 1 fi - msg_ok "Installed Python $VERSION_MATCH via uv" + msg_ok "Installed Python $VERSION_MATCH" fi fi } From 00fe49156d04950ac0d478e00edccd59375d45ec Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 13:07:18 +0200 Subject: [PATCH 34/66] fix pip for adventurelog --- install/adventurelog-install.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/install/adventurelog-install.sh b/install/adventurelog-install.sh index 26154153def..1ec587ee0cf 100644 --- a/install/adventurelog-install.sh +++ b/install/adventurelog-install.sh @@ -79,11 +79,10 @@ EOF cd /opt/adventurelog/backend/server mkdir -p /opt/adventurelog/backend/server/media $STD uv venv /opt/adventurelog/backend/server/.venv -$STD /opt/adventurelog/backend/server/.venv/bin/python -m pip install --upgrade pip -$STD /opt/adventurelog/backend/server/.venv/bin/python -m pip install -r requirements.txt -$STD /opt/adventurelog/backend/server/.venv/bin/python manage.py collectstatic --noinput -$STD /opt/adventurelog/backend/server/.venv/bin/python manage.py migrate -$STD /opt/adventurelog/backend/server/.venv/bin/python manage.py download-countries +$STD uv pip install -r requirements.txt +$STD uv run python manage.py collectstatic --noinput +$STD uv run python manage.py migrate +$STD uv run python manage.py download-countries cat </opt/adventurelog/frontend/.env PUBLIC_SERVER_URL=http://$LOCAL_IP:8000 BODY_SIZE_LIMIT=Infinity From 3b9160a1aaca9e0aa0b40ab9612bb4a6ad0eb209 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 13:16:48 +0200 Subject: [PATCH 35/66] some fixes --- install/bazarr-install.sh | 2 +- install/calibre-web-install.sh | 2 +- install/changedetection-install.sh | 2 +- install/crafty-controller-install.sh | 3 +-- install/deluge-install.sh | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/install/bazarr-install.sh b/install/bazarr-install.sh index f7727d5526e..3d4d3568682 100755 --- a/install/bazarr-install.sh +++ b/install/bazarr-install.sh @@ -22,7 +22,7 @@ $STD unzip bazarr -d /opt/bazarr chmod 775 /opt/bazarr /var/lib/bazarr/ cd /opt/bazarr $STD uv venv /opt/bazarr/.venv -$STD /opt/bazarr/.venv/bin/uv pip install -r requirements.txt +$STD uv pip install -r requirements.txt msg_ok "Installed Bazarr" msg_info "Creating Service" diff --git a/install/calibre-web-install.sh b/install/calibre-web-install.sh index ea91a38ee3c..7ad2bf0f3fd 100644 --- a/install/calibre-web-install.sh +++ b/install/calibre-web-install.sh @@ -32,7 +32,7 @@ mkdir -p /opt/calibre-web $STD curl -fsSL https://github.com/janeczku/calibre-web/raw/master/library/metadata.db -o /opt/calibre-web/metadata.db cd /opt/calibre-web $STD uv venv /opt/calibre-web/.venv -$STD /opt/calibre-web/.venv/bin/uv pip install calibreweb jsonschema +$STD uv pip install calibreweb jsonschema msg_ok "Installed Calibre-Web" msg_info "Creating Service" diff --git a/install/changedetection-install.sh b/install/changedetection-install.sh index 3f1bc855df9..168302703c3 100644 --- a/install/changedetection-install.sh +++ b/install/changedetection-install.sh @@ -50,7 +50,7 @@ msg_info "Installing Change Detection" mkdir -p /opt/changedetection cd /opt/changedetection $STD uv venv /opt/changedetection/.venv -$STD /opt/changedetection/.venv/bin/uv pip install changedetection.io +$STD uv pip install changedetection.io msg_ok "Installed Change Detection" msg_info "Installing Browserless & Playwright" diff --git a/install/crafty-controller-install.sh b/install/crafty-controller-install.sh index a88757492ab..b924f39519d 100644 --- a/install/crafty-controller-install.sh +++ b/install/crafty-controller-install.sh @@ -49,9 +49,8 @@ cd /opt/crafty-controller/crafty $STD uv venv /opt/crafty-controller/crafty/.venv chown -R crafty:crafty /opt/crafty-controller/ $STD sudo -u crafty bash -c ' - source /opt/crafty-controller/crafty/.venv/bin/activate cd /opt/crafty-controller/crafty/crafty-4 - /opt/crafty-controller/crafty/.venv/bin/uv pip install --no-cache-dir -r requirements.txt + uv pip install --no-cache-dir -r requirements.txt ' msg_ok "Installed Craft-Controller and dependencies" diff --git a/install/deluge-install.sh b/install/deluge-install.sh index 375954ad908..02fbf2245ff 100644 --- a/install/deluge-install.sh +++ b/install/deluge-install.sh @@ -22,7 +22,7 @@ PYTHON_VERSION="3.12" setup_uv msg_info "Installing Deluge" mkdir -p /opt/deluge $STD uv venv /opt/deluge/.venv -$STD /opt/deluge/.venv/bin/uv pip install deluge[all] +$STD uv pip install deluge[all] msg_ok "Installed Deluge" msg_info "Creating Service" From e5f2535b6f79e0f9b9321ca85ca03901827d410e Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 13:28:38 +0200 Subject: [PATCH 36/66] remove "This will create an ... LXC" --- install/archivebox-install.sh | 23 ++++++++++++++++++----- misc/build.func | 5 ----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/install/archivebox-install.sh b/install/archivebox-install.sh index 06f2c0b051d..54ee9c13506 100644 --- a/install/archivebox-install.sh +++ b/install/archivebox-install.sh @@ -29,14 +29,27 @@ PYTHON_VERSION="3.12" setup_uv NODE_VERSION="22" install_node_and_modules msg_info "Installing ArchiveBox" + mkdir -p /opt/archivebox/{data,.npm,.cache,.local} adduser --system --shell /bin/bash --gecos 'Archive Box User' --group --disabled-password --home /home/archivebox archivebox -chown -R archivebox:archivebox /opt/archivebox/{data,.npm,.cache,.local} -chmod -R 755 /opt/archivebox/data -$STD uv venv /opt/archivebox/.venv -$STD uv pip install "[all]" -$STD uv pip install playwright + +cd /opt/archivebox +uv venv --python 3.12 .venv + +EXTRAS=$(curl -s https://raw.githubusercontent.com/ArchiveBox/ArchiveBox/dev/setup.cfg | + awk '/\[options.extras_require\]/,/\[.*\]/' | + grep -E '^[a-zA-Z0-9_-]+ *= *' | + cut -d= -f1 | tr -d ' ' | paste -sd, -) + +uv pip install "archivebox[$EXTRAS]" +uv pip install playwright + +chown -R archivebox:archivebox /opt/archivebox +chmod -R 755 /opt/archivebox + sudo -u archivebox /opt/archivebox/.venv/bin/playwright install-deps chromium +sudo -u archivebox /opt/archivebox/.venv/bin/playwright install chromium + msg_ok "Installed ArchiveBox & Playwright" msg_info "Initial ArchiveBox Setup" diff --git a/misc/build.func b/misc/build.func index 00cfcf54919..857bc40abee 100644 --- a/misc/build.func +++ b/misc/build.func @@ -1027,11 +1027,6 @@ check_container_storage() { start() { source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/tools.func) 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 - clear - exit_script - exit - fi SPINNER_PID="" install_script fi From 201d2ae93ef7014a0f309bb7fe8f7cf4374eba19 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 13:30:15 +0200 Subject: [PATCH 37/66] Update archivebox-install.sh --- install/archivebox-install.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/install/archivebox-install.sh b/install/archivebox-install.sh index 54ee9c13506..2bd5c0d8bac 100644 --- a/install/archivebox-install.sh +++ b/install/archivebox-install.sh @@ -35,13 +35,7 @@ adduser --system --shell /bin/bash --gecos 'Archive Box User' --group --disabled cd /opt/archivebox uv venv --python 3.12 .venv - -EXTRAS=$(curl -s https://raw.githubusercontent.com/ArchiveBox/ArchiveBox/dev/setup.cfg | - awk '/\[options.extras_require\]/,/\[.*\]/' | - grep -E '^[a-zA-Z0-9_-]+ *= *' | - cut -d= -f1 | tr -d ' ' | paste -sd, -) - -uv pip install "archivebox[$EXTRAS]" +uv pip install "archivebox[all]" uv pip install playwright chown -R archivebox:archivebox /opt/archivebox From 591c37cbacd5ee558074c38adfb33b2dbc20dd6f Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 13:52:34 +0200 Subject: [PATCH 38/66] harmonize .venv --- install/bazarr-install.sh | 2 +- install/deluge-install.sh | 1 + install/documenso-install.sh | 2 +- install/esphome-install.sh | 2 +- install/spoolman-install.sh | 6 +++--- install/streamlink-webui-install.sh | 4 +--- install/tandoor-install.sh | 15 ++++++++------- install/tasmocompiler-install.sh | 6 ++++-- install/tautulli-install.sh | 9 +++++---- install/unmanic-install.sh | 8 +++++--- install/wger-install.sh | 4 ++-- 11 files changed, 32 insertions(+), 27 deletions(-) diff --git a/install/bazarr-install.sh b/install/bazarr-install.sh index 3d4d3568682..9c614ef5f23 100755 --- a/install/bazarr-install.sh +++ b/install/bazarr-install.sh @@ -22,7 +22,7 @@ $STD unzip bazarr -d /opt/bazarr chmod 775 /opt/bazarr /var/lib/bazarr/ cd /opt/bazarr $STD uv venv /opt/bazarr/.venv -$STD uv pip install -r requirements.txt +$STD /opt/bazarr/.venv/bin/python -m pip install -r requirements.txt msg_ok "Installed Bazarr" msg_info "Creating Service" diff --git a/install/deluge-install.sh b/install/deluge-install.sh index 02fbf2245ff..413bdc0de66 100644 --- a/install/deluge-install.sh +++ b/install/deluge-install.sh @@ -21,6 +21,7 @@ PYTHON_VERSION="3.12" setup_uv msg_info "Installing Deluge" mkdir -p /opt/deluge +cd /opt/deluge $STD uv venv /opt/deluge/.venv $STD uv pip install deluge[all] msg_ok "Installed Deluge" diff --git a/install/documenso-install.sh b/install/documenso-install.sh index ac0c943202c..47e8d709327 100644 --- a/install/documenso-install.sh +++ b/install/documenso-install.sh @@ -55,7 +55,7 @@ $STD unzip v${RELEASE}.zip mv documenso-${RELEASE} /opt/documenso cd /opt/documenso $STD uv venv /opt/documenso/.venv -$STD /opt/documenso/.venv/bin/uv pip install bcrypt +$STD uv pip install bcrypt mv .env.example /opt/documenso/.env sed -i \ -e "s|^NEXTAUTH_SECRET=.*|NEXTAUTH_SECRET='$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-32)'|" \ diff --git a/install/esphome-install.sh b/install/esphome-install.sh index 892ed16d522..6ec7f9cee82 100644 --- a/install/esphome-install.sh +++ b/install/esphome-install.sh @@ -22,7 +22,7 @@ PYTHON_VERSION="3.12" setup_uv msg_info "Setting up Virtual Environment" mkdir -p /opt/esphome $STD uv venv /opt/esphome/.venv -$STD /opt/esphome/.venv/bin/uv pip install esphome tornado esptool +$STD uv pip install esphome tornado esptool msg_ok "Setup and Installed ESPHome" msg_info "Creating Service" diff --git a/install/spoolman-install.sh b/install/spoolman-install.sh index beee29ed21c..5b013924fa3 100644 --- a/install/spoolman-install.sh +++ b/install/spoolman-install.sh @@ -31,8 +31,8 @@ curl -fsSL "https://github.com/Donkie/Spoolman/releases/download/$RELEASE/spoolm $STD unzip spoolman.zip -d spoolman rm -f spoolman.zip cd spoolman -$STD uv venv /opt/spoolman/venv -$STD /opt/spoolman/venv/bin/uv pip install -r requirements.txt +$STD uv venv /opt/spoolman/.venv +$STD uv pip install -r requirements.txt curl -fsSL "https://raw.githubusercontent.com/Donkie/Spoolman/master/.env.example" -o ".env" echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Installed Spoolman" @@ -47,7 +47,7 @@ After=network.target Type=simple WorkingDirectory=/opt/spoolman EnvironmentFile=/opt/spoolman/.env -ExecStart=/opt/spoolman/venv/bin/uvicorn spoolman.main:app --host 0.0.0.0 --port 7912 +ExecStart=/opt/spoolman/.venv/bin/uvicorn spoolman.main:app --host 0.0.0.0 --port 7912 Restart=always User=root diff --git a/install/streamlink-webui-install.sh b/install/streamlink-webui-install.sh index 2ab9fe6a2bb..c1ed5c51aa3 100644 --- a/install/streamlink-webui-install.sh +++ b/install/streamlink-webui-install.sh @@ -14,9 +14,7 @@ setting_up_container network_check update_os -NODE_VERSION="22" -NODE_MODULE="npm@latest,yarn@latest" -install_node_and_modules +NODE_VERSION="22" NODE_MODULE="npm@latest,yarn@latest" install_node_and_modules setup_uv fetch_and_deploy_gh_release "CrazyWolf13/streamlink-webui" diff --git a/install/tandoor-install.sh b/install/tandoor-install.sh index e514d17ba7a..826513a1a26 100644 --- a/install/tandoor-install.sh +++ b/install/tandoor-install.sh @@ -38,8 +38,9 @@ NODE_VERSION="20" NODE_MODULE="yarn@latest" install_node_and_modules msg_info "Installing Tandoor (Patience)" $STD git clone https://github.com/TandoorRecipes/recipes -b master /opt/tandoor mkdir -p /opt/tandoor/{config,api,mediafiles,staticfiles} -$STD uv venv /opt/tandoor/venv -$STD /opt/tandoor/venv/bin/uv pip install -r /opt/tandoor/requirements.txt +cd /opt/tandoor +$STD uv venv /opt/tandoor/.venv +$STD uv pip install -r requirements.txt cd /opt/tandoor/vue $STD yarn install @@ -59,7 +60,7 @@ sed -i -e "s|SECRET_KEY=.*|SECRET_KEY=$secret_key|g" \ -e "s|POSTGRES_USER=.*|POSTGRES_USER=$DB_USER|g" \ -e "\$a\STATIC_URL=/staticfiles/" /opt/tandoor/.env cd /opt/tandoor -$STD /opt/tandoor/venv/bin/uv run python version.py +$STD uv run python version.py msg_ok "Installed Tandoor" msg_info "Install/Set up PostgreSQL Database" @@ -77,9 +78,9 @@ echo -e "Tandoor Database Name: \e[32m$DB_NAME\e[0m" >>~/tandoor.creds echo -e "Tandoor Database User: \e[32m$DB_USER\e[0m" >>~/tandoor.creds echo -e "Tandoor Database Password: \e[32m$DB_PASS\e[0m" >>~/tandoor.creds export $(cat /opt/tandoor/.env | grep "^[^#]" | xargs) -$STD /opt/tandoor/venv/bin/uv run python manage.py migrate -$STD /opt/tandoor/venv/bin/uv run python manage.py collectstatic --no-input -$STD /opt/tandoor/venv/bin/uv run python manage.py collectstatic_js_reverse +$STD uv run python manage.py migrate +$STD uv run python manage.py collectstatic --no-input +$STD uv run python manage.py collectstatic_js_reverse msg_ok "Set up PostgreSQL Database" msg_info "Creating Services" @@ -94,7 +95,7 @@ Restart=always RestartSec=3 WorkingDirectory=/opt/tandoor EnvironmentFile=/opt/tandoor/.env -ExecStart=/opt/tandoor/venv/bin/gunicorn --error-logfile /tmp/gunicorn_err.log --log-level debug --capture-output --bind unix:/opt/tandoor/tandoor.sock recipes.wsgi:application +ExecStart=/opt/tandoor/.venv/bin/gunicorn --error-logfile /tmp/gunicorn_err.log --log-level debug --capture-output --bind unix:/opt/tandoor/tandoor.sock recipes.wsgi:application [Install] WantedBy=multi-user.target diff --git a/install/tasmocompiler-install.sh b/install/tasmocompiler-install.sh index a4ad1015855..1e31b51c922 100644 --- a/install/tasmocompiler-install.sh +++ b/install/tasmocompiler-install.sh @@ -21,8 +21,10 @@ PYTHON_VERSION="3.12" setup_uv NODE_VERSION="22" NODE_MODULE="yarn@latest" install_node_and_modules msg_info "Setup Platformio" -uv venv /opt/tasmocompiler/venv -$STD /opt/tasmocompiler/venv/bin/uv pip install platformio +mkdir -p /opt/tasmocompiler +cd /opt/tasmocompiler +$STD uv venv /opt/tasmocompiler/.venv +$STD uv pip install platformio msg_ok "Setup Platformio" msg_info "Setup TasmoCompiler" diff --git a/install/tautulli-install.sh b/install/tautulli-install.sh index 9723018b568..7c82a89912d 100644 --- a/install/tautulli-install.sh +++ b/install/tautulli-install.sh @@ -22,9 +22,10 @@ PYTHON_VERSION="3.12" setup_uv msg_info "Installing Tautulli" cd /opt $STD git clone https://github.com/Tautulli/Tautulli.git -$STD uv venv /opt/Tautulli/venv -$STD /opt/Tautulli/venv/bin/uv pip install -r /opt/Tautulli/requirements.txt -$STD /opt/Tautulli/venv/bin/uv pip install pyopenssl +cd /opt/Tautulli +$STD uv venv /opt/Tautulli/.venv +$STD uv pip install -r /opt/Tautulli/requirements.txt +$STD uv pip install pyopenssl msg_ok "Installed Tautulli" msg_info "Creating Service" @@ -38,7 +39,7 @@ WorkingDirectory=/opt/Tautulli/ Restart=on-failure RestartSec=5 Type=simple -ExecStart=/opt/Tautulli/venv/bin/python /opt/Tautulli/Tautulli.py +ExecStart=/opt/Tautulli/.venv/bin/python /opt/Tautulli/Tautulli.py KillSignal=SIGINT TimeoutStopSec=20 SyslogIdentifier=tautulli diff --git a/install/unmanic-install.sh b/install/unmanic-install.sh index 90152be2ade..7f7c8dd7ba9 100644 --- a/install/unmanic-install.sh +++ b/install/unmanic-install.sh @@ -34,8 +34,10 @@ if [[ "$CTTYPE" == "0" ]]; then fi msg_info "Installing Unmanic" -uv venv /opt/unmanic/venv -/opt/unmanic/venv/bin/uv pip install unmanic +mkdir -p /opt/unmanic +cd /opt/unmanic +$STD uv venv /opt/unmanic/.venv +$STD uv pip install unmanic sed -i -e 's/^sgx:x:104:$/render:x:104:root/' -e 's/^render:x:106:root$/sgx:x:106:/' /etc/group msg_ok "Installed Unmanic" @@ -49,7 +51,7 @@ StartLimitBurst=3 [Service] Type=simple -ExecStart=/opt/unmanic/venv/bin/unmanic +ExecStart=/opt/unmanic/.venv/bin/unmanic Restart=always RestartSec=30 diff --git a/install/wger-install.sh b/install/wger-install.sh index 6686c6e5374..32e6cefa181 100644 --- a/install/wger-install.sh +++ b/install/wger-install.sh @@ -39,8 +39,8 @@ tar xzf $RELEASE.tar.gz mv wger-$RELEASE /home/wger/src cd /home/wger/src $STD uv venv /home/wger/.venv -$STD /home/wger/.venv/bin/uv pip install -r requirements_prod.txt -$STD /home/wger/.venv/bin/uv pip install -e . +$STD uv pip install -r requirements_prod.txt +$STD uv pip install -e . $STD /home/wger/.venv/bin/wger create-settings --database-path /home/wger/db/database.sqlite sed -i "s#home/wger/src/media#home/wger/media#g" /home/wger/src/settings.py sed -i "/MEDIA_ROOT = '\/home\/wger\/media'/a STATIC_ROOT = '/home/wger/static'" /home/wger/src/settings.py From 171626edbac16d101623db927ca0e47e90ad286d Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Wed, 4 Jun 2025 14:14:11 +0200 Subject: [PATCH 39/66] Change from python3.12 to python3 for venv --- install/archivebox-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/archivebox-install.sh b/install/archivebox-install.sh index 2bd5c0d8bac..18b54f95d0b 100644 --- a/install/archivebox-install.sh +++ b/install/archivebox-install.sh @@ -34,7 +34,7 @@ mkdir -p /opt/archivebox/{data,.npm,.cache,.local} adduser --system --shell /bin/bash --gecos 'Archive Box User' --group --disabled-password --home /home/archivebox archivebox cd /opt/archivebox -uv venv --python 3.12 .venv +uv venv --python 3 .venv uv pip install "archivebox[all]" uv pip install playwright From 11d6a33da1dd42e4faffdfbfae446967dbf2ec2e Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Wed, 4 Jun 2025 14:28:04 +0200 Subject: [PATCH 40/66] Change user --- install/archivebox-install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install/archivebox-install.sh b/install/archivebox-install.sh index 18b54f95d0b..c32fb67c9e4 100644 --- a/install/archivebox-install.sh +++ b/install/archivebox-install.sh @@ -33,6 +33,7 @@ msg_info "Installing ArchiveBox" mkdir -p /opt/archivebox/{data,.npm,.cache,.local} adduser --system --shell /bin/bash --gecos 'Archive Box User' --group --disabled-password --home /home/archivebox archivebox +sudo -u archivebox bash cd /opt/archivebox uv venv --python 3 .venv uv pip install "archivebox[all]" From 1a5fdc0afa21bef9ebd3b6f002ccffb7df447428 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 14:30:21 +0200 Subject: [PATCH 41/66] fixes --- install/bazarr-install.sh | 2 ++ install/deluge-install.sh | 2 +- install/grist-install.sh | 4 +++- install/prometheus-pve-exporter-install.sh | 6 ++++-- install/sabnzbd-install.sh | 9 +++++---- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/install/bazarr-install.sh b/install/bazarr-install.sh index 9c614ef5f23..d518bed2583 100755 --- a/install/bazarr-install.sh +++ b/install/bazarr-install.sh @@ -22,6 +22,8 @@ $STD unzip bazarr -d /opt/bazarr chmod 775 /opt/bazarr /var/lib/bazarr/ cd /opt/bazarr $STD uv venv /opt/bazarr/.venv +$STD /opt/bazarr/.venv/bin/python -m ensurepip --upgrade +$STD /opt/bazarr/.venv/bin/python -m pip install --upgrade pip $STD /opt/bazarr/.venv/bin/python -m pip install -r requirements.txt msg_ok "Installed Bazarr" diff --git a/install/deluge-install.sh b/install/deluge-install.sh index 413bdc0de66..1e9a864552e 100644 --- a/install/deluge-install.sh +++ b/install/deluge-install.sh @@ -23,7 +23,7 @@ msg_info "Installing Deluge" mkdir -p /opt/deluge cd /opt/deluge $STD uv venv /opt/deluge/.venv -$STD uv pip install deluge[all] +$STD uv pip install "deluge[all]" libtorrent msg_ok "Installed Deluge" msg_info "Creating Service" diff --git a/install/grist-install.sh b/install/grist-install.sh index 9c239e84ae6..ab805d08c70 100644 --- a/install/grist-install.sh +++ b/install/grist-install.sh @@ -30,7 +30,9 @@ $STD unzip "v${RELEASE}.zip" mv "grist-core-${RELEASE}" /opt/grist cd /opt/grist $STD uv venv /opt/grist/sandbox_venv3 -$STD /opt/grist/sandbox_venv3/bin/uv pip install -r sandbox/requirements.txt +$STD /opt/grist/sandbox_venv3/bin/python -m ensurepip --upgrade +$STD /opt/grist/sandbox_venv3/bin/python -m pip install --upgrade pip +$STD /opt/grist/sandbox_venv3/bin/python -m pip install -r sandbox/requirements.txt $STD yarn install $STD yarn run build:prod ln -sf /opt/grist/sandbox_venv3/bin/python3 /opt/grist/sandbox_venv3/bin/python diff --git a/install/prometheus-pve-exporter-install.sh b/install/prometheus-pve-exporter-install.sh index 9aa90e3ab11..b3cf7cb43ef 100644 --- a/install/prometheus-pve-exporter-install.sh +++ b/install/prometheus-pve-exporter-install.sh @@ -16,8 +16,10 @@ update_os PYTHON_VERSION="3.12" setup_uv msg_info "Installing Prometheus Proxmox VE Exporter" -$STD uv pip install prometheus-pve-exporter mkdir -p /opt/prometheus-pve-exporter +cd /opt/prometheus-pve-exporter +$STD uv venv /opt/prometheus-pve-exporter/.venv +$STD uv pip install prometheus-pve-exporter cat </opt/prometheus-pve-exporter/pve.yml default: user: prometheus@pve @@ -37,7 +39,7 @@ After=syslog.target network.target User=root Restart=always Type=simple -ExecStart=/usr/local/bin/uv run pve_exporter \ +ExecStart=/opt/prometheus-pve-exporter/.venv/bin/pve_exporter \ --config.file=/opt/prometheus-pve-exporter/pve.yml \ --web.listen-address=0.0.0.0:9221 ExecReload=/bin/kill -HUP \$MAINPID diff --git a/install/sabnzbd-install.sh b/install/sabnzbd-install.sh index 6e54728c045..128b8e369d1 100644 --- a/install/sabnzbd-install.sh +++ b/install/sabnzbd-install.sh @@ -19,7 +19,7 @@ $STD apt-get install -y \ p7zip-full msg_ok "Installed Dependencies" -setup_uv PYTHON_VERSION="3.12" +PYTHON_VERSION="3.12" setup_uv msg_info "Setup Unrar" cat </etc/apt/sources.list.d/non-free.list @@ -33,11 +33,12 @@ msg_ok "Setup Unrar" msg_info "Installing SABnzbd" RELEASE=$(curl -fsSL https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') mkdir -p /opt/sabnzbd -$STD uv venv /opt/sabnzbd/venv +cd /opt/sabnzbd +$STD uv venv /opt/sabnzbd/.venv temp_file=$(mktemp) curl -fsSL "https://github.com/sabnzbd/sabnzbd/releases/download/${RELEASE}/SABnzbd-${RELEASE}-src.tar.gz" -o "$temp_file" tar -xzf "$temp_file" -C /opt/sabnzbd --strip-components=1 -$STD uv pip install -r /opt/sabnzbd/requirements.txt --python=/opt/sabnzbd/venv/bin/python +$STD uv pip install -r /opt/sabnzbd/requirements.txt echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Installed SABnzbd" @@ -49,7 +50,7 @@ After=network.target [Service] WorkingDirectory=/opt/sabnzbd -ExecStart=/opt/sabnzbd/venv/bin/python SABnzbd.py -s 0.0.0.0:7777 +ExecStart=/opt/sabnzbd/.venv/bin/python SABnzbd.py -s 0.0.0.0:7777 Restart=always User=root From 4b5b1a32a507b7ccb4d8c80d9ba7aa06f8a872d1 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 14:39:23 +0200 Subject: [PATCH 42/66] add build-essential to deluge --- install/deluge-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/deluge-install.sh b/install/deluge-install.sh index 1e9a864552e..ab93e49fd52 100644 --- a/install/deluge-install.sh +++ b/install/deluge-install.sh @@ -14,7 +14,7 @@ network_check update_os msg_info "Installing Dependencies" -$STD apt-get install -y python3-libtorrent +$STD apt-get install -y python3-libtorrent build-essential msg_ok "Installed Dependencies" PYTHON_VERSION="3.12" setup_uv From 9ed66d711c48f569fca5fcb190037e923e4114ea Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 17:08:36 +0200 Subject: [PATCH 43/66] some fixes --- install/esphome-install.sh | 2 ++ install/pialert-install.sh | 12 +++++------- install/radicale-install.sh | 8 +++++--- install/searxng-install.sh | 6 +++--- install/slskd-install.sh | 2 +- install/spoolman-install.sh | 1 + install/streamlink-webui-install.sh | 2 +- install/tandoor-install.sh | 2 +- install/tasmocompiler-install.sh | 9 ++------- install/tianji-install.sh | 3 ++- install/unmanic-install.sh | 2 +- install/wger-install.sh | 4 ++-- 12 files changed, 26 insertions(+), 27 deletions(-) diff --git a/install/esphome-install.sh b/install/esphome-install.sh index 6ec7f9cee82..edd31a10ef1 100644 --- a/install/esphome-install.sh +++ b/install/esphome-install.sh @@ -21,6 +21,8 @@ PYTHON_VERSION="3.12" setup_uv msg_info "Setting up Virtual Environment" mkdir -p /opt/esphome +mkdir -p /root/config +cd /opt/esphome $STD uv venv /opt/esphome/.venv $STD uv pip install esphome tornado esptool msg_ok "Setup and Installed ESPHome" diff --git a/install/pialert-install.sh b/install/pialert-install.sh index c5c4c057a8a..46d365779b1 100644 --- a/install/pialert-install.sh +++ b/install/pialert-install.sh @@ -44,17 +44,15 @@ msg_ok "Installed PHP Dependencies" PYTHON_VERSION="3.12" setup_uv -msg_info "Installing Python Dependencies" -source /opt/pialert/.venv/bin/activate +msg_info "Installing Pi.Alert" +curl -fsSL https://github.com/leiweibau/Pi.Alert/raw/main/tar/pialert_latest.tar | tar xvf - -C /opt >/dev/null 2>&1 +rm -rf /var/lib/ieee-data /var/www/html/index.html +cd /opt/pialert +$STD uv venv /opt/pialert/.venv $STD uv pip install mac-vendor-lookup $STD uv pip install fritzconnection $STD uv pip install cryptography $STD uv pip install pyunifi -msg_ok "Installed Python Dependencies" - -msg_info "Installing Pi.Alert" -curl -fsSL https://github.com/leiweibau/Pi.Alert/raw/main/tar/pialert_latest.tar | tar xvf - -C /opt >/dev/null 2>&1 -rm -rf /var/lib/ieee-data /var/www/html/index.html sed -i -e 's#^sudo cp -n /usr/share/ieee-data/.* /var/lib/ieee-data/#\# &#' -e '/^sudo mkdir -p 2_backup$/s/^/# /' -e '/^sudo cp \*.txt 2_backup$/s/^/# /' -e '/^sudo cp \*.csv 2_backup$/s/^/# /' /opt/pialert/back/update_vendors.sh mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.html.old ln -s /usr/share/ieee-data/ /var/lib/ diff --git a/install/radicale-install.sh b/install/radicale-install.sh index c8e374c1196..db4858da9df 100644 --- a/install/radicale-install.sh +++ b/install/radicale-install.sh @@ -21,8 +21,10 @@ msg_ok "Installed Dependencies" PYTHON_VERSION="3.12" setup_uv msg_info "Setting up Radicale" -$STD uv venv /opt/radicale -$STD /opt/radicale/bin/uv pip install --upgrade https://github.com/Kozea/Radicale/archive/master.tar.gz +mkdir -p /opt/radicale/{users} +cd /opt/radicale +$STD uv venv /opt/radicale/.venv +$STD uv pip install --upgrade https://github.com/Kozea/Radicale/archive/master.tar.gz RNDPASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) $STD htpasswd -c -b -5 /opt/radicale/users admin "$RNDPASS" { @@ -35,7 +37,7 @@ msg_ok "Done setting up Radicale" msg_info "Setup Service" cat </opt/radicale/start.sh #!/usr/bin/env bash -/opt/radicale/bin/uv run -m radicale --storage-filesystem-folder=/var/lib/radicale/collections --hosts 0.0.0.0:5232 --auth-type htpasswd --auth-htpasswd-filename /opt/radicale/users --auth-htpasswd-encryption sha512 +uv run -m radicale --storage-filesystem-folder=/var/lib/radicale/collections --hosts 0.0.0.0:5232 --auth-type htpasswd --auth-htpasswd-filename /opt/radicale/users --auth-htpasswd-encryption sha512 EOF chmod +x /opt/radicale/start.sh diff --git a/install/searxng-install.sh b/install/searxng-install.sh index e3a4fc97260..d9875bdef81 100644 --- a/install/searxng-install.sh +++ b/install/searxng-install.sh @@ -30,9 +30,9 @@ useradd -d /etc/searxng searxng chown searxng:searxng /usr/local/searxng /etc/searxng $STD git clone https://github.com/searxng/searxng.git /usr/local/searxng/searxng-src cd /usr/local/searxng/ -$STD uv venv /usr/local/searxng/searx-pyenv -$STD /usr/local/searxng/searx-pyenv/bin/uv pip install --upgrade pip setuptools wheel pyyaml -$STD /usr/local/searxng/searx-pyenv/bin/uv pip install --use-pep517 --no-build-isolation -e /usr/local/searxng/searxng-src +$STD uv venv /usr/local/searxng/.venv +$STD uv pip install --upgrade pip setuptools wheel pyyaml +$STD uv pip install --no-build-isolation -e /usr/local/searxng/searxng-src SECRET_KEY=$(openssl rand -hex 32) cat </etc/searxng/settings.yml diff --git a/install/slskd-install.sh b/install/slskd-install.sh index 737a0960c62..e758a70d3a1 100644 --- a/install/slskd-install.sh +++ b/install/slskd-install.sh @@ -43,7 +43,7 @@ $STD unzip main.zip mv soularr-main /opt/soularr cd /opt/soularr $STD uv venv /opt/soularr/.venv -$STD /opt/soularr/.venv/bin/uv pip install -r requirements.txt +$STD uv pip install -r requirements.txt sed -i \ -e "\|[Slskd]|,\|host_url|s|yourslskdapikeygoeshere|$SLSKD_API_KEY|" \ -e "/host_url/s/slskd/localhost/" \ diff --git a/install/spoolman-install.sh b/install/spoolman-install.sh index 5b013924fa3..c3ebbf8616d 100644 --- a/install/spoolman-install.sh +++ b/install/spoolman-install.sh @@ -33,6 +33,7 @@ rm -f spoolman.zip cd spoolman $STD uv venv /opt/spoolman/.venv $STD uv pip install -r requirements.txt + curl -fsSL "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/streamlink-webui-install.sh b/install/streamlink-webui-install.sh index c1ed5c51aa3..ab83ee58ec7 100644 --- a/install/streamlink-webui-install.sh +++ b/install/streamlink-webui-install.sh @@ -15,7 +15,7 @@ network_check update_os NODE_VERSION="22" NODE_MODULE="npm@latest,yarn@latest" install_node_and_modules -setup_uv +PYTHON_VERSION="3.12" setup_uv fetch_and_deploy_gh_release "CrazyWolf13/streamlink-webui" msg_info "Setup ${APPLICATION}" diff --git a/install/tandoor-install.sh b/install/tandoor-install.sh index 826513a1a26..878c9fb6887 100644 --- a/install/tandoor-install.sh +++ b/install/tandoor-install.sh @@ -15,7 +15,7 @@ network_check update_os msg_info "Installing Dependencies (Patience)" -$STD apt-get install -y --no-install-recommends \ +$STD apt-get install -y \ build-essential \ libpq-dev \ libmagic-dev \ diff --git a/install/tasmocompiler-install.sh b/install/tasmocompiler-install.sh index 1e31b51c922..9277b8db345 100644 --- a/install/tasmocompiler-install.sh +++ b/install/tasmocompiler-install.sh @@ -20,13 +20,6 @@ msg_ok "Installed Dependencies" PYTHON_VERSION="3.12" setup_uv NODE_VERSION="22" NODE_MODULE="yarn@latest" install_node_and_modules -msg_info "Setup Platformio" -mkdir -p /opt/tasmocompiler -cd /opt/tasmocompiler -$STD uv venv /opt/tasmocompiler/.venv -$STD uv pip install platformio -msg_ok "Setup Platformio" - msg_info "Setup TasmoCompiler" mkdir /tmp/Tasmota RELEASE=$(curl -fsSL https://api.github.com/repos/benzino77/tasmocompiler/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') @@ -35,6 +28,8 @@ cd /tmp tar xzf /tmp/v${RELEASE}.tar.gz mv tasmocompiler-${RELEASE}/ /opt/tasmocompiler/ cd /opt/tasmocompiler +$STD uv venv /opt/tasmocompiler/.venv +$STD uv pip install platformio $STD yarn install export NODE_OPTIONS=--openssl-legacy-provider $STD npm i diff --git a/install/tianji-install.sh b/install/tianji-install.sh index af2c02d4c5c..45b4200a4ac 100644 --- a/install/tianji-install.sh +++ b/install/tianji-install.sh @@ -21,7 +21,8 @@ $STD apt-get install -y \ build-essential \ git \ make \ - ca-certificates + ca-certificates \ + jq msg_ok "Installed Dependencies" NODE_VERSION="22" NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/msgbyte/tianji/master/package.json | jq -r '.packageManager | split("@")[1]')" install_node_and_modules diff --git a/install/unmanic-install.sh b/install/unmanic-install.sh index 7f7c8dd7ba9..a826a976c9c 100644 --- a/install/unmanic-install.sh +++ b/install/unmanic-install.sh @@ -14,7 +14,7 @@ network_check update_os msg_info "Installing Dependencies (Patience)" -$STD apt-get install -y ffmpeg +$STD apt-get install -y ffmpeg gcc msg_ok "Installed Dependencies" PYTHON_VERSION="3.12" setup_uv diff --git a/install/wger-install.sh b/install/wger-install.sh index 32e6cefa181..d49d527bf7e 100644 --- a/install/wger-install.sh +++ b/install/wger-install.sh @@ -38,14 +38,14 @@ curl -fsSL "https://github.com/wger-project/wger/archive/refs/tags/$RELEASE.tar. tar xzf $RELEASE.tar.gz mv wger-$RELEASE /home/wger/src cd /home/wger/src +$STD /home/wger/.venv/bin/wger create-settings --database-path /home/wger/db/database.sqlite $STD uv venv /home/wger/.venv $STD uv pip install -r requirements_prod.txt $STD uv pip install -e . -$STD /home/wger/.venv/bin/wger create-settings --database-path /home/wger/db/database.sqlite sed -i "s#home/wger/src/media#home/wger/media#g" /home/wger/src/settings.py sed -i "/MEDIA_ROOT = '\/home\/wger\/media'/a STATIC_ROOT = '/home/wger/static'" /home/wger/src/settings.py $STD /home/wger/.venv/bin/wger bootstrap -$STD /home/wger/.venv/bin/uv run python manage.py collectstatic +$STD uv run python manage.py collectstatic echo "${RELEASE}" >/opt/wger_version.txt msg_ok "Finished setting up wger" From c675b23d05744846aa6f29c196a22aadb154a557 Mon Sep 17 00:00:00 2001 From: CanbiZ Date: Wed, 4 Jun 2025 19:19:41 +0200 Subject: [PATCH 44/66] fix tasmocompiler --- install/tasmocompiler-install.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/install/tasmocompiler-install.sh b/install/tasmocompiler-install.sh index 9277b8db345..e056df1586b 100644 --- a/install/tasmocompiler-install.sh +++ b/install/tasmocompiler-install.sh @@ -29,15 +29,17 @@ tar xzf /tmp/v${RELEASE}.tar.gz mv tasmocompiler-${RELEASE}/ /opt/tasmocompiler/ cd /opt/tasmocompiler $STD uv venv /opt/tasmocompiler/.venv -$STD uv pip install platformio +$STD /opt/tasmocompiler/.venv/bin/python -m ensurepip --upgrade +$STD /opt/tasmocompiler/.venv/bin/python -m pip install --upgrade pip +$STD /opt/tasmocompiler/.venv/bin/python -m pip install platformio $STD yarn install export NODE_OPTIONS=--openssl-legacy-provider $STD npm i $STD yarn build mkdir -p /usr/local/bin -ln -sf /opt/tasmocompiler/venv/bin/platformio /usr/local/bin/platformio -ln -sf /opt/tasmocompiler/venv/bin/pio /usr/local/bin/pio -ln -sf /opt/tasmocompiler/venv/bin/piodebuggdb /usr/local/bin/piodebuggdb +ln -sf /opt/tasmocompiler/.venv/bin/platformio /usr/local/bin/platformio +ln -sf /opt/tasmocompiler/.venv/bin/pio /usr/local/bin/pio +ln -sf /opt/tasmocompiler/.venv/bin/piodebuggdb /usr/local/bin/piodebuggdb echo "${RELEASE}" >"/opt/tasmocompiler_version.txt" msg_ok "Setup TasmoCompiler" From 083810ff5a2fdba8d9df22a05518f1ef8f0cbc65 Mon Sep 17 00:00:00 2001 From: CanbiZ Date: Wed, 4 Jun 2025 19:38:30 +0200 Subject: [PATCH 45/66] more uv migs --- install/adventurelog-install.sh | 12 +++++++----- install/stirling-pdf-install.sh | 6 ++++-- install/tandoor-install.sh | 12 +++++++----- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/install/adventurelog-install.sh b/install/adventurelog-install.sh index 1ec587ee0cf..ade69d13fbd 100644 --- a/install/adventurelog-install.sh +++ b/install/adventurelog-install.sh @@ -79,10 +79,12 @@ EOF cd /opt/adventurelog/backend/server mkdir -p /opt/adventurelog/backend/server/media $STD uv venv /opt/adventurelog/backend/server/.venv -$STD uv pip install -r requirements.txt -$STD uv run python manage.py collectstatic --noinput -$STD uv run python manage.py migrate -$STD uv run python manage.py download-countries +$STD /opt/adventurelog/backend/server/.venv/bin/python -m ensurepip --upgrade +$STD /opt/adventurelog/backend/server/.venv/bin/python -m pip install --upgrade pip +$STD /opt/adventurelog/backend/server/.venv/bin/python -m pip install -r requirements.txt +$STD /opt/adventurelog/backend/server/.venv/bin/python -m manage.py collectstatic --noinput +$STD /opt/adventurelog/backend/server/.venv/bin/python -m manage.py migrate +$STD /opt/adventurelog/backend/server/.venv/bin/python -m manage.py download-countries cat </opt/adventurelog/frontend/.env PUBLIC_SERVER_URL=http://$LOCAL_IP:8000 BODY_SIZE_LIMIT=Infinity @@ -95,7 +97,7 @@ echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" msg_ok "Installed AdventureLog" msg_info "Setting up Django Admin" -$STD uv run python /opt/adventurelog/backend/server/manage.py shell <>~/tandoor.creds echo -e "Tandoor Database User: \e[32m$DB_USER\e[0m" >>~/tandoor.creds echo -e "Tandoor Database Password: \e[32m$DB_PASS\e[0m" >>~/tandoor.creds export $(cat /opt/tandoor/.env | grep "^[^#]" | xargs) -$STD uv run python manage.py migrate -$STD uv run python manage.py collectstatic --no-input -$STD uv run python manage.py collectstatic_js_reverse +$STD /opt/tandoor/.venv/bin/python -m manage.py migrate +$STD /opt/tandoor/.venv/bin/python -m manage.py collectstatic --no-input +$STD /opt/tandoor/.venv/bin/python -m python manage.py collectstatic_js_reverse msg_ok "Set up PostgreSQL Database" msg_info "Creating Services" From 82a0b1ff6050714c22f31ae404634f2dac3bded0 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 5 Jun 2025 11:23:03 +0200 Subject: [PATCH 46/66] testing --- install/archivebox-install.sh | 7 ++++--- install/babybuddy-install.sh | 9 ++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/install/archivebox-install.sh b/install/archivebox-install.sh index c32fb67c9e4..f3a490aff30 100644 --- a/install/archivebox-install.sh +++ b/install/archivebox-install.sh @@ -35,9 +35,10 @@ adduser --system --shell /bin/bash --gecos 'Archive Box User' --group --disabled sudo -u archivebox bash cd /opt/archivebox -uv venv --python 3 .venv -uv pip install "archivebox[all]" -uv pip install playwright +$STD uv venv /opt/archivebox/.venv +$STD /opt/archivebox/.venv/bin/python -m ensurepip --upgrade +$STD /opt/archivebox/.venv/bin/python -m pip install --upgrade pip +$STD /opt/archivebox/.venv/bin/python -m pip install archivebox playwright chown -R archivebox:archivebox /opt/archivebox chmod -R 755 /opt/archivebox diff --git a/install/babybuddy-install.sh b/install/babybuddy-install.sh index 7fb7cf46c05..472c4edb106 100644 --- a/install/babybuddy-install.sh +++ b/install/babybuddy-install.sh @@ -31,8 +31,10 @@ mkdir -p /opt/{babybuddy,data} curl -fsSL "https://github.com/babybuddy/babybuddy/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file" tar zxf "$temp_file" --strip-components=1 -C /opt/babybuddy cd /opt/babybuddy -$STD uv venv .venv -$STD .venv/bin/uv pip install -r requirements.txt +$STD uv venv /opt/babybuddy/.venv +$STD /opt/babybuddy/.venv/bin/python -m ensurepip --upgrade +$STD /opt/babybuddy/.venv/bin/python -m pip install --upgrade pip +$STD /opt/babybuddy/.venv/bin/python -m pip install -r requirements.txt cp babybuddy/settings/production.example.py babybuddy/settings/production.py SECRET_KEY=$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-32) @@ -43,7 +45,8 @@ sed -i \ babybuddy/settings/production.py export DJANGO_SETTINGS_MODULE=babybuddy.settings.production -$STD /opt/babybuddy/.venv/bin/python manage.py migrate +cd /opt/babybuddy +$STD /opt/babybuddy/.venv/bin/python -m manage.py migrate chown -R www-data:www-data /opt/data chmod 640 /opt/data/db.sqlite3 chmod 750 /opt/data From 2664b358c6ad6ab9372d4ab1687eaf742a0f3ed2 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 5 Jun 2025 12:56:22 +0200 Subject: [PATCH 47/66] more migs --- install/metube-install.sh | 9 ++++++--- install/motioneye-install.sh | 4 +++- install/pialert-install.sh | 7 +++---- install/unmanic-install.sh | 4 +++- install/wger-install.sh | 9 ++++++--- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/install/metube-install.sh b/install/metube-install.sh index bf1bc2ecce2..060bc788905 100644 --- a/install/metube-install.sh +++ b/install/metube-install.sh @@ -36,9 +36,12 @@ cd /opt/metube/ui $STD npm install $STD node_modules/.bin/ng build cd /opt/metube -$STD uv venv .venv -$STD .venv/bin/uv pip install pipenv -$STD .venv/bin/pipenv install +$STD uv venv /opt/motioneye/.venv +$STD /opt/metube/.venv/bin/python -m ensurepip --upgrade +$STD /opt/metube/.venv/bin/python -m pip install --upgrade pip +$STD /opt/metube/.venv/bin/python -m pip install pipenv +$STD /opt/metube/.venv/bin/pipenv install + mkdir -p /opt/metube_downloads /opt/metube_downloads/.metube /opt/metube_downloads/music /opt/metube_downloads/videos cat </opt/metube/.env DOWNLOAD_DIR=/opt/metube_downloads diff --git a/install/motioneye-install.sh b/install/motioneye-install.sh index d7e69ccf4c4..73599a892b3 100644 --- a/install/motioneye-install.sh +++ b/install/motioneye-install.sh @@ -33,7 +33,9 @@ msg_ok "Installed FFmpeg" msg_info "Installing MotionEye" $STD apt-get update $STD uv venv /opt/motioneye/.venv -$STD /opt/motioneye/.venv/bin/uv pip install git+https://github.com/motioneye-project/motioneye.git@dev +$STD /opt/motioneye/.venv/bin/python -m ensurepip --upgrade +$STD /opt/motioneye/.venv/bin/python -m pip install --upgrade pip +$STD /opt/motioneye/.venv/bin/python -m pip install git+https://github.com/motioneye-project/motioneye.git@dev mkdir -p /etc/motioneye chown -R root:root /etc/motioneye diff --git a/install/pialert-install.sh b/install/pialert-install.sh index 46d365779b1..c6689f17e8d 100644 --- a/install/pialert-install.sh +++ b/install/pialert-install.sh @@ -49,10 +49,9 @@ curl -fsSL https://github.com/leiweibau/Pi.Alert/raw/main/tar/pialert_latest.tar rm -rf /var/lib/ieee-data /var/www/html/index.html cd /opt/pialert $STD uv venv /opt/pialert/.venv -$STD uv pip install mac-vendor-lookup -$STD uv pip install fritzconnection -$STD uv pip install cryptography -$STD uv pip install pyunifi +$STD /opt/pialert/.venv/bin/python -m ensurepip --upgrade +$STD /opt/pialert/.venv/bin/python -m pip install --upgrade pip +$STD /opt/pialert/.venv/bin/python -m pip install mac-vendor-lookup fritzconnection cryptography pyunifi sed -i -e 's#^sudo cp -n /usr/share/ieee-data/.* /var/lib/ieee-data/#\# &#' -e '/^sudo mkdir -p 2_backup$/s/^/# /' -e '/^sudo cp \*.txt 2_backup$/s/^/# /' -e '/^sudo cp \*.csv 2_backup$/s/^/# /' /opt/pialert/back/update_vendors.sh mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.html.old ln -s /usr/share/ieee-data/ /var/lib/ diff --git a/install/unmanic-install.sh b/install/unmanic-install.sh index a826a976c9c..785103a770d 100644 --- a/install/unmanic-install.sh +++ b/install/unmanic-install.sh @@ -37,7 +37,9 @@ msg_info "Installing Unmanic" mkdir -p /opt/unmanic cd /opt/unmanic $STD uv venv /opt/unmanic/.venv -$STD uv pip install unmanic +$STD /opt/unmanic/.venv/bin/python -m ensurepip --upgrade +$STD /opt/unmanic/.venv/bin/python -m pip install --upgrade pip +$STD /opt/unmanic/.venv/bin/python -m pip install unmanic sed -i -e 's/^sgx:x:104:$/render:x:104:root/' -e 's/^render:x:106:root$/sgx:x:106:/' /etc/group msg_ok "Installed Unmanic" diff --git a/install/wger-install.sh b/install/wger-install.sh index d49d527bf7e..56b4acb6448 100644 --- a/install/wger-install.sh +++ b/install/wger-install.sh @@ -40,12 +40,15 @@ mv wger-$RELEASE /home/wger/src cd /home/wger/src $STD /home/wger/.venv/bin/wger create-settings --database-path /home/wger/db/database.sqlite $STD uv venv /home/wger/.venv -$STD uv pip install -r requirements_prod.txt -$STD uv pip install -e . +$STD /home/wger/.venv/bin/python -m ensurepip --upgrade +$STD /home/wger/.venv/bin/python -m pip install --upgrade pip +$STD /home/wger/.venv/bin/python -m pip install -r requirements_prod.txt +$STD /home/wger/.venv/bin/python -m pip install -e . sed -i "s#home/wger/src/media#home/wger/media#g" /home/wger/src/settings.py sed -i "/MEDIA_ROOT = '\/home\/wger\/media'/a STATIC_ROOT = '/home/wger/static'" /home/wger/src/settings.py $STD /home/wger/.venv/bin/wger bootstrap -$STD uv run python manage.py collectstatic +cd /home/wger/src/ +$STD /home/wger/.venv/bin/python -m manage.py collectstatic echo "${RELEASE}" >/opt/wger_version.txt msg_ok "Finished setting up wger" From 665a47e60bc66eaf66231b2bcb5d5c6cefa9364c Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 5 Jun 2025 13:01:52 +0200 Subject: [PATCH 48/66] more --- install/mylar3-install.sh | 6 ++++-- install/netbox-install.sh | 3 +++ install/prometheus-pve-exporter-install.sh | 5 ++++- install/radicale-install.sh | 4 +++- install/sabnzbd-install.sh | 6 ++++-- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/install/mylar3-install.sh b/install/mylar3-install.sh index 6bfa4aa5da0..c5327afd069 100644 --- a/install/mylar3-install.sh +++ b/install/mylar3-install.sh @@ -29,8 +29,10 @@ mkdir -p /opt/mylar3-data RELEASE=$(curl -fsSL https://api.github.com/repos/mylar3/mylar3/releases/latest | jq -r '.tag_name') curl -fsSL "https://github.com/mylar3/mylar3/archive/refs/tags/${RELEASE}.tar.gz" | tar -xz --strip-components=1 -C /opt/mylar3 cd /opt/mylar3 -$STD uv venv .venv -$STD .venv/bin/uv pip install --no-cache-dir -r requirements.txt +$STD uv venv /opt/mylar3/.venv +$STD /opt/mylar3/.venv/bin/python -m ensurepip --upgrade +$STD /opt/mylar3/.venv/bin/python -m pip install --upgrade pip +$STD /opt/mylar3/.venv/bin/python -m pip install -r requirements.txt echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Installed ${APPLICATION}" diff --git a/install/netbox-install.sh b/install/netbox-install.sh index 8522682e6b4..5d8e8b6a26a 100644 --- a/install/netbox-install.sh +++ b/install/netbox-install.sh @@ -56,6 +56,9 @@ chown --recursive netbox /opt/netbox/netbox/reports/ chown --recursive netbox /opt/netbox/netbox/scripts/ mv /opt/netbox/netbox/netbox/configuration_example.py /opt/netbox/netbox/netbox/configuration.py +$STD uv venv /opt/netbox/.venv +$STD /opt/netbox/.venv/bin/python -m ensurepip --upgrade +$STD /opt/netbox/.venv/bin/python -m pip install --upgrade pip SECRET_KEY=$(/opt/netbox/.venv/bin/python /opt/netbox/netbox/generate_secret_key.py) ESCAPED_SECRET_KEY=$(printf '%s\n' "$SECRET_KEY" | sed 's/[&/\]/\\&/g') diff --git a/install/prometheus-pve-exporter-install.sh b/install/prometheus-pve-exporter-install.sh index b3cf7cb43ef..513611e5bff 100644 --- a/install/prometheus-pve-exporter-install.sh +++ b/install/prometheus-pve-exporter-install.sh @@ -18,8 +18,11 @@ PYTHON_VERSION="3.12" setup_uv msg_info "Installing Prometheus Proxmox VE Exporter" mkdir -p /opt/prometheus-pve-exporter cd /opt/prometheus-pve-exporter + $STD uv venv /opt/prometheus-pve-exporter/.venv -$STD uv pip install prometheus-pve-exporter +$STD /opt/prometheus-pve-exporter/.venv/bin/python -m ensurepip --upgrade +$STD /opt/prometheus-pve-exporter/.venv/bin/python -m pip install --upgrade pip +$STD /opt/prometheus-pve-exporter/.venv/bin/python -m pip install prometheus-pve-exporter cat </opt/prometheus-pve-exporter/pve.yml default: user: prometheus@pve diff --git a/install/radicale-install.sh b/install/radicale-install.sh index db4858da9df..dc143de44f0 100644 --- a/install/radicale-install.sh +++ b/install/radicale-install.sh @@ -24,7 +24,9 @@ msg_info "Setting up Radicale" mkdir -p /opt/radicale/{users} cd /opt/radicale $STD uv venv /opt/radicale/.venv -$STD uv pip install --upgrade https://github.com/Kozea/Radicale/archive/master.tar.gz +$STD /opt/radicale/.venv/bin/python -m ensurepip --upgrade +$STD /opt/radicale/.venv/bin/python -m pip install --upgrade pip +$STD /opt/radicale/.venv/bin/python -m pip install --upgrade https://github.com/Kozea/Radicale/archive/master.tar.gz RNDPASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) $STD htpasswd -c -b -5 /opt/radicale/users admin "$RNDPASS" { diff --git a/install/sabnzbd-install.sh b/install/sabnzbd-install.sh index 128b8e369d1..9271200ef85 100644 --- a/install/sabnzbd-install.sh +++ b/install/sabnzbd-install.sh @@ -34,11 +34,13 @@ msg_info "Installing SABnzbd" RELEASE=$(curl -fsSL https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') mkdir -p /opt/sabnzbd cd /opt/sabnzbd -$STD uv venv /opt/sabnzbd/.venv temp_file=$(mktemp) curl -fsSL "https://github.com/sabnzbd/sabnzbd/releases/download/${RELEASE}/SABnzbd-${RELEASE}-src.tar.gz" -o "$temp_file" tar -xzf "$temp_file" -C /opt/sabnzbd --strip-components=1 -$STD uv pip install -r /opt/sabnzbd/requirements.txt +$STD uv venv /opt/sabnzbd/.venv +$STD /opt/sabnzbd/.venv/bin/python -m ensurepip --upgrade +$STD /opt/sabnzbd/.venv/bin/python -m pip install --upgrade pip +$STD /opt/sabnzbd/.venv/bin/python -m pip install -r requirements.txt echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Installed SABnzbd" From dbfddc2332aef4182159f8d191c1a7f16861d8e7 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 5 Jun 2025 13:17:35 +0200 Subject: [PATCH 49/66] fix deluge --- install/deluge-install.sh | 7 +++++-- install/documenso-install.sh | 4 +++- install/esphome-install.sh | 4 +++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/install/deluge-install.sh b/install/deluge-install.sh index ab93e49fd52..c75f34202ac 100644 --- a/install/deluge-install.sh +++ b/install/deluge-install.sh @@ -23,7 +23,9 @@ msg_info "Installing Deluge" mkdir -p /opt/deluge cd /opt/deluge $STD uv venv /opt/deluge/.venv -$STD uv pip install "deluge[all]" libtorrent +$STD /opt/prometheus-pve-exporter/.venv/bin/python -m ensurepip --upgrade +$STD /opt/prometheus-pve-exporter/.venv/bin/python -m pip install --upgrade pip +$STD /opt/prometheus-pve-exporter/.venv/bin/python -m pip install deluge libtorrent msg_ok "Installed Deluge" msg_info "Creating Service" @@ -58,7 +60,8 @@ ExecStart=/opt/deluge/.venv/bin/deluge-web -d Restart=on-failure [Install] -WantedBy=multi-u +WantedBy=multi-user.target +EOF systemctl enable --now -q deluged.service systemctl enable --now -q deluge-web.service diff --git a/install/documenso-install.sh b/install/documenso-install.sh index 47e8d709327..a16ad88ad16 100644 --- a/install/documenso-install.sh +++ b/install/documenso-install.sh @@ -55,7 +55,9 @@ $STD unzip v${RELEASE}.zip mv documenso-${RELEASE} /opt/documenso cd /opt/documenso $STD uv venv /opt/documenso/.venv -$STD uv pip install bcrypt +$STD /opt/documenso/.venv/bin/python -m ensurepip --upgrade +$STD /opt/documenso/.venv/bin/python -m pip install --upgrade pip +$STD /opt/documenso/.venv/bin/python -m pip install bcrypt mv .env.example /opt/documenso/.env sed -i \ -e "s|^NEXTAUTH_SECRET=.*|NEXTAUTH_SECRET='$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-32)'|" \ diff --git a/install/esphome-install.sh b/install/esphome-install.sh index edd31a10ef1..8e8e022c548 100644 --- a/install/esphome-install.sh +++ b/install/esphome-install.sh @@ -24,7 +24,9 @@ mkdir -p /opt/esphome mkdir -p /root/config cd /opt/esphome $STD uv venv /opt/esphome/.venv -$STD uv pip install esphome tornado esptool +$STD /opt/esphome/.venv/bin/python -m ensurepip --upgrade +$STD /opt/esphome/.venv/bin/python -m pip install --upgrade pip +$STD /opt/esphome/.venv/bin/python -m pip install esphome tornado esptool msg_ok "Setup and Installed ESPHome" msg_info "Creating Service" From 94a55020e334d9ae5603da3b304698cb1503a68f Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 5 Jun 2025 13:24:25 +0200 Subject: [PATCH 50/66] fixes --- install/jupyternotebook-install.sh | 6 ++++-- install/kometa-install.sh | 7 ++++--- install/lazylibrarian-install.sh | 6 ++++-- install/medusa-install.sh | 6 ++++-- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/install/jupyternotebook-install.sh b/install/jupyternotebook-install.sh index 2c3162a68c9..4b8229d7cb6 100644 --- a/install/jupyternotebook-install.sh +++ b/install/jupyternotebook-install.sh @@ -18,8 +18,10 @@ PYTHON_VERSION="3.12" setup_uv msg_info "Installing Jupyter" mkdir -p /opt/jupyter cd /opt/jupyter -$STD uv venv .venv -$STD .venv/bin/uv pip install jupyter +$STD uv venv /opt/jupyter/.venv +$STD /opt/jupyter/.venv/bin/python -m ensurepip --upgrade +$STD /opt/jupyter/.venv/bin/python -m pip install --upgrade pip +$STD /opt/jupyter/.venv/bin/python -m pip install jupyter msg_ok "Installed Jupyter" msg_info "Creating Service" diff --git a/install/kometa-install.sh b/install/kometa-install.sh index 9368c199769..64b79e4ebe1 100644 --- a/install/kometa-install.sh +++ b/install/kometa-install.sh @@ -22,9 +22,10 @@ curl -fsSL "https://github.com/Kometa-Team/Kometa/archive/refs/tags/v${RELEASE}. tar -xzf "$tmp_file" mv "Kometa-${RELEASE}" /opt/kometa cd /opt/kometa - -$STD uv venv .venv -$STD .venv/bin/uv pip install -r requirements.txt +$STD uv venv /home/wger/.venv +$STD /opt/kometa/.venv/bin/python -m ensurepip --upgrade +$STD /opt/kometa/.venv/bin/python -m pip install --upgrade pip +$STD /opt/kometa/.venv/bin/python -m pip install -r requirements.txt mkdir -p config/assets cp config/config.yml.template config/config.yml echo "$RELEASE" >/opt/kometa_version.txt diff --git a/install/lazylibrarian-install.sh b/install/lazylibrarian-install.sh index 2374cd6f1f7..49fe2e89d42 100644 --- a/install/lazylibrarian-install.sh +++ b/install/lazylibrarian-install.sh @@ -28,8 +28,10 @@ msg_ok "Installed Dependencies" msg_info "Installing LazyLibrarian" $STD git clone https://gitlab.com/LazyLibrarian/LazyLibrarian /opt/LazyLibrarian cd /opt/LazyLibrarian -$STD uv venv .venv -$STD .venv/bin/uv pip install . jaraco.stream python-Levenshtein soupsieve pypdf +$STD uv venv /opt/LazyLibrarian/.venv +$STD /opt/LazyLibrarian/.venv/bin/python -m ensurepip --upgrade +$STD /opt/LazyLibrarian/.venv/bin/python -m pip install --upgrade pip +$STD /opt/LazyLibrarian/.venv/bin/python -m pip install . jaraco.stream python-Levenshtein soupsieve pypdf msg_ok "Installed LazyLibrarian" msg_info "Creating Service" diff --git a/install/medusa-install.sh b/install/medusa-install.sh index 5726df0c125..e8eeacb41b9 100644 --- a/install/medusa-install.sh +++ b/install/medusa-install.sh @@ -32,8 +32,10 @@ msg_ok "Installed Dependencies" msg_info "Installing Medusa" $STD git clone https://github.com/pymedusa/Medusa.git /opt/medusa cd /opt/medusa -$STD uv venv .venv -$STD .venv/bin/uv pip install . +$STD uv venv /opt/medusa/.venv +$STD /opt/LazyLibrarian/.venv/bin/python -m ensurepip --upgrade +$STD /opt/LazyLibrarian/.venv/bin/python -m pip install --upgrade pip +$STD /opt/LazyLibrarian/.venv/bin/python -m pip install . msg_ok "Installed Medusa" msg_info "Creating Service" From f0849a43b77bd32c0fbda87914ac48793fdce80a Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 5 Jun 2025 13:28:05 +0200 Subject: [PATCH 51/66] Update wger-install.sh --- install/wger-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/wger-install.sh b/install/wger-install.sh index 56b4acb6448..76b398b2664 100644 --- a/install/wger-install.sh +++ b/install/wger-install.sh @@ -38,12 +38,12 @@ curl -fsSL "https://github.com/wger-project/wger/archive/refs/tags/$RELEASE.tar. tar xzf $RELEASE.tar.gz mv wger-$RELEASE /home/wger/src cd /home/wger/src -$STD /home/wger/.venv/bin/wger create-settings --database-path /home/wger/db/database.sqlite $STD uv venv /home/wger/.venv $STD /home/wger/.venv/bin/python -m ensurepip --upgrade $STD /home/wger/.venv/bin/python -m pip install --upgrade pip $STD /home/wger/.venv/bin/python -m pip install -r requirements_prod.txt $STD /home/wger/.venv/bin/python -m pip install -e . +$STD /home/wger/.venv/bin/wger create-settings --database-path /home/wger/db/database.sqlite sed -i "s#home/wger/src/media#home/wger/media#g" /home/wger/src/settings.py sed -i "/MEDIA_ROOT = '\/home\/wger\/media'/a STATIC_ROOT = '/home/wger/static'" /home/wger/src/settings.py $STD /home/wger/.venv/bin/wger bootstrap From 9e84828e3eb71544143101f79c20c6cd2db15614 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 5 Jun 2025 14:00:04 +0200 Subject: [PATCH 52/66] fixes --- install/adventurelog-install.sh | 11 ++++++----- install/babybuddy-install.sh | 2 +- install/netbox-install.sh | 2 +- install/paperless-ngx-install.sh | 6 +++--- install/tandoor-install.sh | 6 +++--- install/wger-install.sh | 2 +- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/install/adventurelog-install.sh b/install/adventurelog-install.sh index ade69d13fbd..6935a3a58a9 100644 --- a/install/adventurelog-install.sh +++ b/install/adventurelog-install.sh @@ -82,9 +82,9 @@ $STD uv venv /opt/adventurelog/backend/server/.venv $STD /opt/adventurelog/backend/server/.venv/bin/python -m ensurepip --upgrade $STD /opt/adventurelog/backend/server/.venv/bin/python -m pip install --upgrade pip $STD /opt/adventurelog/backend/server/.venv/bin/python -m pip install -r requirements.txt -$STD /opt/adventurelog/backend/server/.venv/bin/python -m manage.py collectstatic --noinput -$STD /opt/adventurelog/backend/server/.venv/bin/python -m manage.py migrate -$STD /opt/adventurelog/backend/server/.venv/bin/python -m manage.py download-countries +$STD /opt/adventurelog/backend/server/.venv/bin/python -m manage collectstatic --noinput +$STD /opt/adventurelog/backend/server/.venv/bin/python -m manage migrate +$STD /opt/adventurelog/backend/server/.venv/bin/python -m manage download-countries cat </opt/adventurelog/frontend/.env PUBLIC_SERVER_URL=http://$LOCAL_IP:8000 BODY_SIZE_LIMIT=Infinity @@ -97,7 +97,8 @@ echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" msg_ok "Installed AdventureLog" msg_info "Setting up Django Admin" -$STD /opt/adventurelog/backend/server/.venv/bin/python -m /opt/adventurelog/backend/server/manage.py shell < " prompt @@ -135,7 +135,7 @@ fi msg_info "Setting up admin Paperless-ngx User & Password" ## From https://github.com/linuxserver/docker-paperless-ngx/blob/main/root/etc/cont-init.d/99-migrations -cat <>~/tandoor.creds echo -e "Tandoor Database User: \e[32m$DB_USER\e[0m" >>~/tandoor.creds echo -e "Tandoor Database Password: \e[32m$DB_PASS\e[0m" >>~/tandoor.creds export $(cat /opt/tandoor/.env | grep "^[^#]" | xargs) -$STD /opt/tandoor/.venv/bin/python -m manage.py migrate -$STD /opt/tandoor/.venv/bin/python -m manage.py collectstatic --no-input -$STD /opt/tandoor/.venv/bin/python -m python manage.py collectstatic_js_reverse +$STD /opt/tandoor/.venv/bin/python -m manage migrate +$STD /opt/tandoor/.venv/bin/python -m manage collectstatic --no-input +$STD /opt/tandoor/.venv/bin/python -m python manage collectstatic_js_reverse msg_ok "Set up PostgreSQL Database" msg_info "Creating Services" diff --git a/install/wger-install.sh b/install/wger-install.sh index 76b398b2664..edcb48c07dd 100644 --- a/install/wger-install.sh +++ b/install/wger-install.sh @@ -48,7 +48,7 @@ sed -i "s#home/wger/src/media#home/wger/media#g" /home/wger/src/settings.py sed -i "/MEDIA_ROOT = '\/home\/wger\/media'/a STATIC_ROOT = '/home/wger/static'" /home/wger/src/settings.py $STD /home/wger/.venv/bin/wger bootstrap cd /home/wger/src/ -$STD /home/wger/.venv/bin/python -m manage.py collectstatic +$STD /home/wger/.venv/bin/python -m manage collectstatic echo "${RELEASE}" >/opt/wger_version.txt msg_ok "Finished setting up wger" From 7ebfebce74815e204e704683ae48a8c3c6e1fa37 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 5 Jun 2025 14:10:08 +0200 Subject: [PATCH 53/66] test sabnzd --- install/babybuddy-install.sh | 4 ++- install/sabnzbd-install.sh | 8 ++--- misc/tools.func | 67 +++++++++++++++++++++++++++--------- 3 files changed, 55 insertions(+), 24 deletions(-) diff --git a/install/babybuddy-install.sh b/install/babybuddy-install.sh index 83af743e049..827abafbfb8 100644 --- a/install/babybuddy-install.sh +++ b/install/babybuddy-install.sh @@ -22,7 +22,7 @@ $STD apt-get install -y \ nginx msg_ok "Installed Dependencies" -PYTHON_VERSION="3.12" setup_uv +setup_uv msg_info "Installing Babybuddy" RELEASE=$(curl -fsSL https://api.github.com/repos/babybuddy/babybuddy/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') @@ -31,6 +31,8 @@ mkdir -p /opt/{babybuddy,data} curl -fsSL "https://github.com/babybuddy/babybuddy/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file" tar zxf "$temp_file" --strip-components=1 -C /opt/babybuddy cd /opt/babybuddy +setup_uv + $STD uv venv /opt/babybuddy/.venv $STD /opt/babybuddy/.venv/bin/python -m ensurepip --upgrade $STD /opt/babybuddy/.venv/bin/python -m pip install --upgrade pip diff --git a/install/sabnzbd-install.sh b/install/sabnzbd-install.sh index 9271200ef85..ede6f1375fd 100644 --- a/install/sabnzbd-install.sh +++ b/install/sabnzbd-install.sh @@ -19,8 +19,6 @@ $STD apt-get install -y \ p7zip-full msg_ok "Installed Dependencies" -PYTHON_VERSION="3.12" setup_uv - msg_info "Setup Unrar" cat </etc/apt/sources.list.d/non-free.list deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware @@ -37,10 +35,8 @@ cd /opt/sabnzbd temp_file=$(mktemp) curl -fsSL "https://github.com/sabnzbd/sabnzbd/releases/download/${RELEASE}/SABnzbd-${RELEASE}-src.tar.gz" -o "$temp_file" tar -xzf "$temp_file" -C /opt/sabnzbd --strip-components=1 -$STD uv venv /opt/sabnzbd/.venv -$STD /opt/sabnzbd/.venv/bin/python -m ensurepip --upgrade -$STD /opt/sabnzbd/.venv/bin/python -m pip install --upgrade pip -$STD /opt/sabnzbd/.venv/bin/python -m pip install -r requirements.txt +setup_uv VENV_FOLDER="/opt/sabnzbd/.venv" REQUIREMENTS_FILE="requirements.txt" PYTHON_VERSION="3.12" setup_uv_venv + echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Installed SABnzbd" diff --git a/misc/tools.func b/misc/tools.func index 03e58a2b3fa..81d8d9d9e8d 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -1081,31 +1081,64 @@ function setup_uv() { rm -rf "$TMP_DIR" ensure_usr_local_bin_persist msg_ok "uv $LATEST_VERSION installed" +} + +# ------------------------------------------------------------------------------ +# Creates a uv-based venv with optional Python version and installs dependencies +# ------------------------------------------------------------------------------ + +function setup_uv_venv() { + local VENV_FOLDER="${VENV_FOLDER:-/opt/app/.venv}" + local REQUIREMENTS_FILE="${REQUIREMENTS_FILE:-requirements.txt}" + local ENABLE_PIP_UPGRADE="${ENABLE_PIP_UPGRADE:-1}" + local ENABLE_ENSUREPIP="${ENABLE_ENSUREPIP:-1}" + + # Fallback auf globale PYTHON_VERSION + local PYTHON_VERSION="${PYTHON_VERSION:-}" - # Optional: install specific Python version - if [[ -n "${PYTHON_VERSION:-}" ]]; then - $STD msg_info "Ensuring Python $PYTHON_VERSION is available via uv..." + setup_uv || return 1 + + # Wenn PYTHON_VERSION gesetzt, installiere gezielt + if [[ -n "$PYTHON_VERSION" ]]; then + export PYTHON_VERSION="$PYTHON_VERSION" + setup_uv || return 1 + fi + + $STD msg_info "Creating uv venv in $VENV_FOLDER" + if ! $STD uv venv "$VENV_FOLDER"; then + msg_error "Failed to create uv venv" + return 1 + fi - local VERSION_MATCH - VERSION_MATCH=$(uv python list --only-downloads | - grep -E "^cpython-${PYTHON_VERSION//./\\.}\.[0-9]+-linux" | - cut -d'-' -f2 | sort -V | tail -n1) + local PYTHON="$VENV_FOLDER/bin/python" - if [[ -z "$VERSION_MATCH" ]]; then - msg_error "No matching Python $PYTHON_VERSION.x version found via uv" + if [[ "$ENABLE_ENSUREPIP" == "1" ]]; then + $STD msg_info "Running ensurepip" + if ! $STD "$PYTHON" -m ensurepip --upgrade; then + msg_error "ensurepip failed" return 1 fi + fi - if uv python list | grep -q "cpython-${VERSION_MATCH}-linux.*uv/python"; then - $STD msg_ok "Python $VERSION_MATCH already installed via uv" - else - if ! $STD uv python install "$VERSION_MATCH"; then - msg_error "Failed to install Python $VERSION_MATCH via uv" - return 1 - fi - msg_ok "Installed Python $VERSION_MATCH" + if [[ "$ENABLE_PIP_UPGRADE" == "1" ]]; then + $STD msg_info "Upgrading pip" + if ! $STD "$PYTHON" -m pip install --upgrade pip; then + msg_error "pip upgrade failed" + return 1 + fi + fi + + if [[ -f "$REQUIREMENTS_FILE" ]]; then + $STD msg_info "Installing requirements from $REQUIREMENTS_FILE" + if ! $STD "$PYTHON" -m pip install -r "$REQUIREMENTS_FILE"; then + msg_error "Failed to install requirements" + return 1 fi + else + msg_info "No requirements file found at $REQUIREMENTS_FILE – skipping" fi + + msg_ok "uv venv setup complete in $VENV_FOLDER" } # ------------------------------------------------------------------------------ From 1fd87132c3ea5e6646101097c1f41b083facec1d Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 5 Jun 2025 14:18:00 +0200 Subject: [PATCH 54/66] test --- install/sabnzbd-install.sh | 3 +- misc/tools.func | 61 +++++++++++++++++++------------------- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/install/sabnzbd-install.sh b/install/sabnzbd-install.sh index ede6f1375fd..47daebd70d0 100644 --- a/install/sabnzbd-install.sh +++ b/install/sabnzbd-install.sh @@ -35,8 +35,7 @@ cd /opt/sabnzbd temp_file=$(mktemp) curl -fsSL "https://github.com/sabnzbd/sabnzbd/releases/download/${RELEASE}/SABnzbd-${RELEASE}-src.tar.gz" -o "$temp_file" tar -xzf "$temp_file" -C /opt/sabnzbd --strip-components=1 -setup_uv VENV_FOLDER="/opt/sabnzbd/.venv" REQUIREMENTS_FILE="requirements.txt" PYTHON_VERSION="3.12" setup_uv_venv - +VENV_FOLDER="/opt/sabnzbd/.venv" REQUIREMENTS_FILE="requirements.txt" PYTHON_VERSION="3.12" setup_uv_venv echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Installed SABnzbd" diff --git a/misc/tools.func b/misc/tools.func index 81d8d9d9e8d..cda28262954 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -1084,56 +1084,55 @@ function setup_uv() { } # ------------------------------------------------------------------------------ -# Creates a uv-based venv with optional Python version and installs dependencies +# Fully autonomous uv-based venv installer with pip/requirements handling +# - Requires: VENV_FOLDER, PYTHON_VERSION +# - Optional: REQUIREMENTS_FILE (default: requirements.txt) # ------------------------------------------------------------------------------ function setup_uv_venv() { - local VENV_FOLDER="${VENV_FOLDER:-/opt/app/.venv}" + local VENV_FOLDER="${VENV_FOLDER:?VENV_FOLDER not set}" + local PYTHON_VERSION="${PYTHON_VERSION:?PYTHON_VERSION not set}" local REQUIREMENTS_FILE="${REQUIREMENTS_FILE:-requirements.txt}" - local ENABLE_PIP_UPGRADE="${ENABLE_PIP_UPGRADE:-1}" - local ENABLE_ENSUREPIP="${ENABLE_ENSUREPIP:-1}" - - # Fallback auf globale PYTHON_VERSION - local PYTHON_VERSION="${PYTHON_VERSION:-}" + local PYTHON_BIN setup_uv || return 1 - # Wenn PYTHON_VERSION gesetzt, installiere gezielt - if [[ -n "$PYTHON_VERSION" ]]; then - export PYTHON_VERSION="$PYTHON_VERSION" - setup_uv || return 1 + # Install Python via uv if not already available + local VERSION_MATCH + VERSION_MATCH=$(uv python list --only-downloads | + grep -E "^cpython-${PYTHON_VERSION//./\\.}\.[0-9]+-linux" | + cut -d'-' -f2 | sort -V | tail -n1) + + if [[ -z "$VERSION_MATCH" ]]; then + msg_error "No matching Python $PYTHON_VERSION.x version found via uv" + return 1 + fi + + if ! uv python list | grep -q "cpython-${VERSION_MATCH}-linux.*uv/python"; then + $STD msg_info "Installing Python $VERSION_MATCH via uv" + $STD uv python install "$VERSION_MATCH" || { + msg_error "Failed to install Python $VERSION_MATCH via uv" + return 1 + } fi $STD msg_info "Creating uv venv in $VENV_FOLDER" - if ! $STD uv venv "$VENV_FOLDER"; then + if ! $STD uv venv "$VENV_FOLDER" --python "$VERSION_MATCH"; then msg_error "Failed to create uv venv" return 1 fi - local PYTHON="$VENV_FOLDER/bin/python" + PYTHON_BIN="$VENV_FOLDER/bin/python" - if [[ "$ENABLE_ENSUREPIP" == "1" ]]; then - $STD msg_info "Running ensurepip" - if ! $STD "$PYTHON" -m ensurepip --upgrade; then - msg_error "ensurepip failed" - return 1 - fi - fi + $STD msg_info "Running ensurepip" + $STD "$PYTHON_BIN" -m ensurepip --upgrade || return 1 - if [[ "$ENABLE_PIP_UPGRADE" == "1" ]]; then - $STD msg_info "Upgrading pip" - if ! $STD "$PYTHON" -m pip install --upgrade pip; then - msg_error "pip upgrade failed" - return 1 - fi - fi + $STD msg_info "Upgrading pip" + $STD "$PYTHON_BIN" -m pip install --upgrade pip || return 1 if [[ -f "$REQUIREMENTS_FILE" ]]; then $STD msg_info "Installing requirements from $REQUIREMENTS_FILE" - if ! $STD "$PYTHON" -m pip install -r "$REQUIREMENTS_FILE"; then - msg_error "Failed to install requirements" - return 1 - fi + $STD "$PYTHON_BIN" -m pip install -r "$REQUIREMENTS_FILE" || return 1 else msg_info "No requirements file found at $REQUIREMENTS_FILE – skipping" fi From dbb268ebf60a58b307c3538a892c1571103ca230 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 5 Jun 2025 14:23:24 +0200 Subject: [PATCH 55/66] Update tools.func --- misc/tools.func | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/misc/tools.func b/misc/tools.func index cda28262954..3033d6372b8 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -1081,12 +1081,35 @@ function setup_uv() { rm -rf "$TMP_DIR" ensure_usr_local_bin_persist msg_ok "uv $LATEST_VERSION installed" + + # Optional: install specific Python version + if [[ -n "${PYTHON_VERSION:-}" ]]; then + $STD msg_info "Ensuring Python $PYTHON_VERSION is available via uv..." + + local VERSION_MATCH + VERSION_MATCH=$(uv python list --only-downloads | + grep -E "^cpython-${PYTHON_VERSION//./\\.}\.[0-9]+-linux" | + cut -d'-' -f2 | sort -V | tail -n1) + + if [[ -z "$VERSION_MATCH" ]]; then + msg_error "No matching Python $PYTHON_VERSION.x version found via uv" + return 1 + fi + + if uv python list | grep -q "cpython-${VERSION_MATCH}-linux.*uv/python"; then + $STD msg_ok "Python $VERSION_MATCH already installed via uv" + else + if ! $STD uv python install "$VERSION_MATCH"; then + msg_error "Failed to install Python $VERSION_MATCH via uv" + return 1 + fi + msg_ok "Installed Python $VERSION_MATCH" + fi + fi } # ------------------------------------------------------------------------------ -# Fully autonomous uv-based venv installer with pip/requirements handling -# - Requires: VENV_FOLDER, PYTHON_VERSION -# - Optional: REQUIREMENTS_FILE (default: requirements.txt) +# Creates a uv-based venv with optional Python version and installs dependencies # ------------------------------------------------------------------------------ function setup_uv_venv() { From 0c04d8900b418d9613a5fa01b122878840bb24c8 Mon Sep 17 00:00:00 2001 From: tremor021 Date: Fri, 6 Jun 2025 09:23:22 +0200 Subject: [PATCH 56/66] MeTube to Python 3.13 --- install/metube-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/metube-install.sh b/install/metube-install.sh index 060bc788905..9f12cad0306 100644 --- a/install/metube-install.sh +++ b/install/metube-install.sh @@ -27,7 +27,7 @@ $STD apt-get install -y --no-install-recommends \ ca-certificates msg_ok "Installed Dependencies" -PYTHON_VERSION="3.12" setup_uv +PYTHON_VERSION="3.13" setup_uv NODE_VERSION="22" install_node_and_modules msg_info "Installing MeTube" From 84e93cd7d0f1908abcdfc72fed3ff97c4fee2715 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 7 Jun 2025 02:54:48 -0400 Subject: [PATCH 57/66] Immich UV test (#5032) - Simplifies UV use in Immich install & update - Uses Python 3.11 (No official support for 3.12 yet) - Restores python3-dev package --- ct/immich.sh | 20 ++++++++------------ install/immich-install.sh | 21 ++++++++------------- 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/ct/immich.sh b/ct/immich.sh index 1a38bbd9beb..323683facdc 100644 --- a/ct/immich.sh +++ b/ct/immich.sh @@ -27,6 +27,9 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi + + setup_uv + STAGING_DIR=/opt/staging BASE_DIR=${STAGING_DIR}/base-images SOURCE_DIR=${STAGING_DIR}/image-source @@ -251,23 +254,16 @@ EOF msg_ok "Updated ${APP} web and microservices" cd "$SRC_DIR"/machine-learning - $STD python3 -m venv "$ML_DIR"/ml-venv + export VIRTUAL_ENV="${ML_DIR}/ml-venv" + $STD uv venv "$VIRTUAL_ENV" if [[ -f ~/.openvino ]]; then msg_info "Updating HW-accelerated machine-learning" - ( - source "$ML_DIR"/ml-venv/bin/activate - $STD pip3 install -U uv - uv -q sync --extra openvino --no-cache --active - ) - patchelf --clear-execstack "$ML_DIR"/ml-venv/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-311-x86_64-linux-gnu.so + uv -q sync --extra openvino --no-cache --active + patchelf --clear-execstack "${VIRTUAL_ENV}/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-311-x86_64-linux-gnu.so" msg_ok "Updated HW-accelerated machine-learning" else msg_info "Updating machine-learning" - ( - source "$ML_DIR"/ml-venv/bin/activate - $STD pip3 install -U uv - uv -q sync --extra cpu --no-cache --active - ) + uv -q sync --extra cpu --no-cache --active msg_ok "Updated machine-learning" fi cd "$SRC_DIR" diff --git a/install/immich-install.sh b/install/immich-install.sh index f85d05a864c..2ccee7f0c69 100644 --- a/install/immich-install.sh +++ b/install/immich-install.sh @@ -13,7 +13,7 @@ setting_up_container network_check update_os -PYTHON_VERSION="3.12" setup_uv +setup_uv msg_info "Configuring apt and installing dependencies" echo "deb http://deb.debian.org/debian testing main contrib" >/etc/apt/sources.list.d/immich.list @@ -29,6 +29,7 @@ $STD apt-get install --no-install-recommends -y \ redis \ autoconf \ build-essential \ + python3-dev \ cmake \ jq \ libbrotli-dev \ @@ -304,22 +305,16 @@ cp LICENSE "$APP_DIR" msg_ok "Installed Immich Web Components" cd "$SRC_DIR"/machine-learning -$STD uv venv "$ML_DIR/.venv" -$ML_DIR/.venv/bin/uv pip install --upgrade uv -$ML_DIR/.venv/bin/uv sync --no-cache -cd "$SRC_DIR"/machine-learning -$STD uv venv "$ML_DIR/.venv" -$ML_DIR/.venv/bin/uv pip install --upgrade uv - +export VIRTUAL_ENV="${ML_DIR}/ml-venv" +$STD uv venv "$VIRTUAL_ENV" if [[ -f ~/.openvino ]]; then msg_info "Installing HW-accelerated machine-learning" - $STD "$ML_DIR/.venv/bin/uv" sync --no-cache --extra openvino - patchelf --clear-execstack "$ML_DIR/.venv/lib/python3.12/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-312-x86_64-linux-gnu.so" + uv -q sync --no-cache --extra openvino --active + patchelf --clear-execstack "${VIRTUAL_ENV}/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-311-x86_64-linux-gnu.so" msg_ok "Installed HW-accelerated machine-learning" - else msg_info "Installing machine-learning" - $STD "$ML_DIR/.venv/bin/uv" sync --no-cache --extra cpu + uv -q sync --no-cache --extra cpu --active msg_ok "Installed machine-learning" fi @@ -396,7 +391,7 @@ set -a . ${INSTALL_DIR}/.env set +a -python -m immich_ml +python3 -m immich_ml EOF chmod +x "$ML_DIR"/ml_start.sh cat </etc/systemd/system/"${APPLICATION}"-web.service From 46dadba06a4e28714bca159cb420039224b46c71 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 16 Jun 2025 08:56:06 +0200 Subject: [PATCH 58/66] Update motioneye-install.sh --- install/motioneye-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/motioneye-install.sh b/install/motioneye-install.sh index 73599a892b3..8f58c21409c 100644 --- a/install/motioneye-install.sh +++ b/install/motioneye-install.sh @@ -35,7 +35,7 @@ $STD apt-get update $STD uv venv /opt/motioneye/.venv $STD /opt/motioneye/.venv/bin/python -m ensurepip --upgrade $STD /opt/motioneye/.venv/bin/python -m pip install --upgrade pip -$STD /opt/motioneye/.venv/bin/python -m pip install git+https://github.com/motioneye-project/motioneye.git@dev +$STD /opt/motioneye/.venv/bin/python -m pip install --pre motioneye mkdir -p /etc/motioneye chown -R root:root /etc/motioneye From 3958172e813135529a8089ef55a045faa28835e2 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 23 Jun 2025 16:47:32 +0200 Subject: [PATCH 59/66] fixes --- ct/metube.sh | 86 ++++++++++++++++++++++++++++++++------- install/metube-install.sh | 2 +- 2 files changed, 72 insertions(+), 16 deletions(-) diff --git a/ct/metube.sh b/ct/metube.sh index 85c2c48cb76..db4fd47a44f 100644 --- a/ct/metube.sh +++ b/ct/metube.sh @@ -8,7 +8,7 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV APP="MeTube" var_tags="${var_tags:-media;youtube}" var_cpu="${var_cpu:-1}" -var_ram="${var_ram:-1024}" +var_ram="${var_ram:-2048}" var_disk="${var_disk:-10}" var_os="${var_os:-debian}" var_version="${var_version:-12}" @@ -23,40 +23,96 @@ function update_script() { header_info check_container_storage check_container_resources + if [[ ! -d /opt/metube ]]; then msg_error "No ${APP} Installation Found!" exit fi + msg_info "Stopping ${APP} Service" systemctl stop metube msg_ok "Stopped ${APP} Service" - msg_info "Updating ${APP} to latest Git" - cd /opt - if [ -d metube_bak ]; then - rm -rf metube_bak + msg_info "Backing up Old Installation" + if [[ -d /opt/metube_bak ]]; then + rm -rf /opt/metube_bak fi - mv metube metube_bak + mv /opt/metube /opt/metube_bak + msg_ok "Backup created" + + msg_info "Cloning Latest ${APP} Release" $STD git clone https://github.com/alexta69/metube /opt/metube + msg_ok "Cloned ${APP}" + + msg_info "Building Frontend" cd /opt/metube/ui $STD npm install $STD node_modules/.bin/ng build + msg_ok "Built Frontend" + + PYTHON_VERSION="3.13" setup_uv + + msg_info "Setting up Python Environment (uv)" + $STD uv venv /opt/metube/.venv + $STD /opt/metube/.venv/bin/python -m ensurepip --upgrade + $STD /opt/metube/.venv/bin/python -m pip install --upgrade pip + $STD /opt/metube/.venv/bin/python -m pip install pipenv + msg_ok "Python Environment Ready" + + msg_info "Installing Backend Requirements" cd /opt/metube - cp /opt/metube_bak/.env /opt/metube/ - $STD pip3 install pipenv - $STD pipenv install + $STD /opt/metube/.venv/bin/pipenv install + msg_ok "Installed Backend" - if [ -d "/opt/metube_bak" ]; then - rm -rf /opt/metube_bak + msg_info "Restoring Environment File" + if [[ -f /opt/metube_bak/.env ]]; then + cp /opt/metube_bak/.env /opt/metube/.env + fi + msg_ok "Restored .env" + + if [[ ! -d /opt/metube/.venv ]]; then + msg_info "Migrating to uv-based environment" + PYTHON_VERSION="3.13" setup_uv + $STD uv venv /opt/metube/.venv + $STD /opt/metube/.venv/bin/python -m ensurepip --upgrade + $STD /opt/metube/.venv/bin/python -m pip install --upgrade pip + $STD /opt/metube/.venv/bin/python -m pip install pipenv + $STD /opt/metube/.venv/bin/pipenv install + + msg_info "Patching systemd Service" + cat </etc/systemd/system/metube.service +[Unit] +Description=Metube - YouTube Downloader +After=network.target + +[Service] +Type=simple +WorkingDirectory=/opt/metube +EnvironmentFile=/opt/metube/.env +ExecStart=/opt/metube/.venv/bin/pipenv run python3 app/main.py +Restart=always +User=root + +[Install] +WantedBy=multi-user.target +EOF + msg_ok "Patched systemd Service" fi - msg_ok "Updated ${APP} to latest Git" + $STD systemctl daemon-reload + msg_ok "Service Updated" + + msg_info "Cleaning up" + rm -rf /opt/metube_bak + $STD apt-get -y autoremove + $STD apt-get -y autoclean + msg_ok "Cleaned Up" msg_info "Starting ${APP} Service" - systemctl start metube + systemctl enable -q --now metube sleep 1 msg_ok "Started ${APP} Service" - msg_ok "Updated Successfully!\n" - exit + + msg_ok "Updated Successfully!" } start diff --git a/install/metube-install.sh b/install/metube-install.sh index 9f12cad0306..207a7c69697 100644 --- a/install/metube-install.sh +++ b/install/metube-install.sh @@ -36,7 +36,7 @@ cd /opt/metube/ui $STD npm install $STD node_modules/.bin/ng build cd /opt/metube -$STD uv venv /opt/motioneye/.venv +$STD uv venv /opt/metube/.venv $STD /opt/metube/.venv/bin/python -m ensurepip --upgrade $STD /opt/metube/.venv/bin/python -m pip install --upgrade pip $STD /opt/metube/.venv/bin/python -m pip install pipenv From 72d0a01382cc5e4b28cb150a35d2ae2357f3fa99 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 24 Jun 2025 08:44:19 +0200 Subject: [PATCH 60/66] fixes --- ct/metube.sh | 3 ++- install/metube-install.sh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ct/metube.sh b/ct/metube.sh index db4fd47a44f..abfd891cbe7 100644 --- a/ct/metube.sh +++ b/ct/metube.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) # Copyright (c) 2021-2025 tteck # Author: MickLesk (Canbiz) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -78,6 +78,7 @@ function update_script() { $STD /opt/metube/.venv/bin/python -m pip install --upgrade pip $STD /opt/metube/.venv/bin/python -m pip install pipenv $STD /opt/metube/.venv/bin/pipenv install + $STD /opt/metube/.venv/bin/pipenv update yt-dlp msg_info "Patching systemd Service" cat </etc/systemd/system/metube.service diff --git a/install/metube-install.sh b/install/metube-install.sh index 207a7c69697..a83a0371eea 100644 --- a/install/metube-install.sh +++ b/install/metube-install.sh @@ -41,6 +41,7 @@ $STD /opt/metube/.venv/bin/python -m ensurepip --upgrade $STD /opt/metube/.venv/bin/python -m pip install --upgrade pip $STD /opt/metube/.venv/bin/python -m pip install pipenv $STD /opt/metube/.venv/bin/pipenv install +$STD /opt/metube/.venv/bin/pipenv update yt-dlp mkdir -p /opt/metube_downloads /opt/metube_downloads/.metube /opt/metube_downloads/music /opt/metube_downloads/videos cat </opt/metube/.env From 729e213d4676b7f2f6b225772ec42382e9aa94e6 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 24 Jun 2025 09:02:51 +0200 Subject: [PATCH 61/66] Update prometheus-pve-exporter.sh --- ct/prometheus-pve-exporter.sh | 53 +++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/ct/prometheus-pve-exporter.sh b/ct/prometheus-pve-exporter.sh index 8fbe7610e02..b8660ee5953 100644 --- a/ct/prometheus-pve-exporter.sh +++ b/ct/prometheus-pve-exporter.sh @@ -25,21 +25,64 @@ function update_script() { check_container_resources if [[ ! -f /etc/systemd/system/prometheus-pve-exporter.service ]]; then msg_error "No ${APP} Installation Found!" - exit + exit 1 fi + msg_info "Stopping ${APP}" systemctl stop prometheus-pve-exporter msg_ok "Stopped ${APP}" - msg_info "Updating ${APP}" - $STD pip install prometheus-pve-exporter --default-timeout=300 --upgrade --root-user-action=ignore - msg_ok "Updated ${APP}" + export PVE_VENV_PATH="/opt/prometheus-pve-exporter/.venv" + export PVE_EXPORTER_BIN="${PVE_VENV_PATH}/bin/pve_exporter" + + if [[ ! -d "$PVE_VENV_PATH" || ! -x "$PVE_EXPORTER_BIN" ]]; then + PYTHON_VERSION="3.12" setup_uv + msg_info "Migrating to uv/venv" + rm -rf "$PVE_VENV_PATH" + mkdir -p /opt/prometheus-pve-exporter + cd /opt/prometheus-pve-exporter + $STD uv venv "$PVE_VENV_PATH" + $STD "$PVE_VENV_PATH/bin/python" -m ensurepip --upgrade + $STD "$PVE_VENV_PATH/bin/python" -m pip install --upgrade pip + $STD "$PVE_VENV_PATH/bin/python" -m pip install prometheus-pve-exporter + msg_ok "Migrated to uv/venv" + else + msg_info "Updating Prometheus Proxmox VE Exporter" + PYTHON_VERSION="3.12" setup_uv + $STD "$PVE_VENV_PATH/bin/python" -m pip install --upgrade prometheus-pve-exporter + msg_ok "Updated Prometheus Proxmox VE Exporter" + fi + local service_file="/etc/systemd/system/prometheus-pve-exporter.service" + if ! grep -q "${PVE_VENV_PATH}/bin/pve_exporter" "$service_file"; then + msg_info "Updating systemd service" + cat <"$service_file" +[Unit] +Description=Prometheus Proxmox VE Exporter +Documentation=https://github.com/znerol/prometheus-pve-exporter +After=syslog.target network.target + +[Service] +User=root +Restart=always +Type=simple +ExecStart=${PVE_VENV_PATH}/bin/pve_exporter \\ + --config.file=/opt/prometheus-pve-exporter/pve.yml \\ + --web.listen-address=0.0.0.0:9221 +ExecReload=/bin/kill -HUP \$MAINPID + +[Install] +WantedBy=multi-user.target +EOF + $STD systemctl daemon-reload + msg_ok "Updated systemd service" + fi msg_info "Starting ${APP}" systemctl start prometheus-pve-exporter msg_ok "Started ${APP}" + msg_ok "Updated Successfully" - exit + exit 0 } start From 6eb3b84073c74365fef060724d79297d9c4d519e Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 24 Jun 2025 09:14:36 +0200 Subject: [PATCH 62/66] fixes --- ct/esphome.sh | 55 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/ct/esphome.sh b/ct/esphome.sh index 52f726fada5..e7bb969e479 100644 --- a/ct/esphome.sh +++ b/ct/esphome.sh @@ -25,22 +25,57 @@ function update_script() { check_container_resources if [[ ! -f /etc/systemd/system/esphomeDashboard.service ]]; then msg_error "No ${APP} Installation Found!" - exit + exit 1 fi - msg_info "Stopping ESPHome" + + msg_info "Stopping ${APP}" systemctl stop esphomeDashboard - msg_ok "Stopped ESPHome" + msg_ok "Stopped ${APP}" + + VENV_PATH="/opt/esphome/.venv" + ESPHOME_BIN="${VENV_PATH}/bin/esphome" + export PYTHON_VERSION="3.12" + + if [[ ! -d "$VENV_PATH" || ! -x "$ESPHOME_BIN" ]]; then + PYTHON_VERSION="3.12" setup_uv + msg_info "Migrating to uv/venv" + rm -rf "$VENV_PATH" + mkdir -p /opt/esphome + cd /opt/esphome + $STD uv venv "$VENV_PATH" + $STD "$VENV_PATH/bin/python" -m ensurepip --upgrade + $STD "$VENV_PATH/bin/python" -m pip install --upgrade pip + $STD "$VENV_PATH/bin/python" -m pip install esphome tornado esptool + msg_ok "Migrated to uv/venv" + else + msg_info "Updating ESPHome" + PYTHON_VERSION="3.12" setup_uv + $STD "$VENV_PATH/bin/python" -m pip install --upgrade esphome tornado esptool + msg_ok "Updated ESPHome" + fi + SERVICE_FILE="/etc/systemd/system/esphomeDashboard.service" + if ! grep -q "${VENV_PATH}/bin/esphome" "$SERVICE_FILE"; then + msg_info "Updating systemd service" + cat <"$SERVICE_FILE" +[Unit] +Description=ESPHome Dashboard +After=network.target + +[Service] +ExecStart=${VENV_PATH}/bin/esphome dashboard /root/config/ +Restart=always +User=root - msg_info "Updating ESPHome" - if [[ -d /srv/esphome ]]; then - $STD source /srv/esphome/bin/activate +[Install] +WantedBy=multi-user.target +EOF + $STD systemctl daemon-reload + msg_ok "Updated systemd service" fi - $STD pip3 install -U esphome - msg_ok "Updated ESPHome" - msg_info "Starting ESPHome" + msg_info "Starting ${APP}" systemctl start esphomeDashboard - msg_ok "Started ESPHome" + msg_ok "Started ${APP}" msg_ok "Updated Successfully" exit } From dde3331cfc498e6634c7971cf074611c5b9ba671 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 24 Jun 2025 09:50:30 +0200 Subject: [PATCH 63/66] Update spoolman-install.sh --- install/spoolman-install.sh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/install/spoolman-install.sh b/install/spoolman-install.sh index c3ebbf8616d..45a8ccf3e1c 100644 --- a/install/spoolman-install.sh +++ b/install/spoolman-install.sh @@ -1,8 +1,7 @@ #!/usr/bin/env bash # Copyright (c) 2021-2025 tteck -# Author: tteck -# Co-Author: MickLesk (Canbiz) +# Author: MickLesk (CanbiZ) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://github.com/Donkie/Spoolman @@ -23,19 +22,16 @@ $STD apt-get install -y \ msg_ok "Installed Dependencies" PYTHON_VERSION="3.12" setup_uv +fetch_and_deploy_gh_release "spoolman" "Donkie/Spoolman" "prebuild" "latest" "/opt/spoolman" "spoolman.zip" msg_info "Installing Spoolman" -RELEASE=$(curl -fsSL https://github.com/Donkie/Spoolman/releases/latest | grep "title>Release" | cut -d " " -f 4) -cd /opt -curl -fsSL "https://github.com/Donkie/Spoolman/releases/download/$RELEASE/spoolman.zip" -o "spoolman.zip" -$STD unzip spoolman.zip -d spoolman -rm -f spoolman.zip -cd spoolman +cd /opt/spoolman $STD uv venv /opt/spoolman/.venv -$STD uv pip install -r requirements.txt +$STD /opt/spoolman/.venv/bin/python -m ensurepip --upgrade +$STD /opt/spoolman/.venv/bin/python -m pip install --upgrade pip +$STD /opt/spoolman/.venv/bin/python -m pip install -r requirements.txt curl -fsSL "https://raw.githubusercontent.com/Donkie/Spoolman/master/.env.example" -o ".env" -echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Installed Spoolman" msg_info "Creating Service" From 3a7fd878edc41ae2391fadd2cf8ccbe38dd0ccff Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 24 Jun 2025 09:57:13 +0200 Subject: [PATCH 64/66] update tools.func for migration --- install/spoolman-install.sh | 1 - misc/tools.func | 735 ++++++++++++++++++++---------------- 2 files changed, 408 insertions(+), 328 deletions(-) diff --git a/install/spoolman-install.sh b/install/spoolman-install.sh index 45a8ccf3e1c..99d383a2c0e 100644 --- a/install/spoolman-install.sh +++ b/install/spoolman-install.sh @@ -30,7 +30,6 @@ $STD uv venv /opt/spoolman/.venv $STD /opt/spoolman/.venv/bin/python -m ensurepip --upgrade $STD /opt/spoolman/.venv/bin/python -m pip install --upgrade pip $STD /opt/spoolman/.venv/bin/python -m pip install -r requirements.txt - curl -fsSL "https://raw.githubusercontent.com/Donkie/Spoolman/master/.env.example" -o ".env" msg_ok "Installed Spoolman" diff --git a/misc/tools.func b/misc/tools.func index 3033d6372b8..46d21279fa6 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -12,7 +12,7 @@ # NODE_MODULE - Comma-separated list of global modules (e.g. "yarn,@vue/cli@5.0.0") # ------------------------------------------------------------------------------ -install_node_and_modules() { +function setup_nodejs() { local NODE_VERSION="${NODE_VERSION:-22}" local NODE_MODULE="${NODE_MODULE:-}" local CURRENT_NODE_VERSION="" @@ -22,20 +22,17 @@ install_node_and_modules() { if command -v node >/dev/null; then CURRENT_NODE_VERSION="$(node -v | grep -oP '^v\K[0-9]+')" if [[ "$CURRENT_NODE_VERSION" != "$NODE_VERSION" ]]; then - msg_info "Node.js version $CURRENT_NODE_VERSION found, replacing with $NODE_VERSION" + msg_info "Old Node.js $CURRENT_NODE_VERSION found, replacing with $NODE_VERSION" NEED_NODE_INSTALL=true - else - msg_ok "Node.js $NODE_VERSION already installed" fi else - msg_info "Node.js not found, installing version $NODE_VERSION" + msg_info "Setup Node.js $NODE_VERSION" NEED_NODE_INSTALL=true fi if ! command -v jq &>/dev/null; then - $STD msg_info "Installing jq..." - $STD apt-get update -qq &>/dev/null - $STD apt-get install -y jq &>/dev/null || { + $STD apt-get update + $STD apt-get install -y jq || { msg_error "Failed to install jq" return 1 } @@ -67,7 +64,13 @@ install_node_and_modules() { exit 1 fi - msg_ok "Installed Node.js ${NODE_VERSION}" + # Update to latest npm + $STD npm install -g npm@latest || { + msg_error "Failed to update npm to latest version" + exit 1 + } + + msg_ok "Setup Node.js ${NODE_VERSION}" fi export NODE_OPTIONS="--max-old-space-size=4096" @@ -106,8 +109,6 @@ install_node_and_modules() { msg_error "Failed to update $MODULE_NAME to latest version" exit 1 fi - else - msg_ok "$MODULE_NAME@$MODULE_INSTALLED_VERSION already installed" fi else msg_info "Installing $MODULE_NAME@$MODULE_REQ_VERSION" @@ -117,7 +118,7 @@ install_node_and_modules() { fi fi done - msg_ok "All requested Node modules have been processed" + msg_ok "Installed Node.js modules: $NODE_MODULE" fi } @@ -135,7 +136,7 @@ install_node_and_modules() { # PG_VERSION - Major PostgreSQL version (e.g. 15, 16) (default: 16) # PG_MODULES - Comma-separated list of extensions (e.g. "postgis,contrib") # ------------------------------------------------------------------------------ -install_postgresql() { +function setup_postgresql() { local PG_VERSION="${PG_VERSION:-16}" local PG_MODULES="${PG_MODULES:-}" local CURRENT_PG_VERSION="" @@ -146,7 +147,7 @@ install_postgresql() { if command -v psql >/dev/null; then CURRENT_PG_VERSION="$(psql -V | awk '{print $3}' | cut -d. -f1)" if [[ "$CURRENT_PG_VERSION" == "$PG_VERSION" ]]; then - msg_ok "PostgreSQL $PG_VERSION is already installed" + : # PostgreSQL is already at the desired version – no action needed else msg_info "Detected PostgreSQL $CURRENT_PG_VERSION, preparing upgrade to $PG_VERSION" NEED_PG_INSTALL=true @@ -158,35 +159,41 @@ install_postgresql() { if [[ "$NEED_PG_INSTALL" == true ]]; then if [[ -n "$CURRENT_PG_VERSION" ]]; then - msg_info "Dumping all PostgreSQL data from version $CURRENT_PG_VERSION" + msg_info "Dumping PostgreSQL $CURRENT_PG_VERSION data" su - postgres -c "pg_dumpall > /var/lib/postgresql/backup_$(date +%F)_v${CURRENT_PG_VERSION}.sql" + msg_ok "Data dump completed" - msg_info "Stopping PostgreSQL service" systemctl stop postgresql fi + rm -f /etc/apt/sources.list.d/pgdg.list /etc/apt/trusted.gpg.d/postgresql.gpg + + $STD msg_info "Adding PostgreSQL PGDG repository" curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg echo "deb https://apt.postgresql.org/pub/repos/apt ${DISTRO}-pgdg main" \ >/etc/apt/sources.list.d/pgdg.list + $STD msg_ok "Repository added" $STD apt-get update - msg_info "Installing PostgreSQL $PG_VERSION" + msg_info "Setup PostgreSQL $PG_VERSION" $STD apt-get install -y "postgresql-${PG_VERSION}" "postgresql-client-${PG_VERSION}" + msg_ok "Setup PostgreSQL $PG_VERSION" if [[ -n "$CURRENT_PG_VERSION" ]]; then - msg_info "Removing old PostgreSQL $CURRENT_PG_VERSION packages" $STD apt-get purge -y "postgresql-${CURRENT_PG_VERSION}" "postgresql-client-${CURRENT_PG_VERSION}" || true fi - msg_info "Starting PostgreSQL $PG_VERSION" + $STD msg_info "Starting PostgreSQL $PG_VERSION" systemctl enable -q --now postgresql + $STD msg_ok "PostgreSQL $PG_VERSION started" if [[ -n "$CURRENT_PG_VERSION" ]]; then msg_info "Restoring dumped data" su - postgres -c "psql < /var/lib/postgresql/backup_$(date +%F)_v${CURRENT_PG_VERSION}.sql" + msg_ok "Data restored" fi msg_ok "PostgreSQL $PG_VERSION installed" @@ -197,13 +204,13 @@ install_postgresql() { IFS=',' read -ra MODULES <<<"$PG_MODULES" for module in "${MODULES[@]}"; do local pkg="postgresql-${PG_VERSION}-${module}" - msg_info "Installing PostgreSQL module: $pkg" + msg_info "Setup PostgreSQL module/s: $pkg" $STD apt-get install -y "$pkg" || { msg_error "Failed to install $pkg" continue } done - msg_ok "All requested PostgreSQL modules installed" + msg_ok "Setup PostgreSQL modules" fi } @@ -219,11 +226,13 @@ install_postgresql() { # MARIADB_VERSION - MariaDB version to install (e.g. 10.11, latest) (default: latest) # ------------------------------------------------------------------------------ -install_mariadb() { +setup_mariadb() { local MARIADB_VERSION="${MARIADB_VERSION:-latest}" local DISTRO_CODENAME DISTRO_CODENAME="$(awk -F= '/^VERSION_CODENAME=/{print $2}' /etc/os-release)" + CURRENT_OS="$(awk -F= '/^ID=/{print $2}' /etc/os-release)" + msg_info "Setting up MariaDB $MARIADB_VERSION" # grab dynamic latest LTS version if [[ "$MARIADB_VERSION" == "latest" ]]; then $STD msg_info "Resolving latest GA MariaDB version" @@ -254,19 +263,19 @@ install_mariadb() { fi if [[ -n "$CURRENT_VERSION" ]]; then - $STD msg_info "Replacing MariaDB $CURRENT_VERSION with $MARIADB_VERSION (data will be preserved)" + $STD msg_info "Upgrading MariaDB $CURRENT_VERSION to $MARIADB_VERSION" $STD systemctl stop mariadb >/dev/null 2>&1 || true $STD apt-get purge -y 'mariadb*' || true rm -f /etc/apt/sources.list.d/mariadb.list /etc/apt/trusted.gpg.d/mariadb.gpg else - msg_info "Setup MariaDB $MARIADB_VERSION" + $STD msg_info "Setup MariaDB $MARIADB_VERSION" fi $STD msg_info "Setting up MariaDB Repository" curl -fsSL "https://mariadb.org/mariadb_release_signing_key.asc" | gpg --dearmor -o /etc/apt/trusted.gpg.d/mariadb.gpg - echo "deb [signed-by=/etc/apt/trusted.gpg.d/mariadb.gpg] http://mirror.mariadb.org/repo/${MARIADB_VERSION}/debian ${DISTRO_CODENAME} main" \ + echo "deb [signed-by=/etc/apt/trusted.gpg.d/mariadb.gpg] http://mirror.mariadb.org/repo/${MARIADB_VERSION}/${CURRENT_OS} ${DISTRO_CODENAME} main" \ >/etc/apt/sources.list.d/mariadb.list $STD apt-get update @@ -287,46 +296,47 @@ install_mariadb() { # MYSQL_VERSION - MySQL version to install (e.g. 5.7, 8.0) (default: 8.0) # ------------------------------------------------------------------------------ -install_mysql() { +function setup_mysql() { local MYSQL_VERSION="${MYSQL_VERSION:-8.0}" local CURRENT_VERSION="" local NEED_INSTALL=false + CURRENT_OS="$(awk -F= '/^ID=/{print $2}' /etc/os-release)" if command -v mysql >/dev/null; then CURRENT_VERSION="$(mysql --version | grep -oP 'Distrib\s+\K[0-9]+\.[0-9]+')" if [[ "$CURRENT_VERSION" != "$MYSQL_VERSION" ]]; then - msg_info "MySQL $CURRENT_VERSION found, replacing with $MYSQL_VERSION" + $STD msg_info "MySQL $CURRENT_VERSION will be upgraded to $MYSQL_VERSION" NEED_INSTALL=true else # Check for patch-level updates if apt list --upgradable 2>/dev/null | grep -q '^mysql-server/'; then - msg_info "MySQL $CURRENT_VERSION available for upgrade" + $STD msg_info "MySQL $CURRENT_VERSION available for upgrade" $STD apt-get update $STD apt-get install --only-upgrade -y mysql-server - msg_ok "MySQL upgraded" + $STD msg_ok "MySQL upgraded" fi return fi else - msg_info "Installing MySQL $MYSQL_VERSION" + msg_info "Setup MySQL $MYSQL_VERSION" NEED_INSTALL=true fi if [[ "$NEED_INSTALL" == true ]]; then - $STD systemctl stop mysql >/dev/null 2>&1 || true + $STD systemctl stop mysql || true $STD apt-get purge -y "^mysql-server.*" "^mysql-client.*" "^mysql-common.*" || true rm -f /etc/apt/sources.list.d/mysql.list /etc/apt/trusted.gpg.d/mysql.gpg local DISTRO_CODENAME DISTRO_CODENAME="$(awk -F= '/VERSION_CODENAME/ { print $2 }' /etc/os-release)" curl -fsSL https://repo.mysql.com/RPM-GPG-KEY-mysql-2023 | gpg --dearmor -o /etc/apt/trusted.gpg.d/mysql.gpg - echo "deb [signed-by=/etc/apt/trusted.gpg.d/mysql.gpg] https://repo.mysql.com/apt/debian/ ${DISTRO_CODENAME} mysql-${MYSQL_VERSION}" \ + echo "deb [signed-by=/etc/apt/trusted.gpg.d/mysql.gpg] https://repo.mysql.com/apt/${CURRENT_OS}/ ${DISTRO_CODENAME} mysql-${MYSQL_VERSION}" \ >/etc/apt/sources.list.d/mysql.list export DEBIAN_FRONTEND=noninteractive $STD apt-get update $STD apt-get install -y mysql-server - msg_ok "Installed MySQL $MYSQL_VERSION" + msg_ok "Setup MySQL $MYSQL_VERSION" fi } @@ -349,7 +359,26 @@ install_mysql() { # PHP_MAX_EXECUTION_TIME - (default: 300) # ------------------------------------------------------------------------------ -install_php() { +# ------------------------------------------------------------------------------ +# Installs PHP with selected modules and configures Apache/FPM support. +# +# Description: +# - Adds Sury PHP repo if needed +# - Installs default and user-defined modules +# - Patches php.ini for CLI, Apache, and FPM as needed +# +# Variables: +# PHP_VERSION - PHP version to install (default: 8.4) +# PHP_MODULE - Additional comma-separated modules +# PHP_APACHE - Set YES to enable PHP with Apache +# PHP_FPM - Set YES to enable PHP-FPM +# PHP_MEMORY_LIMIT - (default: 512M) +# PHP_UPLOAD_MAX_FILESIZE - (default: 128M) +# PHP_POST_MAX_SIZE - (default: 128M) +# PHP_MAX_EXECUTION_TIME - (default: 300) +# ------------------------------------------------------------------------------ + +function setup_php() { local PHP_VERSION="${PHP_VERSION:-8.4}" local PHP_MODULE="${PHP_MODULE:-}" local PHP_APACHE="${PHP_APACHE:-NO}" @@ -375,51 +404,50 @@ install_php() { # Deduplicate modules COMBINED_MODULES=$(echo "$COMBINED_MODULES" | tr ',' '\n' | awk '!seen[$0]++' | paste -sd, -) - local CURRENT_PHP + local CURRENT_PHP="" if command -v php >/dev/null 2>&1; then CURRENT_PHP=$(php -v 2>/dev/null | awk '/^PHP/{print $2}' | cut -d. -f1,2) - else - CURRENT_PHP="" fi if [[ -z "$CURRENT_PHP" ]]; then msg_info "Setup PHP $PHP_VERSION" elif [[ "$CURRENT_PHP" != "$PHP_VERSION" ]]; then - msg_info "PHP $CURRENT_PHP detected, migrating to PHP $PHP_VERSION" - if [[ ! -f /etc/apt/sources.list.d/php.list ]]; then - $STD curl -fsSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb - $STD dpkg -i /tmp/debsuryorg-archive-keyring.deb - echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ ${DISTRO_CODENAME} main" \ - >/etc/apt/sources.list.d/php.list - $STD apt-get update - fi - + msg_info "Old PHP $CURRENT_PHP detected, Setup new PHP $PHP_VERSION" $STD apt-get purge -y "php${CURRENT_PHP//./}"* || true fi + # Ensure Sury repo is available + if [[ ! -f /etc/apt/sources.list.d/php.list ]]; then + $STD curl -fsSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb + $STD dpkg -i /tmp/debsuryorg-archive-keyring.deb + echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ ${DISTRO_CODENAME} main" \ + >/etc/apt/sources.list.d/php.list + $STD apt-get update + fi + local MODULE_LIST="php${PHP_VERSION}" IFS=',' read -ra MODULES <<<"$COMBINED_MODULES" for mod in "${MODULES[@]}"; do MODULE_LIST+=" php${PHP_VERSION}-${mod}" done + if [[ "$PHP_FPM" == "YES" ]]; then MODULE_LIST+=" php${PHP_VERSION}-fpm" fi - if [[ "$PHP_APACHE" == "YES" ]]; then - # Optionally disable old Apache PHP module + if [[ "$PHP_APACHE" == "YES" ]] && [[ -n "$CURRENT_PHP" ]]; then if [[ -f /etc/apache2/mods-enabled/php${CURRENT_PHP}.load ]]; then $STD a2dismod php${CURRENT_PHP} || true fi fi - if [[ "$PHP_FPM" == "YES" ]]; then + if [[ "$PHP_FPM" == "YES" ]] && [[ -n "$CURRENT_PHP" ]]; then $STD systemctl stop php${CURRENT_PHP}-fpm || true $STD systemctl disable php${CURRENT_PHP}-fpm || true fi $STD apt-get install -y $MODULE_LIST - msg_ok "Installed PHP $PHP_VERSION with selected modules" + msg_ok "Setup PHP $PHP_VERSION" if [[ "$PHP_APACHE" == "YES" ]]; then $STD systemctl restart apache2 || true @@ -431,8 +459,7 @@ install_php() { fi # Patch all relevant php.ini files - local PHP_INI_PATHS=() - PHP_INI_PATHS+=("/etc/php/${PHP_VERSION}/cli/php.ini") + local PHP_INI_PATHS=("/etc/php/${PHP_VERSION}/cli/php.ini") [[ "$PHP_FPM" == "YES" ]] && PHP_INI_PATHS+=("/etc/php/${PHP_VERSION}/fpm/php.ini") [[ "$PHP_APACHE" == "YES" ]] && PHP_INI_PATHS+=("/etc/php/${PHP_VERSION}/apache2/php.ini") @@ -456,7 +483,7 @@ install_php() { # - Installs to /usr/local/bin/composer # ------------------------------------------------------------------------------ -install_composer() { +function setup_composer() { local COMPOSER_BIN="/usr/local/bin/composer" export COMPOSER_ALLOW_SUPERUSER=1 @@ -464,7 +491,7 @@ install_composer() { if [[ -x "$COMPOSER_BIN" ]]; then local CURRENT_VERSION CURRENT_VERSION=$("$COMPOSER_BIN" --version | awk '{print $3}') - $STD msg_info "Composer $CURRENT_VERSION found, updating to latest" + $STD msg_info "Old Composer $CURRENT_VERSION found, updating to latest" else msg_info "Setup Composer" fi @@ -481,7 +508,6 @@ install_composer() { chmod +x "$COMPOSER_BIN" composer diagnose >/dev/null 2>&1 msg_ok "Setup Composer" - #msg_ok "Installed Composer $($COMPOSER_BIN --version | awk '{print $3}')" } # ------------------------------------------------------------------------------ @@ -495,7 +521,7 @@ install_composer() { # GO_VERSION - Version to install (e.g. 1.22.2 or latest) # ------------------------------------------------------------------------------ -install_go() { +function setup_go() { local ARCH case "$(uname -m)" in x86_64) ARCH="amd64" ;; @@ -513,7 +539,6 @@ install_go() { msg_error "Could not determine latest Go version" return 1 fi - $STD msg_info "Detected latest Go version: $GO_VERSION" fi local GO_BIN="/usr/local/bin/go" @@ -523,14 +548,13 @@ install_go() { local CURRENT_VERSION CURRENT_VERSION=$("$GO_BIN" version | awk '{print $3}' | sed 's/go//') if [[ "$CURRENT_VERSION" == "$GO_VERSION" ]]; then - $STD msg_ok "Go $GO_VERSION already installed" return 0 else - $STD msg_info "Go $CURRENT_VERSION found, upgrading to $GO_VERSION" + $STD msg_info "Old Go Installation ($CURRENT_VERSION) found, upgrading to $GO_VERSION" rm -rf "$GO_INSTALL_DIR" fi else - msg_info "Installing Go $GO_VERSION" + msg_info "Setup Go $GO_VERSION" fi local TARBALL="go${GO_VERSION}.linux-${ARCH}.tar.gz" @@ -547,7 +571,7 @@ install_go() { ln -sf /usr/local/go/bin/gofmt /usr/local/bin/gofmt rm -f "$TMP_TAR" - msg_ok "Installed Go $GO_VERSION" + msg_ok "Setup Go $GO_VERSION" } # ------------------------------------------------------------------------------ @@ -561,7 +585,7 @@ install_go() { # JAVA_VERSION - Temurin JDK version to install (e.g. 17, 21) # ------------------------------------------------------------------------------ -install_java() { +function setup_java() { local JAVA_VERSION="${JAVA_VERSION:-21}" local DISTRO_CODENAME DISTRO_CODENAME=$(awk -F= '/VERSION_CODENAME/ { print $2 }' /etc/os-release) @@ -569,13 +593,13 @@ install_java() { # Add Adoptium repo if missing if [[ ! -f /etc/apt/sources.list.d/adoptium.list ]]; then - msg_info "Setting up Adoptium Repository" + $STD msg_info "Setting up Adoptium Repository" mkdir -p /etc/apt/keyrings curl -fsSL "https://packages.adoptium.net/artifactory/api/gpg/key/public" | gpg --dearmor -o /etc/apt/trusted.gpg.d/adoptium.gpg echo "deb [signed-by=/etc/apt/trusted.gpg.d/adoptium.gpg] https://packages.adoptium.net/artifactory/deb ${DISTRO_CODENAME} main" \ >/etc/apt/sources.list.d/adoptium.list $STD apt-get update - msg_ok "Set up Adoptium Repository" + $STD msg_ok "Set up Adoptium Repository" fi # Detect currently installed temurin version @@ -585,19 +609,19 @@ install_java() { fi if [[ "$INSTALLED_VERSION" == "$JAVA_VERSION" ]]; then - msg_info "Temurin JDK $JAVA_VERSION already installed, updating if needed" + $STD msg_info "Upgrading Temurin JDK $JAVA_VERSION" $STD apt-get update $STD apt-get install --only-upgrade -y "$DESIRED_PACKAGE" - msg_ok "Updated Temurin JDK $JAVA_VERSION (if applicable)" + $STD msg_ok "Upgraded Temurin JDK $JAVA_VERSION" else if [[ -n "$INSTALLED_VERSION" ]]; then - msg_info "Removing Temurin JDK $INSTALLED_VERSION" + $STD msg_info "Removing Temurin JDK $INSTALLED_VERSION" $STD apt-get purge -y "temurin-${INSTALLED_VERSION}-jdk" fi - msg_info "Installing Temurin JDK $JAVA_VERSION" + msg_info "Setup Temurin JDK $JAVA_VERSION" $STD apt-get install -y "$DESIRED_PACKAGE" - msg_ok "Installed Temurin JDK $JAVA_VERSION" + msg_ok "Setup Temurin JDK $JAVA_VERSION" fi } @@ -612,7 +636,7 @@ install_java() { # MONGO_VERSION - MongoDB major version to install (e.g. 7.0, 8.0) # ------------------------------------------------------------------------------ -install_mongodb() { +function setup_mongodb() { local MONGO_VERSION="${MONGO_VERSION:-8.0}" local DISTRO_ID DISTRO_CODENAME MONGO_BASE_URL DISTRO_ID=$(awk -F= '/^ID=/{ gsub(/"/,"",$2); print $2 }' /etc/os-release) @@ -635,21 +659,20 @@ install_mongodb() { fi if [[ "$INSTALLED_VERSION" == "$MONGO_VERSION" ]]; then - msg_info "MongoDB $MONGO_VERSION already installed, checking for upgrade" + $STD msg_info "Upgrading MongoDB $MONGO_VERSION" $STD apt-get update $STD apt-get install --only-upgrade -y mongodb-org - msg_ok "MongoDB $MONGO_VERSION upgraded if needed" + $STD msg_ok "Upgraded MongoDB $MONGO_VERSION" return 0 fi if [[ -n "$INSTALLED_VERSION" ]]; then - msg_info "Replacing MongoDB $INSTALLED_VERSION with $MONGO_VERSION (data will be preserved)" $STD systemctl stop mongod || true $STD apt-get purge -y mongodb-org || true rm -f /etc/apt/sources.list.d/mongodb-org-*.list rm -f /etc/apt/trusted.gpg.d/mongodb-*.gpg else - msg_info "Installing MongoDB $MONGO_VERSION" + msg_info "Setup MongoDB $MONGO_VERSION" fi curl -fsSL "https://pgp.mongodb.com/server-${MONGO_VERSION}.asc" | gpg --dearmor -o "/etc/apt/trusted.gpg.d/mongodb-${MONGO_VERSION}.gpg" @@ -668,177 +691,243 @@ install_mongodb() { $STD systemctl enable mongod $STD systemctl start mongod - msg_ok "MongoDB $MONGO_VERSION installed and started" + msg_ok "Setup MongoDB $MONGO_VERSION" } # ------------------------------------------------------------------------------ -# Downloads and deploys latest GitHub release tarball. +# Downloads and deploys latest GitHub release (source, binary, tarball, asset). # # Description: -# - Fetches latest release from GitHub API -# - Detects matching asset by architecture -# - Extracts to /opt/ and saves version +# - Fetches latest release metadata from GitHub API +# - Supports the following modes: +# - tarball: Source code tarball (default if omitted) +# - source: Alias for tarball (same behavior) +# - binary: .deb package install (arch-dependent) +# - prebuild: Prebuilt .tar.gz archive (e.g. Go binaries) +# - singlefile: Standalone binary (no archive, direct chmod +x install) +# - Handles download, extraction/installation and version tracking in ~/. # -# Variables: -# APP - Override default application name (optional) -# GITHUB_TOKEN - (optional) GitHub token for private rate limits +# Parameters: +# $1 APP - Application name (used for install path and version file) +# $2 REPO - GitHub repository in form user/repo +# $3 MODE - Release type: +# tarball → source tarball (.tar.gz) +# binary → .deb file (auto-arch matched) +# prebuild → prebuilt archive (e.g. tar.gz) +# singlefile→ standalone binary (chmod +x) +# $4 VERSION - Optional release tag (default: latest) +# $5 TARGET_DIR - Optional install path (default: /opt/) +# $6 ASSET_FILENAME - Required for: +# - prebuild → archive filename or pattern +# - singlefile→ binary filename or pattern +# +# Optional: +# - Set GITHUB_TOKEN env var to increase API rate limit (recommended for CI/CD). +# +# Examples: +# # 1. Minimal: Fetch and deploy source tarball +# fetch_and_deploy_gh_release "myapp" "myuser/myapp" +# +# # 2. Binary install via .deb asset (architecture auto-detected) +# fetch_and_deploy_gh_release "myapp" "myuser/myapp" "binary" +# +# # 3. Prebuilt archive (.tar.gz) with asset filename match +# fetch_and_deploy_gh_release "hanko" "teamhanko/hanko" "prebuild" "latest" "/opt/hanko" "hanko_Linux_x86_64.tar.gz" +# +# # 4. Single binary (chmod +x) like Argus, Promtail etc. +# fetch_and_deploy_gh_release "argus" "release-argus/Argus" "singlefile" "0.26.3" "/opt/argus" "Argus-.*linux-amd64" # ------------------------------------------------------------------------------ -fetch_and_deploy_gh_release() { - local repo="$1" - local raw_app="${APP:-$APPLICATION}" - local app=$(echo "${raw_app,,}" | tr -d ' ') - local api_url="https://api.github.com/repos/$repo/releases/latest" - local header=() - local attempt=0 - local max_attempts=3 - local api_response tag http_code - local current_version="" +function fetch_and_deploy_gh_release() { + local app="$1" + local repo="$2" + local mode="${3:-tarball}" # tarball | binary | prebuild | singlefile + local version="${4:-latest}" + local target="${5:-/opt/$app}" + + local app_lc=$(echo "${app,,}" | tr -d ' ') + local version_file="$HOME/.${app_lc}" local curl_timeout="--connect-timeout 10 --max-time 30" - # Check if the app directory exists and if there's a version file - if [[ -f "/opt/${app}_version.txt" ]]; then - current_version=$(cat "/opt/${app}_version.txt") - $STD msg_info "Current version: $current_version" + + local current_version="" + if [[ -f "$version_file" ]]; then + current_version=$(<"$version_file") fi - # ensure that jq is installed + if ! command -v jq &>/dev/null; then - $STD msg_info "Installing jq..." - $STD apt-get update -qq &>/dev/null - $STD apt-get install -y jq &>/dev/null || { - msg_error "Failed to install jq" - return 1 - } + $STD apt-get install -y jq &>/dev/null fi + + local api_url="https://api.github.com/repos/$repo/releases" + [[ "$version" != "latest" ]] && api_url="$api_url/tags/$version" || api_url="$api_url/latest" + local header=() [[ -n "${GITHUB_TOKEN:-}" ]] && header=(-H "Authorization: token $GITHUB_TOKEN") - until [[ $attempt -ge $max_attempts ]]; do - ((attempt++)) || true - $STD msg_info "[$attempt/$max_attempts] Fetching GitHub release for $repo...\n" - api_response=$(curl $curl_timeout -fsSL -w "%{http_code}" -o /tmp/gh_resp.json "${header[@]}" "$api_url") - http_code="${api_response:(-3)}" - if [[ "$http_code" == "404" ]]; then - msg_error "Repository $repo has no Release candidate (404)" - return 1 - fi - if [[ "$http_code" != "200" ]]; then - $STD msg_info "Request failed with HTTP $http_code, retrying...\n" - sleep $((attempt * 2)) - continue - fi - api_response=$(/dev/null; then - msg_error "Repository not found: $repo" - return 1 - fi - tag=$(echo "$api_response" | jq -r '.tag_name // .name // empty') - [[ "$tag" =~ ^v[0-9] ]] && tag="${tag:1}" - version="${tag#v}" - if [[ -z "$tag" ]]; then - $STD msg_info "Empty tag received, retrying...\n" - sleep $((attempt * 2)) - continue - fi - $STD msg_ok "Found release: $tag for $repo" - break - done - if [[ -z "$tag" ]]; then - msg_error "Failed to fetch release for $repo after $max_attempts attempts." - exit 1 - fi - # Version comparison (if we already have this version, skip) - if [[ "$current_version" == "$tag" ]]; then - $STD msg_info "Already running the latest version ($tag). Skipping update." + + local resp http_code + resp=$(curl $curl_timeout -fsSL -w "%{http_code}" -o /tmp/gh_rel.json "${header[@]}" "$api_url") + http_code="${resp:(-3)}" + [[ "$http_code" != "200" ]] && { + msg_error "Failed to fetch release: HTTP $http_code" + return 1 + } + + local json tag_name + json=$(/dev/null; then - arch=$(dpkg --print-architecture) - elif command -v uname &>/dev/null; then - case "$(uname -m)" in - x86_64) arch="amd64" ;; - aarch64) arch="arm64" ;; - armv7l) arch="armv7" ;; - armv6l) arch="armv6" ;; - *) arch="unknown" ;; - esac - else - arch="unknown" - fi - $STD msg_info "Detected system architecture: $arch" - # Try to find a matching asset for our architecture - local url="" - for u in $assets; do - if [[ "$u" =~ $arch.*\.tar\.gz$ ]]; then - url="$u" - $STD msg_info "Found matching architecture asset: $url" - break - fi - done - # Fallback to other architectures if our specific one isn't found - if [[ -z "$url" ]]; then + local filename="" url="" + + msg_info "Setup $app ($version)" + + if [[ "$mode" == "tarball" || "$mode" == "source" ]]; then + url=$(echo "$json" | jq -r '.tarball_url // empty') + [[ -z "$url" ]] && url="https://github.com/$repo/archive/refs/tags/v$version.tar.gz" + filename="${app_lc}-${version}.tar.gz" + + curl $curl_timeout -fsSL -o "$tmpdir/$filename" "$url" || { + msg_error "Download failed: $url" + rm -rf "$tmpdir" + return 1 + } + + mkdir -p "$target" + tar -xzf "$tmpdir/$filename" -C "$tmpdir" + local unpack_dir + unpack_dir=$(find "$tmpdir" -mindepth 1 -maxdepth 1 -type d | head -n1) + + shopt -s dotglob nullglob + cp -r "$unpack_dir"/* "$target/" + shopt -u dotglob nullglob + + elif [[ "$mode" == "binary" ]]; then + local arch + arch=$(dpkg --print-architecture 2>/dev/null || uname -m) + [[ "$arch" == "x86_64" ]] && arch="x86_64" + [[ "$arch" == "aarch64" ]] && arch="arm64" + + local assets url_match="" + assets=$(echo "$json" | jq -r '.assets[].browser_download_url') + for u in $assets; do - if [[ "$u" =~ (x86_64|amd64|arm64|armv7|armv6).*\.tar\.gz$ ]]; then - url="$u" - $STD msg_info "Architecture-specific asset not found, using: $url" + if [[ "$u" =~ ($arch|amd64|x86_64|aarch64|arm64).*\.deb$ ]]; then + url_match="$u" break fi done - fi - # Fallback to any tar.gz - if [[ -z "$url" ]]; then - for u in $assets; do - if [[ "$u" =~ \.tar\.gz$ ]]; then - url="$u" - $STD msg_info "Using generic tarball: $url" - break - fi + + if [[ -z "$url_match" ]]; then + for u in $assets; do + [[ "$u" =~ \.deb$ ]] && url_match="$u" && break + done + fi + + if [[ -z "$url_match" ]]; then + msg_error "No suitable .deb asset found for $app" + rm -rf "$tmpdir" + return 1 + fi + + filename="${url_match##*/}" + curl $curl_timeout -fsSL -o "$tmpdir/$filename" "$url_match" || { + msg_error "Download failed: $url_match" + rm -rf "$tmpdir" + return 1 + } + + chmod 644 "$tmpdir/$filename" + $STD apt-get install -y "$tmpdir/$filename" || { + $STD dpkg -i "$tmpdir/$filename" || { + msg_error "Both apt and dpkg installation failed" + rm -rf "$tmpdir" + return 1 + } + } + + elif [[ "$mode" == "prebuild" ]]; then + local pattern="$6" + [[ -z "$pattern" ]] && { + msg_error "Mode 'prebuild' requires 6th parameter (asset filename pattern)" + rm -rf "$tmpdir" + return 1 + } + + local asset_url="" + for u in $(echo "$json" | jq -r '.assets[].browser_download_url'); do + [[ "$u" =~ $pattern || "$u" == *"$pattern" ]] && asset_url="$u" && break done - fi - # Final fallback to GitHub source tarball - if [[ -z "$url" ]]; then - # Use tarball_url directly from API response instead of constructing our own URL - url=$(echo "$api_response" | jq -r '.tarball_url // empty') - # If tarball_url is empty for some reason, fall back to a constructed URL as before - if [[ -z "$url" ]]; then - url="https://github.com/$repo/archive/refs/tags/v$version.tar.gz" + [[ -z "$asset_url" ]] && { + msg_error "No asset matching '$pattern' found" + rm -rf "$tmpdir" + return 1 + } + + filename="${asset_url##*/}" + curl $curl_timeout -fsSL -o "$tmpdir/$filename" "$asset_url" || { + msg_error "Download failed: $asset_url" + rm -rf "$tmpdir" + return 1 + } + + mkdir -p "$target" + if [[ "$filename" == *.zip ]]; then + if ! command -v unzip &>/dev/null; then + $STD apt-get install -y unzip + fi + $STD unzip "$tmpdir/$filename" -d "$target" + elif [[ "$filename" == *.tar.gz ]]; then + tar -xzf "$tmpdir/$filename" -C "$target" + else + msg_error "Unsupported archive format: $filename" + rm -rf "$tmpdir" + return 1 fi - $STD msg_info "Using GitHub source tarball: $url" - fi - local filename="${url##*/}" - $STD msg_info "Downloading $url" - if ! curl $curl_timeout -fsSL -o "$tmpdir/$filename" "$url"; then - msg_error "Failed to download release asset from $url" + elif [[ "$mode" == "singlefile" ]]; then + local pattern="$6" + [[ -z "$pattern" ]] && { + msg_error "Mode 'singlefile' requires 6th parameter (asset filename pattern)" + rm -rf "$tmpdir" + return 1 + } + + local asset_url="" + for u in $(echo "$json" | jq -r '.assets[].browser_download_url'); do + [[ "$u" =~ $pattern || "$u" == *"$pattern" ]] && asset_url="$u" && break + done + + [[ -z "$asset_url" ]] && { + msg_error "No asset matching '$pattern' found" + rm -rf "$tmpdir" + return 1 + } + + filename="${asset_url##*/}" + mkdir -p "$target" + curl $curl_timeout -fsSL -o "$target/$app" "$asset_url" || { + msg_error "Download failed: $asset_url" + rm -rf "$tmpdir" + return 1 + } + + chmod +x "$target/$app" + + else + msg_error "Unknown mode: $mode" rm -rf "$tmpdir" return 1 fi - mkdir -p "/opt/$app" - tar -xzf "$tmpdir/$filename" -C "$tmpdir" - local content_root - content_root=$(find "$tmpdir" -mindepth 1 -maxdepth 1 -type d) - if [[ $(echo "$content_root" | wc -l) -eq 1 ]]; then - shopt -s dotglob nullglob - cp -r "$content_root"/* "/opt/$app/" - shopt -u dotglob nullglob - else - shopt -s dotglob nullglob - cp -r "$tmpdir"/* "/opt/$app/" - shopt -u dotglob nullglob - fi - echo "$version" >"/opt/${app}_version.txt" - $STD msg_ok "Deployed $app v$version to /opt/$app" + + echo "$version" >"$version_file" + msg_ok "Setup $app ($version)" rm -rf "$tmpdir" } @@ -850,7 +939,7 @@ fetch_and_deploy_gh_release() { # - Automatically runs on network changes # ------------------------------------------------------------------------------ -setup_local_ip_helper() { +function setup_local_ip_helper() { local BASE_DIR="/usr/local/community-scripts/ip-management" local SCRIPT_PATH="$BASE_DIR/update_local_ip.sh" local IP_FILE="/run/local-ip.env" @@ -860,8 +949,8 @@ setup_local_ip_helper() { # Install networkd-dispatcher if not present if ! dpkg -s networkd-dispatcher >/dev/null 2>&1; then - $STD apt-get update -qq - $STD apt-get install -yq networkd-dispatcher + $STD apt-get update + $STD apt-get install -y networkd-dispatcher fi # Write update_local_ip.sh @@ -918,8 +1007,6 @@ EOF chmod +x "$DISPATCHER_SCRIPT" systemctl enable -q --now networkd-dispatcher.service - - $STD msg_ok "LOCAL_IP helper installed using networkd-dispatcher" } # ------------------------------------------------------------------------------ @@ -929,7 +1016,7 @@ EOF # - Loads from /run/local-ip.env or performs runtime lookup # ------------------------------------------------------------------------------ -import_local_ip() { +function import_local_ip() { local IP_FILE="/run/local-ip.env" if [[ -f "$IP_FILE" ]]; then # shellcheck disable=SC1090 @@ -989,7 +1076,6 @@ function download_with_progress() { content_length=$(curl -fsSLI "$url" | awk '/Content-Length/ {print $2}' | tr -d '\r' || true) if [[ -z "$content_length" ]]; then - #msg_warn "Content-Length not available, falling back to plain download" if ! curl -fL# -o "$output" "$url"; then msg_error "Download failed" return 1 @@ -1011,7 +1097,6 @@ function download_with_progress() { # ------------------------------------------------------------------------------ function setup_uv() { - $STD msg_info "Checking uv installation..." local UV_BIN="/usr/local/bin/uv" local TMP_DIR TMP_DIR=$(mktemp -d) @@ -1047,15 +1132,14 @@ function setup_uv() { local INSTALLED_VERSION INSTALLED_VERSION=$($UV_BIN -V | awk '{print $2}') if [[ "$INSTALLED_VERSION" == "$LATEST_VERSION" ]]; then - $STD msg_ok "uv is already at the latest version ($INSTALLED_VERSION)" rm -rf "$TMP_DIR" [[ ":$PATH:" != *":/usr/local/bin:"* ]] && export PATH="/usr/local/bin:$PATH" return 0 else - $STD msg_info "Updating uv from $INSTALLED_VERSION to $LATEST_VERSION" + msg_info "Updating uv from $INSTALLED_VERSION to $LATEST_VERSION" fi else - $STD msg_info "Installing uv $LATEST_VERSION" + msg_info "Setup uv $LATEST_VERSION" fi # Download and install manually @@ -1080,12 +1164,10 @@ function setup_uv() { rm -rf "$TMP_DIR" ensure_usr_local_bin_persist - msg_ok "uv $LATEST_VERSION installed" + msg_ok "Setup uv $LATEST_VERSION" # Optional: install specific Python version if [[ -n "${PYTHON_VERSION:-}" ]]; then - $STD msg_info "Ensuring Python $PYTHON_VERSION is available via uv..." - local VERSION_MATCH VERSION_MATCH=$(uv python list --only-downloads | grep -E "^cpython-${PYTHON_VERSION//./\\.}\.[0-9]+-linux" | @@ -1096,73 +1178,16 @@ function setup_uv() { return 1 fi - if uv python list | grep -q "cpython-${VERSION_MATCH}-linux.*uv/python"; then - $STD msg_ok "Python $VERSION_MATCH already installed via uv" - else + if ! uv python list | grep -q "cpython-${VERSION_MATCH}-linux.*uv/python"; then if ! $STD uv python install "$VERSION_MATCH"; then msg_error "Failed to install Python $VERSION_MATCH via uv" return 1 fi - msg_ok "Installed Python $VERSION_MATCH" + msg_ok "Setup Python $VERSION_MATCH via uv" fi fi } -# ------------------------------------------------------------------------------ -# Creates a uv-based venv with optional Python version and installs dependencies -# ------------------------------------------------------------------------------ - -function setup_uv_venv() { - local VENV_FOLDER="${VENV_FOLDER:?VENV_FOLDER not set}" - local PYTHON_VERSION="${PYTHON_VERSION:?PYTHON_VERSION not set}" - local REQUIREMENTS_FILE="${REQUIREMENTS_FILE:-requirements.txt}" - local PYTHON_BIN - - setup_uv || return 1 - - # Install Python via uv if not already available - local VERSION_MATCH - VERSION_MATCH=$(uv python list --only-downloads | - grep -E "^cpython-${PYTHON_VERSION//./\\.}\.[0-9]+-linux" | - cut -d'-' -f2 | sort -V | tail -n1) - - if [[ -z "$VERSION_MATCH" ]]; then - msg_error "No matching Python $PYTHON_VERSION.x version found via uv" - return 1 - fi - - if ! uv python list | grep -q "cpython-${VERSION_MATCH}-linux.*uv/python"; then - $STD msg_info "Installing Python $VERSION_MATCH via uv" - $STD uv python install "$VERSION_MATCH" || { - msg_error "Failed to install Python $VERSION_MATCH via uv" - return 1 - } - fi - - $STD msg_info "Creating uv venv in $VENV_FOLDER" - if ! $STD uv venv "$VENV_FOLDER" --python "$VERSION_MATCH"; then - msg_error "Failed to create uv venv" - return 1 - fi - - PYTHON_BIN="$VENV_FOLDER/bin/python" - - $STD msg_info "Running ensurepip" - $STD "$PYTHON_BIN" -m ensurepip --upgrade || return 1 - - $STD msg_info "Upgrading pip" - $STD "$PYTHON_BIN" -m pip install --upgrade pip || return 1 - - if [[ -f "$REQUIREMENTS_FILE" ]]; then - $STD msg_info "Installing requirements from $REQUIREMENTS_FILE" - $STD "$PYTHON_BIN" -m pip install -r "$REQUIREMENTS_FILE" || return 1 - else - msg_info "No requirements file found at $REQUIREMENTS_FILE – skipping" - fi - - msg_ok "uv venv setup complete in $VENV_FOLDER" -} - # ------------------------------------------------------------------------------ # Ensures /usr/local/bin is permanently in system PATH. # @@ -1188,7 +1213,6 @@ function ensure_usr_local_bin_persist() { # ------------------------------------------------------------------------------ function setup_gs() { - msg_info "Setup Ghostscript" mkdir -p /tmp TMP_DIR=$(mktemp -d) CURRENT_VERSION=$(gs --version 2>/dev/null || echo "0") @@ -1204,12 +1228,11 @@ function setup_gs() { fi if dpkg --compare-versions "$CURRENT_VERSION" ge "$LATEST_VERSION_DOTTED"; then - msg_ok "Ghostscript is already at version $CURRENT_VERSION" rm -rf "$TMP_DIR" return fi - msg_info "Installing/Updating Ghostscript to $LATEST_VERSION_DOTTED" + msg_info "Setup Ghostscript $LATEST_VERSION_DOTTED" curl -fsSL "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${LATEST_VERSION}/ghostscript-${LATEST_VERSION_DOTTED}.tar.gz" -o "$TMP_DIR/ghostscript.tar.gz" if ! tar -xzf "$TMP_DIR/ghostscript.tar.gz" -C "$TMP_DIR"; then @@ -1235,7 +1258,7 @@ function setup_gs() { rm -rf "$TMP_DIR" if [[ $EXIT_CODE -eq 0 ]]; then - msg_ok "Ghostscript installed/updated to version $LATEST_VERSION_DOTTED" + msg_ok "Setup Ghostscript $LATEST_VERSION_DOTTED" else msg_error "Ghostscript installation failed" fi @@ -1254,7 +1277,7 @@ function setup_gs() { # RUBY_INSTALL_RAILS - true/false to install Rails (default: true) # ------------------------------------------------------------------------------ -setup_rbenv_stack() { +function setup_ruby() { local RUBY_VERSION="${RUBY_VERSION:-3.4.4}" local RUBY_INSTALL_RAILS="${RUBY_INSTALL_RAILS:-true}" @@ -1264,9 +1287,8 @@ setup_rbenv_stack() { local TMP_DIR TMP_DIR=$(mktemp -d) - $STD msg_info "Installing rbenv + ruby-build + Ruby $RUBY_VERSION" + msg_info "Setup Ruby $RUBY_VERSION" - # Fetch latest rbenv release tag from GitHub (e.g. v1.3.2 → 1.3.2) local RBENV_RELEASE RBENV_RELEASE=$(curl -fsSL https://api.github.com/repos/rbenv/rbenv/releases/latest | grep '"tag_name":' | cut -d '"' -f4 | sed 's/^v//') if [[ -z "$RBENV_RELEASE" ]]; then @@ -1275,14 +1297,12 @@ setup_rbenv_stack() { return 1 fi - # Download and extract rbenv release curl -fsSL "https://github.com/rbenv/rbenv/archive/refs/tags/v${RBENV_RELEASE}.tar.gz" -o "$TMP_DIR/rbenv.tar.gz" tar -xzf "$TMP_DIR/rbenv.tar.gz" -C "$TMP_DIR" mkdir -p "$RBENV_DIR" cp -r "$TMP_DIR/rbenv-${RBENV_RELEASE}/." "$RBENV_DIR/" - cd "$RBENV_DIR" && src/configure && make -C src + cd "$RBENV_DIR" && src/configure && $STD make -C src - # Fetch latest ruby-build plugin release tag (e.g. v20250507 → 20250507) local RUBY_BUILD_RELEASE RUBY_BUILD_RELEASE=$(curl -fsSL https://api.github.com/repos/rbenv/ruby-build/releases/latest | grep '"tag_name":' | cut -d '"' -f4 | sed 's/^v//') if [[ -z "$RUBY_BUILD_RELEASE" ]]; then @@ -1291,44 +1311,35 @@ setup_rbenv_stack() { return 1 fi - # Download and install ruby-build plugin curl -fsSL "https://github.com/rbenv/ruby-build/archive/refs/tags/v${RUBY_BUILD_RELEASE}.tar.gz" -o "$TMP_DIR/ruby-build.tar.gz" tar -xzf "$TMP_DIR/ruby-build.tar.gz" -C "$TMP_DIR" mkdir -p "$RBENV_DIR/plugins/ruby-build" cp -r "$TMP_DIR/ruby-build-${RUBY_BUILD_RELEASE}/." "$RBENV_DIR/plugins/ruby-build/" echo "$RUBY_BUILD_RELEASE" >"$RBENV_DIR/plugins/ruby-build/RUBY_BUILD_version.txt" - # Persist rbenv init to user's profile if ! grep -q 'rbenv init' "$PROFILE_FILE"; then echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >>"$PROFILE_FILE" echo 'eval "$(rbenv init -)"' >>"$PROFILE_FILE" fi - # Activate rbenv in current shell export PATH="$RBENV_DIR/bin:$PATH" eval "$("$RBENV_BIN" init - bash)" - # Install Ruby version if not already present - if "$RBENV_BIN" versions --bare | grep -qx "$RUBY_VERSION"; then - msg_ok "Ruby $RUBY_VERSION already installed" - else - $STD msg_info "Installing Ruby $RUBY_VERSION" + if ! "$RBENV_BIN" versions --bare | grep -qx "$RUBY_VERSION"; then $STD "$RBENV_BIN" install "$RUBY_VERSION" fi - # Set Ruby version globally "$RBENV_BIN" global "$RUBY_VERSION" hash -r - # Optionally install Rails via gem if [[ "$RUBY_INSTALL_RAILS" == "true" ]]; then - $STD msg_info "Installing latest Rails via gem" + msg_info "Setup Rails via gem" gem install rails - msg_ok "Rails $(rails -v) installed" + msg_ok "Setup Rails $(rails -v)" fi rm -rf "$TMP_DIR" - msg_ok "rbenv stack ready (Ruby $RUBY_VERSION)" + msg_ok "Setup Ruby $RUBY_VERSION" } # ------------------------------------------------------------------------------ @@ -1340,14 +1351,12 @@ setup_rbenv_stack() { # Variables: # APP - Application name (default: $APPLICATION variable) # ------------------------------------------------------------------------------ -create_selfsigned_certs() { +function create_selfsigned_certs() { local app=${APP:-$(echo "${APPLICATION,,}" | tr -d ' ')} - $STD msg_info "Creating Self-Signed Certificate" $STD openssl req -x509 -nodes -days 365 -newkey rsa:4096 \ -keyout /etc/ssl/private/"$app"-selfsigned.key \ -out /etc/ssl/certs/"$app"-selfsigned.crt \ -subj "/C=US/O=$app/OU=Domain Control Validated/CN=localhost" - $STD msg_ok "Created Self-Signed Certificate" } # ------------------------------------------------------------------------------ @@ -1367,18 +1376,18 @@ create_selfsigned_certs() { # RUST_CRATES - Comma-separated list of crates (e.g. "cargo-edit,wasm-pack@0.12.1") # ------------------------------------------------------------------------------ -install_rust_and_crates() { +function setup_rust() { local RUST_TOOLCHAIN="${RUST_TOOLCHAIN:-stable}" local RUST_CRATES="${RUST_CRATES:-}" local CARGO_BIN="${HOME}/.cargo/bin" # rustup & toolchain if ! command -v rustup &>/dev/null; then - msg_info "Installing rustup" + msg_info "Setup Rust" curl -fsSL https://sh.rustup.rs | $STD sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN" export PATH="$CARGO_BIN:$PATH" echo 'export PATH="$HOME/.cargo/bin:$PATH"' >>"$HOME/.profile" - msg_ok "Installed rustup with $RUST_TOOLCHAIN" + msg_ok "Setup Rust" else $STD rustup install "$RUST_TOOLCHAIN" $STD rustup default "$RUST_TOOLCHAIN" @@ -1403,20 +1412,21 @@ install_rust_and_crates() { if [[ -n "$INSTALLED_VER" ]]; then if [[ -n "$VER" && "$VER" != "$INSTALLED_VER" ]]; then - msg_info "Updating $NAME from $INSTALLED_VER to $VER" + msg_info "Update $NAME: $INSTALLED_VER → $VER" $STD cargo install "$NAME" --version "$VER" --force + msg_ok "Updated $NAME to $VER" elif [[ -z "$VER" ]]; then - msg_info "Updating $NAME to latest" + msg_info "Update $NAME: $INSTALLED_VER → latest" $STD cargo install "$NAME" --force - else - msg_ok "$NAME@$INSTALLED_VER already up to date" + msg_ok "Updated $NAME to latest" fi else - msg_info "Installing $NAME ${VER:+($VER)}" + msg_info "Setup $NAME ${VER:+($VER)}" $STD cargo install "$NAME" ${VER:+--version "$VER"} + msg_ok "Setup $NAME ${VER:-latest}" fi done - msg_ok "All requested Rust crates processed" + msg_ok "Setup Rust" fi } @@ -1428,9 +1438,9 @@ install_rust_and_crates() { # - Supports Alpine and Debian-based systems # ------------------------------------------------------------------------------ -install_adminer() { +function setup_adminer() { if grep -qi alpine /etc/os-release; then - msg_info "Installing Adminer (Alpine)" + msg_info "Setup Adminer (Alpine)" mkdir -p /var/www/localhost/htdocs/adminer if ! curl -fsSL https://github.com/vrana/adminer/releases/latest/download/adminer.php \ -o /var/www/localhost/htdocs/adminer/index.php; then @@ -1439,10 +1449,81 @@ install_adminer() { fi msg_ok "Adminer available at /adminer (Alpine)" else - msg_info "Installing Adminer (Debian/Ubuntu)" + msg_info "Setup Adminer (Debian/Ubuntu)" $STD apt-get install -y adminer $STD a2enconf adminer $STD systemctl reload apache2 msg_ok "Adminer available at /adminer (Debian/Ubuntu)" fi } + +# ------------------------------------------------------------------------------ +# Installs or updates yq (mikefarah/yq - Go version). +# +# Description: +# - Checks if yq is installed and from correct source +# - Compares with latest release on GitHub +# - Updates if outdated or wrong implementation +# ------------------------------------------------------------------------------ + +function setup_yq() { + local TMP_DIR + TMP_DIR=$(mktemp -d) + local CURRENT_VERSION="" + local BINARY_PATH="/usr/local/bin/yq" + local GITHUB_REPO="mikefarah/yq" + + if ! command -v jq &>/dev/null; then + $STD apt-get update + $STD apt-get install -y jq || { + msg_error "Failed to install jq" + rm -rf "$TMP_DIR" + return 1 + } + fi + + if command -v yq &>/dev/null; then + if ! yq --version 2>&1 | grep -q 'mikefarah'; then + rm -f "$(command -v yq)" + else + CURRENT_VERSION=$(yq --version | awk '{print $NF}' | sed 's/^v//') + fi + fi + + local RELEASE_JSON + RELEASE_JSON=$(curl -fsSL "https://api.github.com/repos/${GITHUB_REPO}/releases/latest") + local LATEST_VERSION + LATEST_VERSION=$(echo "$RELEASE_JSON" | jq -r '.tag_name' | sed 's/^v//') + + if [[ -z "$LATEST_VERSION" ]]; then + msg_error "Could not determine latest yq version from GitHub." + rm -rf "$TMP_DIR" + return 1 + fi + + if [[ -n "$CURRENT_VERSION" && "$CURRENT_VERSION" == "$LATEST_VERSION" ]]; then + return + fi + + msg_info "Setup yq ($LATEST_VERSION)" + curl -fsSL "https://github.com/${GITHUB_REPO}/releases/download/v${LATEST_VERSION}/yq_linux_amd64" -o "$TMP_DIR/yq" + chmod +x "$TMP_DIR/yq" + mv "$TMP_DIR/yq" "$BINARY_PATH" + + if [[ ! -x "$BINARY_PATH" ]]; then + msg_error "Failed to install yq to $BINARY_PATH" + rm -rf "$TMP_DIR" + return 1 + fi + + rm -rf "$TMP_DIR" + hash -r + + local FINAL_VERSION + FINAL_VERSION=$("$BINARY_PATH" --version 2>/dev/null | awk '{print $NF}') + if [[ "$FINAL_VERSION" == "v$LATEST_VERSION" ]]; then + msg_ok "Setup yq ($LATEST_VERSION)" + else + msg_error "yq installation incomplete or version mismatch" + fi +} From 6ade76b9fb029adaae4eda949112d22a4c4fa9de Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 24 Jun 2025 10:25:18 +0200 Subject: [PATCH 65/66] Update spoolman-install.sh --- install/spoolman-install.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/install/spoolman-install.sh b/install/spoolman-install.sh index 99d383a2c0e..c7f685156ba 100644 --- a/install/spoolman-install.sh +++ b/install/spoolman-install.sh @@ -27,8 +27,6 @@ fetch_and_deploy_gh_release "spoolman" "Donkie/Spoolman" "prebuild" "latest" "/o msg_info "Installing Spoolman" cd /opt/spoolman $STD uv venv /opt/spoolman/.venv -$STD /opt/spoolman/.venv/bin/python -m ensurepip --upgrade -$STD /opt/spoolman/.venv/bin/python -m pip install --upgrade pip $STD /opt/spoolman/.venv/bin/python -m pip install -r requirements.txt curl -fsSL "https://raw.githubusercontent.com/Donkie/Spoolman/master/.env.example" -o ".env" msg_ok "Installed Spoolman" From 8dbd9aa750c35666b6f844864c341d6baa12b00a Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 24 Jun 2025 10:43:56 +0200 Subject: [PATCH 66/66] Update spoolman-install.sh --- 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 c7f685156ba..53bf5a44c0f 100644 --- a/install/spoolman-install.sh +++ b/install/spoolman-install.sh @@ -27,7 +27,7 @@ fetch_and_deploy_gh_release "spoolman" "Donkie/Spoolman" "prebuild" "latest" "/o msg_info "Installing Spoolman" cd /opt/spoolman $STD uv venv /opt/spoolman/.venv -$STD /opt/spoolman/.venv/bin/python -m pip install -r requirements.txt +$STD /opt/spoolman/.venv/bin/uv pip install -r requirements.txt curl -fsSL "https://raw.githubusercontent.com/Donkie/Spoolman/master/.env.example" -o ".env" msg_ok "Installed Spoolman"