Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Option to disable "root warning" message. #3760

Closed
envygeeks opened this issue Jun 18, 2015 · 9 comments
Closed

Option to disable "root warning" message. #3760

envygeeks opened this issue Jun 18, 2015 · 9 comments

Comments

@envygeeks
Copy link

It would be cool if we could get an option to disable the root warning message. In the past this message served a useful purpose (even though I always felt that if it didn't pre-warn about sudo it didn't matter anyways) but now that a lot of people are using Docker it's quite common to install gems as root (we do before we drop down to a normal user because it's the startup that's invoking bundler not the user.)

@envygeeks
Copy link
Author

Google might have failed me but I did search for this option before asking for it.

@segiddins
Copy link
Member

Why would that mean installing as root is a good idea?

@envygeeks
Copy link
Author

I'm not trying to be mean here but what is the difference if you're going to sudo without my permission anyways? Defeating the entire purpose of the message, whether you sudo or I sudo it's still going as root so the security doesn't even exist at that point.

@envygeeks
Copy link
Author

All I'm asking for is the option to disable the message because technically it serves no purpose except to cruft our logs when building a docker image for users where startup is done as root, and sure we could sudo into a user just to have you sudo back into root but did you read that "sudo to another user to have bundler sudo as root..."

@agis
Copy link
Contributor

agis commented Oct 22, 2015

@envygeeks I believe the warning's purpose is letting users (mostly newcomers) that run bundler as sudo know that installing as root is not a good idea. The question here is if it worth it adding an option for that specific kind of warnings and for that specific use-case (ie. Docker).

I assume other lines also cruft logs when building a docker image, for example: "Use bundle show [gemname] to see where a bundled gem is installed". Personally I don't think adding specific options for specific warnings is a good idea (that's what --quiet is for) but let's see what @segiddins has to say.

P.S. There is already the --quiet switch that will, among other things, silence the root warning.

@envygeeks
Copy link
Author

I requested an option but I don't know if it needs to be an option, maybe just an environment variable like Debian does (or did actually) with RubyGems where you would be like "REALLY_GEM_UPDATE_SYSTEM" except "SILENCE_ROOT_WARNING=true" would just be detected by the sudo warning and skipped.

I agree that adding a dedicated option is probably too much to ask for, but maybe just a simple targeted environment variable would be easier to implement and require far less work.

@segiddins
Copy link
Member

A pr to that effect, with tests, would probably be mergable!

@envygeeks
Copy link
Author

I will happily send one sometime this weekend when I have time, thanks!

@cbliard
Copy link

cbliard commented Jan 8, 2016

I think this has been addressed by #4113

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants