Skip to content

Offer to reboot when toggling sudoless Docker; show only the relevant menu entry - #8098

Merged
dhh merged 2 commits into
quattrofrom
sudoless-docker-toggle
Aug 24, 2026
Merged

dhh merged 2 commits into
quattrofrom
sudoless-docker-toggle

Conversation

@omarchybot

Copy link
Copy Markdown
Collaborator

Follow-up to #8056 / #8080.

Two fixes for toggling sudoless Docker.

Reboot to apply. A docker group change is only picked up by a fresh session, and in practice a logout or newgrp isn't enough — only a reboot reliably applies it. So omarchy-setup-security-sudoless-docker and omarchy-remove-security-sudoless-docker now flag the reboot and offer to do it right away with a gum confirm (the same shape as the GPU toggle), and the notices say "after a reboot" rather than pointing at logout/newgrp. The existing-user migration reuses the removal command inside omarchy update, so it passes OMARCHY_DEFER_REBOOT to skip the prompt there — omarchy-update-restart still handles the reboot once the whole update has finished, instead of cutting it short.

Only the entry you need. Setup > Security showed Sudoless Docker under both Setup and Remove. The Setup entry is now conditioned on the group being absent (Remove already conditions on it being present), so exactly one shows: Setup when it's off, Remove when it's on.

🤖 Generated by Opus 4.8 in Claude Code.

… menu entry

Group membership only takes effect on a fresh session, and in practice a logout
or newgrp isn't enough — only a reboot reliably applies it. So the setup/remove
commands now flag the reboot and offer to do it now with a gum confirm (like the
GPU toggle), and the notices say "after a reboot" instead of pointing at logout
or newgrp. The existing-user migration passes OMARCHY_DEFER_REBOOT so it does not
prompt mid-update — omarchy-update-restart still handles the reboot once the whole
update finishes.

The Setup > Security menu also showed Sudoless Docker under both Setup and
Remove. Condition the Setup entry on the group being absent (Remove already
conditions on it being present), so only the applicable one appears.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gb7x6poap4hGCndPx5qt5T
Copilot AI balanced review requested due to automatic review settings August 24, 2026 19:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds reboot handling for Docker group changes and conditionally displays the sudoless Docker menu action.

Changes:

  • Offers or defers reboot after toggling group membership.
  • Adds menu visibility guards.
  • Expands toggle and migration tests.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
bin/omarchy-setup-security-sudoless-docker Offers reboot after setup.
bin/omarchy-remove-security-sudoless-docker Offers reboot after removal.
migrations/1787580187.sh Defers migration-triggered reboot.
default/omarchy/omarchy-menu.jsonc Guards the Setup menu entry.
test/shell.d/docker-group-migration-test.sh Tests deferred migration reboot.
test/shell.d/sudoless-docker-toggle-test.sh Tests toggle and reboot behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread default/omarchy/omarchy-menu.jsonc Resolved
Comment thread migrations/1787580187.sh Resolved
Every place that chooses between talking to Docker directly and elevating was
testing group membership by hand, and the menu guards tested the wrong thing:
they read the running session's groups, which do not change until the reboot,
so after enabling sudoless Docker the menu still offered Setup — the one action
that could no longer do anything — while Remove stayed hidden.

Add omarchy-sudo-docker as the single answer, with the two questions that
actually differ in that window. By default it asks whether this session can
reach the socket, which is what decides if a command must elevate: lazydocker
and the Windows VM keep prompting until the reboot lands. With --configured it
asks whether the account is set up for sudoless Docker, which is what the menu
and the toggles need, so the menu switches to the action that can change state
as soon as the group is written.

Also correct a comment: nothing surfaces reboot-required in the bar; it is
omarchy-update-restart that reads it during a later update.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gb7x6poap4hGCndPx5qt5T
@dhh
dhh merged commit 06a3dbc into quattro Aug 24, 2026
3 checks passed
@dhh
dhh deleted the sudoless-docker-toggle branch August 24, 2026 19:58
omarchybot added a commit that referenced this pull request Aug 25, 2026
… menu entry (backport of #8098)

Backport of the sudoless Docker follow-up (PR #8098, merged to quattro as
06a3dbc) onto the v4-0-1 release branch, on top of the #8056 and #8080
backports it follows.

Group membership only takes effect on a fresh session, and in practice a logout
or newgrp is not enough -- only a reboot reliably applies it. The setup and
remove commands now flag the reboot and offer to do it right away with a gum
confirm, the same shape as the GPU toggle, and their notices say "after a
reboot" instead of pointing at logout or newgrp. The existing-user migration
reuses the removal command inside omarchy update, so it passes
OMARCHY_DEFER_REBOOT to skip the prompt there and lets omarchy-update-restart
handle the reboot once the whole update has finished.

Setup > Security showed Sudoless Docker under both Setup and Remove, and the
guards tested the running session's groups, which do not change until the
reboot: after enabling sudoless Docker the menu still offered Setup, the one
action that could no longer do anything, while Remove stayed hidden. Add
omarchy-sudo-docker as the single answer to both questions that differ in that
window -- by default whether this session can reach the socket, which is what
decides if a command must elevate, and with --configured whether the account is
set up for it, which is what the menu and the toggles need. It succeeds when
sudo is needed, so the Setup entry appears while sudoless Docker is off and
Remove once it is on. lazydocker and the Windows VM keep prompting until the
reboot lands.

Clean cherry-pick on top of the earlier backports: every file is byte-identical
to quattro except default/omarchy/omarchy-menu.jsonc, which merged into this
branch's menu and whose two Sudoless Docker lines match quattro exactly.
test/shell passes: 188 files, including the two this adds. test/cli passes, so
the new command's metadata is well-formed. Exercised the helper here: with no
socket it reports sudo is needed, and --configured answers from the account's
groups.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_018DEMYa9UWtroz93DhMTtcV
@omarchybot omarchybot mentioned this pull request Aug 25, 2026
nick1udwig pushed a commit to nick1udwig/omarchy that referenced this pull request Sep 9, 2026
… menu entry (omacom#8098)

* Offer to reboot when toggling sudoless Docker; show only the relevant menu entry

Group membership only takes effect on a fresh session, and in practice a logout
or newgrp isn't enough — only a reboot reliably applies it. So the setup/remove
commands now flag the reboot and offer to do it now with a gum confirm (like the
GPU toggle), and the notices say "after a reboot" instead of pointing at logout
or newgrp. The existing-user migration passes OMARCHY_DEFER_REBOOT so it does not
prompt mid-update — omarchy-update-restart still handles the reboot once the whole
update finishes.

The Setup > Security menu also showed Sudoless Docker under both Setup and
Remove. Condition the Setup entry on the group being absent (Remove already
conditions on it being present), so only the applicable one appears.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gb7x6poap4hGCndPx5qt5T

* Ask omarchy-sudo-docker whether Docker needs sudo

Every place that chooses between talking to Docker directly and elevating was
testing group membership by hand, and the menu guards tested the wrong thing:
they read the running session's groups, which do not change until the reboot,
so after enabling sudoless Docker the menu still offered Setup — the one action
that could no longer do anything — while Remove stayed hidden.

Add omarchy-sudo-docker as the single answer, with the two questions that
actually differ in that window. By default it asks whether this session can
reach the socket, which is what decides if a command must elevate: lazydocker
and the Windows VM keep prompting until the reboot lands. With --configured it
asks whether the account is set up for sudoless Docker, which is what the menu
and the toggles need, so the menu switches to the action that can change state
as soon as the group is written.

Also correct a comment: nothing surfaces reboot-required in the bar; it is
omarchy-update-restart that reads it during a later update.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gb7x6poap4hGCndPx5qt5T

---------

Co-authored-by: David Heinemeier Hansson <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants