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) } }