-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
grafana-cli: Add ability to read password from stdin to reset admin password #26016
grafana-cli: Add ability to read password from stdin to reset admin password #26016
Conversation
…assword Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Sounds good. Previous work on this have been introducing breaking changes. This doesn't. 👍 |
When I try your branch, I don't see the new option? What am I missing?
|
Oh, maybe it is me who missed something... I tested grafana-cli by running:
|
Oh no, the mistake was actually on my side. For some reason, some |
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
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.
Sorry, last one I promise. I just realized the correlation between scanner.Scan() returning false and scanner.Err()
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
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.
LGTM!
Thanks for contributing to Grafana! |
Signed-off-by: m.nabokikh maksim.nabokikh@flant.com
What this PR does / why we need it:
This PR adds the ability to securely read the password from stdin, either typing or sending it via the pipe. It helps to use the reset-admin-password command in scripts.
Which issue(s) this PR fixes:
Fixes #14076
Special notes for your reviewer:
I understand that the issue is 2 years old, but in my opinion, it deserves to be fixed.
This PR also covers cases to read the password from a file or from an env variable: