I would like to introduce access control to cgit once the cgi of cgit has been launched. The idea would be to list all the repos available in gitolite but enable/disable the directory listing based on user authentication.
I managed to get access control before apache is executing the cgit cgi:
AllowOverride None
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /var/lib/git_alfonso/passwords
Options +ExecCGI
Order allow,deny
Allow from all
Alias /cgit.png /var/www/htdocs/cgit/cgit.png
Alias /cgit.css /var/www/htdocs/cgit/cgit.css
ScriptAlias /cgit "/var/www/htdocs/cgit/cgit.cgi"
RewriteRule ^$ / [R]
RewriteRule ^/(.*)$ /cgit.cgi/$1****
But I don't know how to get the same effect once the repositories paths are accessed, I tried with the directory directive and adding the authentication there but once cgit is launched apache doesn't apply any other directive stated in the http.conf file.
Any clue on how to achieve it?
Thanks a lot in advance.
Br Alfonso.