Authentication with Gitblit as Plug-in in Gerrit

210 views Asked by At

I have a Gerrit installation on ubuntu which uses HTTP Authentication with an apache2. As a viewer we would like to use Gitblit as a plug-in in Gerrit. I found already the plugin here here and I followed the install instruction there.

Since all other plugins in Gerrit works properly, like blabla.com/gerrit/plugins/gitiles/ or some other, I always get a log-in request when I try to browse to blabla.com/gerrit/plugins/gitblit/ (Also the documentation folder).

I think I have anything wrong or missing in the apache2 configuration, but I don't found the right so far.

After installation of the apache2 for Gerrit (by this guide) I haven't touched the apache2.conf, I just added a gerrit.conf in the mods-enable subfolder of apache2 with this content:

ProxyPass           /gerrit  http://localhost:8081/gerrit nocanon
ProxyPassReverse    /gerrit  http://localhost:8081/gerrit nocanon
ProxyRequests       Off

<Proxy http://localhost:8081/gerrit>
  Order deny,allow
  Allow from all
</Proxy>

<Location /gerrit>
  AuthType Digest
  AuthName "gerrit"
  AuthUserFile /etc/apache2/.htdigest
  Require valid-user
</Location>

When I access Gerrit using our address/gerrit I get asked for the permission which we added using htdigest in the first place.

Any Idea what's wrong? Why Gitblit is ask for a log-in and doesn't accept any? (I'm new in Apache authentication at all)

1

There are 1 answers

0
William.Tsang On

http://gitblit.com/setup_authentication.html Gitblit only support authtype below:

LDAP authentication
Windows authentication
PAM authentication
Htpasswd authentication
HTTP header authentication
Redmine auhentication
Salesforce.com authentication
Servlet container authentication

But your auth type is Digest, you can try switching auth type to htpasswd by the below steps:

  1. add a new auth file sudo htpasswd -c /etc/apache2/.htpasswd log_name_xxx
  2. modify your gerrit.conf in /etc/apache2/...

    AuthType Basic AuthName "gerrit" AuthUserFile /etc/apache2/.htpasswd Require valid-user

  3. restart apache2

    sudo service apache2 restart

Please let me know if there is any other problem. Hope it useful. Ahhhhh