Commit Graph
81 Commits
Author SHA1 Message Date
David Heinemeier HanssonandClaude Opus 5.5 e1614f2bdb Ask for the sudo password once per omarchy update (#13323)
* Ask for the sudo password once per omarchy update

Every sudo call in omarchy update prompted, because the no-update wrapper
covered the whole run on top of per-phase revokes, and stay-awake revoked
the timestamp on its own entry and exit. A single update could ask four
times before the snapshot finished (#13319).

Authorize once, right after confirmation, starting from a revoked
timestamp so the prompt always belongs to this update. A background
keepalive refreshes it until the update is done. Prune, snapshot,
stay-awake, keyring, system packages, migrations, orphan removal, service
restarts, the post-update hook, and mise all share that authorization.

AUR builds run third-party PKGBUILD code, so they move to the end and run
cold: the keepalive stops, the timestamp is revoked, and yay and any bare
sudo use the no-update wrapper. The timestamp is revoked again after AUR
and on every exit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep the single authorization for passwordless sudo and ttyless inhibition

Authorize by running a command instead of sudo -v. Under the default
verifypw=all, -v prompts even when passwordless sudo is enabled, which
would have added a prompt those users never had.

Inside an update without a terminal, stay-awake now reuses the update's
authorization with a non-interactive sudo instead of asking again through
polkit. It falls back to polkit only if that authorization is gone.

The test sudo refuses a cold non-interactive call, as the real one does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 15:31:40 +02:00
Afonso Oliveira 56ca654dc8 Merge quattro into update security foundation 2026-09-21 14:14:59 +01:00
David Heinemeier Hansson d174d4aa27 Add omarchy up alias 2026-09-18 15:34:03 +02:00
Afonso OliveiraandClaude Fable 5.1 43b91163f6 Install cleanup traps before the entry revocation and bound the bus probe
The protected entrypoints revoked the sudo timestamp before installing
their cleanup traps, so a signal or failure during that first sudo -k
exited without the cleanup path. Install the traps first.

The shell restart probed the notification bus name with busctl's
default 25 second timeout, so an unresponsive user bus could stall the
restart by that much per probe. Bound each probe to one second.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 20:33:59 +01:00
Afonso OliveiraandClaude Fable 5.1 13a4306a8e Run the refresh hook before its transaction and keep the inhibitor through user work
Three review findings on the update-hook boundary:

The pre-refresh-pacman hook had been moved after the refresh transaction
and, during a channel switch, deferred to the very end. That defeated the
hook's purpose: custom repositories and IgnorePkg entries were not in
place when the downgrade-capable -Syyuu ran. Run the hook where it used
to run, after the package config is re-synced and before the transaction,
but cold: revoke the timestamp, run it behind the no-update wrapper with
the caller's original PATH, and revoke again before continuing. Every
later privileged command authenticates with --no-update, so a detached
child left by the hook has no reusable timestamp to wait for. Channel
switching hands the caller's PATH to the refresh the same way the updater
receives it, and no longer defers or re-runs the hook.

Stay Awake was released before AUR builds, hooks and mise, so the machine
could sleep during the longest part of an update. Releasing the inhibitor
needs no privilege because the held command already dropped to the user,
so stop it after mise and before the reboot prompt, as before.

A packaged channel destination cannot be inspected before its package is
installed, and a transaction can replace the running tree with a release
that predates the command-scoped wrapper; from then on a bare sudo would
resolve to /usr/bin/sudo and publish a timestamp, and the destination's
own updater authenticates the same way. The switch used to abort only
after the packages had changed, with generic rerun advice. Now it checks
for the wrapper after each transaction before any further privileged
step, completes what it safely can, and stops cold with instructions to
run that release's update from a fresh session instead of launching it.

Boundary tests pin the hook between the config copies and the transaction
with a cold timestamp on both sides, the older-destination stop with its
guidance and no launched updater, the new inhibitor position, and the
post-update hook staying unreached on failures and signals. Docs, the
manual and the sample hook describe the restored timing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 11:11:08 +01:00
Afonso Oliveira 5bc41b2585 Resolve security libraries beside canonical entrypoints 2026-09-07 17:31:54 +01:00
Afonso Oliveira f37c73fa20 Bind protected update commands to their source root 2026-09-07 17:27:04 +01:00
Afonso Oliveira 5b692c5b30 Preserve user PATH across updater relaunches 2026-09-07 14:31:07 +01:00
Afonso Oliveira a9e9954e3e Clarify unattended updates still require sudo authorization 2026-09-06 22:59:08 +01:00
Afonso Oliveira f2c3925431 Revoke before session cleanup and protect standalone inhibition 2026-09-06 22:49:43 +01:00
Afonso Oliveira 35b318ed09 Complete command-scoped authentication across update phases 2026-09-06 22:26:06 +01:00
Afonso Oliveira 1136a715c0 OM-SEC-14: Run update hooks without reusable sudo authority 2026-08-31 21:32:42 +01:00
David Heinemeier HanssonandClaude Opus 5 5ca3030c5a Put a blocked package upgrade back to whoever is updating (#6830)
Pacman answers its own conflict question with No under --noconfirm, so one
retired package can stop every update after it. Which package to drop is a
decision rather than a cleanup, so run the upgrade again with pacman asking
when there is a terminal to answer on, and report instead when -y promised
not to ask.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 09:08:34 +02:00
David Heinemeier HanssonandClaude Opus 5 fd23ca023a Prune the package cache before updating (#6734)
The pacman cache grows without bound across updates, and nothing in the
update flow ever reclaimed it. On a machine that has been updating for a
while it reaches several gigabytes of superseded versions that nothing
will ever install again.

Prune it with paccache -rk2 as the first step of an update. Both halves
of that placement are load-bearing.

Keeping two versions rather than one preserves the rollback path. The
cache is Arch's only offline downgrade: when an update breaks a single
package, reinstalling its predecessor from here is the surgical fix,
where a snapshot rollback would revert every other package too. Pruning
before the packages update means the installed version is still the
newest cached, so it survives along with a spare. Retention is by
version order and never consults what is installed, so that holds while
the installed version is among the two newest cached; a deliberate
downgrade or repeated failed transactions can stack newer archives on
top of it.

Running before the snapshot is what actually frees the space. The cache
sits on the snapshotted root subvolume, so a prune taken afterwards
leaves the fresh snapshot holding those extents and reclaims nothing
until it ages out of the number cleanup.

A failed prune warns and continues. Cache housekeeping should not trip
the update's ERR trap and tell the user their update went wrong.

This runs after omarchy-update-requires-free-space, so it reclaims space
during healthy updates but does not rescue a machine already under the
10 GiB gate.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-12 11:56:02 +02:00
3bfea9b840 Fail loudly when a pre-update snapshot isn't actually created (#6580)
* Fail the snapshot when Snapper is installed but has no configs

omarchy-snapshot create loops over the configs snapper reports. With none,
the loop body never runs, so it prints "Create system snapshot" and exits 0
without capturing anything. Every update then reports a snapshot it never
took, and the absence only surfaces when a rollback is needed and the
snapshot list turns out to be empty.

* Say so when the update proceeds without a snapshot

The update ignores exit 127 so a system without snapper updates quietly.
Any other snapshot failure was being swallowed by the same expression,
which let the update continue with no indication that it was now
unprotected. Keep continuing, but say it out loud.

* Point the snapshot repair hint at how the installer runs it

Also hold the green header until a snapshot will actually be attempted,
so the no-config failure doesn't open with a success banner.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Continue the quattro upgrade when the pre-upgrade snapshot fails

The upgrade runs under set -e, so the new non-zero exit from an
unconfigured Snapper would have aborted a re-run at the snapshot step
instead of proceeding like omarchy-update does.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: David Heinemeier Hansson <david@hey.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 18:44:37 +02:00
David Heinemeier Hansson 8554801537 Split update coordination helpers 2026-07-29 20:04:49 -07:00
Eric van Riet PaapandDavid Heinemeier Hansson bf4aac95ad Warn when disk space is low before updating in Quattro (#6432)
* Warn when disk space is low before updating

* Simplify update free space warning

* Stop updates without enough free space

* Allow forcing updates with low disk space

---------

Co-authored-by: David Heinemeier Hansson <david@hey.com>
2026-07-29 18:47:27 -04:00
David Heinemeier HanssonandClaude Opus 5 03902f2460 Never notify about pending migrations during an update
The retired omarchy-update-user-notify.path stays loaded in sessions that
started before the update removing it, and pacman writes the migrations
directory mid-transaction, so it fired a critical toast for migrations that
omarchy-migrate was about to apply a step later. Migration 1785095882 stops
that watcher, but migrations run after pacman, so it lands 11 seconds too
late to prevent the toast it exists to retire.

Check the lock omarchy-update holds for its whole pipeline instead of
trusting that no trigger exists. That covers the stale watcher and anything
added later: during an update every pending migration is by definition
already being applied. The check repeats after waiting for the notification
server, which is long enough for an update to start underneath it.

Only this user's runtime directory is read, never the /tmp path the updater
falls back to without XDG_RUNTIME_DIR. A shared lock file belongs to whoever
created it first, so honouring it would let one user silence another user's
notification; a redundant toast is the better failure.

The sleep inhibitor now starts with the lock descriptor closed. It outlives
the step that starts it, so an update killed before restore_update_inhibitors
left it holding the flock indefinitely. That already blocked later updates,
and now that the notifier reads the same lock it would have silenced
migration notices at every login.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 09:41:03 -07:00
David Heinemeier Hansson 9b09a3c142 Clear update inhibitors before reboot prompt 2026-07-23 18:58:55 -07:00
David Heinemeier Hansson 8e549c27d0 Update active dev checkout with system 2026-07-23 15:28:32 -07:00
David Heinemeier Hansson 8862fb22bd Use Omarchy command helpers consistently 2026-07-18 10:08:43 -07:00
David Heinemeier Hansson 3fd36802ac Simplify the system-update check
No need for a panel, just focus on the main omarchy package
2026-06-23 15:59:27 +02:00
Ryan Hughes 0804962619 Improve update and migration flow 2026-06-04 18:38:25 -04:00
Ryan Hughes 75cb4f7195 Make setup ISO-only
Remove legacy online installer entrypoints, collapse migrations for 4.0, and move setup responsibilities into target-side system, hardware, and user commands.
2026-06-04 18:37:32 -04:00
Ryan HughesandDavid Heinemeier Hansson d2a4cc0c4d Add omarchy CLI (#5477)
* Add omarchy CLI

* Remove outdated or internal

* Add bash completions for command

* Add omarchy command documentation

* Add missing docs

* Correct to what's now right

* Fix tests

---------

Co-authored-by: David Heinemeier Hansson <david@hey.com>
2026-05-01 17:40:22 +02:00
David Heinemeier Hansson abace0cbd5 Prevent the need for double sudo 2026-04-06 09:36:35 +02:00
David Heinemeier Hansson ef93f6356c Move to git update to ensure it's not lost 2026-03-08 17:04:12 +01:00
David Heinemeier Hansson 169ef6ec9e Time has to be updated before git repo is pulled
Or SSL certificate will complain
2026-03-08 17:01:33 +01:00
David Heinemeier Hansson 7514ae7dcf Use consistent bash5 style for conditionals and quoting 2026-02-21 10:18:47 +01:00
Ryan Hughes 5711f42ac3 Don't delete snapshot on error 2026-02-20 17:48:24 -05:00
Mridul AgarwalandMrid22 8a58b8153c delete snapshot if update fails since it takes up space, esspecially when redoing the update as it makes another snapshot (#4531)
Co-authored-by: Mrid22 <mridulaga@outlook.com>
2026-02-07 12:37:58 +01:00
David Heinemeier Hansson e44e937284 Ensure that noidle is turned off after update is complete
Closees #3982
Co-authored-by: @sgruendel
2025-12-24 19:25:18 +01:00
David Heinemeier Hansson 021d66f9b6 Channel changes should prompt a full update 2025-12-15 10:04:00 -08:00
David Heinemeier Hansson 1f4c50eddf Pull noidle setting out into its own step 2025-12-15 09:55:09 -08:00
David Heinemeier Hansson 4391df6853 Fix declining an update 2025-11-04 08:47:17 +01:00
David Heinemeier Hansson dd3b64ef7f Extract the confirmation into its own file 2025-10-31 14:33:54 +01:00
David Heinemeier Hansson 407d283cb7 Rephrase 2025-10-29 10:58:24 +01:00
David Heinemeier Hansson 7770f49c1a Looks better without margin 2025-10-28 18:20:39 +01:00
Ryan Hughes ef0a9464a2 Back to default colors here 2025-10-27 19:05:01 -04:00
Ryan Hughes b75e70fb9b Add an update confirmation
Will prevent some users from accidentally clicking the update icon only
to terminate and wind up in a broken state.
2025-10-27 18:12:35 -04:00
Ryan Hughes 413d292f2a Improve update error catching 2025-10-23 21:33:23 -04:00
David Heinemeier Hansson 2719db01f9 Separate out the bulk of omarchy-update so we can get any changes from git to it first
Also run migrate after we have updated system packages
2025-09-15 21:58:11 +02:00
David Heinemeier Hansson a66e8ebebd Stop restarting waybar entirely on updates
This had problems and like this we also won't have an ugly flash
2025-09-10 16:00:14 +02:00
David Heinemeier Hansson a50041721c Just sync time together with timezone 2025-08-25 12:09:49 +02:00
David Heinemeier Hansson e3bda8a970 Ensure time has been synced before updating so we don't get SSL errors 2025-08-25 11:58:19 +02:00
David Heinemeier Hansson d031237b42 Sync clock before doing an update 2025-08-25 11:57:01 +02:00
David Heinemeier Hansson f1af28f10d Simplify guard against an unavailable AUR 2025-08-24 17:41:41 +02:00
David Heinemeier Hansson aa32b147ad Ensure package repositories are available before installing or doing updates 2025-08-24 12:10:07 +02:00
Ryan Hughes 193797393f Exit if you don't have snapper but continue update 2025-08-23 19:16:47 +02:00
Ryan HughesandDavid Heinemeier Hansson d4403051cf Add Limine + Snapper support (#998)
* Persist urgent notifications

* Create omarchy-snapshot

* Create snapshot before pulling

* Extract alternative bootloader configs

* Add limine-snapper config

* Fix check

* Update login scripts

* Make chroot friendly

* Extract cmdline instead of using blkid due to error

* Add restore command

* Export $TERMINAL so we get clickable restore notifications

* Remove sync -- causes errors...we have nothing to sync yet

* Executable

* Minor cleanup and compatibility for non-ISO

* Give login its own section

* Give no-arg guard and inline commands

---------

Co-authored-by: David Heinemeier Hansson <david@hey.com>
2025-08-23 16:52:25 +02:00