My web application runs on Google App Engine (standard environment) and the purpose of it is to make automatic modifications to a certain Github private repository and push the commits.
In order to do this, I set up SSH public/private keys, uploaded the public key to Github and now I want to copy the private key into the web application's server's filesystem (essentially server of GAE) so that it can clone the repo first and push commits.
The problem is that I don't have access to write to the filesystem as it's running on Google App Engine, so I can't make use of copying the private key to the ~/.ssh
location. The only place I have both read/write access is the tmp folder.
My first approach was seeing if I could copy the private key file into the tmp folder and use the env var GIT_SSH_COMMAND
to specify that key while running the git commands. So something like:
GIT_SSH_COMMAND='ssh -i /path/to/tmp/privatekey' git clone git@github.com:username/test-repo.git
However, when running the application, git is still looking at the folder ~/.ssh
to authenticate, which I do not have access to write on.
My knowledge on ssh and git system is pretty limited - I would like to know if there is a workaround to this, and the application must be running on Google App Engine.