Closed elldritch closed 1 year ago
Doppler CLI installs and updates both currently require sudo due to their installing the CLI into your PATH. We have plans to support updating the CLI based on its current location, but currently we only support installing/updating the CLI that's installed globally on your machine.
Thanks for that tip about recommending --debug
output, I'll add that to our bug template.
Doppler CLI installs and updates both currently require sudo
Sure. I'm suggesting that, when installing via package manager, the install script should ask for sudo (e.g. the install script could call sudo rpm -i
) rather than expecting the user to run sudo doppler update
. systemctl
does this when it needs authentication, and wg-quick
does something similar.
(Perhaps alternatively, download the package and then print "run rpm -i PACKAGE_FILE
to finish the install".)
Personally, I am very reluctant to run sudo doppler update
just to get updates. In general, I am reluctant to run arbitrary binaries under sudo
.
due to their installing the CLI into your PATH.
Another possibility is to take the ghcup
-ish approach and install to $HOME/.local/bin
, and then tell the user to add $HOME/.local/bin
to $PATH
.
In either case, I've worked around this by just manually updating my local doppler
from a GH release, so this is not an urgent ask - just some suggestions when you get around to fixing this.
Thanks for that tip about recommending --debug output, I'll add that to our bug template.
Glad I could be helpful!
How can we get around this today and install doppler on arch linux based distros?
@elldritch: Are you happy for me to close out this ticket?
@pedrobonifacio: If your issue is related to installing the CLI on Arch Linux could you open a new ticket or ask for help in the Doppler Community Forum
Here's the result of
doppler update --debug
, running on Arch Linux:My guess is that the problems arise from the following snippets in
install.sh
:Package manager detection: https://github.com/DopplerHQ/cli/blob/ef7601fded3157faa1e6736c667b231c9f6b0509/scripts/install.sh#L144-L150
RPM installation: https://github.com/DopplerHQ/cli/blob/ef7601fded3157faa1e6736c667b231c9f6b0509/scripts/install.sh#L274-L286
There are two problems here:
rpm
installed, that's actually not my primary package manager. My primary package manager ispacman
. I haverpm
installed for development purposes (I totally get that this is an edge case for users).rpm
were my primary package manager,rpm -i
requiressudo
, so this was always doomed to fail.My recommendation is to always try to install into
/usr/local/bin
(or in the location of an existingwhich doppler
), and not bother trying to interact with package managers. On developer workstations, I expect you'll frequently run into the "package manager requires sudo" problem, and in CI or other automated environments (where the user may actually be running as root), your users probably don't want to be automatically downloading and executing an arbitrary update anyway.(As another note, I also manage an open source CLI repository. I've found it very useful to add directions into the bug reporting template to provide the
--debug
output. You might want to do the same.)