Update #1: I normally add ‘Updates’ at the bottom, but this one simplifies this entire post. Daniel Spiewak was kind enough to point out that simply using the preferred Eclipse Subversion plugin “Subversive” works right out of the box, without any of this monkey-business. I have not confirmed this yet though, but I’d say it’s worth a try before doing all the stuff below.
NOTE: I am using Eclipse 3.2.2 + Subclipse 1.0.5 on Windows XP
So it’s pretty slick that MediaTemple lets you setup Subversion repositories on your (gs) accounts. I did that and followed this document from their Knowledge base to get the repository created. I stopped after this command:
svnadmin create –fs-type fsfs <repo-name>
Because the rest of the work, to create the project dirs, I can do from Eclipse once it’s working.
The problem now is that every time you try and connect to your repository, using a connection string that looks like this:
NOTE: There is a space in the URL above right after <customerdomain.com>, this is intentional to allow the line to wrap so you can read the entire URL. You should not actually include the space in the URL you construct in your subversion client.
NOTE: In the comments at the bottom of the KB page, some user mentions using @ instead of %25 for another SVN client, in Eclipse, you need to use %25.
NOTE: You might notice, while SSH’ed into your MT account, that the actual path to your repository is more along the lines of /home/<site_number>/users/.home/data/<repo-name>. That’s ok, go ahead and use the path above and it still works.
Now, in order to get the actual connection working and have it stop failing in Eclipse, you need to check out this blog entry. It discusses how to setup a proper tunnel for SVN over SSH, which is what Eclipse keeps complaining about.
The trick is to load up your file C:\Documents and Settings\[user_name]\Application Data\Subversion\config in a text editor, go down to the line that looks like:
# ssh = $SVN_SSH ssh
And change it to something like this:
ssh = C:/Program Files/TortoiseSVN/bin/TortoisePlink.exe
NOTE: Using back-slashes instead of front-slashes won’t work on Windows.
You’ll notice I have TortoiseSVN installed, so I’m using the TortoisePlink executable. That might be the easiest thing to do, otherwise if you know what you are doing, feel free to specify something else.
Now that you have that setup, notice that if you attempt your connection in Eclipse again, it will work this time, but prompt you constantly for your password.
So now before we go freaking nuts, check out this article, it tells us how to setup password files for SSH so it stops prompting us. The key seems to be going to the PuTTY Homepage, and downloading PuTTYGen.
After you download PuTTYGen, run it. Tell it to generate a key and move the mouse around to add randomness to the key:
When you are done generating the key, save Private key to a file, then move it someplace safe on your hard drive. Also you can copy the Public key to the clipboard as you will need it later.
Now go back to the blog entry we were reading earlier, and take note of the command:
ssh = [path_to_ssh_client] -2 -i [path_to_private_key_file]
So given that we are using TortoiseSVN already, our version of this string will look like this:
ssh = C:/Program Files/TortoiseSVN/bin/TortoisePlink.exe -2 -i C:/ssh_private_key.ppk
Before we are done, we now need to login to the site using SSH that we want to connect to, and do the following:
- $ mkdir ~/.ssh
- $ cd ~/.ssh/
- $ touch authorized_keys
- Open the authorized_keys file you just created in a text editor.
- Paste the contents of the public key PuTTYGen created for you into the authorized_keys file.
The content you want to paste in Step #5 is from the window in PuTTYGen that tells you to:
NOTE: In the image above, the key is truncated for security reasons, yours will be much longer.
Now when you save that file and try and access the Subversion repository on MediaTemple, you won’t be prompted for a password and it will just work.
And that’s it… all 77 steps of this simple walk through