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

Add support for reading config parameters from files for use with docker secrets #24

Closed
WisdomWolf opened this issue Jan 18, 2019 · 3 comments

Comments

@WisdomWolf
Copy link

Would like to be able to provide things like client-id, client-secret, and secret from docker secrets stored as files. Could either load the entire config from a file stored as a docker secret or (preferably) have additional environment variable options like the docker example:

  • CLIENT_ID_FILE
  • CLIENT_SECRET_FILE
  • SECRET_FILE

This would enable the use of secrets in a similar fashion to the example:

environment:
       CLIENT_ID_FILE: /run/secrets/oauth_client_id
@thomseddon
Copy link
Owner

Hi,

This can already be done (it's how I pass those secrets :), it's described at the end of the configuration section of the README: https://github.com/thomseddon/traefik-forward-auth/blob/master/README.md#configuration

Let me know if you have any problems

@maximunited
Copy link

I don't think this is working in v2. at least not for me:
I've tried:

PROVIDERS_GOOGLE_CLIENT_ID_FILE=/run/secrets/google_client_id
PROVIDERS_GOOGLE_CLIENT_ID=/run/secrets/google_client_id
CLIENT_ID_FILE=/run/secrets/google_client_id
CLIENT_ID=/run/secrets/google_client_id

@maximunited
Copy link

maximunited commented Jul 18, 2020

I don't think this is working in v2. at least not for me:
I've tried:

PROVIDERS_GOOGLE_CLIENT_ID_FILE=/run/secrets/google_client_id
PROVIDERS_GOOGLE_CLIENT_ID=/run/secrets/google_client_id
CLIENT_ID_FILE=/run/secrets/google_client_id
CLIENT_ID=/run/secrets/google_client_id

answering to myself. The answer was in issue #147
configuring docker-compose works:

    environment:
      CONFIG: /run/secrets/credentials
    secrets:
      - credentials

secrets:
  credentials:
    name: oauth2_credentials
    file: ${SECRETSDIR}/oauth2_credentials.ini

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

3 participants