gitolite + http mode + LDAP
gitolite 安裝
參考這邊,將 /var/www 改為想要放置 git repo 位置的目錄cd /var/www/mkdir gitolite-homeexport GITOLITE_HTTP_HOME=/var/www/gitolite-homePATH=$PATH:$GITOLITE_HTTP_HOME/bincd gitolite-home/git clone git://github.com/sitaramc/gitolite gitolite-sourcecd gitolite-source/GHH=$GITOLITE_HTTP_HOMEmkdir -p $GHH/bin $GHH/share/gitolite/conf $GHH/share/gitolite/hookssrc/gl-system-install $GHH/bin $GHH/share/gitolite/conf $GHH/share/gitolite/hooksvim /var/www/gitolite-home/share/gitolite/conf/example.gitolite.rcgl-setup ADMIN的LDAP帳號
apache 設定
參考這邊,修改 auth 的部份為 LDAP
<LocationMatch "/git">AuthType BasicAuthName "Git"Require valid-userAuthBasicProvider ldapAuthzLDAPAuthoritative offAuthLDAPURL "ldap://server:389/dc=company,dc=local?sAMAccountName?sub?(objectclass=*)" NONEAuthLDAPBindDN "cn=user,ou=team,ou=department,dc=company,dc=local"AuthLDAPBindPassword secret</LocationMatch>
設定gitolite
選擇以後要放設定檔的位置
- git clone http://server/git/gitolite-admin
gitolite.conf 的設定說明,要新增 repo 或是要加入使用者設定都是在這個檔案修改,修改完成以後將 gitolite.conf 更新回 server
- git add
- git commit
- git push origin master
No comments:
Post a Comment