<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Isshen, LLC: How to do http + ssh with Subversion on Linux</title>
    <link>http://blog.isshen.com/articles/2006/12/16/how-to-do-http-ssh-with-subversion</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>How to do http + ssh with Subversion on Linux</title>
      <description>&lt;p&gt;Originally posted on a private mailing list.&lt;/p&gt;

&lt;p&gt;One of the consequences of having a mobile development station is being able to go to places such as &lt;a href="http://www.panera.com"&gt;Panera's&lt;/a&gt; or the local coffee shop to do development work. These days, it is trivially easy for people to get something similar to Kismet and do packet sniffing ... so I tend to proxy my internet connection through ssh. Fortunately, most of the GUI programs does this -- Firefox, Thunderbird, Gaim, Xchat2.&lt;/p&gt;

&lt;p&gt;Unfortunately, Subversion doesn't.&lt;/p&gt;

&lt;p&gt;We have it set up so that Subversion runs through Apache in order to take advantage of authenticating (but not authorizing) against a MySQL database. In this way, svn+ssh is not an option. However, the svn command line does not understand SOCKS4 or SOCKS5. This is where a transparent socks proxy comes in. I'm using something called &lt;a href="http://proxychains.sourceforge.net/"&gt;proxychains&lt;/a&gt;, though &lt;a href="http://tsocks.sourceforge.net/"&gt;tsocks&lt;/a&gt; is also available on the internet. You set it up by writing into ~/.proxychains/proxychains.conf with:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;DynamicChain&lt;br/&gt;
    tcp_read_time_out 15000&lt;br/&gt;
    tcp_connect_time_out 10000&lt;br/&gt;&lt;/p&gt;
    
    &lt;p&gt;[ProxyList]&lt;br/&gt;
    socks5 127.0.0.1 1080&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and then you have two methods for accessing it. For svn commands, you can do:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;proxychain svn ls http://svn.mydomain.com/project/trunk/&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;but I prefer just setting the environment variable,&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;export LD_PRELOAD=/usr/lib/libproxychains.so&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Update 2007-07-22&lt;/strong&gt;: I now put in my .bashrc file alias svn="proxychains svn" and alias svk="proxychains svk"&lt;/p&gt;

&lt;p&gt;The library intercepts TCP connect calls and reroutes them through a socks proxy. Transparent, effect, ... and kinda scary, considering how easy it is to replace DLL calls like that. In any case, although I did this mainly because I have a laptop and &lt;a href="http://www.panera.com"&gt;Panera's&lt;/a&gt; uses an http proxy, I
think I'll need to do this for my workstation as well. Then require a proxy to access the Subversion server.&lt;/p&gt;

&lt;h2&gt;References:&lt;/h2&gt;

&lt;p&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="http://blog.isshen.com/articles/2007/07/27/svn-http-via-ssh-from-xp"&gt;How to do HTTP+SSH with Subversion on Windows&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Sat, 16 Dec 2006 08:30:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:d4ea5845-496b-49c9-a350-132c6e33dbf1</guid>
      <author>Hosh</author>
      <link>http://blog.isshen.com/articles/2006/12/16/how-to-do-http-ssh-with-subversion</link>
      <category>Subversion/SVK</category>
      <category>svk</category>
      <category>svn</category>
      <category>proxychains</category>
      <category>socks5</category>
      <category>linux</category>
      <category>tools</category>
    </item>
  </channel>
</rss>
