Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

"set :use_sudo, false" appears to be broken #211

Closed
tboyko opened this Issue · 10 comments

7 participants

@tboyko

Running cap deploy:setup requests sudo password even when :use_sudo has been set to false.

See issue here: http://stackoverflow.com/questions/10761534/capistrano-using-sudo-even-with-set-use-sudo-false

@leehambley
Owner

cap deploy:setup can't work without sudo, it requires sudo (of course) to create, and change the access mode on the directories to be installed to. No un-privilidged user should have permission to be doing those things. :use_sudo refers to the standard deployments.

@leehambley leehambley closed this
@dekz

Err, this seems to cascade and fail on mkdir with sprinkle. An under privileged user shouldn't be able to make directories?

@radfahrer

So how do I figure out what deploy:setup is trying to do, so I can do it with my "un-privileged user", and or have IT do for me?

@leehambley
Owner
@radfahrer

Got it figured out, just seems odd that only certain tasks ignore the :use_sudo option. Consistency would be nice.

@jansegre

That shouldn't be up to capistrano to decide, on my current setup all relevant directories belong to the deployer, all setup commands can be run from the deployer user.

As far as I can tell it's secure and probably more secure than adding the user to sudoers or whitelisting chmod and mkdir on sudo for that user.

@dsdobrzynski

I agree that this shouldn't be up to Capistrano to decide. Users should be able to set the permissions and work with different server setups.

@andrewpwade

I am in the same position as jansegre and I agree.

@leehambley
Owner

FWIW, this ticket refers to Capistrano v2 which is unsupported since October 2013.

@andrewpwade

Ah, I didn't pick up on that. I guess I'm using v3 incorrectly. Thanks!

@yyyc514 yyyc514 referenced this issue from a commit in sprinkle-tool/sprinkle
@yyyc514 yyyc514 fix capistrano :use_sudo setting
- explicit `set :use_sudo, true` in Capistrano should now trigger use of sudo
- anyone previously using :run_method should switch to :use_sudo
- :run_method is technically what Capistrano (and Sprinkle) use to decide
  how to run commands, but :run_method examines the :use_sudo setting to
  help make it's decision.  No need to mess with :run_method directly.
- Note: :use_sudo in Sprinkle::Capistrano defaults to false (unlike raw
  Capistrano, which defaults to true)

Resolves:
capistrano/capistrano#211
32325b8
@magnetised magnetised referenced this issue from a commit in magnetised/sprinkle
@yyyc514 yyyc514 fix capistrano :use_sudo setting
- explicit `set :use_sudo, true` in Capistrano should now trigger use of sudo
- anyone previously using :run_method should switch to :use_sudo
- :run_method is technically what Capistrano (and Sprinkle) use to decide
  how to run commands, but :run_method examines the :use_sudo setting to
  help make it's decision.  No need to mess with :run_method directly.
- Note: :use_sudo in Sprinkle::Capistrano defaults to false (unlike raw
  Capistrano, which defaults to true)

Resolves:
capistrano/capistrano#211
47c33f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.