I\'d like to copy my config.yml file from my local django app directory to my heroku server, but I\'m not sure how to get the user@host.com format for heroku.
I\'ve tri
As @tamas7 said it's firewalled, but your local machine is probably also firewalled. So unless you have a private server with SSH accessible from the Internet, you won't be able to scp.
I'm personally using transfer.sh free and open source service.
Upload your config.yml
to it:
$ curl --upload-file ./config.yml https://transfer.sh/
https://transfer.sh/66nb8/config.yml
Then download it back from wherever you want:
$ wget https://transfer.sh/66nb8/config.yml
Expanding on tamas7's answer:
You can connect to your computer from the heroku server.
If your computer is behind a router, you'll also need to forward the connection to your computer.
ssh
connectionsOn my mac it was as simple as enabling it in the Preferences / Sharing
panel.
Go to your router's settings page in your browser (typically 192.168.0.1
but varies depending on the router). Find the port forwarding section and forward some port to your computer on port 22
.
This is how it looked on my tp-link:
Here I am making sure that port 22000
is forwarded to my computer (192.168.0.110
) on port 22
.
Simply google "what is my IP".
heroku run bash
scp -P 22000 your_user@your_external_IP:/path/to/your/file .
Once you're done it's probably good practice to disable the port forwarding and remote login.
If you need to download your entire repo, for example to recover an app that you no longer have locally, use heroku git:clone -a myapp
. Docs.
According to http://www.evans.io/posts/heroku-survival-guide/ incoming connections are firewalled off. In this case you need to approach your local machine from the Heroku server.
heroku run bash
scp user@mylocalmachine:/home/user/dir/file.txt .
This is a bit late to answer this question, but I use services like localtunnel
- https://localtunnel.github.io/www/ to copy files from local machine to heroku.
First, run a python HTTP server in the directory where the file is located.
cd /path/to/file
python3 -m http.server
This starts a server in port 8000. Configure localtunnel to connect to that port.
lt -s mylocal -p 8000
Now from your heroku machine, you can fetch the file via curl.
curl -XGET http://mylocal.localtunnel.me/myfile.txt > myfile.txt