Skip to content
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

--config flag doesn't work #110

Closed
RazerM opened this issue Aug 22, 2018 · 4 comments
Closed

--config flag doesn't work #110

RazerM opened this issue Aug 22, 2018 · 4 comments

Comments

@RazerM
Copy link

RazerM commented Aug 22, 2018

Oathkeeper ignores the --config parameter:

$ cat ~/.oathkeeper-api.yml
DATABASE_URL: postgres://.../oathkeeper
...
$ oathkeeper serve --config ~/.oathkeeper-api.yml api
FATA[0000] Unable to initialize database connectivity    error="No database URL provided"

It seems this is because viper.SetConfigName unsets configFile:

oathkeeper/cmd/root.go

Lines 74 to 78 in 3c0c862

if cfgFile != "" { // enable ability to specify config file via flag
viper.SetConfigFile(cfgFile)
}
viper.SetConfigName(".oathkeeper") // name of config file (without extension)

@aeneasr
Copy link
Member

aeneasr commented Aug 22, 2018

The intended way is to actually load this from env vars as those are usually not compromised if the filesystem is compromised, and are easier to use in PaaS (Kubernetes, Heroku, ECS) as well as in Docker. It is confusing though that --config exists.

@RazerM
Copy link
Author

RazerM commented Aug 22, 2018

I'm aware of that, --config is still broken though.

@aeneasr
Copy link
Member

aeneasr commented Aug 22, 2018

Do you intend on using --config? I think we'll just remove the option.

@RazerM
Copy link
Author

RazerM commented Aug 22, 2018

No, I was just getting it started for some testing on my local machine. Removal would be fine with me.

aeneasr pushed a commit that referenced this issue Aug 22, 2018
aeneasr pushed a commit that referenced this issue Aug 22, 2018
aeneasr pushed a commit that referenced this issue Aug 24, 2018
aeneasr pushed a commit that referenced this issue Aug 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants