Skip to content

Config store helper #328

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

Closed
wants to merge 2 commits into from
Closed

Conversation

gregod-com
Copy link

This MR allows to define a local executable via the flag --config-helper or EnvVar RANCHER_CONFIG_HELPER to store the rancher config.

The methods to load and write the config are intercepted and by default keep the existing method of storing the config as file on the filesystem. (~/.rancher/cli2.json)
If the flag --config-helper is set to a other values than built-in, the method invokes a call to the defined executable with the argument get to load the config and store to persist the config.

An example config-helper could look like this:

rancher-helper

#!/bin/zsh

case "$1" in
    get)   gopass show -o -y rancher-config ;;
    store) echo $2 | gopass insert -f rancher-config ;;
esac

The motivation for this MR is to allow a secure storage of the credentials found in the rancher config.

@samjustus
Copy link

hi @gregod-com sorry for the delay - is this still something you would like to pursue?

@gregod-com
Copy link
Author

hi @gregod-com sorry for the delay - is this still something you would like to pursue?

Hey @samjustus,

yeah sure. As far as I remember the change was quite small and straight forward. I did/do not have the time to keep a fork of rancher cli open and in sync, bit it should be easy to recreate the PR with my changes. I can have a look in the coming days, if somebody is willing to review.

It would definitely be nice to not have credentials just in clear text on the hard disk anymore 😀

@gregod-com
Copy link
Author

@samjustus I've opened a new PR #441 that is in sync with the current master and adds a few tests and better documentation about the change.
If you have time to review that would be awesome.

@samjustus
Copy link

@gregod-com thanks - we find the new PR promising! Currently our QA team is swamped so we will have to see if we can fit this in right now but indeed we will review and go from there

@gregod-com
Copy link
Author

closing this in favor of #441

@gregod-com gregod-com closed this Jun 1, 2025
@gregod-com gregod-com deleted the config-store-helper branch June 1, 2025 09:10
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.

2 participants