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.

Fix remote telemetry adoption reports

rcourtmane1a05104d980
diff --git a/docs/release-control/v6/internal/subsystems/security-privacy.md b/docs/release-control/v6/internal/subsystems/security-privacy.md
index 39e9a542a5..2f5017c619 100644
--- a/docs/release-control/v6/internal/subsystems/security-privacy.md
+++ b/docs/release-control/v6/internal/subsystems/security-privacy.md
@@ -978,6 +978,10 @@ new categorical value against its fixed set before storage. The adoption
report may aggregate those latest-per-install signals and use indexed time
filters plus compressed remote transport, but it must not enrich them with
accounts, request IPs, customer records, or event-level browser data.
+The compressed remote-report transport must compile the exact generated Python
+program in its unit proof. Its JSON-lines delimiter is escaped at the outer
+generator boundary so the program sent over SSH contains a valid `b"\n"`
+literal rather than an unterminated bytes literal.
That same telemetry trust boundary must remain operator-inspectable in-product:
the shared system settings surface may preview only the exact runtime payload
Pulse would send, and it must allow an operator to rotate the local telemetry
diff --git a/scripts/telemetry_adoption_report.py b/scripts/telemetry_adoption_report.py
index 118dc39901..89d089a422 100644
--- a/scripts/telemetry_adoption_report.py
+++ b/scripts/telemetry_adoption_report.py
@@ -1203,7 +1203,7 @@ rows_sql = (
output = gzip.GzipFile(fileobj=sys.stdout.buffer, mode="wb", compresslevel=6)
def emit(value):
- output.write(json.dumps(value, separators=(",", ":")).encode("utf-8") + b"\n")
+ output.write(json.dumps(value, separators=(",", ":")).encode("utf-8") + b"\\n")
try:
db_stats = dict(conn.execute(db_stats_sql).fetchone())
diff --git a/scripts/tests/test_telemetry_adoption_report.py b/scripts/tests/test_telemetry_adoption_report.py
index 02a208215f..a7b039eaf0 100644
--- a/scripts/tests/test_telemetry_adoption_report.py
+++ b/scripts/tests/test_telemetry_adoption_report.py
@@ -49,6 +49,7 @@ class TelemetryAdoptionReportTest(unittest.TestCase):
remote_script = run_mock.call_args.kwargs["input"].decode("utf-8")
self.assertNotIn("fetchall", remote_script)
self.assertIn("received_at >= datetime('now', ?)", remote_script)
+ compile(remote_script, "<telemetry-remote-fetch>", "exec")
def test_fetch_rows_remote_rejects_empty_response(self) -> None:
completed = subprocess.CompletedProcess(