From d430efcecb5e37780346954056a464c485fc0ff1 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Mon, 20 Oct 2025 21:58:37 +0000 Subject: [PATCH] fix: correct fmt.Sprintf argument alignment in PVE setup script Critical bug fix: The setup script's format string had 33 placeholders but was only receiving 27 arguments, causing: - INSTALLER_URL to receive authToken instead of pulseURL - This made curl try to resolve the token value as a hostname - Error: 'curl: (6) Could not resolve host: N7AE3P' - Token ID showed '%!s(MISSING)' in manual setup instructions Fixed by: - Added missing tokenName at position 7 - Added literal '%s' strings for version_ge printf placeholders - Added authToken arguments for Authorization headers (positions 29, 31) - Ensured all 33 format placeholders have corresponding arguments Now generates correct URLs: - INSTALLER_URL: http://192.168.0.160:7655/api/install/install-sensor-proxy.sh - --pulse-server: http://192.168.0.160:7655 - Token ID: pulse-monitor@pam!pulse-192-168-0-160-[timestamp] --- internal/api/config_handlers.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/api/config_handlers.go b/internal/api/config_handlers.go index 0d48535..d409dac 100644 --- a/internal/api/config_handlers.go +++ b/internal/api/config_handlers.go @@ -4343,11 +4343,13 @@ if [ "$AUTO_REG_SUCCESS" != true ]; then echo " Token Value: [See token output above]" fi echo " Host URL: YOUR_PROXMOX_HOST:8006" - echo "" +echo "" fi `, serverName, time.Now().Format("2006-01-02 15:04:05"), pulseIP, tokenName, tokenName, tokenName, tokenName, tokenName, tokenName, - authToken, pulseURL, serverHost, tokenName, tokenName, storagePerms, sshKeys.ProxyPublicKey, sshKeys.SensorsPublicKey, minProxyReadyVersion, pulseURL, pulseURL, pulseURL, pulseURL, pulseURL, pulseURL, authToken, pulseURL, authToken, pulseURL, tokenName) + authToken, pulseURL, serverHost, tokenName, tokenName, storagePerms, + sshKeys.ProxyPublicKey, sshKeys.SensorsPublicKey, minProxyReadyVersion, + pulseURL, "%s", "%s", pulseURL, pulseURL, pulseURL, pulseURL, pulseURL, pulseURL, authToken, pulseURL, authToken, pulseURL, tokenName) } else { // PBS script = fmt.Sprintf(`#!/bin/bash