From 073d5ffa55d4c479a3cea06cce3e03c67be84cdd Mon Sep 17 00:00:00 2001 From: rcourtman Date: Tue, 2 Dec 2025 11:38:47 +0000 Subject: [PATCH] fix: Use --ctid instead of --standalone --http-mode in quick-setup command The quick-setup command for temperature monitoring was generating --standalone --http-mode which is meant for Docker deployments. This confused users trying to set up multi-server Proxmox monitoring. Now uses --ctid which works for both local and remote Proxmox hosts. The installer detects when the container doesn't exist locally and installs in "host monitoring only" mode automatically. If we can determine the actual CTID from the host proxy summary, we use it; otherwise we show for the user to replace. Related to #785 --- internal/api/router.go | 14 ++++++++++++-- internal/api/temperature_proxy_command_test.go | 7 +++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/internal/api/router.go b/internal/api/router.go index 36c8b34..9278a85 100644 --- a/internal/api/router.go +++ b/internal/api/router.go @@ -4048,9 +4048,19 @@ func (r *Router) handleTemperatureProxyInstallCommand(w http.ResponseWriter, req baseURL = strings.TrimRight(baseURL, "/") node := strings.TrimSpace(req.URL.Query().Get("node")) + + // Use --ctid approach which works for both local and remote Proxmox hosts. + // The installer detects when the container doesn't exist locally and + // installs in "host monitoring only" mode. This is more reliable than + // --standalone --http-mode which is meant for Docker deployments. + ctid := "" + if summary, err := loadHostProxySummary(); err == nil && summary != nil && summary.CTID != "" { + ctid = summary.CTID + } + command := fmt.Sprintf( - "curl -fsSL https://github.com/rcourtman/Pulse/releases/latest/download/install-sensor-proxy.sh | sudo bash -s -- --standalone --http-mode --pulse-server %s", - baseURL, + "curl -fsSL https://github.com/rcourtman/Pulse/releases/latest/download/install-sensor-proxy.sh | sudo bash -s -- --ctid %s --pulse-server %s", + ctid, baseURL, ) response := map[string]string{ diff --git a/internal/api/temperature_proxy_command_test.go b/internal/api/temperature_proxy_command_test.go index ddcb0a6..b0a70b3 100644 --- a/internal/api/temperature_proxy_command_test.go +++ b/internal/api/temperature_proxy_command_test.go @@ -39,7 +39,10 @@ func TestHandleTemperatureProxyInstallCommand(t *testing.T) { if !strings.Contains(command, cfg.PublicURL) { t.Fatalf("command does not include pulse URL: %s", command) } - if !strings.Contains(command, "--standalone --http-mode") { - t.Fatalf("command missing expected flags: %s", command) + if !strings.Contains(command, "--ctid") { + t.Fatalf("command missing expected --ctid flag: %s", command) + } + if !strings.Contains(command, "--pulse-server") { + t.Fatalf("command missing expected --pulse-server flag: %s", command) } }