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 cargo ssh keys #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

vasilakisfil
Copy link

This is required if you have private repos in github, otherwise Cargo can't access them. The idea is to export a machine (Github user) ssh key as env var on Heroku. This is not related to Heroku but with cargo itself, how it handles ssh keys. It was first noted by @dignifiedquire in #39

Copy link
Owner

@emk emk 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 the PR! I'd definitely be interested in merging this with one small change.

@@ -78,6 +78,8 @@ EOF
exit 1
fi

eval "$(ssh-agent -s)" && ssh-add
Copy link
Owner

Choose a reason for hiding this comment

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

This looks great! Could you add a small comment here explaining why we need to do this?

Copy link
Author

Choose a reason for hiding this comment

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

This PR makes the buildpack to be able to work in combination with https://github.com/jacobdr/ssh-private-key-buildpack. Basically, when you want to talk to a private repo, you export an SSH_KEY env var and the ssh-private-key-buildpack, will make sure it's written under .ssh/ folder.

Then this line of this buildpack will make sure to start ssh-agent -s for that specifically shell and also make sure to add any existing ssh keys (by running ssh-add) to the ssh agent run by this shell.

Copy link
Owner

Choose a reason for hiding this comment

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

Thank you! If you have a chance, could you please include a version of this comment in the code, so future maintainers know why the code is there, and users can understand how to use it? Thank you very much for figuring this out!

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