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

chef_secrets for data collector #1131

Merged
merged 3 commits into from
Mar 10, 2017
Merged

Conversation

marcparadise
Copy link
Member

Relatively untested WIP.

Signed-off-by: Marc A. Paradise [email protected]

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
Copy link
Contributor

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"))
Copy link
Contributor

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.

Copy link
Contributor

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...

Copy link
Member Author

@marcparadise marcparadise Mar 9, 2017

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)
Copy link
Contributor

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.

Copy link
Member Author

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
Copy link
Contributor

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.

@marcparadise marcparadise force-pushed the mp/data-collector-secrets-2 branch from ac58fe7 to ec8f899 Compare March 8, 2017 21:03
@marcparadise marcparadise force-pushed the mp/data-collector-secrets-2 branch 2 times, most recently from c64e28e to db14071 Compare March 9, 2017 15:58
marcparadise and others added 3 commits March 10, 2017 14:05
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]>
@srenatus srenatus force-pushed the mp/data-collector-secrets-2 branch from db14071 to 3350262 Compare March 10, 2017 13:37
Copy link
Contributor

@srenatus srenatus left a 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.

@stevendanna stevendanna merged commit 74d942f into master Mar 10, 2017
@stevendanna stevendanna deleted the mp/data-collector-secrets-2 branch March 13, 2017 09:18
@stevendanna stevendanna restored the mp/data-collector-secrets-2 branch March 13, 2017 09:18
@stevendanna stevendanna deleted the mp/data-collector-secrets-2 branch March 13, 2017 09:20
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

Successfully merging this pull request may close these issues.

3 participants