Skip to content

Instantly share code, notes, and snippets.

@3on
Created July 3, 2012 21:06
Show Gist options
  • Save 3on/3043124 to your computer and use it in GitHub Desktop.
Save 3on/3043124 to your computer and use it in GitHub Desktop.
tunnel-on-dotcloud in few steps
// 1. clone the tunnel-on-dotcloud repo to get the config files
git clone git://github.com/3on/tunnel-on-dotcloud.git
cd tunnel-on-dotcloud
// 2. create a dotCloud app
dotcloud create webtunnel
// 3. push on dotCloud
dotcloud push webtunnel
// if you try to access the given url yet you get a 502 error, which normal since you have not opened yet the tunnel
// 4. grab the infos needed
dotcloud info webtunnel.proxy
// look for the ssh:// url in the ports section of proxy.0, from which you should grab:
// - the user (should be 'dotcloud'), let's call it $USER
// - the hostname (should be something like webtunnel-dotCloudUsername.dotcloud.com, which we'll call $HOST
// - the port (the 4 digits number after the :) which we'll named $PORT
// 5. Open the SSH tunnel on your computer (don't forget to replace $USER $PORT and $HOST)
// if you don't have any webserver running you can just fire up a simple one using the following:
// python -m SimpleHTTPServer
// in the other hand if you have one be careful to replace the local port (8080 here) with the one your webserver is listing on.
ssh -i ~/.dotcloud/dotcloud.key -l $USER -p $PORT $HOST -R 8042:localhost:8080
// if you are lazy like me just alias it in to your .bash_profile or .bashrc
echo "alias webtunnel='ssh -i ~/.dotcloud/dotcloud.key -l $USER -p $PORT $HOST -R 8042:localhost:8080'" >> ~/.bash_profile
@dlehman
Copy link

dlehman commented Mar 13, 2013

DotCloud CLI has been updated, so you no longer need the app name for common commands. Use this instead:

$ dotcloud push
$ dotcloud info
$ dotcloud info proxy

Even so, I cannot get the reverse SSH proxy to work. When I create the app, it creates a /.dotcloud folder in the root of my app. But there is no "dotcloud.key" in the .dotcloud folder. If I enter my dotcloud password at the prompt, it doesn't work either.

Can anyone shed light on what i'm doing wrong? Pretty sure i'm fundamentally misunderstanding something...

@zethussuen
Copy link

Try running find ~/ -name "dotcloud.key" to look for your .key

@anthonyto
Copy link

@dlehman I was running into this too, and I realized in my root directory the generated folder is actually named .dotcloud_cli NOT .dotcloud

Changing this in the ssh script worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment