<?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>Fellinghaug Blog &#187; subversion</title>
	<atom:link href="http://asbjorn.fellinghaug.com/blog/tag/subversion/feed/" rel="self" type="application/rss+xml" />
	<link>http://asbjorn.fellinghaug.com/blog</link>
	<description>&#62;&#62;&#62; from fellinghaug import asbjorn; asbjorn.play()</description>
	<lastBuildDate>Thu, 19 Nov 2009 21:22:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Apache, subversion and LDAP group authentication</title>
		<link>http://asbjorn.fellinghaug.com/blog/2009/06/apache-subversion-and-ldap-group-authentication/</link>
		<comments>http://asbjorn.fellinghaug.com/blog/2009/06/apache-subversion-and-ldap-group-authentication/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 07:30:00 +0000</pubDate>
		<dc:creator>Asbjørn Alexander Fellinghaug</dc:creator>
				<category><![CDATA[general IT]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[authenticate]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[ldap-filter]]></category>
		<category><![CDATA[ldap-group]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://asbjorn.fellinghaug.com/blog/?p=222</guid>
		<description><![CDATA[Hellu!
Lately I&#8217;ve been working on securing some web accessible resource, especially Subversion access to repositories through the Apache webserver. One aspect we found very difficult was to secure subversion access through our apache server, when we had a Active Directory server to authenticate against (I know..).
Apache have some directives such as &#8220;Require valid-user&#8221; which signals [...]]]></description>
			<content:encoded><![CDATA[<p>Hellu!</p>
<p>Lately I&#8217;ve been working on securing some web accessible resource, especially Subversion access to repositories through the Apache webserver. One aspect we found very difficult was to secure subversion access through our apache server, when we had a Active Directory server to authenticate against (I know..).</p>
<p>Apache have some directives such as &#8220;Require valid-user&#8221; which signals that a user has to be authenticated against some authentication provider. This is in most cases a standard &#8220;.htaccess&#8221; and &#8220;.htpasswd&#8221; combination which provides this. For small projects, this may be a working approach. However, in a large-scale organization where you want a dynamic handling of users and their access, then using groups to reflect the users access to resources may be a better working solution.</p>
<p>For one of our projects, we wanted all LDAP (AD) users to have read access, while members of certain groups have read and write access. We solved this with the following Apache config:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="apache apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">Location</span> /wicked_project&gt;
   DAV svn
   SVNParentPath /var/svn/wicked_project
   AuthzLDAPAuthoritative <span style="color: #0000ff;">off</span>
   <span style="color: #00007f;">AuthType</span> basic
   AuthBasicProvider ldap
   <span style="color: #00007f;">AuthName</span> <span style="color: #7f007f;">&quot;Need to authenticate here&quot;</span>
   AuthLDAPBindDN <span style="color: #7f007f;">&quot;ldap_user@domain.net&quot;</span>
   AuthLDAPBindPassword secretPassword
   AuthLDAPURL <span style="color: #7f007f;">&quot;ldap://ad.domain.net/dc=domain,dc=net?sAMAccountName?sub?(objectClass=*)&quot;</span>
&nbsp;
   &lt;Limit GET PROPFIND <span style="color: #00007f;">OPTIONS</span> CHECKOUT&gt;
      <span style="color: #00007f;">Require</span> valid-<span style="color: #00007f;">user</span>
   &lt;/Limit&gt;
   &lt;Limit REPORT MKACTIVITY PROPPATCH PUT MKCOL MOVE COPY DELETE LOCK UNLOCK MERGE&gt;
   <span style="color: #00007f;">Require</span> ldap-filter |(memberOf=CN=Staff,OU=GROUPS,DC=DOMAIN,DC=NET) \
                (memberOf=CN=Wicked_project_rw,OU=GROUPS,DC=DOMAIN,DC=NET)
   &lt;/Limit&gt;
&lt;/<span style="color: #000000; font-weight:bold;">Location</span>&gt;</pre></td></tr></table></div>

<p>Another LDAP directive which can work if you only need one group to have read and write access is the &#8220;ldap-group&#8221; directive. However, in our case we needed multiple groups, which is not supported by the &#8220;ldap-group&#8221; directive.</p>
<p>To solve this problem we used &#8220;ldap-filter&#8221; with multiple group filters inside the same filter, and divide them with the boolean OR. I don&#8217;t know if there are any more elegant ways of achieving the same result, but this solved our problems.</p>
<p>Having a second look at this &#8220;ldap-fiter&#8221; directive, I see that it have a significant strength in terms of flexibility. However, one aspect I have not considered is the performance of this approach. Without looking in-depth into the mod_ldap apache module, I can guess that for each filter inside the ldap-filter directive, it have to make a query to the LDAP (AD) server to retrieve the wanted resource. So, for each group filter inside the ldap-filter, you need a call. In our approach, we need two LDAP queries. As you now may see, the more groups to filter, the more LDAP queries, hence the performance will degrade the more complex the ldap-filter is.</p>
]]></content:encoded>
			<wfw:commentRss>http://asbjorn.fellinghaug.com/blog/2009/06/apache-subversion-and-ldap-group-authentication/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Make global-ignores in subversion</title>
		<link>http://asbjorn.fellinghaug.com/blog/2009/01/make-global-ignores-in-subversion/</link>
		<comments>http://asbjorn.fellinghaug.com/blog/2009/01/make-global-ignores-in-subversion/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 08:42:41 +0000</pubDate>
		<dc:creator>Asbjørn Alexander Fellinghaug</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[general IT]]></category>
		<category><![CDATA[ignores]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[svn:ignore]]></category>

		<guid isPermaLink="false">http://asbjorn.fellinghaug.com/blog/?p=190</guid>
		<description><![CDATA[Hi everyone.
Every now and then I get somewhat annoyed by the fact that I add temporary or &#8220;unwanted&#8221; files to a subversion repository. These files may be just temporary files, like *.tmp, which has no value of being kept in a repository, or compiled python files *.pyc, etc.
The common characteristics is that they are generally [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everyone.</p>
<p>Every now and then I get somewhat annoyed by the fact that I add temporary or &#8220;unwanted&#8221; files to a subversion repository. These files may be just temporary files, like *.tmp, which has no value of being kept in a repository, or compiled python files *.pyc, etc.</p>
<p>The common characteristics is that they are generally unwanted, and that they can easily be removed from the SVN repository. A common approach towards this issue is to set a property named &#8220;<em>svn:ignore</em>&#8221; on a directory, or the whole directory structure. This can be achieved with this command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #007800;">$#</span> <span style="color: #c20cb9; font-weight: bold;">svn</span> propset <span style="color: #c20cb9; font-weight: bold;">svn</span>:ignore <span style="color: #ff0000;">&quot;*.tmp&quot;</span> .</pre></div></div>

<p>where the single-dot at the end signalize the standing directory. However, this must be performed for each subversion project, which can get annoying in time. I&#8217;ve recently discovered the possibility of setting global subversion settings for my own user. The per-user subversion settings file is located on $HOME/.subversion/config. In that file there is a section named &#8220;[miscellany]&#8220;, which holds a variable named &#8220;global-ignores&#8221;. This variable can hold multiple ignore statements which will apply for all the svn checkouts you may work on (given you are using this user).</p>
<p>This subversion setting file also contains many more exciting options, such as automatic properties which apply to certain files. Have a look at the end for the $HOME/.subversion/config file and notice some of the predefined settings.</p>
<p>A tip based on personal experience is to hook the current files to the global-ignores variable:</p>
<blockquote><p>
*.pyc # python byte compiled code<br />
*.swp # vim swap file<br />
*.tmp # general temp files
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://asbjorn.fellinghaug.com/blog/2009/01/make-global-ignores-in-subversion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
