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 password as docker secrets #22

Open
m0rtalis opened this issue Apr 26, 2021 · 2 comments
Open

Add support for password as docker secrets #22

m0rtalis opened this issue Apr 26, 2021 · 2 comments

Comments

@m0rtalis
Copy link
Contributor

Hi,
would like to include the mangement api key as docker secret into the container instead of having to expose the password in the environments section of my docker-compose file.

I would imaging using an environments variable like OPENVPNMONITOR_SITES_<INDEX>_PASSWORD_FILE=/run/secrets/mngmt-key to point to the secret.

Since conf.d does not support multiple backends we would need to iterate the environment variables as shown here and call a function like this to expose the correct env-var before calling confd in entrypoint.sh.
Also the key should be ignored in confd/templates/openvpn-monitor.conf.tmpl#L25 (or it needs a name not starting with OPENVPNMONITOR_SITES).

show_disconnect={{- getv (printf "/openvpnmonitor/sites/%s/%s" $i "showdisconnect") -}}
{{- else -}}
{{- $property }}={{- getv (printf "/openvpnmonitor/sites/%s/%s" $i $property) -}}

I can create a PR for this if you want to implement it as suggested.

@ruimarinho
Copy link
Owner

That would be great, @m0rtalis!

@mrquincle
Copy link

How to actually write the password in the environment section? What's the syntax?

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