<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>「Redmine 的 Repository Controls plugin（續）」的迴響</title>
	<atom:link href="http://blog.tinlans.org/2009/12/19/redmine-%e7%9a%84-repository-controls-plugin-%ef%bc%88%e7%ba%8c%ef%bc%89/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tinlans.org/2009/12/19/redmine-%e7%9a%84-repository-controls-plugin-%ef%bc%88%e7%ba%8c%ef%bc%89/</link>
	<description></description>
	<lastBuildDate>Fri, 27 Jan 2012 04:17:59 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3-beta1-18972</generator>
	<item>
		<title>由：uranus</title>
		<link>http://blog.tinlans.org/2009/12/19/redmine-%e7%9a%84-repository-controls-plugin-%ef%bc%88%e7%ba%8c%ef%bc%89/comment-page-1/#comment-233</link>
		<dc:creator>uranus</dc:creator>
		<pubDate>Fri, 26 Feb 2010 17:08:50 +0000</pubDate>
		<guid isPermaLink="false">https://blog.tinlans.org/?p=1017#comment-233</guid>
		<description>其實我自己是開一個 svn.xxx.org 的 virtual host，
所以是寫 &lt;Location /&gt; ... &lt;/Location&gt;。
並不會使用到我保留的原作者所寫的那前面三行，
而是後面 else { } 裡我自己寫的部分：
&lt;pre lang=&quot;perl&quot;&gt;
    if($location ne &quot;/&quot;) {
        ($path) = $r-&gt;uri =~ m{$location/*[^/]+(/.*)};
    }
    else {
         my @path_items = split /\//, $r-&gt;uri;
 
         if(@path_items &lt;= 2) {
             $path = &quot;/&quot;;
         }
         else {
             if($path_items[2] eq &quot;!svn&quot;) {
                 if(@path_items &lt;= 5) {
                     return &quot;/!svn&quot;;
                 }
 
                 @path_items = @path_items[5..$#path_items];
             }
             else {
                 @path_items = @path_items[2..$#path_items];
             }
 
             $path = &quot;/&quot; . join &quot;/&quot;, @path_items;
         }
   }
&lt;/pre&gt;
我用 perl 的 split 根據 &quot;/&quot; 這個字元把 string 分解成 array，
然後再依據 array 的 size 以及內容做一些判斷；
像是 http(s)://host/a/b/c 的話我的 @path_items 會是一個 { &#039;a&#039;, &#039;b&#039;, &#039;c&#039; } 的 array。
這個部分的 code 沒有辦法直接套用在 &lt;Locaation /svn&gt; 這種設定上，
因為還必須多寫一些 if 去判斷 $location 跟 $path_items[0] 去設定一個 base_index 值，
再把後面的 $path_items[1] 之類的動作改成 $path_items[base_index + 1] 這樣讓它聰明一點。

但是就像前面說的其實弄到會動之後就懶得做一般化了，
所以不是用 &lt;Location /&gt; 的就丟給原作者的 code 負責，
這樣原作者有更新那一行 code 的時候你們也能直接貼上去當 patch。</description>
		<content:encoded><![CDATA[<p>其實我自己是開一個 svn.xxx.org 的 virtual host，<br />
所以是寫 &lt;Location /&gt; ... &lt;/Location&gt;。<br />
並不會使用到我保留的原作者所寫的那前面三行，<br />
而是後面 else { } 裡我自己寫的部分：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1017code1'); return false;">View Code</a> PERL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10171"><td class="code" id="p1017code1"><pre class="perl" style="font-family:monospace;">    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$location</span> <span style="color: #b1b100;">ne</span> <span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$path</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$r</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">uri</span> <span style="color: #339933;">=~</span> <a href="http://perldoc.perl.org/functions/m.html"><span style="color: #000066;">m</span></a><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$location</span><span style="color: #339933;">/*</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">^</span><span style="color: #009966; font-style: italic;">/]+(/</span><span style="color: #339933;">.*</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
         <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@path_items</span> <span style="color: #339933;">=</span> <a href="http://perldoc.perl.org/functions/split.html"><span style="color: #000066;">split</span></a> <span style="color: #009966; font-style: italic;">/\//</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$r</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">uri</span><span style="color: #339933;">;</span>
&nbsp;
         <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@path_items</span> <span style="color: #339933;">&lt;=</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
             <span style="color: #0000ff;">$path</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #339933;">;</span>
         <span style="color: #009900;">&#125;</span>
         <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
             <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$path_items</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">&quot;!svn&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                 <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@path_items</span> <span style="color: #339933;">&lt;=</span> <span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                     <a href="http://perldoc.perl.org/functions/return.html"><span style="color: #000066;">return</span></a> <span style="color: #ff0000;">&quot;/!svn&quot;</span><span style="color: #339933;">;</span>
                 <span style="color: #009900;">&#125;</span>
&nbsp;
                 <span style="color: #0000ff;">@path_items</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">@path_items</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">..</span><span style="color: #0000ff;">$#path_items</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
             <span style="color: #009900;">&#125;</span>
             <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                 <span style="color: #0000ff;">@path_items</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">@path_items</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">..</span><span style="color: #0000ff;">$#path_items</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
             <span style="color: #009900;">&#125;</span>
&nbsp;
             <span style="color: #0000ff;">$path</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;/&quot;</span> <span style="color: #339933;">.</span> <a href="http://perldoc.perl.org/functions/join.html"><span style="color: #000066;">join</span></a> <span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">@path_items</span><span style="color: #339933;">;</span>
         <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>我用 perl 的 split 根據 "/" 這個字元把 string 分解成 array，<br />
然後再依據 array 的 size 以及內容做一些判斷；<br />
像是 http(s)://host/a/b/c 的話我的 @path_items 會是一個 { 'a', 'b', 'c' } 的 array。<br />
這個部分的 code 沒有辦法直接套用在 &lt;Locaation /svn&gt; 這種設定上，<br />
因為還必須多寫一些 if 去判斷 $location 跟 $path_items[0] 去設定一個 base_index 值，<br />
再把後面的 $path_items[1] 之類的動作改成 $path_items[base_index + 1] 這樣讓它聰明一點。</p>
<p>但是就像前面說的其實弄到會動之後就懶得做一般化了，<br />
所以不是用 &lt;Location /&gt; 的就丟給原作者的 code 負責，<br />
這樣原作者有更新那一行 code 的時候你們也能直接貼上去當 patch。</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：ajian</title>
		<link>http://blog.tinlans.org/2009/12/19/redmine-%e7%9a%84-repository-controls-plugin-%ef%bc%88%e7%ba%8c%ef%bc%89/comment-page-1/#comment-231</link>
		<dc:creator>ajian</dc:creator>
		<pubDate>Fri, 26 Feb 2010 08:44:08 +0000</pubDate>
		<guid isPermaLink="false">https://blog.tinlans.org/?p=1017#comment-231</guid>
		<description>我已经可以正常使用了.而且没有任何错误了.已经可以满足了我的需求了.就是后台有点傻,但还能用.
解决方法其实很简单,就是使用的你的RedmineRepoControl.pm　但你的之前使用的时候就会出现$path为空的情况　我想这个可能和perl的版本有关系吧.我的perl是５.８.８　取到的就对的但就如你上说的　至少也应该得到/　这个版本的就是得到的空　我也没有去深究.
解决了上面为空的问题再解决另外一个问题后发现这个插件的数据库查询语句有问题原来用的是老的文件改的.本打算就把这个文件通看一遍看要取什么数据库自己来写的,突然想到你也用得正好可能你的数据库查询是正确的所以就把你的那个文件改了楼上那个问题就可以正常使用了.
要谢谢你为我细心的解答问题.</description>
		<content:encoded><![CDATA[<p>我已经可以正常使用了.而且没有任何错误了.已经可以满足了我的需求了.就是后台有点傻,但还能用.<br />
解决方法其实很简单,就是使用的你的RedmineRepoControl.pm　但你的之前使用的时候就会出现$path为空的情况　我想这个可能和perl的版本有关系吧.我的perl是５.８.８　取到的就对的但就如你上说的　至少也应该得到/　这个版本的就是得到的空　我也没有去深究.<br />
解决了上面为空的问题再解决另外一个问题后发现这个插件的数据库查询语句有问题原来用的是老的文件改的.本打算就把这个文件通看一遍看要取什么数据库自己来写的,突然想到你也用得正好可能你的数据库查询是正确的所以就把你的那个文件改了楼上那个问题就可以正常使用了.<br />
要谢谢你为我细心的解答问题.</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：uranus</title>
		<link>http://blog.tinlans.org/2009/12/19/redmine-%e7%9a%84-repository-controls-plugin-%ef%bc%88%e7%ba%8c%ef%bc%89/comment-page-1/#comment-224</link>
		<dc:creator>uranus</dc:creator>
		<pubDate>Thu, 25 Feb 2010 04:11:12 +0000</pubDate>
		<guid isPermaLink="false">https://blog.tinlans.org/?p=1017#comment-224</guid>
		<description>我最近比較常睡白天所以就算有那種通訊軟體也沒意義，
因為最近比較忙。

你現在說我才發現我的版本也有一個地方沒改到，
不過神奇的地方是目前為止都沒有跳出過錯誤訊息來。

基本上 members.role_id 這個 column 在 trunk 已經拿掉很長一段時間了，
trunk 的版本多了一張叫 member_roles 的 table (就是在做正規化遇到 many-to-many 關係時要做的 junction table)，
你要把它一起 join 進來才能拿到 role_id。
其實官方的 Redmine.pm 已經修正這個問題快一年了：
http://www.redmine.org/issues/3330

RedmineRepoControl.pm 其實是從官方舊版的 Redmine.pm 改來用，
所以也是會有這個問題，
原作者大概沒有跟上 trunk 的版本。

說起來我也差不多該睡了...</description>
		<content:encoded><![CDATA[<p>我最近比較常睡白天所以就算有那種通訊軟體也沒意義，<br />
因為最近比較忙。</p>
<p>你現在說我才發現我的版本也有一個地方沒改到，<br />
不過神奇的地方是目前為止都沒有跳出過錯誤訊息來。</p>
<p>基本上 members.role_id 這個 column 在 trunk 已經拿掉很長一段時間了，<br />
trunk 的版本多了一張叫 member_roles 的 table (就是在做正規化遇到 many-to-many 關係時要做的 junction table)，<br />
你要把它一起 join 進來才能拿到 role_id。<br />
其實官方的 Redmine.pm 已經修正這個問題快一年了：<br />
<a href="http://www.redmine.org/issues/3330" rel="nofollow">http://www.redmine.org/issues/3330</a></p>
<p>RedmineRepoControl.pm 其實是從官方舊版的 Redmine.pm 改來用，<br />
所以也是會有這個問題，<br />
原作者大概沒有跟上 trunk 的版本。</p>
<p>說起來我也差不多該睡了...</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：ajian</title>
		<link>http://blog.tinlans.org/2009/12/19/redmine-%e7%9a%84-repository-controls-plugin-%ef%bc%88%e7%ba%8c%ef%bc%89/comment-page-1/#comment-223</link>
		<dc:creator>ajian</dc:creator>
		<pubDate>Thu, 25 Feb 2010 03:51:41 +0000</pubDate>
		<guid isPermaLink="false">https://blog.tinlans.org/?p=1017#comment-223</guid>
		<description>我的gtalk就是我的邮箱 msn是5root@live.cn 如果可以直接交流会更快些 谢谢.</description>
		<content:encoded><![CDATA[<p>我的gtalk就是我的邮箱 msn是5root@live.cn 如果可以直接交流会更快些 谢谢.</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：ajian</title>
		<link>http://blog.tinlans.org/2009/12/19/redmine-%e7%9a%84-repository-controls-plugin-%ef%bc%88%e7%ba%8c%ef%bc%89/comment-page-1/#comment-222</link>
		<dc:creator>ajian</dc:creator>
		<pubDate>Thu, 25 Feb 2010 03:42:11 +0000</pubDate>
		<guid isPermaLink="false">https://blog.tinlans.org/?p=1017#comment-222</guid>
		<description>我现在做了些程序的修改
&lt;pre&gt;
 my $path ;
     if ($r-&gt;uri =~ m{$location/*[^/]+(/.*)}) {
        ($path) = $r-&gt;uri =~ m{$location/*[^/]+(/.*)};
    } elsif ($r-&gt;uri =~ m{$location/*[^/]}) {
        $path = &quot;/&quot;;
    }
&lt;/pre&gt;
并且修改
&lt;pre&gt;
if ( $req_path =~ m{\Q$path[/]?\E} ) {
&lt;/pre&gt;
可以实现按用户进行checkout了.
但其实还是有错误 日志中
DBD::mysql::st execute failed: Unknown column &#039;members.role_id&#039; in &#039;where clause&#039; at /usr/lib/perl5/site_perl/Apache/RedmineRepoControl.pm line 282.
DBD::mysql::st fetchrow_array failed: fetch() without execute() at /usr/lib/perl5/site_perl/Apache/RedmineRepoControl.pm line 283.
并且不能进行提交 也是报同样的错误 我确认在插件上我已经添加了/的读写权限.
从上面的错误可以看出来 是不存在相应的列 难道这个版本不相符?我redmine用的是trunk的 插件也是checkout最新的.
是否有gtalk类似的联系方式 这样交流太慢了.</description>
		<content:encoded><![CDATA[<p>我现在做了些程序的修改</p>
<pre>
 my $path ;
     if ($r-&gt;uri =~ m{$location/*[^/]+(/.*)}) {
        ($path) = $r-&gt;uri =~ m{$location/*[^/]+(/.*)};
    } elsif ($r-&gt;uri =~ m{$location/*[^/]}) {
        $path = "/";
    }
</pre>
<p>并且修改</p>
<pre>
if ( $req_path =~ m{\Q$path[/]?\E} ) {
</pre>
<p>可以实现按用户进行checkout了.<br />
但其实还是有错误 日志中<br />
DBD::mysql::st execute failed: Unknown column 'members.role_id' in 'where clause' at /usr/lib/perl5/site_perl/Apache/RedmineRepoControl.pm line 282.<br />
DBD::mysql::st fetchrow_array failed: fetch() without execute() at /usr/lib/perl5/site_perl/Apache/RedmineRepoControl.pm line 283.<br />
并且不能进行提交 也是报同样的错误 我确认在插件上我已经添加了/的读写权限.<br />
从上面的错误可以看出来 是不存在相应的列 难道这个版本不相符?我redmine用的是trunk的 插件也是checkout最新的.<br />
是否有gtalk类似的联系方式 这样交流太慢了.</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：uranus</title>
		<link>http://blog.tinlans.org/2009/12/19/redmine-%e7%9a%84-repository-controls-plugin-%ef%bc%88%e7%ba%8c%ef%bc%89/comment-page-1/#comment-218</link>
		<dc:creator>uranus</dc:creator>
		<pubDate>Wed, 24 Feb 2010 10:03:17 +0000</pubDate>
		<guid isPermaLink="false">https://blog.tinlans.org/?p=1017#comment-218</guid>
		<description>m{regular expression} 或 m/regular expression/ 這類 m 後面跟著各種成對標點括起的，
表示要用裡面的 regular expression 做 match 的動作，
包住 regular expression 的只要是成對的標點大都可以，
這個 plugin 用 {} 主要是可以避免內部出現 / 號被當成 expression 的結尾 (因為是分析 URL 字串內容易出現 / 號)。
而 regular expression 中出現圓括弧表示要記憶 match 到的 string。
=~ 的左邊你可以把它當成 regular expression 要 match 的 input。

如果單純寫 if($str =~ m{regexp}) 則代表判斷是否 match 成功，
如果寫 ($var1, $var2) = $str =~ m{(subexp1)(subexp2)} 則代表 $var1 要儲存 subexp1 所 match 到的 string，
而 $var2 代表要儲存 subexp2 所 match 到的 string。
要儲存的個數取決於你 regular expression 出現成對圓括弧的次數。

[^/]+ 表示「一個或多個」非 / 號的 string，
(/.*) 則表示要記憶由 / 號開始後面接著零到多個任意字元的 string。
所以假設你 $location 是 &quot;/svn&quot; (這取決於你 apache 的設定)，
輸入的網址是 http://host/svn/aaa/bbb.txt ，
$r-&gt;uri 會是 &quot;/svn/aaa/bbb.txt&quot;，
m{$location/*[^/]+(/.*)} 的 [^/]+ 會 match 你的 aaa，
(/.*) 會 match 你的 /bbb.txt 並儲存。
既然寫的是 ($path) = $r-&gt;uri =~ m{$location/*[^/]+(/.*)}，
那麼 (/.*) 的 match 結果就會被儲存到 $path 中，
所以 $path 就是 &quot;/bbb.txt&quot; 了。

如果你輸入的是 http://host/svn/aaa/ ，
(/.*) 會得到 &quot;/&quot; 這唯一一個字元，
也就是根目錄，
這樣還不至於變成空值；
但是如果你輸入的是 http://host/svn/aaa ，
那 (/.*) 當然就沒辦法 match 了。
當然一般的檔案庫下都還會有 trunk、branches、tags 這三個目錄在，
所以正常來說也很少遇到會讓 $path 變成空的狀況。

這個問題其實去年 10 月就有人 feedback 給 plugin 的原作者過：
  http://code.google.com/p/redminerepositorycontrol/issues/detail?id=1
而上個月中原作者也說他做了一些 fix，
你如果跟我一樣是在那之前就開始用的，
可以 svn update 一下看看原作者是否修正了這個問題。


我改的 plugin 如果 anonymous 有打開讀取權限，
任何人就能從不用認證的 port 80 直接 checkout 檔案，
但不影響 port 443 這個需要認證的 port 的行為。

用哪套 plugin 是取決於你的需求，
Redmine 官方那個是「只要登入就能任意寫入」，
也就是登入成功就有完整的存取權。
Repository Controls Plugin 以及我改過的版本，
是在模擬 svn 檔案庫的 conf/authz 這個檔案在做的行為，
會進一步確認你登入的 id 是否有某個 path 的 read/write 權限。
如果你的需求沒有要設到這麼細，
使用官方的那個 Redmine.pm 就可以了。
要是你沒有堅持一定要在 web UI 上設定每個 id / roles 存取權限，
你也可以手動編輯各檔案庫的 conf/authz 檔來達成目的，
當然 apache 上也要有對應的設定指向該檔案就是了。

另外官方建議的 /svn-private 這個設定主要是讓 Redmine 的 Repository 這頁能直接讀取你的檔案庫，
它基本上只適合用在 read-only 性質，
如果你要 commit 的話我不建議你走這條路線，
因為可能會無法記錄是誰 commit 的。</description>
		<content:encoded><![CDATA[<p>m{regular expression} 或 m/regular expression/ 這類 m 後面跟著各種成對標點括起的，<br />
表示要用裡面的 regular expression 做 match 的動作，<br />
包住 regular expression 的只要是成對的標點大都可以，<br />
這個 plugin 用 {} 主要是可以避免內部出現 / 號被當成 expression 的結尾 (因為是分析 URL 字串內容易出現 / 號)。<br />
而 regular expression 中出現圓括弧表示要記憶 match 到的 string。<br />
=~ 的左邊你可以把它當成 regular expression 要 match 的 input。</p>
<p>如果單純寫 if($str =~ m{regexp}) 則代表判斷是否 match 成功，<br />
如果寫 ($var1, $var2) = $str =~ m{(subexp1)(subexp2)} 則代表 $var1 要儲存 subexp1 所 match 到的 string，<br />
而 $var2 代表要儲存 subexp2 所 match 到的 string。<br />
要儲存的個數取決於你 regular expression 出現成對圓括弧的次數。</p>
<p>[^/]+ 表示「一個或多個」非 / 號的 string，<br />
(/.*) 則表示要記憶由 / 號開始後面接著零到多個任意字元的 string。<br />
所以假設你 $location 是 "/svn" (這取決於你 apache 的設定)，<br />
輸入的網址是 <a href="http://host/svn/aaa/bbb.txt" rel="nofollow">http://host/svn/aaa/bbb.txt</a> ，<br />
$r->uri 會是 "/svn/aaa/bbb.txt"，<br />
m{$location/*[^/]+(/.*)} 的 [^/]+ 會 match 你的 aaa，<br />
(/.*) 會 match 你的 /bbb.txt 並儲存。<br />
既然寫的是 ($path) = $r->uri =~ m{$location/*[^/]+(/.*)}，<br />
那麼 (/.*) 的 match 結果就會被儲存到 $path 中，<br />
所以 $path 就是 "/bbb.txt" 了。</p>
<p>如果你輸入的是 <a href="http://host/svn/aaa/" rel="nofollow">http://host/svn/aaa/</a> ，<br />
(/.*) 會得到 "/" 這唯一一個字元，<br />
也就是根目錄，<br />
這樣還不至於變成空值；<br />
但是如果你輸入的是 <a href="http://host/svn/aaa" rel="nofollow">http://host/svn/aaa</a> ，<br />
那 (/.*) 當然就沒辦法 match 了。<br />
當然一般的檔案庫下都還會有 trunk、branches、tags 這三個目錄在，<br />
所以正常來說也很少遇到會讓 $path 變成空的狀況。</p>
<p>這個問題其實去年 10 月就有人 feedback 給 plugin 的原作者過：<br />
  <a href="http://code.google.com/p/redminerepositorycontrol/issues/detail?id=1" rel="nofollow">http://code.google.com/p/redminerepositorycontrol/issues/detail?id=1</a><br />
而上個月中原作者也說他做了一些 fix，<br />
你如果跟我一樣是在那之前就開始用的，<br />
可以 svn update 一下看看原作者是否修正了這個問題。</p>
<p>我改的 plugin 如果 anonymous 有打開讀取權限，<br />
任何人就能從不用認證的 port 80 直接 checkout 檔案，<br />
但不影響 port 443 這個需要認證的 port 的行為。</p>
<p>用哪套 plugin 是取決於你的需求，<br />
Redmine 官方那個是「只要登入就能任意寫入」，<br />
也就是登入成功就有完整的存取權。<br />
Repository Controls Plugin 以及我改過的版本，<br />
是在模擬 svn 檔案庫的 conf/authz 這個檔案在做的行為，<br />
會進一步確認你登入的 id 是否有某個 path 的 read/write 權限。<br />
如果你的需求沒有要設到這麼細，<br />
使用官方的那個 Redmine.pm 就可以了。<br />
要是你沒有堅持一定要在 web UI 上設定每個 id / roles 存取權限，<br />
你也可以手動編輯各檔案庫的 conf/authz 檔來達成目的，<br />
當然 apache 上也要有對應的設定指向該檔案就是了。</p>
<p>另外官方建議的 /svn-private 這個設定主要是讓 Redmine 的 Repository 這頁能直接讀取你的檔案庫，<br />
它基本上只適合用在 read-only 性質，<br />
如果你要 commit 的話我不建議你走這條路線，<br />
因為可能會無法記錄是誰 commit 的。</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：ajian</title>
		<link>http://blog.tinlans.org/2009/12/19/redmine-%e7%9a%84-repository-controls-plugin-%ef%bc%88%e7%ba%8c%ef%bc%89/comment-page-1/#comment-217</link>
		<dc:creator>ajian</dc:creator>
		<pubDate>Wed, 24 Feb 2010 09:03:22 +0000</pubDate>
		<guid isPermaLink="false">https://blog.tinlans.org/?p=1017#comment-217</guid>
		<description>现在最大的问题就是 是路徑的問題，
&quot;因為那個 plugin 的 get_project_identifier 和 get_requested_path 這兩個 function 沒有寫得很好，
可能會造成 project 的 id 或是 path 變成 null；&quot;
确认我做过程序方面调试了
($path) = $r-&gt;uri =~ m{$location/*[^/]+(/.*)};
这个部分$path得到的是空的 $r-&gt;uri 得到的是/svn/aa   $location得到的是 /svn  但是经过=~运算后就成了空了 我在我本地用perl引入这两个变量执行这个语句也是为空. 不知道这取值要取到什么才是正确的 这句的意义在哪?

另外你说的checkout的格式我也添加了/  还是一样的.
我查看了你贴的地个图 跟我的那个有些差别 是否可以大概的描述下你的安装过程和版本情况.
你自己改的这两个脚本anonymous 这个是任何人都可以访问吗? 是80的端口的 但是需要认证的是443的 我用的是官网的做法 如果是要可以直接访问的是用/svn-private做了IP的限制 而/svn就是需要用户认证的.</description>
		<content:encoded><![CDATA[<p>现在最大的问题就是 是路徑的問題，<br />
"因為那個 plugin 的 get_project_identifier 和 get_requested_path 這兩個 function 沒有寫得很好，<br />
可能會造成 project 的 id 或是 path 變成 null；"<br />
确认我做过程序方面调试了<br />
($path) = $r-&gt;uri =~ m{$location/*[^/]+(/.*)};<br />
这个部分$path得到的是空的 $r-&gt;uri 得到的是/svn/aa   $location得到的是 /svn  但是经过=~运算后就成了空了 我在我本地用perl引入这两个变量执行这个语句也是为空. 不知道这取值要取到什么才是正确的 这句的意义在哪?</p>
<p>另外你说的checkout的格式我也添加了/  还是一样的.<br />
我查看了你贴的地个图 跟我的那个有些差别 是否可以大概的描述下你的安装过程和版本情况.<br />
你自己改的这两个脚本anonymous 这个是任何人都可以访问吗? 是80的端口的 但是需要认证的是443的 我用的是官网的做法 如果是要可以直接访问的是用/svn-private做了IP的限制 而/svn就是需要用户认证的.</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：uranus</title>
		<link>http://blog.tinlans.org/2009/12/19/redmine-%e7%9a%84-repository-controls-plugin-%ef%bc%88%e7%ba%8c%ef%bc%89/comment-page-1/#comment-214</link>
		<dc:creator>uranus</dc:creator>
		<pubDate>Tue, 23 Feb 2010 14:47:39 +0000</pubDate>
		<guid isPermaLink="false">https://blog.tinlans.org/?p=1017#comment-214</guid>
		<description>官方的 Redmine.pm 會先判斷你 redmine 裡那個 project 是不是設定成 public，
如果是 public 而且你的存取動作是讀取性質的，
就會直接取消後續的驗證動作直接讓你讀取。
如果是寫入性質的，
就會發個 401 要求你輸入帳號密碼。
client 收到 401 會跳出對話框或提示符號要求使用者輸入帳號密碼，
如果持續得到 401 才會放棄要求 user 輸入並回報 401 給 user。
Repository Controls Plugin 是改自官方的 Redmine.pm，
所以這條規則相同。
但我修改後的版本就完全不管 project 是否被設定成 public，
而是完全按照各路徑的權限設定來判定。

遇到 403 的可能性有兩種。

一種是你沒在 &lt;Location&gt; 標籤裡放入 Allow from all，
或是你寫了 Allow from &lt;ip-address&gt; 但是你的連線來源卻不是那個 IP。

另一種就是你裝了 Repository Controls Plugin 並在 apache 的設定裡使用它。
這個 plugin 跟官方那個的差別是官方是只要登入就可以寫入任意路徑，
而這個 plugin 則是還會確認你是否有某個路徑的讀取/寫入權限。
這 plugin 剛安裝好的時候權限設定的部分是空白的，
你至少必須去 project 的設定頁面替 Manager 這個 role 開啟 / 的 read/write 權限才行：
&lt;a href=&quot;http://blog.tinlans.org/wp-content/uploads/2009/12/RepoControlSettings.jpg&quot; rel=&quot;lightbox[1017]&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;http://blog.tinlans.org/wp-content/uploads/2009/12/RepoControlSettings.jpg&quot; alt=&quot;&quot; title=&quot;RepoControlSettings&quot; width=&quot;512&quot; height=&quot;251&quot; class=&quot;alignnone size-full wp-image-1214&quot; /&gt;&lt;/a&gt;
否則你就算是用有 Manager 權限的身份登入也是照樣收到 403。
我是忘了這 plugin 的原作者是不是這樣設計的，
不過如果你用我改過的版本那就一定是這樣。</description>
		<content:encoded><![CDATA[<p>官方的 Redmine.pm 會先判斷你 redmine 裡那個 project 是不是設定成 public，<br />
如果是 public 而且你的存取動作是讀取性質的，<br />
就會直接取消後續的驗證動作直接讓你讀取。<br />
如果是寫入性質的，<br />
就會發個 401 要求你輸入帳號密碼。<br />
client 收到 401 會跳出對話框或提示符號要求使用者輸入帳號密碼，<br />
如果持續得到 401 才會放棄要求 user 輸入並回報 401 給 user。<br />
Repository Controls Plugin 是改自官方的 Redmine.pm，<br />
所以這條規則相同。<br />
但我修改後的版本就完全不管 project 是否被設定成 public，<br />
而是完全按照各路徑的權限設定來判定。</p>
<p>遇到 403 的可能性有兩種。</p>
<p>一種是你沒在 &lt;Location&gt; 標籤裡放入 Allow from all，<br />
或是你寫了 Allow from <ip -address> 但是你的連線來源卻不是那個 IP。</p>
<p>另一種就是你裝了 Repository Controls Plugin 並在 apache 的設定裡使用它。<br />
這個 plugin 跟官方那個的差別是官方是只要登入就可以寫入任意路徑，<br />
而這個 plugin 則是還會確認你是否有某個路徑的讀取/寫入權限。<br />
這 plugin 剛安裝好的時候權限設定的部分是空白的，<br />
你至少必須去 project 的設定頁面替 Manager 這個 role 開啟 / 的 read/write 權限才行：<br />
<a href="http://blog.tinlans.org/wp-content/uploads/2009/12/RepoControlSettings.jpg" rel="lightbox[1017]" rel="nofollow"><img src="http://blog.tinlans.org/wp-content/uploads/2009/12/RepoControlSettings.jpg" alt="" title="RepoControlSettings" width="512" height="251" class="alignnone size-full wp-image-1214" /></a><br />
否則你就算是用有 Manager 權限的身份登入也是照樣收到 403。<br />
我是忘了這 plugin 的原作者是不是這樣設計的，<br />
不過如果你用我改過的版本那就一定是這樣。</ip></p>
]]></content:encoded>
	</item>
	<item>
		<title>由：uranus</title>
		<link>http://blog.tinlans.org/2009/12/19/redmine-%e7%9a%84-repository-controls-plugin-%ef%bc%88%e7%ba%8c%ef%bc%89/comment-page-1/#comment-213</link>
		<dc:creator>uranus</dc:creator>
		<pubDate>Tue, 23 Feb 2010 12:12:44 +0000</pubDate>
		<guid isPermaLink="false">https://blog.tinlans.org/?p=1017#comment-213</guid>
		<description>下面那個不知道。
上面那個是路徑的問題，
因為那個 plugin 的 get_project_identifier 和 get_requested_path 這兩個 function 沒有寫得很好，
可能會造成 project 的 id 或是 path 變成 null；
你可以在 .pm 檔裡插入一些 print，
然後用 httpd -X 啟動 apache 來看它的輸出做一些基本的 debug。

之前印象中原作者的寫法有強烈要求路徑名稱要完整，
也就是不能用 http://222.111.56.199/svn/aa，
而是必須用 http://222.111.56.199/svn/aa/ 這樣結尾有 / (目錄才需要)，
不然是會發生錯誤的。

我修改後的 .pm 檔也有保留原作者的部分：
&lt;pre lang=&quot;perl&quot;&gt;
    if($location ne &quot;/&quot;) {
        # 這段是原作者寫的，他假設你一定是寫 &lt;Location /svn&gt;，存取路徑一定是 http(s)://svn/檔案庫名稱/... 這樣。
        ($path) = $r-&gt;uri =~ m{$location/*[^/]+(/.*)};
    }
    else {
        # 這段是我自己寫的，因為我是開 vhost 所以直接用 &lt;Location /&gt;，存取路徑就是 http(s)://檔案庫名稱/... 這樣。
        ...
    }
&lt;/pre&gt;
其實要改到完美不保留原作者寫的部分也不是不行，
只是當初實在懶得做下去了。</description>
		<content:encoded><![CDATA[<p>下面那個不知道。<br />
上面那個是路徑的問題，<br />
因為那個 plugin 的 get_project_identifier 和 get_requested_path 這兩個 function 沒有寫得很好，<br />
可能會造成 project 的 id 或是 path 變成 null；<br />
你可以在 .pm 檔裡插入一些 print，<br />
然後用 httpd -X 啟動 apache 來看它的輸出做一些基本的 debug。</p>
<p>之前印象中原作者的寫法有強烈要求路徑名稱要完整，<br />
也就是不能用 <a href="http://222.111.56.199/svn/aa，" rel="nofollow">http://222.111.56.199/svn/aa，</a><br />
而是必須用 <a href="http://222.111.56.199/svn/aa/" rel="nofollow">http://222.111.56.199/svn/aa/</a> 這樣結尾有 / (目錄才需要)，<br />
不然是會發生錯誤的。</p>
<p>我修改後的 .pm 檔也有保留原作者的部分：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1017code2'); return false;">View Code</a> PERL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10172"><td class="code" id="p1017code2"><pre class="perl" style="font-family:monospace;">    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$location</span> <span style="color: #b1b100;">ne</span> <span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># 這段是原作者寫的，他假設你一定是寫 &lt;Location /svn&gt;，存取路徑一定是 http(s)://svn/檔案庫名稱/... 這樣。</span>
        <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$path</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$r</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">uri</span> <span style="color: #339933;">=~</span> <a href="http://perldoc.perl.org/functions/m.html"><span style="color: #000066;">m</span></a><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$location</span><span style="color: #339933;">/*</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">^</span><span style="color: #009966; font-style: italic;">/]+(/</span><span style="color: #339933;">.*</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># 這段是我自己寫的，因為我是開 vhost 所以直接用 &lt;Location /&gt;，存取路徑就是 http(s)://檔案庫名稱/... 這樣。</span>
        <span style="color: #339933;">...</span>
    <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>其實要改到完美不保留原作者寫的部分也不是不行，<br />
只是當初實在懶得做下去了。</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：uranus</title>
		<link>http://blog.tinlans.org/2009/12/19/redmine-%e7%9a%84-repository-controls-plugin-%ef%bc%88%e7%ba%8c%ef%bc%89/comment-page-1/#comment-212</link>
		<dc:creator>uranus</dc:creator>
		<pubDate>Tue, 23 Feb 2010 12:03:45 +0000</pubDate>
		<guid isPermaLink="false">https://blog.tinlans.org/?p=1017#comment-212</guid>
		<description>照 plugin 官方的設定方式是沒有問題的。
如果是用我的那兩個 .pm 來設定的話，
anonymous 用的 vhost 是這樣設：
&lt;pre lang=&quot;&quot;&gt;
&lt;VirtualHost *:80&gt;
  ...
  PerlLoadModule Apache::RedminePublicRepoControl
  &lt;Location /svn&gt;
    ...
    PerlAccessHandler Apache::Authn::RedminePublicRepoControl::access_handler
    ...
  &lt;/Location&gt;
  ...
&lt;/VirtualHost&gt;
&lt;/pre&gt;
需要認證的 vhost 則是：
&lt;pre lang=&quot;&quot;&gt;
&lt;VirtualHost *:443&gt;
  ...
  PerlLoadModule Apache::RedmineRepoControl
  &lt;Location /svn&gt;
    ...
    PerlAccessHandler Apache::Authn::RedmineRepoControl::access_handler
    PerlAuthenHandler Apache::Authn::RedmineRepoControl::authen_handler
    PerlAuthzHandler Apache::Authn::RedmineRepoControl::authz_handle
    ...
  &lt;/Location&gt;
  ...
&lt;/VirtualHost&gt;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>照 plugin 官方的設定方式是沒有問題的。<br />
如果是用我的那兩個 .pm 來設定的話，<br />
anonymous 用的 vhost 是這樣設：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1017code3'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10173"><td class="code" id="p1017code3"><pre class="text" style="font-family:monospace;">&lt;VirtualHost *:80&gt;
  ...
  PerlLoadModule Apache::RedminePublicRepoControl
  &lt;Location /svn&gt;
    ...
    PerlAccessHandler Apache::Authn::RedminePublicRepoControl::access_handler
    ...
  &lt;/Location&gt;
  ...
&lt;/VirtualHost&gt;</pre></td></tr></table></div>

<p>需要認證的 vhost 則是：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1017code4'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10174"><td class="code" id="p1017code4"><pre class="text" style="font-family:monospace;">&lt;VirtualHost *:443&gt;
  ...
  PerlLoadModule Apache::RedmineRepoControl
  &lt;Location /svn&gt;
    ...
    PerlAccessHandler Apache::Authn::RedmineRepoControl::access_handler
    PerlAuthenHandler Apache::Authn::RedmineRepoControl::authen_handler
    PerlAuthzHandler Apache::Authn::RedmineRepoControl::authz_handle
    ...
  &lt;/Location&gt;
  ...
&lt;/VirtualHost&gt;</pre></td></tr></table></div>

]]></content:encoded>
	</item>
	<item>
		<title>由：uranus</title>
		<link>http://blog.tinlans.org/2009/12/19/redmine-%e7%9a%84-repository-controls-plugin-%ef%bc%88%e7%ba%8c%ef%bc%89/comment-page-1/#comment-211</link>
		<dc:creator>uranus</dc:creator>
		<pubDate>Tue, 23 Feb 2010 11:44:39 +0000</pubDate>
		<guid isPermaLink="false">https://blog.tinlans.org/?p=1017#comment-211</guid>
		<description>可以試試看 &lt;pre lang=&quot;&quot;&gt;&lt;&gt; 或 &lt;code&gt; 標籤。
不過我也不確定 wordpress 給不給在 comments 裡面用，
因為 web UI 上沒看到相關設定，
似乎需要直接改 code 或寫 plugin 去 hook 它。</description>
		<content:encoded><![CDATA[<p>可以試試看 &lt;pre lang=""&gt;&lt;&gt; 或 &lt;code&gt; 標籤。<br />
不過我也不確定 wordpress 給不給在 comments 裡面用，<br />
因為 web UI 上沒看到相關設定，<br />
似乎需要直接改 code 或寫 plugin 去 hook 它。</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：ajian</title>
		<link>http://blog.tinlans.org/2009/12/19/redmine-%e7%9a%84-repository-controls-plugin-%ef%bc%88%e7%ba%8c%ef%bc%89/comment-page-1/#comment-210</link>
		<dc:creator>ajian</dc:creator>
		<pubDate>Tue, 23 Feb 2010 03:53:33 +0000</pubDate>
		<guid isPermaLink="false">https://blog.tinlans.org/?p=1017#comment-210</guid>
		<description>我检查了日志不能够checkout的原因是
Use of uninitialized value in pattern match (m//) at /usr/lib/perl5/site_perl/Apache/RedmineRepoControl.pm line 244.\n
在redmine上操作该插件出现的错误有
NoMethodError (undefined method `each&#039; for nil:NilClass):
  vendor/plugins/redmine_repository_control/app/controllers/repository_controls_controller.rb:15:in `new&#039;
但解决办法还没有找到 perl语言不是很熟</description>
		<content:encoded><![CDATA[<p>我检查了日志不能够checkout的原因是<br />
Use of uninitialized value in pattern match (m//) at /usr/lib/perl5/site_perl/Apache/RedmineRepoControl.pm line 244.\n<br />
在redmine上操作该插件出现的错误有<br />
NoMethodError (undefined method `each' for nil:NilClass):<br />
  vendor/plugins/redmine_repository_control/app/controllers/repository_controls_controller.rb:15:in `new'<br />
但解决办法还没有找到 perl语言不是很熟</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：ajian</title>
		<link>http://blog.tinlans.org/2009/12/19/redmine-%e7%9a%84-repository-controls-plugin-%ef%bc%88%e7%ba%8c%ef%bc%89/comment-page-1/#comment-209</link>
		<dc:creator>ajian</dc:creator>
		<pubDate>Tue, 23 Feb 2010 03:08:14 +0000</pubDate>
		<guid isPermaLink="false">https://blog.tinlans.org/?p=1017#comment-209</guid>
		<description>补充,我使用的redmine是 trunk的  
另外发现该插件官网的配置文件中
PerlLoadModule Apache::RedmineRepoControl  这个是没有Authn的
但后面的
  PerlAccessHandler Apache::Authn::RedmineRepoControl::access_handler
     PerlAuthenHandler Apache::Authn::RedmineRepoControl::authen_handler
     PerlAuthzHandler Apache::Authn::RedmineRepoControl::authz_handler
又是存在的 不知道这个官网文档是否正确?</description>
		<content:encoded><![CDATA[<p>补充,我使用的redmine是 trunk的<br />
另外发现该插件官网的配置文件中<br />
PerlLoadModule Apache::RedmineRepoControl  这个是没有Authn的<br />
但后面的<br />
  PerlAccessHandler Apache::Authn::RedmineRepoControl::access_handler<br />
     PerlAuthenHandler Apache::Authn::RedmineRepoControl::authen_handler<br />
     PerlAuthzHandler Apache::Authn::RedmineRepoControl::authz_handler<br />
又是存在的 不知道这个官网文档是否正确?</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：ajian</title>
		<link>http://blog.tinlans.org/2009/12/19/redmine-%e7%9a%84-repository-controls-plugin-%ef%bc%88%e7%ba%8c%ef%bc%89/comment-page-1/#comment-208</link>
		<dc:creator>ajian</dc:creator>
		<pubDate>Tue, 23 Feb 2010 02:56:48 +0000</pubDate>
		<guid isPermaLink="false">https://blog.tinlans.org/?p=1017#comment-208</guid>
		<description>上面配置文件中的&lt; 尖括号都被过滤掉了, 需要用什么标识才可以保存原始代码呢?</description>
		<content:encoded><![CDATA[<p>上面配置文件中的&lt; 尖括号都被过滤掉了, 需要用什么标识才可以保存原始代码呢?</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：ajian</title>
		<link>http://blog.tinlans.org/2009/12/19/redmine-%e7%9a%84-repository-controls-plugin-%ef%bc%88%e7%ba%8c%ef%bc%89/comment-page-1/#comment-207</link>
		<dc:creator>ajian</dc:creator>
		<pubDate>Tue, 23 Feb 2010 02:46:45 +0000</pubDate>
		<guid isPermaLink="false">https://blog.tinlans.org/?p=1017#comment-207</guid>
		<description>你好!
   我最近也在用这个Redmine,而且很需要这个Repository Controls plugin 这个的功能.
根据这个插件的官方文档进行了安装.确保在使用redmine.pm的情况下可以通过项目的关联进行正常的SVN存取.但是只要改成RedmineRepoControl 后就不行了.
我的apache配置文件是:
&lt;pre lang=&quot;&quot;&gt;
PerlLoadModule Apache::Authn::RedmineRepoControl
...
  &lt;Location /svn&gt;
     DAV svn                                    
     SVNParentPath &quot;/home/svn&quot;                                    
     AuthType Basic
     AuthName redmine
     Require valid-user

#     PerlAccessHandler Apache::Authn::Redmine::access_handler
#     PerlAuthenHandler Apache::Authn::Redmine::authen_handler
     PerlAccessHandler Apache::Authn::RedmineRepoControl::access_handler
     PerlAuthenHandler Apache::Authn::RedmineRepoControl::authen_handler
     PerlAuthzHandler Apache::Authn::RedmineRepoControl::authz_handler  

     ## for mysql
     RedmineDSN &quot;DBI:mysql:database=redmine;host=localhost&quot;
     
     RedmineDbUser &quot;redmine&quot;
     RedmineDbPass &quot;yourpassword&quot;

     #Cache the last 50 auth entries
     RedmineCacheCredsMax 100
  &lt;/Location&gt;

  &lt;Location /svn-private&gt;
  # /svn location for Redmine

    DAV svn
    SVNParentPath &quot;/home/svn&quot;
    Order deny,allow
    Deny from all
    # only allow reading orders

    Allow from 127.0.0.1
  &lt;/Location&gt;
&lt;/pre&gt;
  
使用/svn无法进行CO  提示一次用户名之后直接401错误,如果不是用这个插件 正确的提示会在root密码回车之后再提示输入新的用户名.
linux-ajian:/tmp # svn co http://222.111.56.199/svn/aa aa
认证领域:  redmine
“root”的密码:
svn: 服务器发送了意外的返回值(401 Authorization Required)，在响应 “OPTIONS” 的请求 “http://222.111.56.199/svn/aa” 中
使用/svn-private进行CO 可以进行匿名的CO 但是无法存入
# svn ci -m &quot;aaa&quot;
svn: Commit failed (details follow):
svn: MKACTIVITY of &#039;/svn-private/aa/!svn/act/0dc0ff55-6c78-45cd-975f-e34840245075&#039;: 403 Forbidden (http://127.0.0.1)

我也看过你的文章 并且把你的PM文件也都添加上去了 但还是不行.这个插件的资料比较少,希望能帮我分析下问题的原因是什么.谢谢.</description>
		<content:encoded><![CDATA[<p>你好!<br />
   我最近也在用这个Redmine,而且很需要这个Repository Controls plugin 这个的功能.<br />
根据这个插件的官方文档进行了安装.确保在使用redmine.pm的情况下可以通过项目的关联进行正常的SVN存取.但是只要改成RedmineRepoControl 后就不行了.<br />
我的apache配置文件是:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1017code5'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10175"><td class="code" id="p1017code5"><pre class="text" style="font-family:monospace;">PerlLoadModule Apache::Authn::RedmineRepoControl
...
  &lt;Location /svn&gt;
     DAV svn                                    
     SVNParentPath &quot;/home/svn&quot;                                    
     AuthType Basic
     AuthName redmine
     Require valid-user
&nbsp;
#     PerlAccessHandler Apache::Authn::Redmine::access_handler
#     PerlAuthenHandler Apache::Authn::Redmine::authen_handler
     PerlAccessHandler Apache::Authn::RedmineRepoControl::access_handler
     PerlAuthenHandler Apache::Authn::RedmineRepoControl::authen_handler
     PerlAuthzHandler Apache::Authn::RedmineRepoControl::authz_handler  
&nbsp;
     ## for mysql
     RedmineDSN &quot;DBI:mysql:database=redmine;host=localhost&quot;
&nbsp;
     RedmineDbUser &quot;redmine&quot;
     RedmineDbPass &quot;yourpassword&quot;
&nbsp;
     #Cache the last 50 auth entries
     RedmineCacheCredsMax 100
  &lt;/Location&gt;
&nbsp;
  &lt;Location /svn-private&gt;
  # /svn location for Redmine
&nbsp;
    DAV svn
    SVNParentPath &quot;/home/svn&quot;
    Order deny,allow
    Deny from all
    # only allow reading orders
&nbsp;
    Allow from 127.0.0.1
  &lt;/Location&gt;</pre></td></tr></table></div>

<p>使用/svn无法进行CO  提示一次用户名之后直接401错误,如果不是用这个插件 正确的提示会在root密码回车之后再提示输入新的用户名.<br />
linux-ajian:/tmp # svn co <a href="http://222.111.56.199/svn/aa" rel="nofollow">http://222.111.56.199/svn/aa</a> aa<br />
认证领域:  redmine<br />
“root”的密码:<br />
svn: 服务器发送了意外的返回值(401 Authorization Required)，在响应 “OPTIONS” 的请求 “http://222.111.56.199/svn/aa” 中<br />
使用/svn-private进行CO 可以进行匿名的CO 但是无法存入<br />
# svn ci -m "aaa"<br />
svn: Commit failed (details follow):<br />
svn: MKACTIVITY of '/svn-private/aa/!svn/act/0dc0ff55-6c78-45cd-975f-e34840245075': 403 Forbidden (<a href="http://127.0.0.1" rel="nofollow">http://127.0.0.1</a>)</p>
<p>我也看过你的文章 并且把你的PM文件也都添加上去了 但还是不行.这个插件的资料比较少,希望能帮我分析下问题的原因是什么.谢谢.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

