New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow a user to issue commands with sudo, fixes #918, fixes #919, fixes #920 #935
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me, thanks! We'll pull this early next week if we don't have qualms after the weekend about possible security issues. Also, need to make ddev-macos build succeed, but I imagine that's the testbot.
docs/users/extending-commands.md
Outdated
@@ -41,6 +41,7 @@ hooks: | |||
post-import-db: | |||
- exec: "drush cc all" | |||
- exec: "drush uli" | |||
- exec: "sudo mkdir /hello" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a post-start with
- exec: sudo apt-get update
- exec: sudo apt-get install -y ghostscript sqlite3 php7.2-sqlite3
The Problem/Issue/Bug:
Users are currently unable to issue privileged commands using ddev.
How this PR Solves The Problem:
This PR gives users the ability to use
sudo
in the web container.Manual Testing Instructions:
With a running ddev project, execute a command that requires root privileges with
ddev exec
. For example,ddev exec apt-get update
should fail due to lack of permissions. Execute the same command with sudo:ddev exec sudo apt-get update
. The command will complete successfully.Automated Testing Overview:
A simple test case that confirms a sudo command can be executed has been added.
Related Issue Link(s):
#918