-
Notifications
You must be signed in to change notification settings - Fork 210
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
chef_secrets for data collector #1131
Conversation
ngx.req.set_header("x-data-collector-auth", "version=1.0") | ||
-- Secrets are provided by chef_secrets and will be preloaded into the environment. | ||
ngx.req.set_header("x-data-collector-token", os.getenv("DATA_COLLECTOR_TOKEN")) | ||
ngx.req.set_header("x-data-collector-auth", "version=1.0")gT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stray: gT
if res.status == ngx.HTTP_OK then | ||
ngx.var.upstream = '<%= URI.parse(node['private_chef']['data_collector']['root_url']).scheme %>://data-collector' | ||
ngx.req.set_uri('<%= URI.parse(node['private_chef']['data_collector']['root_url']).path %>') | ||
ngx.req.set_header("x-data-collector-token", "<%= node['private_chef']['data_collector']['token'] %>") | ||
-- Secrets are provided by chef_secrets and will be preloaded into the environment. | ||
ngx.req.set_header("x-data-collector-token", os.getenv("DATA_COLLECTOR_TOKEN")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can make sure we don't look this up on every request. It should be cheap, either way though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well we've thought that before and stuff got mysterious. I'd prefer this to go the redis password route...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do it similarly. If we do it in confg.lua it should only ever need to run once.
def confirm_continue!(message) | ||
require 'highline' | ||
if ARGV.delete("--yes") | ||
exit(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you want to return here rather than exit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed I do.
if !HighLine.agree("Would you like to continue (y/n)? ") | ||
exit(0) | ||
end | ||
add_command_under_category "set-data-collector-token", "Secrets Management", "Set or change the data collector token", 2 do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to this command we probably need to ingest existing attrs.
ac58fe7
to
ec8f899
Compare
c64e28e
to
db14071
Compare
Signed-off-by: Marc A. Paradise <[email protected]>
- Ensure priv dir exists - Fix badmatch on ensure_all_started Signed-off-by: Steven Danna <[email protected]>
Signed-off-by: Stephan Renatus <[email protected]>
db14071
to
3350262
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stevendanna and I have paired on changing what we'd wanted to see changed and done some testing. LGTM.
Relatively untested WIP.
Signed-off-by: Marc A. Paradise [email protected]