<?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>Magoo &#187; server</title>
	<atom:link href="http://morgangoose.com/blog/tag/server/feed/" rel="self" type="application/rss+xml" />
	<link>http://morgangoose.com/blog</link>
	<description>affiliated with the society of blog bloggables</description>
	<lastBuildDate>Thu, 03 Jun 2010 12:58:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Authenticating svn and trac with wordpress</title>
		<link>http://morgangoose.com/blog/2009/05/authenticating-svn-and-trac-with-wordpress/</link>
		<comments>http://morgangoose.com/blog/2009/05/authenticating-svn-and-trac-with-wordpress/#comments</comments>
		<pubDate>Thu, 07 May 2009 19:05:16 +0000</pubDate>
		<dc:creator>Morgan</dc:creator>
				<category><![CDATA[Webservers]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://morgangoose.com/blog/?p=15</guid>
		<description><![CDATA[Problem caused by wordpress upgrade My club uses WordPress and I have our forums and subversion authenticate via the wordpress install&#8217;s user table. This became very useful, and something that I tried to make sure I could apply on any new app I would install for the site. When trying to get the same thing [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem caused by wordpress upgrade</strong></p>
<p><strong></strong>My club uses WordPress and I have our forums and subversion authenticate via the wordpress install&#8217;s user table. This became very useful, and something that I tried to make sure I could apply on any new app I would install for the site. </p>
<p>When trying to get the same thing setup for an install of Trac I had just made I ran into a bit of trouble.  With the old versions of wordpress this was pretty simple to do. Just a few lines in an apache conf file and we were golden.</p>
<p>With the most recent revisions though their implementation of password storage changed, causing the old setup to break for svn, and causing me a nice headache when trying to duplicate my old fix for svn onto trac.  They went from a simple md5 hash to using a much more secure phpass. (why it isn&#8217;t phppass I don&#8217;t know)</p>
<p>The main problem with this is that this isn&#8217;t an authentication encryption that apache&#8217;s mysql handler could use.  I tried to find a work around to get back to md5, but I couldn&#8217;t find any. It was probably for the best anyhow, as I&#8217;d rather the site be more secure, than have more tools. No point in propagating something that could be exploited. Searching around some more I found the awesome work of <a href="http://nikolay.bg/" target="_blank">Nikolay</a>. given out on <a href="http://barry.wordpress.com/2008/05/19/mod_auth_mysql-and-phpass/" target="_blank">Barry&#8217;s</a> blog, and explaining the install process.  Nikolay made an apache module to compile that added in the ability to use phpass. This compiled great and worked with the fedora install the server is on,  so the old fix for subversion was working again, with a single line changed.</p>
<p><strong>Subversion</strong></p>
<div class="codecolorer-container apache vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="apache codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #00007f;">RedirectMatch</span> ^(/repos)$ $<span style="color: #ff0000;">1</span>/<br />
&lt;<span style="color: #000000; font-weight:bold;">Location</span> /repos/&gt;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #00007f;">Options</span> <span style="color: #0000ff;">all</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #00007f;">DAV</span> svn<br />
&nbsp; &nbsp; &nbsp;<span style="color: #00007f;">SVNParentPath</span> /repos/gcc/<br />
&nbsp; &nbsp; &nbsp;<span style="color: #00007f;">SVNListParentPath</span> <span style="color: #0000ff;">on</span><br />
<br />
&nbsp; &nbsp; &nbsp;<span style="color: #00007f;">AuthName</span> <span style="color: #7f007f;">&quot;MySQL authentication for SVN&quot;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #00007f;">AuthType</span> Basic<br />
&nbsp; &nbsp; &nbsp;<span style="color: #00007f;">Require</span> valid-<span style="color: #00007f;">user</span><br />
<br />
&nbsp; &nbsp; &nbsp;AuthMYSQLEnable <span style="color: #0000ff;">on</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #00007f;">AuthBasicAuthoritative</span> <span style="color: #0000ff;">off</span><br />
&nbsp; &nbsp; &nbsp;AuthMySQLAuthoritative <span style="color: #0000ff;">on</span><br />
<br />
&nbsp; &nbsp; &nbsp;AuthMySQLHost localhost<br />
&nbsp; &nbsp; &nbsp;AuthMySQLUser <span style="color: #00007f;">user</span><br />
&nbsp; &nbsp; &nbsp;AuthMySQLPassword password<br />
&nbsp; &nbsp; &nbsp;AuthMySQLDB wordpress_db<br />
&nbsp; &nbsp; &nbsp;AuthMySQLUserTable wp_users<br />
&nbsp; &nbsp; &nbsp;AuthMySQLNameField user_login<br />
&nbsp; &nbsp; &nbsp;AuthMySQLPasswordField user_pass<br />
&nbsp; &nbsp; &nbsp;AuthMySQLPwEncryption phpass<br />
&lt;/<span style="color: #000000; font-weight:bold;">Location</span>&gt;<br />
<span style="color: #00007f;">CustomLog</span> logs/svn_logfile <span style="color: #7f007f;">&quot;%t %u %{SVN-ACTION}e&quot;</span> env=SVN-<span style="color: #00007f;">ACTION</span></div></div>
<p>That is the config that makes sure that only people that have accounts on the wordpress blog can have access to the repos. I plan on soon adding in a SVN auth file to make the commit users  more constrained, but at the moment, it isn&#8217;t a priority.</p>
<p>The last line makes nice entries of SVN access in its own log file, which is very handy for debugging problems.</p>
<p><strong>Trac</strong></p>
<p>For trac I took the simple apache auth they provided on their website, and applied the same idea from svn to it:</p>
<div class="codecolorer-container apache vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="apache codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;<span style="color: #000000; font-weight:bold;">Location</span> <span style="color: #7f007f;">&quot;/projects/project-name/login&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #00007f;">AuthType</span> Basic<br />
&nbsp; &nbsp; &nbsp;<span style="color: #00007f;">Require</span> valid-<span style="color: #00007f;">user</span><br />
<br />
&nbsp; &nbsp; &nbsp;<span style="color: #00007f;">AuthName</span> <span style="color: #7f007f;">&quot;Trac Auth&quot;</span><br />
&nbsp; &nbsp; &nbsp;AuthMYSQLEnable <span style="color: #0000ff;">on</span><br />
&nbsp; &nbsp; &nbsp;AuthMySQLAuthoritative <span style="color: #0000ff;">on</span><br />
&nbsp; &nbsp; &nbsp;AuthMySQLHost localhost<br />
&nbsp; &nbsp; &nbsp;AuthMySQLUser wordpress<br />
&nbsp; &nbsp; &nbsp;AuthMySQLPassword password<br />
&nbsp; &nbsp; &nbsp;AuthMySQLDB wordpress_db<br />
&nbsp; &nbsp; &nbsp;AuthMySQLUserTable wp_users<br />
&nbsp; &nbsp; &nbsp;AuthMySQLNameField user_login<br />
&nbsp; &nbsp; &nbsp;AuthMySQLPasswordField user_pass<br />
&nbsp; &nbsp; &nbsp;AuthMySQLPwEncryption phpass<br />
&lt;/<span style="color: #000000; font-weight:bold;">Location</span>&gt;</div></div>
<p>I plan to use this type of database integration more, specifically with a wiki installation. Although I don&#8217;t know of any wiki that could use this type of authentication as I am only familiar with mediawiki, and really only as a user.</p>
<p><strong>Links</strong></p>
<ul>
<li>http://barry.wordpress.com/2008/05/19/mod_auth_mysql-and-phpass/</li>
<li>http://nikolay.bg/</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://morgangoose.com/blog/2009/05/authenticating-svn-and-trac-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
