<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Vitriol and Routing Tables &#187; Subversion</title>
	<atom:link href="http://www.raptorized.com/tags/english/work/svn/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.raptorized.com</link>
	<description>Tales from the OSI layer 3</description>
	<lastBuildDate>Wed, 08 Sep 2010 02:34:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Subversion: .htaccess gives 403 forbidden?</title>
		<link>http://www.raptorized.com/2006/11/14/subversion-htaccess-gives-403-forbidden/</link>
		<comments>http://www.raptorized.com/2006/11/14/subversion-htaccess-gives-403-forbidden/#comments</comments>
		<pubDate>Tue, 14 Nov 2006 21:44:31 +0000</pubDate>
		<dc:creator>mr_daemon</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://www.raptorized.com/?p=92</guid>
		<description><![CDATA[I&#8217;m trying to import a brand new top secret project into my Subversion Repository. Okay, I&#8217;ve had my share of troubles with that set-up &#8212; it is behind an Apache Reverse Proxy, with a bit of perl hacking to support move operations accross SSL tunnels. (I&#8217;ll post about this soon, I&#8217;m sure it will interest [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m trying to import a brand new top secret project into <a href="http://nailhead.underwares.org">my Subversion Repository</a>.</p>

<p>Okay, I&#8217;ve had my share of troubles with that set-up &#8212; it is behind an Apache Reverse Proxy, with a bit of perl hacking to support move operations accross SSL tunnels. (I&#8217;ll post about this soon, I&#8217;m sure it will interest someone).</p>

<p>So, I was trying to import my new project and BANG, it dies.</p>

<pre><code>Ajout          public/javascripts/application.js
Ajout          public/javascripts/controls.js
Ajout          public/404.html
Ajout          public/index.html
Ajout          public/.htaccess
svn: PUT of '/svn/repos/!svn/xx/.htaccess': 
302 Found (https://www.underwares.org)
svn: Le message de propagation a été laissé dans un fichier temporaire :
svn:    'svn-commit.4.tmp'
</code></pre>

<p>I first wonder the meaning of such foolery (foolery that has nothing to do with Tom, whatsoever) and then slap my forehead loudly. </p>

<p><span id="more-92"></span></p>

<p>I use shitty redirects for HTTP errors to display lovely custom error messages. SVN probably dislikes the redirect and displays it as the problem, hence, 302 found.</p>

<p>I comment that stuff out of httpd.conf, restart apache, and bam. There is the real error.</p>

<pre><code>svn: PUT of '/svn/repos/!svn/wrk/xx/.htaccess': 
403 Forbidden (https://www.underwares.org)
</code></pre>

<p>Well, shit. It seems to be explicitely rejecting files named &#8220;.htaccess&#8221;.
I thought it might have been mod_security being too anal once again, but that would have returned a 406 (content unacceptable). I still disable mod_security, to no avail.</p>

<p>I run a simple test to confirm. I create a folder with four files:</p>

<ul>
    <li>.htaccess</li>
    <li>.htpasswd</li>
    <li>.htpouet</li>
    <li>.pouet</li>
</ul>

<p>So, we&#8217;ll see what happen. I try to import them into svn. I first start with &#8220;.pouet&#8221;, for kicks.</p>

<pre><code>$ svn import . https://www.underwares.org/svn/repos/private/test
Ajout          .pouet

Révision 275 propagée.</code></pre>

<p>Well, that worked. So it&#8217;s not the dot. Next, &#8220;.htaccess&#8221;.</p>

<pre><code> phobos$ svn import . https://www.underwares.org/svn/repos/private/test
svn: PROPFIND request failed on '/svn/repos/private/test/.htaccess'
svn: PROPFIND of '/svn/repos/private/test/.htaccess': 
403 Forbidden (https://www.underwares.org)
svn: Le message de propagation a été laissé dans un fichier temporaire :
svn:    'svn-commit.2.tmp'
phobos$</code></pre>

<p>Well, that failed. &#8220;.htpasswd&#8221; fails as well, and to much of my surprise, <b>&#8220;.htpouet&#8221; fails as well</b>.</p>

<p>Then it hit me. The following regular expression flashed through my mind:
<code>^.ht</code>
Damn it! The default httpd.conf has a directive that denies access to such files on a global level. A quick look at the file confirms:</p>

<pre><code>&lt;Files ~ "^\.ht"&gt;
    Order allow,deny
    Deny from all
    Satisfy All
&lt;/Files&gt;</code></pre>

<p>So here we go. I comment out that obnoxious directive, and move it inside the &#8220;Directory&#8221; directive of my vhost. I also add it to every single vhost on my server.</p>

<p>Some clever people are probably thinking, why didn&#8217;t you do something like this?</p>

<pre><code>&lt;Location /svn&gt;
  &lt;Files ~ "^\.ht"&gt;
        Order allow,deny
        Allow from all
        Satisfy All
  &lt;/Files&gt;
&lt;/Location&gt;</code></pre>

<p>Well, you can&#8217;t have a Files directive nested inside a Location directive. You can, however, have one inside a Directory directive. So, now users can&#8217;t access .ht files through the web, which is good, and SVN can, which is good as well. </p>

<p>All of this was probably related to my sinister Reverse Proxy buisness. Don&#8217;t attempt such a set-up unless you like pain, kids.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raptorized.com/2006/11/14/subversion-htaccess-gives-403-forbidden/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Subversion: On fixing &#8220;can&#8217;t recode string&#8221;&#8230;</title>
		<link>http://www.raptorized.com/2005/11/16/subversion-on-fixing-cant-recode-string/</link>
		<comments>http://www.raptorized.com/2005/11/16/subversion-on-fixing-cant-recode-string/#comments</comments>
		<pubDate>Wed, 16 Nov 2005 18:43:02 +0000</pubDate>
		<dc:creator>mr_daemon</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[Tutorials/How-To]]></category>
		<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.raptorized.com/?p=51</guid>
		<description><![CDATA[Well, I recently set up a subversion system where I work, on Windows. Clients are using Tortoise SVN, and everything works beautifully. However this morning, I checked out the trunk on my Mac OS X powered Powerbook, and the lawnmower hit a brick the split second svn tried to checkout a folder with accented characters [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I recently set up a subversion system where I work, on Windows. Clients are using Tortoise SVN, and everything works beautifully. However this morning, I checked out the trunk on my Mac OS X powered Powerbook, and the lawnmower hit a brick the split second svn tried to checkout a folder with accented characters (In french, for instance. Could have been german umlauts).</p>

<p>svn: Can&#8217;t recode string</p>

<p>Well, this was a matter of changing the encoding used by my system locale to match the one of the repository, which was done by editing the file <em>.profile</em> in my home directory (I use bash as a default shell, which is the default on OS X 10.3 and above, as opposed to csh) and added the following:</p>

<pre>
<code>
export LC_CTYPE="en_US.UTF-8"
export LANG="en_US.UTF-8"
</code>
</pre>

<p>This basically had the effect of setting up the locale to UTF8, which swallowed the file without problems. I just though I&#8217;d post it there because it was useful &#8212; I didn&#8217;t really google around to check out if that solution was already out there, but I will mirror it on <a href="http://www.underwares.org/zcgi/contents">underwares.org</a> anyways.</p>

<p>Hope this helps someone, somehow. <img src='http://www.raptorized.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.raptorized.com/2005/11/16/subversion-on-fixing-cant-recode-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
