vicenteguerra / git-deploy

Php Script for Auto-Pull in server (Using WebHook from GitLab, GitHub and Bitbucket)
641 stars 236 forks source link

Issues with www-root user accessing git repo #24

Closed BrandonClapp closed 6 years ago

BrandonClapp commented 6 years ago

Hey, thanks for the script. I think I've just about got it set up and am down to the last details. Upon setting up my github webhooks and testing, the debug.log file indicates that I have issues with my host key.

I'm assuming that this has to do with the SSH key that my www-root user is using to access my github repository. I have used ssh-keygen to generate rsa keys for both my www-root user as well as my normal user. For my normal user, git pull works fine, however when the webhook hits the deploy.php script, I receive the following error.

I tried generating the rsa key for my www-root user in it's home directory at /var/www/.ssh/ and adding the public key to github, but no cigar.

*** AUTO PULL INITIATED ***
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

*** AUTO PULL COMPLETE ***

Any thoughts? I'm not sure if this is an issue with this repo, but perhaps it's an opportunity for more clarification in the readme if it is something really simple.

BrandonClapp commented 6 years ago

After more research, it looks like something similar was going on here: https://github.com/markomarkovic/simple-php-git-deploy/issues/65#issuecomment-168496005

After using the test tool, I guess it added it to my known hosts and allowed me to continue.