Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python | heroku | how to access packages over ssh

Hi heroku python people,

I want my heroku app to access shared private libraries in my github account.

So I would like to have a requirements.txt file that looks like this ...

# requirements.txt
requests==1.2.2
-e git+ssh://[email protected]/jtushman/dict_digger.git#egg=dict_digger

And I would like it to use a ssh key that I upload with heroku keys:add or have some mechanism to get a private key from the heroku cli.

Right now I get the following error (which is I guess expected):

Host key verification failed.

It does work if I do (per @kenneth_reitz's https://stackoverflow.com/a/9136665/192791):

-e git+https://username:[email protected]/jtushman/dict_digger.git#egg=dict_digger

But it is really unworkable for me to put credentials in my requirements.txt file

Has anyone come up with a nice solution for this?


I have also posted an issue on the heroku python buildpack project here

like image 951
Jonathan Avatar asked Nov 12 '22 01:11

Jonathan


1 Answers

Kenneth, the maintainer of heroku's python buildpack said the following (and I am cutting and pasting here)

I would currently recommend the way mentioned (git over https)

Using the key you have registered with heroku would be cool, but unfortunately, you would have to provide your private key for this to work. Quite undesirable.

However, you could also write your keys into a .ssh folder in your app or use .profile scripts to facilitate this.

Can see the full thread here: https://github.com/heroku/heroku-buildpack-python/issues/97

like image 178
Jonathan Avatar answered Nov 14 '22 23:11

Jonathan