http経由で使えるようにしたgitリポジトリをgitweb.cgiで閲覧可能にする
ここでHTTP経由でgitを使えるようにしましたが、
Basic認証外のユーザにWebからgitweb.cgiでアクセス制御なしに
閲覧可能にしたいと思います。
% sudo cp /opt/local/share/git-core/gitweb/* /opt/local/var/git/ % sudo chmod755 /opt/local/var/git/gitweb.cgi % sudo vi /opt/local/var/git/gitweb.cgi % sudo vi opt/local/apache2/conf/conf.d/git.conf % sudo /opt/local/apache2/bin/apachectl restart
gitweb.cgi
our $projectroot = "/pub/git"; ↓ our $projectroot = "/opt/local/var/git"; # URI of stylesheets our @stylesheets = ("static/gitweb.css"); # URI of a single stylesheet, which can be overridden in GITWEB_CONFIG. our $stylesheet = undef; # URI of GIT logo (72x27 size) our $logo = "static/git-logo.png"; # URI of GIT favicon, assumed to be image/png type our $favicon = "static/git-favicon.png"; # URI of gitweb.js (JavaScript code for gitweb) our $javascript = "static/gitweb.js"; ↓ # URI of stylesheets our @stylesheets = ("gitweb.css"); # URI of a single stylesheet, which can be overridden in GITWEB_CONFIG. our $stylesheet = undef; # URI of GIT logo (72x27 size) our $logo = "git-logo.png"; # URI of GIT favicon, assumed to be image/png type our $favicon = "git-favicon.png"; # URI of gitweb.js (JavaScript code for gitweb) our $javascript = "gitweb.js";
conf.d/git.conf
DavLockDB "/tmp/DavLock" Alias /git/ "/opt/local/var/git/" Alias /git/webFirstPj/ "/opt/local/var/git/webFirstPj/" <Directory "/opt/local/var/git"> AddHandler cgi-script .cgi Options ExecCGI Order allow,deny Allow from all </Directory> <Directory "/opt/local/var/git/webFirstPj"> DAV on AuthType Basic AuthName "Git" AuthUserFile /opt/local/apache2/var/passwd.git Require valid-user Order allow,deny Allow from all </Directory>
※インターネットにCGIを公開するまでのセキュリティの考慮はしてません。