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

Support reading client/server secret from an environment variable #18

Merged
merged 1 commit into from
Apr 14, 2022

Conversation

orhun
Copy link
Contributor

@orhun orhun commented Apr 12, 2022

This PR adds env feature to clap for defining custom variables to read the values of --secret arguments from the environment.

  • BORE_SECRET: sets the client/server secret

closes #17

Copy link
Owner

@ekzhang ekzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for doing this! Is there a reason why the environment variable names are different between client and server though, rather than just BORE_SECRET? I can't think of any case where a user would set these two environment variables to different values, since the secret is intended to be the same on both ends.

@orhun
Copy link
Contributor Author

orhun commented Apr 13, 2022

Thank you for doing this! Is there a reason why the environment variable names are different between client and server though, rather than just BORE_SECRET? I can't think of any case where a user would set these two environment variables to different values, since the secret is intended to be the same on both ends.

Good point, I guess I haven't thought of that 🐻

Updated the PR.

@praveenperera
Copy link
Contributor

Thank you for doing this! Is there a reason why the environment variable names are different between client and server though, rather than just BORE_SECRET? I can't think of any case where a user would set these two environment variables to different values, since the secret is intended to be the same on both ends.

Could someone maybe use bore to hope traffic between a few servers? That's the only reason I could see both bore client and server being used on the same machine.

@gngeorgiev
Copy link

@praveenperera You can just reassign the env variable per each instance:

BORE_SECRET=$BORE_CLIENT_SECRET ./client
BORE_SECRET=$BORE_SERVER_SECRET ./server

@ekzhang
Copy link
Owner

ekzhang commented Apr 14, 2022

Thank you!

@ekzhang ekzhang merged commit cae08bb into ekzhang:main Apr 14, 2022
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.

Feature request: read server secret from environment variable
4 participants