Skip to content

fix(dde): drop sudo wrapper around dde system:install - #95

Merged
sbaerlocher merged 1 commit into
mainfrom
fix/setup-dde-chown-after-system-install
Apr 30, 2026
Merged

sbaerlocher merged 1 commit into
mainfrom
fix/setup-dde-chown-after-system-install

Conversation

@sbaerlocher

Copy link
Copy Markdown
Owner

Summary

Remove the sudo --preserve-env=... wrapper around dde system:install
in setup-dde. The upstream README runs the command unprivileged; dde
escalates internally (passwordless sudo) for the steps that actually
need root (mkcert CA, DNS resolver tweak).

Why

Wrapping the whole command in sudo had two side effects:

  1. State files end up root-owned. The next unprivileged
    dde project:up then fails with Permission denied when trying to
    overwrite the generated dnsmasq config:

    [ERROR] Cannot rename "/tmp/dnsmasq.conf..." to
            "/home/runner/.dde/data/dnsmasq/dnsmasq.conf":
            Permission denied
    

    Observed in sbaerlocher/savvy#102
    once the action-resolution bug fixed in fix(dde): reference setup-dde via full repo path in project-up #93 stopped masking it.

  2. The --preserve-env=HOME,USER,DDE_CONFIG_DIR,DDE_DATA_DIR workaround
    exists only because of the sudo wrap; dropping the wrap drops the
    workaround.

Test plan

  • CI passes on this PR (note: test-actions-dde.yml runs
    system-install: 'false', so this code path is not directly
    covered — see follow-up below).
  • After merge + 2026-04-28 tag-move: re-run the failing
    savvy E2E job
    and confirm dde project:up proceeds past the dnsmasq config step.

Follow-ups

  • The self-test workflow uses system-install: 'false', so this code
    path is not exercised in this repo's CI. Adding a smoke job that
    runs system:install on ubuntu-latest would close the gap.

Comment thread .github/actions/setup-dde/action.yml Resolved
`setup-dde` was wrapping `dde system:install` in
`sudo --preserve-env=HOME,USER,...`, but the upstream README runs the
command unprivileged (`dde system:install`). dde escalates internally
for the individual steps that actually need root — mkcert CA install
and the DNS resolver tweak — using passwordless sudo, which
GitHub-hosted runners provide.

Wrapping the whole command in `sudo` had two side effects we no
longer want:

1. State files written under $HOME/.dde end up root-owned. The next
   unprivileged `dde project:up` then fails with `Permission denied`
   when trying to overwrite the generated dnsmasq config — observed
   in sbaerlocher/savvy#102 once the action-resolution bug fixed in
   #93 stopped masking it.
2. The --preserve-env workaround for HOME/USER/DDE_CONFIG_DIR/
   DDE_DATA_DIR exists only because of the sudo wrap; dropping the
   wrap drops the workaround.

Update the input description so callers know what dde needs from the
host (Docker + passwordless sudo for dde's internal calls), and add a
short comment explaining why this step is intentionally not under sudo.

Signed-off-by: Simon Bärlocher <[email protected]>
@sbaerlocher
sbaerlocher force-pushed the fix/setup-dde-chown-after-system-install branch from 533bf34 to 4e21c57 Compare April 30, 2026 15:49
@sbaerlocher

Copy link
Copy Markdown
Owner Author

Doku-Hinweise adressiert (force-push):

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All raised issues have been addressed.

@sbaerlocher
sbaerlocher merged commit 0866659 into main Apr 30, 2026
6 checks passed
@sbaerlocher
sbaerlocher deleted the fix/setup-dde-chown-after-system-install branch April 30, 2026 15:52
sbaerlocher added a commit that referenced this pull request Apr 30, 2026
CHANGELOG.md: add the action-resolution fix shipped in #93 to the
2026-04-30 release. Both fixes (#93 and #95) are merged into a single
`### Fixed` block placed after `### Changed (BREAKING)`, matching the
Keep-a-Changelog conventional ordering. The 2026-04-30 release block
now reads: rename (BREAKING), then the two fixes.

README.md / AGENTS.md: bump the "Last updated" markers from
2026-04-28 to 2026-04-30. The AGENTS.md `Version` field is left at
1.3.0 — its meaning (doc-scoped semver vs. release marker) is
unresolved and shouldn't be decided in a docs-bump PR; tracked as a
follow-up.

Signed-off-by: Simon Bärlocher <[email protected]>
sbaerlocher added a commit that referenced this pull request Apr 30, 2026
CHANGELOG.md: add the action-resolution fix shipped in #93 to the
2026-04-30 release. Both fixes (#93 and #95) are merged into a single
`### Fixed` block placed after `### Changed (BREAKING)`, matching the
Keep-a-Changelog conventional ordering. The 2026-04-30 release block
now reads: rename (BREAKING), then the two fixes.

README.md / AGENTS.md: bump the "Last updated" markers from
2026-04-28 to 2026-04-30. The AGENTS.md `Version` field is left at
1.3.0 — its meaning (doc-scoped semver vs. release marker) is
unresolved and shouldn't be decided in a docs-bump PR; tracked as a
follow-up.

Signed-off-by: Simon Bärlocher <[email protected]>
sbaerlocher added a commit to sbaerlocher/savvy that referenced this pull request May 15, 2026
`dde system:install` writes a `/etc/systemd/resolved.conf.d/` drop-in but
does not escalate for that path on GitHub-hosted runners — mkdir fails
with `Permission denied` and the step exits 1 even though dnsmasq and
traefik came up fine. Chmod the parent dir to o+w before the install so
the unprivileged dde process can create the drop-in directory itself.

This is the same shape of fix as the dnsmasq perms workaround in
sbaerlocher/.github#95 and should be removed once whatwedo/dde
escalates internally for the systemd-resolved config path.
sbaerlocher added a commit to sbaerlocher/savvy that referenced this pull request May 15, 2026
`dde system:install` configures systemd-resolved with a drop-in and then
restarts the service, but does not escalate for either step on
GitHub-hosted runners — the install fails first with
`mkdir(): Permission denied` on `/etc/systemd/resolved.conf.d`, and then
(once mkdir works) with `Failed to restart systemd-resolved.service:
Interactive authentication required.`. In both cases dnsmasq and
traefik already came up fine; the resolver failure is what flips the
step's exit code to 1.

Two minimal workarounds, both targeted at the runner only:
* `chmod o+w /etc/systemd` so the unprivileged dde process can create
  the drop-in directory.
* polkit rule for `systemd-resolved.service` so the same process can
  restart it without an interactive prompt.

This parallels the dnsmasq fix in sbaerlocher/.github#95 and should be
removed once whatwedo/dde escalates internally for these paths.
sbaerlocher added a commit to sbaerlocher/savvy that referenced this pull request Jun 10, 2026
`dde system:install` configures systemd-resolved with a drop-in and then
restarts the service, but does not escalate for either step on
GitHub-hosted runners — the install fails first with
`mkdir(): Permission denied` on `/etc/systemd/resolved.conf.d`, and then
(once mkdir works) with `Failed to restart systemd-resolved.service:
Interactive authentication required.`. In both cases dnsmasq and
traefik already came up fine; the resolver failure is what flips the
step's exit code to 1.

Two minimal workarounds, both targeted at the runner only:
* `chmod o+w /etc/systemd` so the unprivileged dde process can create
  the drop-in directory.
* polkit rule for `systemd-resolved.service` so the same process can
  restart it without an interactive prompt.

This parallels the dnsmasq fix in sbaerlocher/.github#95 and should be
removed once whatwedo/dde escalates internally for these paths.
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.

1 participant