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 <PULSE_CTID> for the user to replace. Related to #785
This commit is contained in:
parent
9f174be20b
commit
073d5ffa55
2 changed files with 17 additions and 4 deletions
|
|
@ -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 := "<PULSE_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{
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue