Thread (16 messages) flat view 16 messages, 4 authors, 2016-06-15

Re: git no longer prompting for password

From: BJ Hargrave <hidden>
Date: 2016-06-15 22:54:35

Possibly related (same subject, not in this thread)

On Aug 27, 2012, at 04:28 , Iain Paton wrote:
On 26/08/12 10:57, Iain Paton wrote:
quoted
       <If "%{THE_REQUEST} =~ /git-receive-pack/">
I've just discovered that the <If ..> directive only appears in apache 2.4 
so something more generic will probably be a better idea. Not everyone will 
be running 2.4.x for a while yet.

You could try something like this:

<Location /git>
  # Require authentication for git push
  RewriteCond %{QUERY_STRING} service=git-receive-pack
  RewriteRule .* - [E=AUTHREQUIRED:yes]
  Order Allow,Deny
  Deny from env=AUTHREQUIRED
  Allow from all
  Satisfy Any
  # Whatever auth rules you want ...

I haven't tested this specific example but it is based upon similar rules I use on a 2.0 server to require auth when specific query parameters are present. In my case, I have the Rewrite rules in the <VirtualHost> and the other directives in the <Directory> being protected.
-- 

BJ
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help