-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
Support passing puppetdb certificates via environment variables #671
Conversation
ca48187
to
a836d3a
Compare
Codecov Report
@@ Coverage Diff @@
## master #671 +/- ##
==========================================
+ Coverage 88.12% 88.32% +0.19%
==========================================
Files 18 18
Lines 943 959 +16
==========================================
+ Hits 831 847 +16
Misses 112 112
Continue to review full report at Codecov.
|
Thanks @SeanHood! If this works for you then we can merge it. But if you write that:
...then perhaps you should consider implementing support for base64-encoded strings, without line wrapping, as input? This is a common solution for passing file contents in a env variables when the file may contain new lines and you want to avoid having them in the variable because it causes problems. (Yes, I know that the certificates in PEM are internally base64-encoded too but they DO have wrapped lines and thus the new lines.) |
That's a good shout, I'll add that to this PR. As for where I've put this code does it make sense? |
Yes, for this purpose it makes perfect sense. (Of course we could start a long design discussion that because it could be useful for non-dockerized Puppetboard, it should be moved out of |
Please also add docs update, @SeanHood. |
100% onboard with you there. |
6a27fb0
to
c32bd58
Compare
Thanks for the code, @SeanHood, and for the code review, @russellcain! |
Closes #669
Adds support for passing certificates and keys to the following environment variables:
I have tested this in my own environment as per the issue. With the container running in AWS Fargate, certificates being passed as env vars from AWS SSM Parameter store.
I had ran into a couple edge cases where the shell was breaking the new lines. These feel like general environment variable edge cases and not so much an issue with this code.