From 8fb9ef2e8f4b4b565c8336b25581afb7a300ce6d Mon Sep 17 00:00:00 2001 From: rcourtman Date: Thu, 23 Oct 2025 22:34:07 +0000 Subject: [PATCH] fix: correct checksum URL construction in install script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The checksum URL was incorrectly constructed by appending .sha256 to the entire download URL including query parameters, resulting in: /download/pulse-host-agent?platform=linux&arch=amd64.sha256 This caused .sha256 to be part of the arch parameter, which prevented the checksum endpoint from being reached correctly. Fixed to construct checksum URL with .sha256 as part of the path: /download/pulse-host-agent.sha256?platform=linux&arch=amd64 Tested on Proxmox VE host (delly): - Installation: ✓ Binary downloaded and installed successfully - Service: ✓ systemd service created, enabled, and started - Validation: ✓ Service running and attempting to report - Logs: ✓ JSON logs writing to /var/log/pulse/host-agent.log - Uninstallation: ✓ Complete cleanup (binary, service, logs) - Colors: ✓ ANSI colored output working properly Note: Checksum validation gracefully handled when endpoint unavailable (server doesn't provide checksums yet) --- frontend-modern/public/install-host-agent.sh | 2 +- .../src/components/Settings/APITokenManager.tsx | 7 ++++--- scripts/install-host-agent.sh | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend-modern/public/install-host-agent.sh b/frontend-modern/public/install-host-agent.sh index c24ea4f..233c4ba 100755 --- a/frontend-modern/public/install-host-agent.sh +++ b/frontend-modern/public/install-host-agent.sh @@ -246,12 +246,12 @@ fi # Download agent binary from Pulse server DOWNLOAD_URL="$PULSE_URL/download/pulse-host-agent?platform=$PLATFORM&arch=$ARCH" +CHECKSUM_URL="$PULSE_URL/download/pulse-host-agent.sha256?platform=$PLATFORM&arch=$ARCH" TEMP_BINARY="/tmp/pulse-host-agent-$$.tmp" log_info "Downloading agent binary from $PULSE_URL..." DOWNLOAD_SUCCESS=false -CHECKSUM_URL="${DOWNLOAD_URL}.sha256" if command -v curl &> /dev/null; then if curl -fL --progress-bar -o "$TEMP_BINARY" "$DOWNLOAD_URL" 2>&1; then diff --git a/frontend-modern/src/components/Settings/APITokenManager.tsx b/frontend-modern/src/components/Settings/APITokenManager.tsx index cf1f213..eb134fb 100644 --- a/frontend-modern/src/components/Settings/APITokenManager.tsx +++ b/frontend-modern/src/components/Settings/APITokenManager.tsx @@ -183,8 +183,8 @@ export const APITokenManager: Component = (props) => { const { token, record } = await SecurityAPI.createToken(trimmedName, scopePayload); setTokens((prev) => [record, ...prev]); - setNewTokenValue(token); setNewTokenRecord(record); + setNewTokenValue(token); setNameInput(''); showTokenReveal({ @@ -212,7 +212,8 @@ export const APITokenManager: Component = (props) => { } }; - const tokenHint = (record: APITokenRecord) => { + const tokenHint = (record: APITokenRecord | null | undefined) => { + if (!record) return '—'; if (record.prefix && record.suffix) { return `${record.prefix}…${record.suffix}`; } @@ -398,7 +399,7 @@ export const APITokenManager: Component = (props) => { class="flex flex-wrap items-center justify-between gap-3 border border-green-300/70 text-sm text-green-800 dark:border-green-700/70 dark:text-green-200" > - ✓ Token generated: {newTokenRecord()?.name || 'Untitled'} ({tokenHint(newTokenRecord()!)}) + ✓ Token generated: {newTokenRecord()?.name || 'Untitled'} ({tokenHint(newTokenRecord())})