From 93a601d7c7a006dcade123a66adb75946b790f14 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Mon, 20 Oct 2025 18:03:09 +0000 Subject: [PATCH] fix: only check Pulse version for containerized deployments The version check was blocking ALL v4.23.0 users from temperature monitoring, even non-containerized ones who don't need the proxy. Changed to only check version when PULSE_IS_CONTAINERIZED=true, since: - Non-containerized Pulse can use direct SSH on any version - Containerized Pulse requires v4.24.0+ for proxy support This ensures non-containerized v4.23.0 users can still use temperature monitoring via direct SSH while properly blocking proxy setup for containerized v4.23.0. Fixes regression introduced in commit fbe4ab83a --- internal/api/config_handlers.go | 41 ++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/internal/api/config_handlers.go b/internal/api/config_handlers.go index 95f14d9..c7bbb55 100644 --- a/internal/api/config_handlers.go +++ b/internal/api/config_handlers.go @@ -3617,25 +3617,6 @@ version_ge() { [ "$1" = "$2" ] } -PULSE_VERSION=$(curl -s -f "$PULSE_VERSION_ENDPOINT" 2>/dev/null | awk -F'"' '/"version":/{print $4}' | head -n1) -if [ -z "$PULSE_VERSION" ]; then - echo "" - echo "⚠️ Could not determine Pulse version from $PULSE_VERSION_ENDPOINT" - echo " Temperature proxy requires Pulse $MIN_PROXY_VERSION or later." - TEMP_MONITORING_AVAILABLE=false -elif ! version_ge "$PULSE_VERSION" "$MIN_PROXY_VERSION"; then - echo "" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "⚠️ Pulse upgrade required for temperature proxy" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "Detected Pulse version: $PULSE_VERSION" - echo "Minimum required version: $MIN_PROXY_VERSION" - echo "" - echo "Please upgrade the Pulse container before rerunning this setup script." - echo "" - TEMP_MONITORING_AVAILABLE=false -fi - # Check if temperature proxy is available and override SSH key if it is PROXY_KEY_URL="%s/api/system/proxy-public-key" TEMPERATURE_PROXY_KEY=$(curl -s -f "$PROXY_KEY_URL" 2>/dev/null || echo "") @@ -3683,6 +3664,28 @@ fi # Track whether temperature monitoring can work (may be disabled by checks above) +# For containerized Pulse, verify version supports proxy (v4.24.0+) +if [ "$PULSE_IS_CONTAINERIZED" = true ]; then + PULSE_VERSION=$(curl -s -f "$PULSE_VERSION_ENDPOINT" 2>/dev/null | awk -F'"' '/"version":/{print $4}' | head -n1) + if [ -z "$PULSE_VERSION" ]; then + echo "" + echo "⚠️ Could not determine Pulse version from $PULSE_VERSION_ENDPOINT" + echo " Temperature proxy requires Pulse $MIN_PROXY_VERSION or later." + TEMP_MONITORING_AVAILABLE=false + elif ! version_ge "$PULSE_VERSION" "$MIN_PROXY_VERSION"; then + echo "" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "⚠️ Pulse upgrade required for temperature proxy" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "Detected Pulse version: $PULSE_VERSION" + echo "Minimum required version: $MIN_PROXY_VERSION" + echo "" + echo "Please upgrade the Pulse container before rerunning this setup script." + echo "" + TEMP_MONITORING_AVAILABLE=false + fi +fi + # If Pulse is containerized, try to install proxy automatically if [ "$TEMP_MONITORING_AVAILABLE" = true ] && [ "$PULSE_IS_CONTAINERIZED" = true ] && [ -n "$PULSE_CTID" ]; then # Try automatic installation - proxy keeps SSH credentials on the host for security