Commit Graph

148 Commits

Author SHA1 Message Date
pulse-triage[bot]
9225b8b8ac Describe service recovery without claiming binary rollback
Script publication can fail after the replacement executable is installed. Report only recovered service liveness, and prove both installer paths keep the new binary while preserving the old script bundle.

Change-source: pulse-maintainer
2026-10-31 12:10:10 +00:00
pulse-triage[bot]
de86c27e59 Keep unexpected fresh script destinations stopped
A fresh bundle has no captured previous directory. Preserve a competing destination without exposing it through an automatic restart; exercise both archive and source consumers.

Contract-Neutral: Completes the script publication contract's existing unexpected-destination and no-restart invariant; no contract change.
Change-source: pulse-maintainer
2026-10-31 10:59:27 +00:00
pulse-triage[bot]
8412544af5 Publish served agent installers as a complete bundle
Prepare scripts and signature sidecars privately and preserve the old bundle on copy, permission or publication failure. Propagate script failures through archive/source installers and every CLI completion path; retain uncertain recovery instead of restarting unknown served content.

Change-source: pulse-maintainer
2026-10-31 10:56:59 +00:00
pulse-triage[bot]
8d41a5a3b4 Require confirmed startup before reporting server installation success
Retain failed startup and unknown service state as incomplete installation for fresh and prior-stopped installs. Preserve the prior-active bounded recovery retry and propagate startup failure through all five conditional main routes before markers or completion. Register real-producer service doubles and saved-state controls.

Change-source: pulse-maintainer
2026-10-31 09:37:49 +00:00
pulse-triage[bot]
4c8e2eb075 Require ownership evidence before rotating configuration snapshots
A literal backup prefix can also name another live instance. Publish private source/path/inode receipts without changing copied payloads, and require matching records before rotation or discard. Preserve unmarked historical copies and fail closed on receipt collisions; register filesystem controls and explain retention limits.

Change-source: pulse-maintainer
2026-10-31 07:52:43 +00:00
pulse-triage[bot]
5003b7c55f Stop installation when directory setup is incomplete
Propagate creation, ownership, environment-write and permission failures explicitly, including when Bash errexit is disabled by a caller. Require directory admission in all five installation/update paths before later helper, unit, service or completion work. Preserve existing bytes and report partial setup honestly. Register confined failure and success controls with the deployment contract.

Change-source: pulse-maintainer
2026-10-31 05:08:11 +00:00
pulse-triage[bot]
f4808c56b2 Preserve trailing pathname bytes in configuration snapshots
Keep a capture sentinel around dirname and basename output so command substitution cannot move a custom instance's backup and retention into a trimmed-name peer. Stop explicitly on component resolution failure, including conditional update callers, and treat relative option-shaped paths as data. Register filesystem controls for final-name and parent newlines, retention, peer state and failure paths. This is a remaining edge of Pulse #3611; the earlier literal-pattern repair in PR #3610 is also required.

Change-source: pulse-maintainer
2026-10-31 03:27:21 +00:00
pulse-triage[bot]
befecbdc84 Keep configuration snapshot rotation in its literal instance namespace
Custom directory names were interpreted by find as patterns, and newline-delimited results could become different recursive removal targets. Expand only the snapshot suffix and retain each complete pathname as a separate shell word. Keep current-snapshot protection, retention counts and non-following directory scope, with connected installer controls for foreign configuration and recovery files.

Change-source: pulse-maintainer
2026-10-31 02:15:54 +00:00
pulse-triage[bot]
2100b5bdea Keep installer configuration snapshots private during copying
cp -a adopts source-root permissions, defeating a reserved private stage when legacy configuration is broadly traversable. Keep the copy behind an installer-owned private enclosure until its root mode is 0700, then use the existing no-clobber publication. Preserve source ownership, nested recovery metadata, flat layout, retention and failure-before-mutation semantics.

Register real-copy prepublication privacy, final metadata and failed-mode preservation controls in the ordinary installer suite, and update the deployment contract. No frontend, host policy, installed service or release state changes.

Change-source: pulse-maintainer
2026-10-30 00:38:43 +00:00
pulse-triage[bot]
47250b2b85 Keep server recovery data until removal has completed
Check file, account and systemd removal failures explicitly in both server entrypoints, including conditional callers. Keep configuration deletion last and reject overlapping runtime/data layouts before deleting files.

Exercise actual sourced removal with confined filesystem failures, partial data deletion, preserved choices and separate-instance controls; retain native installed acceptance as a separate proof.

Change-source: pulse-maintainer
2026-10-28 12:06:53 +00:00
pulse-triage[bot]
953a0ea9e8 Preserve cleanup failures through conditional LXC exits
Propagate actual owned-input removal errors instead of relying on errexit inside a conditional cleanup call. Exercise both production cleanup helpers, retain the original installation exit, and require every recovery control in the containing Go suite.

Change-source: pulse-maintainer
2026-10-28 09:57:27 +00:00
pulse-triage[bot]
2b2cc7f12d Keep failed Proxmox installs available for recovery
Stop at required package failures, retain their diagnostics and original exits, and preserve partially installed containers on errors or interruption. Keep temporary-input cleanup scoped, expose recovery guidance during guest commands, and exercise the real entry through confined failure, success and signal controls.

Change-source: pulse-maintainer
2026-10-28 09:51:48 +00:00
pulse-triage[bot]
5d88967eec Keep new Proxmox installs out of existing guest maintenance
Remove the legacy v4 estate-wide mount cleanup from LXC creation. It could stop and rewrite existing workloads before offering Cancel; explicit sensor-proxy maintenance remains separate. Add real PTY and detached entry fixtures with inert lifecycle spies, and record the changed installation scope.

Change-source: pulse-maintainer
2026-10-28 08:25:17 +00:00
pulse-triage[bot]
44b0500abc Preserve recovery keys when local legacy cleanup cannot complete
Separate staging-file admission from grep no-match in both shipped local cleanup paths. Resolve shared targets, require intact metadata and return incomplete results without replacing unrelated keys or caller resources. Add actual filesystem failure and caller-path controls.

Change-source: pulse-maintainer
2026-10-26 20:52:58 +00:00
pulse-triage[bot]
aa4f3bbf8d Preserve updater assets when repository configuration fails
Return actual allocation, syntax, mode and rename failures before publishing a configured updater. Prepare the rewrite beside its input and leave the installed helper and units unchanged when configuration cannot complete. Exercise the real rewriter and its containing asset installer under the conditional callers that suppress errexit.

Contract-Neutral: Repairs the existing configured-helper and failure-preservation guarantees without changing update consent, source selection, service policy or deployment contracts.
Change-source: pulse-maintainer
2026-10-25 21:47:30 +00:00
pulse-triage[bot]
89c61b233c Keep signed manual update bootstraps on HTTPS
The generated manual helper currently permits an HTTPS asset redirect to plaintext HTTP, unlike the unattended downloader. Restrict initial and redirect protocols for both signed inputs, without weakening deadlines, signature verification or cleanup. Exercise the actual helper with real curl and authenticated local TLS, including downgrade refusals and permitted HTTPS redirects; keep the native systemd fixture on the exact envelope.

Change-source: pulse-maintainer
2026-10-25 15:47:43 +00:00
pulse-triage[bot]
70a0c54e84 Replace manual update helpers without truncating running readers
The published v6.5.0 to v6.6.0 lifecycle run 40197749411 reported an unmatched quote after the installer rewrote /bin/update in place. Stage, validate and atomically replace the helper so an executing Bash reader keeps its original inode. Preserve the optional non-fatal setup guarantee on every preparation or replacement failure.

Change-source: pulse-maintainer
2026-10-25 13:42:11 +00:00
pulse-triage[bot]
b239891b75 Bound signed manual-update bootstrap downloads
Keep both bootstrap requests within curl's connection and whole-request deadlines, without ambient retry settings. Arm cleanup before allocation so a second mktemp failure cannot strand the first input. Exercise the emitted helper's signed success, partial download failures, allocation failures and signature rejection without native or production execution.

Change-source: pulse-maintainer
2026-10-25 06:33:50 +00:00
pulse-triage[bot]
b79496219f Preserve prior installer snapshots on retry
Reconcile the retained snapshot publication repair with current main without importing unrelated containing history. Unique private staging, no-clobber publication and failure-before-mutation protect earlier recovery copies; retain zero-retention and hardened-unit fallback semantics.

Retained-source: 854ea3c81a94ffe88145d663d25d5040d4637a47, 91bd7393fc4413b6629ad851f90c2c7f6c2c0991
Change-source: pulse-maintainer
2026-10-23 22:39:08 +01:00
rcourtman
6dc43d298c Stage server update archives on the install filesystem, not /tmp
The server installer downloaded the release archive and extracted it
under /tmp. Debian 13 and many LXC templates mount /tmp as tmpfs, whose
pages are charged to the container's memory cgroup. A v6.5.0 archive is
~280 MB and extracts to ~750 MB, so an unattended update on a 1 GiB LXC
filled the cgroup with ~820 MB of shmem; the kernel OOM-killed the
container's systemd and Proxmox stopped the container mid-update.

Download and extract into owner-only hidden directories under the
install directory instead. It is always writable from the hardened
pulse-update.service sandbox, it is where the staged binary already
lives, and the disk headroom preflight now measures the filesystem the
update actually stages on. The Go updater already prefers its data
directory over /tmp for the same reason.

Unlike /tmp, the install filesystem keeps an interrupted run's staging
across reboots. Staging setup now removes stale staging directories that
match only the exact owner-only names, never symlinks or files, and only
once their ctime is over six hours old: install.sh has no update lock,
so age is what proves no live run still owns them. Every recursive
pulse chown of the install directory now goes through one helper that
skips staging, so the payload root still reads is never handed to the
service account and the ~750 MB tree is not rewritten for nothing.

The "Failed to print table: Broken pipe" line in the report was
systemctl list-unit-files | grep -q in v6.5.0's service discovery; main
already reads that inventory in full, and it was not the failure.

Contract-Neutral: Defect fix inside the existing private server-installer inputs and update-space boundaries; staging moves from tmpfs-prone /tmp to the install filesystem with no public contract change
2026-10-16 23:49:36 +01:00
pulse-triage[bot]
b3b368c21b Admit silent unit absence without losing inventory failures
Adapt rcourtman’s Pulse PR2855 (aef53d0d3e), which diagnosed systemd’s silent exit-one absence. The original contributor commit is unchanged and explicitly credited, not imported, amended or re-parented in this maintainer candidate.

One bounded stdout/stderr observation accepts genuine absence but retains failed first reads, other statuses and blank-line output. Include the existing registered installer/updater verification hooks, real-empty-root controls and missing-unit recovery double in this same source commit. This replaces the rejected foreign-history composition with a normal maintainer-reviewed implementation; no provenance policy, credential or host installation changes.

Source-attribution: rcourtman, https://github.com/rcourtman/Pulse/pull/2855, aef53d0d3e
Change-source: pulse-maintainer
2026-10-12 03:15:49 +01:00
pulse-triage[bot]
3c9a102e83 Refuse ambiguous server service discovery during updates
Consume one bounded inventory of exact historical unit names without early pipe closure. Preserve legacy and explicit-instance selection, and stop replacement, unit creation, reset and removal after unknown inventory even when Bash errexit is disabled. Distinguish this source defect from the unconfirmed cause of the reported LXC stop.

Refs: #2785
Change-source: pulse-maintainer
2026-10-10 10:52:58 +01:00
pulse-triage[bot]
8512d38dd5 Preserve effective systemd masks before update asset replacement
Reconcile the returned timer-discovery repair: both exact units must have a successful bounded unmasked inventory before shared asset staging. Keep configured, runtime and off-destination persistent masks and all assets unchanged across every installer consumer, explicit setup and sandbox repair. Unknown or failed inventory stops replacement; enabled and disabled refresh remains consent-preserving.

Change-source: pulse-maintainer
2026-10-09 12:41:00 +01:00
pulse-triage[bot]
acce9cf13d Discover existing update timers before consent-preserving refresh
Match complete systemctl inventory rows by exact unit field with bounded reads, so updates and reinstalls reach the existing helper refresh. Preserve deliberate timer and updater masks instead of replacing their symlinks. Exercise all five installer consumers, unchanged settings and enablement, failure/timeout controls and actual fixture-root systemctl inventory.

Change-source: pulse-maintainer
2026-10-09 11:30:49 +01:00
pulse-triage[bot]
843b8d82b6 Keep server installer inputs private and authenticated
Keep archive and sidecar downloads in owner-only staging, clean only owned leaves after handled failures and bootstrap exit, and preserve caller-provided inputs. Require the piped LXC installer signature before copying or execution instead of trusting PID-named files in shared tmp.

Exercise the actual download, prefetch and complete container bootstrap through confined offline doubles and real fixture SSH signatures. Preserve version, archive re-verification, staging-before-stop, service recovery, timer consent and removal boundaries; native acceptance remains separate.

Change-source: pulse-maintainer
2026-10-09 10:17:47 +01:00
pulse-triage[bot]
b155982e30 Bind unattended installer updates to exact menu targets
Use the reviewed server-only selector in the existing-installation menu and bind automatic selection to available channel rows. A current selected release is a no-op; unavailable metadata or an automatic downgrade stops before mutations. Preview selection retains its channel, numeric beta/RC revisions compare correctly, and deliberate reinstall pins the actual current version.

Execute the actual menu through confined offline transport and stopped mutation boundaries. Preserve explicit version, interactive removal, signature and all-unit quiescence contracts; reconcile the inherited comment-only preview assertion with the real selector consumer.

Change-source: pulse-maintainer
2026-10-09 09:20:16 +01:00
pulse-triage[bot]
56fec40f2d Select only published server releases in the installer
Use one complete-metadata selector for installer URLs and server archives. Exclude chart and draft releases, reject unusable metadata and transport bodies, and preserve explicit pins, signed assets and downgrade refusal. Exercise the actual selectors with bounded offline controls and retain native installation as separate acceptance.

Change-source: pulse-maintainer
Contract-Neutral: Restore server-only discovery within existing stable/preview channels; installer authority, signatures, architecture admission, downgrade refusal and state contracts are unchanged.
2026-10-09 08:29:32 +01:00
pulse-triage[bot]
af32cbdcbf fix(installer): contain destructive reset and bind lifecycle proofs
Observe every timer, updater and server before mutation; refuse configuration deletion on uncertain quiescence and restore only prior-active servers and recorded timer states. Keep roles independent of accepted custom service names and never replay an interrupted updater. Exercise actual sourced paths and adverse controls. Move existing Windows native-exit assertions unchanged to their registry-named completion file without relaxing checks.

Change-source: pulse-maintainer
2026-10-08 02:49:30 +01:00
pulse-triage[bot]
40dcedde85 Refuse server removal until affected units are quiescent
Contain destructive installer removal when systemd observation, stop or disable is uncertain. Stop the updater before the server, reconcile default aliases and local legacy units, and preserve files on refusal. Propagate failed legacy-key replacement even in conditional cleanup. Exercise both removal entrypoints and instance isolation in confined fixtures.

Change-source: pulse-maintainer
2026-10-07 23:15:53 +01:00
pulse-triage[bot]
493e0b5fa9 Bind parsed manual channels through installer execution
The installer rereads saved preferences without an explicit selector. Forward the parsed stable default as well as RC, and prove the containing installer's actual channel-selection functions against the same signed fixtures.

Change-source: pulse-maintainer
2026-10-07 19:23:46 +01:00
pulse-triage[bot]
589d7e18b5 Read manual update channels from complete top-level settings
Stop the generated helper before downloads when saved channel evidence is malformed or unreadable. Preserve explicit selectors, source-marker precedence and signed-installer verification; exercise the actual helper with signed local fixtures.

Change-source: pulse-maintainer
2026-10-07 19:08:04 +01:00
pulse-triage[bot]
1e6629c03c Stage source-built server binaries before atomic replacement
Admit a prepared executable and source revision before stopping Pulse. Keep the live binary in place until one same-filesystem rename, and restore only a previously active service after a failed rename. Preserve existing recovery files and exercise staging, stop, rename and recovery failures.

Change-source: pulse-maintainer
2026-10-07 12:44:56 +01:00
pulse-triage[bot]
c0772f0d7d Admit archive binaries before stopping Pulse and replace them atomically
Reject signature, extraction, architecture, destination staging and version failures before the service outage. Keep the live executable until a same-filesystem rename succeeds, remove the destructive version retry, and recover only a previously active, confirmed-stopped service if rename fails. Exercise the real archive path with download/local inputs and retained byte/mode/state fault controls; preserve uncertain-stop restrictions and separate native acceptance.

Change-source: pulse-maintainer
2026-10-07 11:39:38 +01:00
pulse-triage[bot]
407da3addb Refuse server replacement until Pulse is confirmed stopped
Archive and source installs ignored stop failures, while the manual flows stopped Pulse before staging. Require bounded state reads and a confirmed inactive service before either replacement; keep prior-active attribution and installed metadata on refusal. Exercise both real paths, timeout and uncertain-state controls, and manual staging failures without native or production mutation.

Change-source: pulse-maintainer
2026-10-07 08:41:36 +01:00
pulse-triage[bot]
eb7e70135d Preserve auto-update consent during manual version changes
An update, rollback or reinstall must not silently enable unattended updates. Share the existing-install opt-in prompt and retain affirmative CLI and interactive choices without changing helper refresh or fresh-install defaults.

Exercise all five existing main flows and add bounded configuration/timer intent observations to the signed published lifecycle rehearsal, including changed and unavailable negative controls.

Change-source: pulse-maintainer
2026-10-01 11:50:33 +01:00
pulse-triage[bot]
521acef97a Reject mixed bootstrap metadata and align credential-safe fixtures
The root parser's legacy no-token alias accepted a new private-file command beside a legacy download URL. Reject every mixed alias, as the existing coherent-transport contract requires. Preserve backup-permission URL bindings. Align older secret-in-command and shared type fixtures, and exercise the actual wrong server installer parser.

Contract-Neutral: Enforce the already-declared coherent bootstrap transports and correct verification fixtures; no API, scope or documented behaviour delta.
Change-source: pulse-maintainer
2026-10-01 05:42:34 +01:00
pulse-triage[bot]
2fd114b3ac Keep Proxmox bootstrap credentials out of copied commands
Separate PVE/PBS setup and telemetry credentials from shell source and download URLs. Use silent root/sudo input, private-file handoff, complete downloads and the agent preflight; preserve scope, TLS defaults, single-line paste and coherent rolling-upgrade metadata. Reveal tokens through the existing dialog and discard late issuance after close. Pin executable shell, history, TLS/registration and browser contracts without using real credentials.

Change-source: pulse-maintainer
2026-10-01 05:23:08 +01:00
pulse-triage[bot]
07d54cd345 fix(installer): discard unneeded config backup when staging cannot start
backup_existing snapshots the configuration before the update stages, but a
staging disk-headroom failure then exited and left that snapshot behind. On a
small root filesystem each automatic retry added another full backup and made
the low-space condition progressively worse until updates could no longer run
(#2127). Record the snapshot and remove it when download_pulse aborts at the
headroom check, before anything was replaced. Add regression coverage.

Change-source: pulse-maintainer
2026-09-20 17:44:43 +01:00
pulse-triage[bot]
d5945f824d Preserve Pulse severity in systemd journal 2026-08-31 11:46:51 +01:00
rcourtman
66eb537522 Fix local subscription CLI service setup 2026-08-23 09:28:44 +01:00
rcourtman
e434466269 fix(security): verify SSH hosts during proxy cleanup 2026-08-08 05:18:55 +01:00
rcourtman
5787cea4eb fix(install): use absolute binary path in pct exec instructions
pct exec runs with PATH=/sbin:/bin:/usr/sbin:/usr/bin, which does not
include /usr/local/bin where the pulse binary is linked. Every first-run
instruction that invoked a bare `pulse` through pct exec therefore failed
with exit 127, including the command the installer itself prints at the
end of an LXC install.

Reproduced on Proxmox VE 9.1.9 and 8.3.0:

    pct exec <ctid> -- pulse --version
      -> exit 127, Failed to exec "pulse"
    pct exec <ctid> -- /usr/local/bin/pulse --version
      -> Pulse v6.2.0-rc.8

The installer now prints $BINARY_LINK_PATH and $UPDATE_HELPER_PATH rather
than a bare name, so both stay correct when a custom service name moves
them. The update helper was only affected for custom service names, since
the default /bin/update already sits on the pct exec PATH.

Docs updated in INSTALL.md, FAQ.md and TROUBLESHOOTING.md plus their
frontend-modern/public/docs mirrors. The setup wizard prints the same
broken command and is fixed separately.
2026-08-06 12:08:13 +01:00
rcourtman
9992d98172 Narrow two over-broad triage changes back to scope
Two follow-ups from auditing this morning's triage commits.

2a1bf2839 placed the config-directory guard after safe_systemctl enable, so
a failure to create the directory would have left the update timer enabled
while the installer reported automatic updates as disabled and never wrote
system.json. Move the guard above both the asset install and the timer
enable so a failure leaves nothing half-configured, and pin the ordering
with a test.

419385ccf regenerated the whole bundle-size baseline when only the FilterBar
chunk was over budget. That raised the recorded baseline for 22 other chunks
that were still passing, absorbing about 15 kB of accumulated drift and
resetting their headroom. Restore every other chunk and both totals to their
previous values and bump FilterBar alone, so the drift those chunks have
already accrued stays visible to the next change.

Contract-Neutral: scope corrections to earlier triage commits

Refs #1663
2026-08-03 18:00:04 +01:00
rcourtman
2a1bf28394 Create the config directory before enabling auto-updates
Reinstalling after removing /etc/pulse reaches setup_auto_updates before
setup_directories has recreated the config directory. The system.json
write then failed with "No such file or directory" while the run still
printed that automatic updates were enabled, so the installer reported a
state it had not reached.

mkdir -p the config directory first, and fall back to disabling
auto-updates when it cannot be created.

Contract-Neutral: installer behavioural fix, no contract delta

Refs #1663
2026-08-03 09:47:03 +01:00
rcourtman
c8ff52339f Rotate configuration backups instead of growing without bound
Every unattended update created another full config snapshot under
config-backups (or next to the config dir) and nothing ever pruned old
ones, so small root filesystems filled up within days (#1646, reported
on the hardened-unit fallback path where snapshots land under the
install dir). backup_existing now keeps the five newest snapshots and
removes the rest after each successful copy.

Contract-Neutral: installer config backup rotation; shell-only fix, no runtime contract
2026-08-02 18:56:05 +01:00
rcourtman
630d151460 Repair half-removed installations in the installer update paths
A box with the binary still at /opt/pulse/bin/pulse but /etc/pulse, the
systemd unit and the /usr/local/bin symlink deleted by hand takes the
update path ("Reinstalling version ..."), which assumed the previous
install's environment still existed. With auto-updates enabled the run
died at setup_auto_updates writing system.json into the missing config
dir; without them it printed a success completion while systemctl
enable/start had failed with "Unit pulse.service could not be found",
softened into the unprivileged-container note (#1663).

Both the --version and menu update flows now run setup_directories and
recreate the unit file when it is missing (an existing unit stays
untouched so user customizations survive normal updates), and
start_pulse refuses to report success when the unit does not exist at
all. Documented as a deployment-installability contract invariant.
2026-08-01 13:19:59 +01:00
courtmanr@gmail.com
5c1c89a363 Guard auto-update asset staging and migrate stale update units
Adversarial review of 9db25ba60 found four residual defects in the
auto-update asset install, plus a doc line it left contradicting itself.

- install_auto_update_assets copied the bundled helper into the staged
  mktemp file with an unchecked cp, and both call sites invoke the
  function under `if !`, which suppresses errexit for its whole body. A
  failed copy (ENOSPC, EIO) fell through to
  configure_auto_update_script_repo, whose awk emits a lone GITHUB_REPO=
  line for empty input, so a shebang-less one-line stub replaced the
  working helper with a "script" that only ever exits 0 - silently
  disabling unattended updates. Check the cp, and refuse the swap unless
  the staged helper is non-empty and starts with #!.
- Both units were rendered with a bare truncating `cat > "$unit"` whose
  status was never checked, and the function's last statement is
  safe_systemctl daemon-reload, which returns 0 by design. A failing
  write truncated a working unit and still reported success. Render each
  unit to ${path}.tmp and commit it with a checked rename, so a failure
  leaves the installed unit byte-identical.
- The widened ReadWritePaths could not reach deployed boxes: the unit
  that grants the write access is itself the file that has to be
  rewritten, and on an existing install the sandbox running the
  installer excludes /etc/systemd/system and /usr/local/bin (EROFS). The
  Go update pipeline cannot carry it either - pulse.service runs as
  User=pulse with its own ProtectSystem=strict over the install and
  config dirs only. So probe each destination directory up front and,
  when one is blocked, re-exec this already-signature-verified installer
  through systemd-run with a new internal --repair-auto-update-units
  entry point: PID 1 forks the transient unit, so it starts in the host
  mount namespace instead of inheriting the sandbox. The installer is
  copied into the install dir first because the calling unit's
  PrivateTmp=yes hides its /tmp copy from PID 1. The escape needs root
  and systemd-run, and never recurses.
- Keep the ReadWritePaths entries as directory grants: every write now
  commits with a rename from a sibling staging file, and rename needs
  write access on the containing directory, so the file-level entries
  systemd would otherwise accept cannot work. Document the tradeoff in
  the unit and the subsystem contract instead.

The deployment-installability contract still claimed the update sandbox
leaves "only the install dir, config dir and /tmp" writable, which the
paragraph the same file gained in 9db25ba60 contradicts; the same stale
rationale had been copied into two test comments.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-28 11:56:52 +01:00
courtmanr@gmail.com
9db25ba60e Fix doubled auto-update schedule and unfreeze sandboxed refreshes
Residual auto-update defects found while triaging #1643 and #1637
(the primary regression was fixed in 806cbe83d):

- The generated pulse-update.timer carried both OnCalendar=daily and
  OnCalendar=02:00, so with RandomizedDelaySec=4h every box attempted
  two updates per day (00:00-04:00 and 02:00-06:00 windows). Keep the
  single documented 02:00 schedule.
- The generated pulse-update.service sandbox (ProtectSystem=strict)
  excluded the helper and unit directories from ReadWritePaths, so the
  unattended path could never refresh /usr/local/bin/pulse-auto-update.sh
  or rewrite the units - updater fixes only reached boxes via manual
  installs. Grant the sandbox write access to both directories on
  purpose.
- Because the unattended path replaces the helper bash is currently
  executing, stage the new helper next to its destination and swap it
  in with an atomic rename only after repo configuration succeeds. A
  failed download or configure now leaves the previously working helper
  in place instead of rm -f'ing it out from under the enabled timer's
  ExecStart.
- Delete scripts/systemd/pulse-update.{service,timer}: orphaned
  reference copies that had drifted from the units install.sh actually
  generates and were referenced by nothing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-28 11:13:37 +01:00
courtmanr@gmail.com
806cbe83dc Fix auto-update leaving service down after installer failure
Two bugs from #1630 that combined to take installs down silently:

1. perform_update()'s install-failed rollback branch restored the backup
   but never restarted pulse.service. Since the generated
   pulse-update.service gates on ExecCondition=systemctl is-active,
   every later timer run was then skipped and the install stayed down
   until manual intervention. Restart is now guaranteed by a
   service_was_active-guarded restart in that branch plus an
   ensure_service_restarted RETURN trap so no exit path can miss it
   (re-fix of #1323, originally c0b3a0e66, lost in 778a2577b and only
   partially restored in 672e81985).

2. install.sh aborted under errexit when writing the /bin/update helper
   on a read-only filesystem - after the new binary was installed and
   the service stopped, landing in bug 1's no-restart branch. The stock
   pulse-update.service uses ProtectSystem=strict, so /bin and
   /usr/local/bin are read-only on stock unattended updates; transient
   read-only remounts hit the same path. The helper write, PATH
   appends, and the /usr/local/bin/pulse symlink are now idempotent and
   non-fatal with a warning (install_binary_symlink).

Contract: deployment-installability now pins fail-closed service
availability for unattended updates and non-fatal writes outside the
hardened unit's writable set, with proofs in pulse_auto_update_test.go
and root_install_sh_test.go plus shell regression coverage in
scripts/tests/test-pulse-auto-update.sh (installer-exits-nonzero path)
and scripts/tests/test-install-update-resilience.sh (read-only helper
and symlink paths, verified under set -e, root-safe via ENOTDIR).

Fixes #1630

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 09:38:37 +01:00
rcourtman
dbca44937b Add privacy-safe telemetry lifecycle and outcome signals 2026-07-23 01:10:38 +01:00