Compare commits

..

18 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] ad94016835 Clarify DISABLE_UPDATE default value 2026-06-23 04:29:01 +00:00
copilot-swe-agent[bot] f9abae77a4 Handle unset DISABLE_UPDATE safely in build.func 2026-06-23 04:28:34 +00:00
copilot-swe-agent[bot] 8cbdd0ac4d Fix unset DISABLE_UPDATE handling in build prompt guard 2026-06-23 04:27:39 +00:00
community-scripts-pr-app[bot] a96402797e Update CHANGELOG.md (#15327)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-22 20:07:11 +00:00
Jesse Hills 9b619969ad update: esphome to install and run ESPHome Device Builder (#15195) 2026-06-22 22:06:36 +02:00
community-scripts-pr-app[bot] 70e14ef238 Update CHANGELOG.md (#15326)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-22 20:02:47 +00:00
community-scripts-pr-app[bot] 7ac60ac88e Update CHANGELOG.md (#15325)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-22 20:02:33 +00:00
CanbiZ (MickLesk) cfb5114d8b invoiceshelf: use pnpm instead of yarn for frontend build (#15312) 2026-06-22 22:02:17 +02:00
community-scripts-pr-app[bot] d879050293 Update CHANGELOG.md (#15324)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-22 20:02:04 +00:00
CanbiZ (MickLesk) bd228edb21 tools.func: refresh ruby-build when requested version is missing (#15315) 2026-06-22 22:01:40 +02:00
community-scripts-pr-app[bot] fdd6704b3c Update CHANGELOG.md (#15323)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-22 20:00:49 +00:00
CanbiZ (MickLesk) 084993ba60 VictoriaMetrics: resolve architecture before jq asset filter (#15316) 2026-06-22 22:00:23 +02:00
community-scripts-pr-app[bot] f8ae0738c9 Update CHANGELOG.md (#15322)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-22 20:00:07 +00:00
community-scripts-pr-app[bot] f1321ce38b Update CHANGELOG.md (#15321)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-22 19:59:57 +00:00
CanbiZ (MickLesk) 1cdf74dd41 update-apps: sanitize service detection and fail on invalid names (#15318) 2026-06-22 21:59:43 +02:00
CanbiZ (MickLesk) fd1dbf2ba1 core:: skip LXC stack upgrade prompt in unattended mode (#15319) 2026-06-22 21:59:27 +02:00
community-scripts-pr-app[bot] 68bf362a9d Update CHANGELOG.md (#15320)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-22 19:47:16 +00:00
CanbiZ (MickLesk) edbd570adf Endurain: pin uv to the version required by the project (#15313) 2026-06-22 21:46:52 +02:00
12 changed files with 145 additions and 88 deletions
+18
View File
@@ -496,6 +496,9 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
- #### 🐞 Bug Fixes - #### 🐞 Bug Fixes
- invoiceshelf: use pnpm instead of yarn for frontend build [@MickLesk](https://github.com/MickLesk) ([#15312](https://github.com/community-scripts/ProxmoxVE/pull/15312))
- VictoriaMetrics: resolve architecture before jq asset filter [@MickLesk](https://github.com/MickLesk) ([#15316](https://github.com/community-scripts/ProxmoxVE/pull/15316))
- Endurain: pin uv to the version required by the project [@MickLesk](https://github.com/MickLesk) ([#15313](https://github.com/community-scripts/ProxmoxVE/pull/15313))
- add proxy headers to dispatcharr from #15143 [@asylumexp](https://github.com/asylumexp) ([#15293](https://github.com/community-scripts/ProxmoxVE/pull/15293)) - add proxy headers to dispatcharr from #15143 [@asylumexp](https://github.com/asylumexp) ([#15293](https://github.com/community-scripts/ProxmoxVE/pull/15293))
- Fix-15015: check correct path for certbot [@galz55](https://github.com/galz55) ([#15034](https://github.com/community-scripts/ProxmoxVE/pull/15034)) - Fix-15015: check correct path for certbot [@galz55](https://github.com/galz55) ([#15034](https://github.com/community-scripts/ProxmoxVE/pull/15034))
- fix(romm): resolve 403 Forbidden error on nginx mod_zip installation [@hug-efrei](https://github.com/hug-efrei) ([#15134](https://github.com/community-scripts/ProxmoxVE/pull/15134)) - fix(romm): resolve 403 Forbidden error on nginx mod_zip installation [@hug-efrei](https://github.com/hug-efrei) ([#15134](https://github.com/community-scripts/ProxmoxVE/pull/15134))
@@ -505,16 +508,31 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
- #### ✨ New Features - #### ✨ New Features
- update: esphome to install and run ESPHome Device Builder [@jesserockz](https://github.com/jesserockz) ([#15195](https://github.com/community-scripts/ProxmoxVE/pull/15195))
- [arm64] Port scripts between warracker-zwavejsui to support arm64 [@asylumexp](https://github.com/asylumexp) ([#15291](https://github.com/community-scripts/ProxmoxVE/pull/15291)) - [arm64] Port scripts between warracker-zwavejsui to support arm64 [@asylumexp](https://github.com/asylumexp) ([#15291](https://github.com/community-scripts/ProxmoxVE/pull/15291))
- [arm64] Port scripts between thingsboard & wanderer to support arm64 [@asylumexp](https://github.com/asylumexp) ([#15286](https://github.com/community-scripts/ProxmoxVE/pull/15286)) - [arm64] Port scripts between thingsboard & wanderer to support arm64 [@asylumexp](https://github.com/asylumexp) ([#15286](https://github.com/community-scripts/ProxmoxVE/pull/15286))
- [arm64] Port scripts between snowshare & thelounge to support arm64 [@asylumexp](https://github.com/asylumexp) ([#15280](https://github.com/community-scripts/ProxmoxVE/pull/15280)) - [arm64] Port scripts between snowshare & thelounge to support arm64 [@asylumexp](https://github.com/asylumexp) ([#15280](https://github.com/community-scripts/ProxmoxVE/pull/15280))
### 💾 Core ### 💾 Core
- #### 🐞 Bug Fixes
- tools.func: refresh ruby-build when requested version is missing [@MickLesk](https://github.com/MickLesk) ([#15315](https://github.com/community-scripts/ProxmoxVE/pull/15315))
- #### ✨ New Features - #### ✨ New Features
- core: add pre-install storage health checks [@MickLesk](https://github.com/MickLesk) ([#15226](https://github.com/community-scripts/ProxmoxVE/pull/15226)) - core: add pre-install storage health checks [@MickLesk](https://github.com/MickLesk) ([#15226](https://github.com/community-scripts/ProxmoxVE/pull/15226))
- #### 🔧 Refactor
- core:: skip LXC stack upgrade prompt in unattended mode [@MickLesk](https://github.com/MickLesk) ([#15319](https://github.com/community-scripts/ProxmoxVE/pull/15319))
### 🧰 Tools
- #### 🔧 Refactor
- update-apps: sanitize service detection and fail on invalid names [@MickLesk](https://github.com/MickLesk) ([#15318](https://github.com/community-scripts/ProxmoxVE/pull/15318))
## 2026-06-21 ## 2026-06-21
### 🚀 Updated Scripts ### 🚀 Updated Scripts
+2
View File
@@ -61,6 +61,8 @@ function update_script() {
msg_info "Updating Backend" msg_info "Updating Backend"
cd /opt/endurain/backend cd /opt/endurain/backend
UV_VERSION=$(grep -Po 'required-version\s*=\s*"\K[^"]+' pyproject.toml 2>/dev/null || echo "0.11.18")
UV_VERSION="$UV_VERSION" setup_uv
$STD poetry export -f requirements.txt --output requirements.txt --without-hashes $STD poetry export -f requirements.txt --output requirements.txt --without-hashes
$STD uv venv --clear $STD uv venv --clear
$STD uv pip install -r requirements.txt $STD uv pip install -r requirements.txt
+20 -16
View File
@@ -24,13 +24,14 @@ function update_script() {
header_info header_info
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -f /etc/systemd/system/esphomeDashboard.service ]]; then if [[ ! -f /etc/systemd/system/esphome-device-builder.service && ! -f /etc/systemd/system/esphomeDashboard.service ]]; then
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
msg_info "Stopping Service" msg_info "Stopping Service"
systemctl stop esphomeDashboard systemctl stop esphome-device-builder 2>/dev/null || true
systemctl stop esphomeDashboard 2>/dev/null || true
msg_ok "Stopped Service" msg_ok "Stopped Service"
VENV_PATH="/opt/esphome/.venv" VENV_PATH="/opt/esphome/.venv"
@@ -46,33 +47,36 @@ function update_script() {
$STD uv venv --clear "$VENV_PATH" $STD uv venv --clear "$VENV_PATH"
$STD "$VENV_PATH/bin/python" -m ensurepip --upgrade $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 --upgrade pip
$STD "$VENV_PATH/bin/python" -m pip install esphome tornado esptool $STD "$VENV_PATH/bin/python" -m pip install esphome esphome-device-builder esptool
msg_ok "Migrated to uv/venv" msg_ok "Migrated to uv/venv"
else else
msg_info "Updating ESPHome" msg_info "Updating ESPHome Device Builder"
PYTHON_VERSION="3.12" setup_uv PYTHON_VERSION="3.12" setup_uv
$STD "$VENV_PATH/bin/python" -m pip install --upgrade esphome tornado esptool $STD "$VENV_PATH/bin/python" -m pip install --upgrade esphome esphome-device-builder esptool
msg_ok "Updated ESPHome" msg_ok "Updated ESPHome Device Builder"
fi fi
SERVICE_FILE="/etc/systemd/system/esphomeDashboard.service"
if ! grep -q "${VENV_PATH}/bin/esphome" "$SERVICE_FILE"; then msg_info "Migrating to ESPHome Device Builder service"
msg_info "Updating systemd service" if [[ -f /etc/systemd/system/esphomeDashboard.service ]]; then
cat <<EOF >"$SERVICE_FILE" systemctl disable -q esphomeDashboard 2>/dev/null || true
rm -f /etc/systemd/system/esphomeDashboard.service
fi
cat <<EOF >/etc/systemd/system/esphome-device-builder.service
[Unit] [Unit]
Description=ESPHome Dashboard Description=ESPHome Device Builder
After=network.target After=network.target
[Service] [Service]
ExecStart=${VENV_PATH}/bin/esphome dashboard /root/config/ ExecStart=${VENV_PATH}/bin/esphome-device-builder /root/config/
Restart=always Restart=always
User=root User=root
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
$STD systemctl daemon-reload $STD systemctl daemon-reload
msg_ok "Updated systemd service" $STD systemctl enable esphome-device-builder
fi msg_ok "Migrated to ESPHome Device Builder service"
msg_info "Linking esphome to /usr/local/bin" msg_info "Linking esphome to /usr/local/bin"
rm -f /usr/local/bin/esphome rm -f /usr/local/bin/esphome
@@ -80,7 +84,7 @@ EOF
msg_ok "Linked esphome binary" msg_ok "Linked esphome binary"
msg_info "Starting Service" msg_info "Starting Service"
systemctl start esphomeDashboard systemctl start esphome-device-builder
msg_ok "Started Service" msg_ok "Started Service"
msg_ok "Updated successfully!" msg_ok "Updated successfully!"
exit exit
+4 -5
View File
@@ -53,12 +53,11 @@ function update_script() {
cd /opt/invoiceshelf cd /opt/invoiceshelf
$STD composer install --no-dev --optimize-autoloader $STD composer install --no-dev --optimize-autoloader
if command -v corepack >/dev/null 2>&1; then if command -v corepack >/dev/null 2>&1; then
$STD corepack pnpm install
$STD corepack yarn install $STD corepack pnpm run build
$STD corepack yarn build
else else
$STD yarn install $STD pnpm install
$STD yarn build $STD pnpm run build
fi fi
$STD php artisan migrate --force $STD php artisan migrate --force
$STD php artisan optimize:clear $STD php artisan optimize:clear
+3 -14
View File
@@ -29,21 +29,10 @@ function update_script() {
exit exit
fi fi
setup_mariadb setup_mariadb
ensure_dependencies git
if [[ ! -d /opt/librenms/.git ]]; then
msg_info "Initializing LibreNMS git metadata"
LIBRENMS_VERSION=$(cat ~/.librenms 2>/dev/null)
cd /opt/librenms
git init -q
git remote add origin https://github.com/librenms/librenms.git
git fetch --depth 1 origin "refs/tags/v${LIBRENMS_VERSION}" 2>/dev/null ||
git fetch --depth 1 origin "refs/tags/${LIBRENMS_VERSION}" 2>/dev/null || true
git checkout -qf FETCH_HEAD 2>/dev/null || true
chown -R librenms:librenms .git
msg_ok "Initialized LibreNMS git metadata"
fi
msg_info "Updating LibreNMS" msg_info "Updating LibreNMS"
$STD su - librenms -s /bin/bash -c 'cd /opt/librenms && ./daily.sh' su librenms
cd /opt/librenms
./daily.sh
msg_ok "Updated LibreNMS" msg_ok "Updated LibreNMS"
exit exit
} }
+2
View File
@@ -81,6 +81,8 @@ msg_ok "Built Frontend"
msg_info "Setting up Backend" msg_info "Setting up Backend"
cd /opt/endurain/backend cd /opt/endurain/backend
UV_VERSION=$(grep -Po 'required-version\s*=\s*"\K[^"]+' pyproject.toml 2>/dev/null || echo "0.11.18")
UV_VERSION="$UV_VERSION" setup_uv
$STD uv tool install poetry $STD uv tool install poetry
$STD uv tool update-shell $STD uv tool update-shell
export PATH="/root/.local/bin:$PATH" export PATH="/root/.local/bin:$PATH"
+6 -6
View File
@@ -26,8 +26,8 @@ cd /opt/esphome
$STD uv venv --clear /opt/esphome/.venv $STD uv venv --clear /opt/esphome/.venv
$STD /opt/esphome/.venv/bin/python -m ensurepip --upgrade $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 --upgrade pip
$STD /opt/esphome/.venv/bin/python -m pip install esphome tornado esptool $STD /opt/esphome/.venv/bin/python -m pip install esphome esphome-device-builder esptool
msg_ok "Setup and Installed ESPHome" msg_ok "Setup and Installed ESPHome Device Builder"
msg_info "Linking esphome to /usr/local/bin" msg_info "Linking esphome to /usr/local/bin"
rm -f /usr/local/bin/esphome rm -f /usr/local/bin/esphome
@@ -36,13 +36,13 @@ msg_ok "Linked esphome binary"
msg_info "Creating Service" msg_info "Creating Service"
mkdir -p /root/config mkdir -p /root/config
cat <<EOF >/etc/systemd/system/esphomeDashboard.service cat <<EOF >/etc/systemd/system/esphome-device-builder.service
[Unit] [Unit]
Description=ESPHome Dashboard Description=ESPHome Device Builder
After=network.target After=network.target
[Service] [Service]
ExecStart=/opt/esphome/.venv/bin/esphome dashboard /root/config/ ExecStart=/opt/esphome/.venv/bin/esphome-device-builder /root/config/
Restart=always Restart=always
User=root User=root
@@ -50,7 +50,7 @@ User=root
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
systemctl enable -q --now esphomeDashboard systemctl enable -q --now esphome-device-builder
msg_ok "Created Service" msg_ok "Created Service"
motd_ssh motd_ssh
-11
View File
@@ -17,7 +17,6 @@ msg_info "Installing Dependencies"
$STD apt install -y \ $STD apt install -y \
acl \ acl \
fping \ fping \
git \
graphviz \ graphviz \
imagemagick \ imagemagick \
mtr-tiny \ mtr-tiny \
@@ -65,16 +64,6 @@ EOF
chown -R librenms:librenms /opt/librenms chown -R librenms:librenms /opt/librenms
chmod 771 /opt/librenms chmod 771 /opt/librenms
chmod -R ug=rwX /opt/librenms/bootstrap/cache /opt/librenms/storage /opt/librenms/logs /opt/librenms/rrd chmod -R ug=rwX /opt/librenms/bootstrap/cache /opt/librenms/storage /opt/librenms/logs /opt/librenms/rrd
if [[ ! -d /opt/librenms/.git ]]; then
LIBRENMS_VERSION=$(cat ~/.librenms 2>/dev/null)
cd /opt/librenms
git init -q
git remote add origin https://github.com/librenms/librenms.git
git fetch --depth 1 origin "refs/tags/v${LIBRENMS_VERSION}" 2>/dev/null ||
git fetch --depth 1 origin "refs/tags/${LIBRENMS_VERSION}" 2>/dev/null || true
git checkout -qf FETCH_HEAD 2>/dev/null || true
chown -R librenms:librenms .git
fi
msg_ok "Configured LibreNMS" msg_ok "Configured LibreNMS"
msg_info "Configure MariaDB" msg_info "Configure MariaDB"
+1 -1
View File
@@ -16,7 +16,7 @@ update_os
msg_info "Getting latest version of VictoriaMetrics" msg_info "Getting latest version of VictoriaMetrics"
victoriametrics_release=$(curl -fsSL "https://api.github.com/repos/VictoriaMetrics/VictoriaMetrics/releases" | victoriametrics_release=$(curl -fsSL "https://api.github.com/repos/VictoriaMetrics/VictoriaMetrics/releases" |
jq -r --arg a "$arch_resolve" '.[] | select(.assets[].name | match("^victoria-metrics-linux-" + $a + "-v[0-9.]+.tar.gz$")) | .tag_name' | jq -r --arg a "$(arch_resolve)" '.[] | select(.assets[].name | match("^victoria-metrics-linux-" + $a + "-v[0-9.]+.tar.gz$")) | .tag_name' |
head -n 1) head -n 1)
victoriametrics_filename="victoria-metrics-linux-$(arch_resolve)-${victoriametrics_release}.tar.gz" victoriametrics_filename="victoria-metrics-linux-$(arch_resolve)-${victoriametrics_release}.tar.gz"
vmutils_filename="vmutils-linux-$(arch_resolve)-${victoriametrics_release}.tar.gz" vmutils_filename="vmutils-linux-$(arch_resolve)-${victoriametrics_release}.tar.gz"
+6
View File
@@ -5722,6 +5722,12 @@ create_lxc_container() {
return 0 return 0
fi fi
local _disable_update="${DISABLE_UPDATE:-no}"
if [[ "${PHS_SILENT:-0}" == "1" || "${_disable_update,,}" == "yes" ]]; then
msg_info "Skipping host LXC stack upgrade prompt (unattended mode)"
return 2
fi
msg_warn "An update for the Proxmox LXC stack is available" msg_warn "An update for the Proxmox LXC stack is available"
echo " pve-container: installed=${_pvec_i:-n/a} candidate=${_pvec_c:-n/a}" echo " pve-container: installed=${_pvec_i:-n/a} candidate=${_pvec_c:-n/a}"
echo " lxc-pve : installed=${_lxcp_i:-n/a} candidate=${_lxcp_c:-n/a}" echo " lxc-pve : installed=${_lxcp_i:-n/a} candidate=${_lxcp_c:-n/a}"
+34 -19
View File
@@ -8452,29 +8452,34 @@ setup_ruby() {
fi fi
# Install ruby-build plugin # Install ruby-build plugin
if [[ ! -d "$RBENV_DIR/plugins/ruby-build" ]]; then _install_ruby_build_plugin() {
local RUBY_BUILD_RELEASE local RUBY_BUILD_RELEASE
RUBY_BUILD_RELEASE=$(get_latest_github_release "rbenv/ruby-build") || { RUBY_BUILD_RELEASE=$(get_latest_github_release "rbenv/ruby-build") || {
msg_error "Failed to fetch latest ruby-build version from GitHub" msg_error "Failed to fetch latest ruby-build version from GitHub"
rm -rf "$TMP_DIR"
return 7 return 7
} }
if ! curl_with_retry "https://github.com/rbenv/ruby-build/archive/refs/tags/v${RUBY_BUILD_RELEASE}.tar.gz" "$TMP_DIR/ruby-build.tar.gz"; then if ! curl_with_retry "https://github.com/rbenv/ruby-build/archive/refs/tags/v${RUBY_BUILD_RELEASE}.tar.gz" "$TMP_DIR/ruby-build.tar.gz"; then
msg_error "Failed to download ruby-build" msg_error "Failed to download ruby-build"
msg_error "Hint: Check connectivity to github.com/rbenv/ruby-build" msg_error "Hint: Check connectivity to github.com/rbenv/ruby-build"
rm -rf "$TMP_DIR"
return 7 return 7
fi fi
tar -xzf "$TMP_DIR/ruby-build.tar.gz" -C "$TMP_DIR" || { tar -xzf "$TMP_DIR/ruby-build.tar.gz" -C "$TMP_DIR" || {
msg_error "Failed to extract ruby-build" msg_error "Failed to extract ruby-build"
rm -rf "$TMP_DIR"
return 251 return 251
} }
mkdir -p "$RBENV_DIR/plugins/ruby-build" mkdir -p "$RBENV_DIR/plugins/ruby-build"
cp -r "$TMP_DIR/ruby-build-${RUBY_BUILD_RELEASE}/." "$RBENV_DIR/plugins/ruby-build/" cp -r "$TMP_DIR/ruby-build-${RUBY_BUILD_RELEASE}/." "$RBENV_DIR/plugins/ruby-build/"
return 0
}
if [[ ! -d "$RBENV_DIR/plugins/ruby-build" ]]; then
_install_ruby_build_plugin || {
rm -rf "$TMP_DIR"
return 7
}
fi fi
# Setup PATH and install Ruby version # Setup PATH and install Ruby version
@@ -8482,6 +8487,14 @@ setup_ruby() {
eval "$("$RBENV_BIN" init - bash)" 2>/dev/null || true eval "$("$RBENV_BIN" init - bash)" 2>/dev/null || true
if ! "$RBENV_BIN" versions --bare 2>/dev/null | grep -qx "$RUBY_VERSION"; then if ! "$RBENV_BIN" versions --bare 2>/dev/null | grep -qx "$RUBY_VERSION"; then
if [[ ! -f "$RBENV_DIR/plugins/ruby-build/share/ruby-build/$RUBY_VERSION" ]]; then
msg_info "Updating ruby-build definitions"
_install_ruby_build_plugin || {
rm -rf "$TMP_DIR"
return 7
}
msg_ok "Updated ruby-build definitions"
fi
$STD "$RBENV_BIN" install "$RUBY_VERSION" || { $STD "$RBENV_BIN" install "$RUBY_VERSION" || {
msg_error "Failed to install Ruby $RUBY_VERSION" msg_error "Failed to install Ruby $RUBY_VERSION"
rm -rf "$TMP_DIR" rm -rf "$TMP_DIR"
@@ -8710,12 +8723,14 @@ setup_uv() {
ensure_dependencies jq ensure_dependencies jq
# Fetch latest version # Fetch target version (pinned via UV_VERSION or latest release)
local LATEST_VERSION local TARGET_VERSION="${UV_VERSION:-}"
LATEST_VERSION=$(get_latest_github_release "astral-sh/uv") || { if [[ -z "$TARGET_VERSION" ]]; then
msg_error "Could not fetch latest uv version from GitHub API" TARGET_VERSION=$(get_latest_github_release "astral-sh/uv") || {
return 7 msg_error "Could not fetch latest uv version from GitHub API"
} return 7
}
fi
# Get currently installed version # Get currently installed version
local INSTALLED_VERSION="" local INSTALLED_VERSION=""
@@ -8723,9 +8738,9 @@ setup_uv() {
INSTALLED_VERSION=$("$UV_BIN" --version 2>/dev/null | awk '{print $2}') INSTALLED_VERSION=$("$UV_BIN" --version 2>/dev/null | awk '{print $2}')
fi fi
# Scenario 1: Already at latest version # Scenario 1: Already at target version
if [[ -n "$INSTALLED_VERSION" && "$INSTALLED_VERSION" == "$LATEST_VERSION" ]]; then if [[ -n "$INSTALLED_VERSION" && "$INSTALLED_VERSION" == "$TARGET_VERSION" ]]; then
cache_installed_version "uv" "$LATEST_VERSION" cache_installed_version "uv" "$TARGET_VERSION"
# Check if uvx is needed and missing # Check if uvx is needed and missing
if [[ "${USE_UVX:-NO}" == "YES" ]] && [[ ! -x "$UVX_BIN" ]]; then if [[ "${USE_UVX:-NO}" == "YES" ]] && [[ ! -x "$UVX_BIN" ]]; then
@@ -8738,13 +8753,13 @@ setup_uv() {
fi fi
# Scenario 2: New install or upgrade # Scenario 2: New install or upgrade
if [[ -n "$INSTALLED_VERSION" && "$INSTALLED_VERSION" != "$LATEST_VERSION" ]]; then if [[ -n "$INSTALLED_VERSION" && "$INSTALLED_VERSION" != "$TARGET_VERSION" ]]; then
msg_info "Upgrade uv from $INSTALLED_VERSION to $LATEST_VERSION" msg_info "Upgrade uv from $INSTALLED_VERSION to $TARGET_VERSION"
else else
msg_info "Setup uv $LATEST_VERSION" msg_info "Setup uv $TARGET_VERSION"
fi fi
local UV_URL="https://github.com/astral-sh/uv/releases/download/${LATEST_VERSION}/${UV_TAR}" local UV_URL="https://github.com/astral-sh/uv/releases/download/${TARGET_VERSION}/${UV_TAR}"
if ! curl_with_retry "$UV_URL" "$TMP_DIR/uv.tar.gz"; then if ! curl_with_retry "$UV_URL" "$TMP_DIR/uv.tar.gz"; then
msg_error "Failed to download uv from $UV_URL" msg_error "Failed to download uv from $UV_URL"
@@ -8799,8 +8814,8 @@ setup_uv() {
msg_ok "Python $PYTHON_VERSION installed" msg_ok "Python $PYTHON_VERSION installed"
fi fi
cache_installed_version "uv" "$LATEST_VERSION" cache_installed_version "uv" "$TARGET_VERSION"
msg_ok "Setup uv $LATEST_VERSION" msg_ok "Setup uv $TARGET_VERSION"
} }
# Helper function to install uvx wrapper # Helper function to install uvx wrapper
+49 -16
View File
@@ -145,11 +145,35 @@ function header_info {
EOF EOF
} }
function sanitize_service_name() {
local name="${1//$'\r'/}"
name="${name//$'\n'/}"
[[ -z "$name" ]] && return 1
[[ "$name" == *'#!'* ]] && return 1
[[ ! "$name" =~ ^[a-zA-Z0-9._-]+$ ]] && return 1
return 0
}
function validate_service_script() {
local name="$1"
sanitize_service_name "$name" || return 1
curl -fsSL --max-time 10 -o /dev/null \
"https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/${name}.sh" 2>/dev/null
}
function detect_service() { function detect_service() {
pushd $(mktemp -d) >/dev/null local container="$1"
pct pull "$1" /usr/bin/update update 2>/dev/null local tmpdir update_file
service=$(cat update | sed 's|.*/ct/||g' | sed 's|\.sh).*||g') service=""
popd >/dev/null tmpdir=$(mktemp -d)
update_file="$tmpdir/update"
pct pull "$container" /usr/bin/update "$update_file" 2>/dev/null || true
if [[ ! -s "$update_file" ]]; then
rm -rf "$tmpdir"
return 1
fi
service=$(grep -oE '/ct/[a-zA-Z0-9._-]+\.sh' "$update_file" 2>/dev/null | head -n1 | sed 's|.*/ct/||; s|\.sh$||')
rm -rf "$tmpdir"
} }
function dry_run_container() { function dry_run_container() {
@@ -447,24 +471,33 @@ for container in $CHOICE; do
#1) Detect service using the service name in the update command #1) Detect service using the service name in the update command
detect_service $container detect_service $container
#1.1) If update script not detected, return #1.1) If update script not detected or service name is invalid, skip
if [ -z "${service}" ]; then if [ -z "${service}" ] || ! sanitize_service_name "${service}"; then
echo -e "${YW}[WARN]${CL} Update script not found. Skipping to next container" echo -e "${RD}[ERROR]${CL} Could not detect a valid service name for container $container"
log_result "$container" "(unknown)" "SKIPPED" "No update script found in container" log_result "$container" "(unknown)" "ERROR" "Invalid or missing service name in /usr/bin/update"
log_write "Container $container: SKIPPED — no update script found" log_write "Container $container: ERROR — invalid or missing service name"
continue continue
else
echo -e "${BL}[INFO]${CL} Detected service: ${GN}${service}${CL}"
log_write "Container $container: detected service '$service'"
fi fi
if ! validate_service_script "${service}"; then
echo -e "${RD}[ERROR]${CL} Service '${service}' does not resolve to ct/${service}.sh"
log_result "$container" "${service}" "ERROR" "No matching ct/${service}.sh script found"
log_write "Container $container: ERROR — ct/${service}.sh not found"
continue
fi
echo -e "${BL}[INFO]${CL} Detected service: ${GN}${service}${CL}"
log_write "Container $container: detected service '${service}'"
#2) Extract service build/update resource requirements from config/installation file #2) Extract service build/update resource requirements from config/installation file
script=$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/${service}.sh) script=$(curl -fsSL "https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/${service}.sh")
#2.1) Check if the script downloaded successfully #2.1) Check if the script downloaded successfully
if [ $? -ne 0 ]; then if [ $? -ne 0 ] || [ -z "${script}" ]; then
echo -e "${RD}[ERROR]${CL} Issue while downloading install script." echo -e "${RD}[ERROR]${CL} Failed to download ct/${service}.sh"
echo -e "${YW}[WARN]${CL} Unable to assess build resource requirements. Proceeding with current resources." log_result "$container" "${service}" "ERROR" "Failed to download ct/${service}.sh"
log_write "Container $container (${service}): ERROR — failed to download install script"
continue
fi fi
config=$(pct config "$container") config=$(pct config "$container")