在像我希望的那样使用 GIT 成功进行重写后,我设法打破了推送到 git 所需的身份验证。
ScriptAlias
出于某种原因,如果请求的话,似乎重写了身份验证信息,http://username:password@domain.tld/
这使得无法推送数据。
<VirtualHost *:80>
DocumentRoot /home/subgit/repos
<Directory /home/subgit/repos>
Options None
AllowOverride none
Order allow,deny
Allow from all
</Directory>
CustomLog /home/subgit/logs/access_log combined
SuexecUserGroup subgit subgit
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^git
RewriteRule ^(.*)$ /git/testrepo/$1 [PT]
RewriteCond %{QUERY_STRING} service=git-receive-pack [OR,NC]
RewriteCond %{REQUEST_URI} ^/git/.*/git-receive-pack$ [NC]
RewriteRule .* - [E=AUTHREQUIRED:yes]
ScriptAlias /git/ /home/subgit/bin/gitolite-suexec-wrapper.sh/
<LocationMatch "/git/">
Order Allow,Deny
Deny from env=AUTHREQUIRED
Allow from all
Satisfy Any
AuthType Basic
AuthName "subgit"
AuthBasicProvider file
AuthUserFile /home/subgit/etc/subgit
Require valid-user
</LocationMatch>
</VirtualHost>