2017-04-20 27 views
1

我們如何用gitolite中的智能http實現細粒度ACL?如何在gitolite中使用智能http訪問獲取存儲庫的細粒度ACL?

這是什麼確切指的是:如果我使用ssh限制某些用戶的某些式回購gitolite如果我嘗試克隆限制回購,gitolite講述:

Fatal R any (some_username) is denied. 
Please make sure the repository exists". 

如何實現上述訪問控制列表使用智能http?
如果可能的話,請指定設置(apache2)以達到相同效果。

回答

0

gitolite是智能HTTP兼容,正如我所說in 2012in here

所有你需要做的是設置those 4 lines

SetEnv GIT_PROJECT_ROOT @[email protected]/repositories 
SetEnv GIT_HTTP_EXPORT_ALL 
SetEnv GITOLITE_HTTP_HOME @[email protected] 
ScriptAlias /hgit/ /path/to/gitolite/sbin/gitolite-shell/ 
SetEnv GIT_HTTP_BACKEND "/path/to/git/libexec/git-core/git-http-backend" 

這樣一來,任何url with a path開始/hgit將查詢gitolite第一(通過其src/gitolite-shell perl腳本)

git clone http://myserver/hgit/myrepo.git 

您需要通過authentication basic provider(file,ldap,dbm,...)
01之一以to authenticate yourself的方式將其耦合在my httpd.conf, I use LDAP

AuthName "LDAP authentication for ITSVC Smart HTTP Git repositories" 
    AuthType Basic 
    AuthBasicProvider ldap 
    AuthLDAPBindDN "@[email protected]" 
    AuthLDAPBindPassword @[email protected] 
    AuthLDAPURL @[email protected] 
    AuthLDAPGroupAttribute member 

你會通過their actual values替換佔位符串@[email protected]

+0

我試着用上面提到的代碼。但我仍然無法找到答案。你能否以順序的方式發佈步驟(代碼),以便我清楚地瞭解哪一步首先執行,哪一步最後執行。我閱讀了很多關於「smart-http」實現的文檔,實際上很混亂,每個人都以多種方式實現了相同的主題,這對於像我這樣的初學者來說似乎非常複雜。請幫我解決這個問題。 –