我只是想用Apache在http上做一个私有的reposity。但是当我执行git PULL时,我不能强制服务器要求用户/密码。当我按下按钮时,只询问用户/通行证。
仓库在c:/htdocs/git/test.git
我的httpd.conf:
<Directory />
#AllowOverride none
#Require all denied
</Directory>
SetEnv GIT_PROJECT_ROOT G:/htdocs/git
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
ScriptAlias /git/ "C:/Program Files (x86)/Git/libexec/git-core/git-http-backend.exe/"
<Directory "C:/Program Files (x86)/Git/libexec/git-core/">
AllowOverride None
Options +ExecCGI
Order allow,deny
Allow from all
</Directory>
ScriptAliasMatch \
"(?x)^/(.*/(HEAD | \
info/refs | \
objects/(info/[^/]+ | \
[0-9a-f]{2}/[0-9a-f]{38} | \
pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
git-(upload|receive)-pack))$" \
"C:/Program Files (x86)/Git/libexec/git-core/git-http-backend.exe/$1"
<LocationMatch "^/.*/git-receive-pack$">
Options +ExecCGI
AuthType Basic
AuthName "Git"
AuthUserFile "G:/gitSecurity/password.git"
Require valid-user
</LocationMatch>
我错过了什么?
谢谢!
1条答案
按热度按时间nxowjjhe1#
刚刚解决了这个问题,我认为问题是你的
LocationMatch
只检查当有人推(git-receive-pack
)。您需要使用一个Location
指令,该指令适用于对git repos的所有访问,如