-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Hostkeys not added for the user code runs as #12
Comments
Coming back to this a while later it looks like the issues are possibly related to changes in buildstep to support apps running as non-root user. Looking at the code for this plugin (and dokku-hostkeys-plugin) it doesn't seem to take this into account in the |
I think the assumption here is that the build phase is run as root and thus you want these keys setup for the root user. |
My use case for adding the keys is so that my application code can access git repositories from GitHub. Do you think this is a valid use case or an abuse of this plugin? |
Meaning your app, at runtime, attempts to access GH repos via SSH? |
Yes. It is granted read access to some private repositories (via adding it's public key generated via dokku-deployment-keys to a member of a team). It needs this access so it can clone those repositories. Does that make sense? |
That's what i created those for in the first place - hostkeys for pure trusted connections to specific hosts (which you need for ssh) and deplyoment-keys for the key management. |
Actually this should work. The plugin places the keys in |
The plugin seems to put the keys in https://github.com/cedricziel/dokku-hostkeys-plugin/blob/master/pre-build#L46 I gues sit should be putting it in I am just trying to reproduce the issue on a fresh VM with the latest versions of dokku and all plugins and I'll update the ticket when I've had a chance to do so... |
Sorry I was looking at the deployment keys plugin as you were mentioning the app attempting to access private github repos. Now re-reading your original issue I see what your talking about. This plugin seems to create the known hosts file with the correct perms. I'm interested to hear what you find. Maybe it's an issue with the top-level config file? |
Everything seems to be working fine now! Embarrassingly I think the main problem was on my side... I misunderstood how Since the key hadn't been added properly then it was prompting to add the real hostkey which got me looking at why that was failing. Sorry for the noise and thanks for the help and the plugin! |
👍 |
When I create a node dokku app the code runs as a user
u2079
(but the name of the user seems to vary with each deployment). When node calls a script which tries togit push
it doesn't work because the user in question hasn't accepted the host keysThe text was updated successfully, but these errors were encountered: