DopplerHQ / cli

The official CLI for interacting with your Doppler secrets and configuration.
https://docs.doppler.com
Apache License 2.0
214 stars 43 forks source link

[FEATURE] Allow baseConfigDir to be configurable #323

Closed jgautsch closed 1 year ago

jgautsch commented 1 year ago

Is your feature request related to a problem? Please describe.

I'm trying to run doppler run in a docker container with USER nobody. However this fails with message Doppler Error: mkdir /nonexistent/.doppler: no such file or directory. This is due to baseConfigDir = utils.HomeDir() in config.go calling out to os.UserHomeDir() which for nobody is /nonexistent (which is not writable).

Describe the solution you'd like

A flag that lets me specify what baseConfigDir should be.

Describe alternatives you've considered

My options right now are to not use nobody, or to manually set $HOME so os.UserHomeDir() returns something I've prepared to be writable (this feels hacky).

Additional context

N/A

ryan-blunden commented 1 year ago

Hi @jgautsch,

If the base config directory needs to be explicitly set, I'd recommend the equivalent of what you're needing by setting the HOME env var inline:

HOME=/tmp doppler run -- start server

Would this be a sufficient workaround?