Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Never serve the server installer at /install.sh; serve local agent installer (#1470)

rcourtman191ddfdfc81e
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index 08d5c83106..3f084dfa98 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -720,13 +720,17 @@ profile and assignment columns, but embedded table framing must route through
the omitted `usage` or `total` series as missing lifecycle telemetry or
enrollment-state evidence.
Dashboard storage trend consumers on that shared router boundary must now reuse the single `/api/storage-charts` summary response instead of fanning out per-pool `/api/metrics-store/history` reads, and lifecycle surfaces still must treat that batched storage summary transport as presentation context only rather than install, enrollment, or freshness truth.
-14. Keep lifecycle installer fallback pinned to published release lineage only.
- When `internal/api/unified_agent.go` has to proxy `/install.sh` or
- `/install.ps1` from GitHub, the shared lifecycle path may only treat stable
- tags and explicit RC prerelease tags as release assets. Working-line dev
- prereleases and build-metadata versions must fail closed so first-host
- install, repair, and fleet continuity do not depend on unpublished or
- branch-local installer URLs.
+14. Keep lifecycle installer fallback pinned to published release lineage only,
+ and reserved for a genuinely-absent local script. The GitHub proxy in
+ `internal/api/unified_agent.go` for `/install.sh` / `/install.ps1` runs only
+ when no local installer is bundled at all; a present-but-unsigned local agent
+ installer is served locally so first-host install, repair, and fleet
+ continuity never receive the top-level GitHub `install.sh` SERVER installer in
+ place of the bundled AGENT installer (issue #1470). When the proxy does run,
+ the shared lifecycle path may only treat stable tags and explicit RC
+ prerelease tags as release assets. Working-line dev prereleases and
+ build-metadata versions must fail closed so install/repair do not depend on
+ unpublished or branch-local installer URLs.
15. Keep self-hosted purchase handoff state on the adjacent commercial/auth
boundary. When shared `internal/api/router.go`,
`internal/api/router_routes_cloud.go`, `internal/api/licensing_handlers.go`,
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index ddb0189e31..dd2ad6d556 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -672,7 +672,7 @@ the canonical monitored-system blocked payload.
host-agent row for the same machine must leave the API boundary as one
hybrid `agent` resource with merged source facets, not as duplicate rows
that disappear only after REST reconciliation.
-8. Route unified-agent installer and binary download headers through `internal/api/unified_agent.go` and `internal/api/contract_test.go` together; published release downloads must keep the canonical `X-Checksum-Sha256` plus `X-Signature-Ed25519` contract for updater clients and the base64-encoded `X-Signature-SSHSIG` contract for installer clients whether the asset is served locally or proxied from the matching GitHub release, instead of leaving callers to infer trust from source location alone.
+8. Route unified-agent installer and binary download headers through `internal/api/unified_agent.go` and `internal/api/contract_test.go` together. Unified-agent BINARY downloads must keep the canonical `X-Checksum-Sha256` plus `X-Signature-Ed25519` contract for updater clients whether the binary is served locally or proxied from the matching GitHub release, instead of leaving callers to infer trust from source location alone. The served install-script endpoints (GET /install.sh and /install.ps1) are governed differently: they must always serve the locally bundled AGENT installer and must never substitute the top-level GitHub install.sh release asset, which is the SERVER installer and rejects the agent wizard's --url / --token-file (issue #1470). They attach the base64-encoded `X-Signature-SSHSIG` header when the local detached signatures are present (or when a genuinely-absent local script is proxied from the matching release), but a present-but-unsigned local agent installer is served WITHOUT the header rather than proxying a signed-but-wrong server installer; the agent install path (curl piped into bash) does not verify these headers, so correctness of the served script outranks signature presence on that endpoint.
9. Route canonical AI intelligence summary and resource-intelligence reads through `frontend-modern/src/api/ai.ts`, `frontend-modern/src/stores/aiIntelligence.ts`, `frontend-modern/src/stores/aiIntelligenceSummaryModel.ts`, `frontend-modern/src/features/patrol/usePatrolIntelligenceState.ts`, `frontend-modern/src/features/patrol/PatrolIntelligenceSurface.tsx`, the Patrol-owned section files under `frontend-modern/src/features/patrol/`, `frontend-modern/src/pages/AIIntelligence.tsx`, `internal/api/ai_handlers.go`, and `internal/api/contract_test.go` together so the summary card, store normalization owner, runtime hook, feature shell, section owners, route shell, and backend payload stay aligned on one governed surface, including the canonical recent-changes slice
while keeping the learning counters backend-only coverage, so the summary page keeps Patrol health and findings primary and renders timeline, correlation, and policy-posture data as secondary investigation context rather than as a separate headline product metric
and the Patrol findings empty-state behavior, so `0 active findings` only renders as a healthy frontend conclusion when the same governed AI summary contract still reports healthy overall health; degraded or not-fully-verified health predictions must flow through to the Patrol findings surface instead of being replaced by page-local "looks healthy" copy
diff --git a/docs/release-control/v6/internal/subsystems/deployment-installability.md b/docs/release-control/v6/internal/subsystems/deployment-installability.md
index 2d95d89cf5..e9a8de8d6e 100644
--- a/docs/release-control/v6/internal/subsystems/deployment-installability.md
+++ b/docs/release-control/v6/internal/subsystems/deployment-installability.md
@@ -169,17 +169,22 @@ server-side update execution surfaces.
handle `--version)` in its argument parser, contains the agent installer
banner string, or does not print the server installer's version-pinning
help line when invoked with `--help`.
- Because the served `/install.sh` endpoint hands out the AGENT installer, a
- server install must also deploy the script's `.sig` / `.sshsig` sidecars next
- to it (`/opt/pulse/scripts/install.sh.sig`, `.sshsig`). For published-release
- versions `internal/api/unified_agent.go::handleDownloadInstallScriptCommon`
- only serves the local copy when both sidecars are present; otherwise it
- proxies the top-level GitHub `install.sh` asset, which (per the rule above) is
- the SERVER installer, so the "Install on Linux" agent wizard's
- `--url` / `--token-file` command is rejected with "Unknown option". The
- Docker image deploys these sidecars (`Dockerfile`); `install.sh`'s
- `deploy_agent_scripts` must deploy them for LXC / systemd installs too. This
- parity gap shipped as the rc.6 agent-wizard regression (issue #1470).
+ The served `/install.sh` endpoint must only ever hand out the AGENT installer,
+ never the top-level GitHub `install.sh` release asset (which, per the rule
+ above, is the SERVER installer and rejects the "Install on Linux" wizard's
+ `--url` / `--token-file` with "Unknown option"). Two layers enforce this and
+ both must hold: (a) `internal/api/unified_agent.go::handleDownloadInstallScriptCommon`
+ serves the locally bundled agent installer and must not fall back to proxying
+ the GitHub `install.sh` asset when the local copy is present but its detached
+ signatures are missing (nothing on the `curl ... | bash` agent path verifies
+ those headers, so an unsigned-but-correct local script beats a signed-but-wrong
+ proxied one); and (b) a server install should still deploy the script's
+ `.sig` / `.sshsig` sidecars next to it (`/opt/pulse/scripts/install.sh.sig`,
+ `.sshsig`) so the served script carries signatures. The Docker image deploys
+ these sidecars (`Dockerfile`); `install.sh`'s `deploy_agent_scripts` must
+ deploy them for LXC / systemd installs too. The original gap (sidecars never
+ deployed on LXC, so the endpoint proxied the SERVER installer) shipped as the
+ rc.6 agent-wizard regression (issue #1470).
Deployment bootstrap token behavior remains a deployment-installability
trust boundary even when the handler is API-owned. `internal/api/deploy_handlers.go`
must preserve server-derived `owner_user_id` lineage on bootstrap tokens and
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index eb9b8d1365..6e5adf7321 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -929,9 +929,14 @@ recovery scope, or a storage/recovery-owned secret source.
treated as published GitHub release assets; only stable or explicit RC
tags may back the shared installer fallback that those adjacent surfaces
inherit. Published release-tagged local assets on that shared boundary
- must also preserve their detached `.sig` sidecars so recovery- and
+ should also preserve their detached `.sig` sidecars so recovery- and
storage-adjacent flows do not silently downgrade installer or agent
download trust back to unsigned local files during upgrade or repair.
+ When the served install-script local copy is nonetheless present without its
+ sidecars, that shared boundary serves the local AGENT installer rather than
+ proxying the top-level GitHub `install.sh` SERVER installer: a correct but
+ unsigned local script beats a signed-but-wrong proxied one on the unverified
+ `curl ... | bash` agent path (issue #1470).
15. Keep storage summary chart identity and sticky-shell behavior on the
shared storage path. Pool rows, disk rows, storage summary cards, and
storage detail charts must all address history through the canonical
diff --git a/internal/api/unified_agent.go b/internal/api/unified_agent.go
index 8b5e0da780..e8cb65b138 100644
--- a/internal/api/unified_agent.go
+++ b/internal/api/unified_agent.go
@@ -76,9 +76,15 @@ func handleDownloadInstallScriptCommon(w http.ResponseWriter, req *http.Request,
signature, sigErr := readReleaseAssetSignature(scriptPath)
sshSignature, sshSigErr := readReleaseAssetSSHSignature(scriptPath)
if (sigErr != nil || sshSigErr != nil) && isPublishedReleaseAssetVersion(serverVersion) {
- log.Warn().Err(errors.Join(sigErr, sshSigErr)).Str("path", scriptPath).Msg("Signed install script unavailable locally, proxying from GitHub releases")
- fallbackProxy(w, req, scriptName)
- return
+ // The local agent installer is present but its detached signatures are not
+ // (e.g. an install from before the installer deployed the sidecars). Serve
+ // the local AGENT installer anyway; do NOT proxy the GitHub install.sh
+ // release asset, which is the SERVER installer (rejects the wizard's
+ // --url/--token-file). The served /install.sh endpoint must only ever hand
+ // out the agent installer. Nothing on the agent install path verifies these
+ // headers (the wizard is `curl ... | bash`), so omitting them is safe; new
+ // installs ship the sidecars and are served signed. See issue #1470.
+ log.Warn().Err(errors.Join(sigErr, sshSigErr)).Str("path", scriptPath).Msg("Serving local install script without release signatures; sidecars not deployed")
}
w.Header().Set("Content-Type", contentType)
diff --git a/internal/api/unified_agent_test.go b/internal/api/unified_agent_test.go
index 7aabbe5b0d..81ac70ec61 100644
--- a/internal/api/unified_agent_test.go
+++ b/internal/api/unified_agent_test.go
@@ -67,6 +67,35 @@ func TestDownloadInstallScript_Local(t *testing.T) {
assert.Equal(t, "text/x-shellscript", w.Header().Get("Content-Type"))
}
+// TestDownloadInstallScript_PublishedReleaseUnsignedLocalServesAgentInstaller
+// pins the issue #1470 closure: when the local agent installer is present on a
+// published-release server but its .sig/.sshsig sidecars are not, the endpoint
+// must serve the LOCAL agent installer, never proxy the GitHub install.sh asset
+// (which is the SERVER installer). This is the state every pre-fix LXC/systemd
+// install is in until it redeploys the sidecars.
+func TestDownloadInstallScript_PublishedReleaseUnsignedLocalServesAgentInstaller(t *testing.T) {
+ router, tempDir := setupUnifiedAgentRouter(t)
+ router.serverVersion = "v6.0.0-rc.6"
+ // A client that fails any outbound call, so a regression that re-introduces
+ // the GitHub proxy fallback surfaces as a test failure rather than silently
+ // serving the server installer.
+ router.installScriptClient = newTestInstallScriptClient(t, http.MethodGet, "", 0, "", errors.New("proxy must not be used"))
+
+ scriptContent := "#!/usr/bin/env bash\n# Pulse Unified Agent Installer\necho 'agent'"
+ scriptPath := filepath.Join(tempDir, "scripts", "install.sh")
+ require.NoError(t, os.WriteFile(scriptPath, []byte(scriptContent), 0644))
+ // Note: no .sig / .sshsig sidecars written.
+
+ req := httptest.NewRequest(http.MethodGet, "/install.sh", nil)
+ w := httptest.NewRecorder()
+
+ router.handleDownloadUnifiedInstallScript(w, req)
+
+ require.Equal(t, http.StatusOK, w.Code)
+ assert.Equal(t, scriptContent, w.Body.String())
+ assert.NotEqual(t, "github-fallback", w.Header().Get("X-Served-From"))
+}
+
func TestDownloadInstallScriptPS_Local(t *testing.T) {
router, tempDir := setupUnifiedAgentRouter(t)