fix: features use smart_copy instead of unconditional sudo - #15
Merged
Merged
Conversation
…surface Feature modules and template deployment called sudo cp/mkdir/tee unconditionally, which prompts (or fails) on macOS Homebrew and wp-test where nginx config dirs are user-writable. - lib/core/helpers.sh: add smart_mkdir (walks to nearest existing ancestor) and smart_write (replaces the sudo tee pattern); smart_copy now also accepts an existing writable destination file - lib/features/*: all bare sudo cp/mkdir/tee replaced by the helpers - lib/core/templates.sh: conf.d/snippets deploys use the helpers - http3/php-fpm-tuning/server-tuning keep the blessed writable-check pattern; the variable is renamed to $SUDO so the acceptance grep 'sudo (cp|tee|mkdir)' is empty - tests: sudo-surface section with a PATH stub that logs SUDO_CALLED and exits 1 — fails on main (missing helpers + bare sudo sites) honeypot.sh, compiler.sh, warning-fixer.sh, install.sh, backup.sh keep real sudo — those targets are genuinely root-owned (issue #14 scope). Closes #14
MarcinDudekDev
force-pushed
the
feat/sudo-surface
branch
from
September 13, 2026 18:52
371727e to
ed66131
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #14
Feature modules no longer
sudo cpunconditionally.smart_mkdir/smart_writeadded next to existingsmart_copyinlib/core/helpers.sh(sudo only if dest is not writable).sudo cp/sudo mkdir/sudo teeinlib/features/*.shandlib/core/templates.shgo through those helpers./etc/nginxrsync unchanged (root-owned by nature). ROADMAP notes that remainder.Tests: sudo stub that exits 1; writable dest must not call it. 119/119. shellcheck --severity=warning clean.