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.

Reject unscoped server updater commands in release bodies

pulse-triage[bot]9d77f09b4f6b
diff --git a/docs/release-control/v6/internal/subsystems/deployment-installability.md b/docs/release-control/v6/internal/subsystems/deployment-installability.md
index 13dc89ef77..f5ab597d5d 100644
--- a/docs/release-control/v6/internal/subsystems/deployment-installability.md
+++ b/docs/release-control/v6/internal/subsystems/deployment-installability.md
@@ -6026,3 +6026,20 @@ offline dependency snapshot for the updated lockfile, which is not present in
the current assignment; a host dependency acquisition on the next launch is
required before this contract's Go evidence can be produced. No passing Go
suite, installed build or release acceptance is claimed here.
+
+## Release-body updater ownership (30 September 2026)
+
+Each executable `/bin/update --version` example in a published body must carry
+its own nearby condition: only use it when that helper was installed by the
+Pulse server installer. A warning in a distant highlight does not scope an
+unqualified install, rollback or authored Before-you-upgrade command. The
+existing generated sections retain their signed, version-pinned installer
+fallback for community-scripts installations or an unknown helper owner.
+
+`validate_release_body_shape` applies `validate_server_updater_guidance` to
+the complete body before accepting it; it rejects unsafe examples rather than
+rewriting the author's instructions or selecting another rollback version.
+`render_release_body_test.py` exercises all three unsafe published contexts,
+distant-scope rejection, and valid generated and inline ownership conditions.
+This changes publication validation, not installer behaviour, immutable release
+contents or proof of an installed upgrade/rollback.
diff --git a/scripts/release_control/render_release_body.py b/scripts/release_control/render_release_body.py
index ce091c9e32..40e63e72c1 100644
--- a/scripts/release_control/render_release_body.py
+++ b/scripts/release_control/render_release_body.py
@@ -360,6 +360,33 @@ def strip_validation_status_block(text: str) -> str:
return _canonical_body(stripped.lstrip("\n"))
+def validate_server_updater_guidance(text: str) -> None:
+ """Every executable updater example needs its own nearby ownership scope.
+
+ A warning in a distant highlight does not make an unqualified install or
+ rollback command safe. This covers authored bullets as well as the generated
+ sections, without rewriting the author's instructions or rollback target.
+ """
+ command = re.compile(r"(?<![\w/])/bin/update\s+--version\b")
+ ownership = re.compile(
+ r"only when\s+`?/bin/update`?\s+was installed by\s+the Pulse server installer",
+ re.IGNORECASE,
+ )
+ for section in re.split(r"(?m)^#{1,6}[ \t]+.*$", _normalize_newlines(text)):
+ for match in command.finditer(section):
+ paragraphs = re.split(r"\n[ \t]*\n", section[:match.start()])
+ context = paragraphs[-1]
+ # The generated command is in a fence, immediately after the scoped
+ # paragraph. Do not borrow a warning from an earlier bullet/section.
+ if re.fullmatch(r"\s*```[A-Za-z0-9_-]*\s*(?:sudo\s+)?", context):
+ context = paragraphs[-2] if len(paragraphs) > 1 else ""
+ if not ownership.search(context):
+ raise ReleaseBodyIntegrityError(
+ "each /bin/update --version command must say nearby that it is "
+ "only for the helper installed by the Pulse server installer"
+ )
+
+
def validate_release_body_shape(
body: str,
version: str,
@@ -412,6 +439,7 @@ def validate_release_body_shape(
)
authored_notes = authored_prefix.split(visual_heading, 1)[0]
validate_release_notes_shape(authored_notes, version)
+ validate_server_updater_guidance(clean_body)
if expected_body is not None:
expected_clean = strip_validation_status_block(expected_body)
diff --git a/scripts/release_control/render_release_body_test.py b/scripts/release_control/render_release_body_test.py
index 481302bacc..23b092e25a 100644
--- a/scripts/release_control/render_release_body_test.py
+++ b/scripts/release_control/render_release_body_test.py
@@ -608,6 +608,34 @@ Controls remain readable without horizontal scrolling.
body,
)
+ def test_updater_ownership_scope_cannot_be_borrowed_from_a_distant_warning(self) -> None:
+ args = type("Args", (), {"version": "6.3.2", "rollback_target": "v6.3.1",
+ "rollback_command": "sudo /bin/update --version v6.3.1"})()
+ authored = "# Pulse v6.3.2 Release Notes\n\nSummary.\n\n## Before you upgrade\n\n"
+ install = render_release_body.build_installation_section("6.3.2")
+ rollback = render_release_body.build_rollback_section(args)
+ safe = authored + "Keep a backup.\n\n" + install + "\n\n" + rollback
+ render_release_body.validate_release_body_shape(safe, "6.3.2")
+ unsafe = (
+ safe.replace("Use this CLI command only when `/bin/update` was installed by the Pulse server installer:",
+ "For systemd and Proxmox LXC installs, use:"),
+ safe.replace("For systemd and Proxmox LXC servers, use this command only when "
+ "`/bin/update` was installed by the Pulse server installer:", "Run:"),
+ safe.replace("Keep a backup.", "On systemd and Proxmox LXC installs, use "
+ "`sudo /bin/update --version v6.3.1`."),
+ safe.replace("Keep a backup.", "Use this CLI command only when `/bin/update` was installed "
+ "by the Pulse server installer.\n\nA separate unrelated bullet.\n\n"
+ "```bash\nsudo /bin/update --version v6.3.1\n```"),
+ )
+ for body in unsafe:
+ with self.subTest(body=body), self.assertRaisesRegex(
+ render_release_body.ReleaseBodyIntegrityError, "each /bin/update"):
+ render_release_body.validate_release_body_shape(body, "6.3.2")
+ render_release_body.validate_server_updater_guidance(
+ "Use this command only when `/bin/update` was installed by\n"
+ "the Pulse server installer: `sudo /bin/update --version v6.3.1`."
+ )
+
def test_flattened_release_notes_fail_closed(self) -> None:
flattened = (
"# Pulse v6.1.0-rc.2 Release Notes"