Added a non-root precondition to _preflight in Taskfile.yml, which is the shared dependency for all local task commands (analyze, test, test-widget, build-linux, check, etc.). This is the single choke point that rejects root before any local work begins.
Added an identical id -u guard to five scripts that can be invoked directly outside of task: deploy.sh, scripts/setup_dagger_remote.sh, stalwart-dev/test.sh, stalwart-dev/integration_ui_test.sh, stalwart-dev/integration_android_test.sh.
Added rm -f ~/.ssh/dagger_key before the write in scripts/setup_dagger_remote.sh so an existing stale file or symlink is cleanly removed rather than clobbered via redirection.
No SSH-as-root patterns were found in any scripts (audit passed clean — setup_dagger_remote.sh uses dagger@$DAGGER_ENGINE_HOST, deploy.sh uses the configurable $SSH_USER, and DEVELOPMENT.md already recommends ssh $DEV_USER@localhost).
Test plan
Verify task check (or any task command) prints "Do not run as root" and exits non-zero when run as root.
Verify stalwart-dev/test.sh and sibling scripts print the same error when run as root.
Closes #414
## Summary
- Added a non-root precondition to `_preflight` in `Taskfile.yml`, which is the shared dependency for all local `task` commands (`analyze`, `test`, `test-widget`, `build-linux`, `check`, etc.). This is the single choke point that rejects root before any local work begins.
- Added an identical `id -u` guard to five scripts that can be invoked directly outside of `task`: `deploy.sh`, `scripts/setup_dagger_remote.sh`, `stalwart-dev/test.sh`, `stalwart-dev/integration_ui_test.sh`, `stalwart-dev/integration_android_test.sh`.
- Added `rm -f ~/.ssh/dagger_key` before the write in `scripts/setup_dagger_remote.sh` so an existing stale file or symlink is cleanly removed rather than clobbered via redirection.
No SSH-as-root patterns were found in any scripts (audit passed clean — `setup_dagger_remote.sh` uses `dagger@$DAGGER_ENGINE_HOST`, `deploy.sh` uses the configurable `$SSH_USER`, and `DEVELOPMENT.md` already recommends `ssh $DEV_USER@localhost`).
## Test plan
- [ ] Verify `task check` (or any `task` command) prints "Do not run as root" and exits non-zero when run as root.
- [ ] Verify `stalwart-dev/test.sh` and sibling scripts print the same error when run as root.
- [ ] Verify normal non-root execution is unaffected.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #414
Summary
_preflightinTaskfile.yml, which is the shared dependency for all localtaskcommands (analyze,test,test-widget,build-linux,check, etc.). This is the single choke point that rejects root before any local work begins.id -uguard to five scripts that can be invoked directly outside oftask:deploy.sh,scripts/setup_dagger_remote.sh,stalwart-dev/test.sh,stalwart-dev/integration_ui_test.sh,stalwart-dev/integration_android_test.sh.rm -f ~/.ssh/dagger_keybefore the write inscripts/setup_dagger_remote.shso an existing stale file or symlink is cleanly removed rather than clobbered via redirection.No SSH-as-root patterns were found in any scripts (audit passed clean —
setup_dagger_remote.shusesdagger@$DAGGER_ENGINE_HOST,deploy.shuses the configurable$SSH_USER, andDEVELOPMENT.mdalready recommendsssh $DEV_USER@localhost).Test plan
task check(or anytaskcommand) prints "Do not run as root" and exits non-zero when run as root.stalwart-dev/test.shand sibling scripts print the same error when run as root.🤖 Generated with Claude Code