You are not logged in.

#1 2022-03-25 17:00:01

H2R
Member
Registered: 2021-11-13
Posts: 13

Consistent Permission Errors with cgit/nginx/gitolite

Similar to to this post from 7 years ago I am getting a "No repositories found" error on the cgit interface. That post wasn't about hosting cgit on a sub-domain, and I think my issue is different.

My gitolite setup is working fine, and I have changed permissions as directed in the cgit wiki "Integration" section, i.e:

sudo -u gitolite gitolite setup -pk /var/lib/gitolite/username.pub
usermod -aG gitolite http
# Change UMASK to 0027 in /var/lib/gitolite/.gitolite.rc
chmod g+rX /var/lib/gitolite
chmod -R g+rX /var/lib/gitolite/repositories

This was done prior to setting up nginx. My nginx setup is identical to the one described on the cgit wiki page (beyond the changed *server_name* and GIT_PROJECT_ROOT, HOME):

worker_processes          1;
 
events {
  worker_connections      1024;
}
 
http {
  include                 mime.types;
  default_type            application/octet-stream;
  sendfile                on;
  keepalive_timeout       65;
  gzip                    on;
 
  # Cgit
  server {
    listen                80;
    server_name           git.user.com;
    root                  /usr/share/webapps/cgit;
    try_files             $uri @cgit;

    # Configure HTTP transport
    location ~ /.+/(info/refs|git-upload-pack) {
        include             fastcgi_params;
        fastcgi_param       SCRIPT_FILENAME     /usr/libexec/git-core/git-http-backend;
        fastcgi_param       PATH_INFO           $uri;
        fastcgi_param       GIT_HTTP_EXPORT_ALL 1;
        fastcgi_param       GIT_PROJECT_ROOT    /var/lib/gitolite/repositories/;
        fastcgi_param       HOME                /var/lib/gitolite/;
        fastcgi_pass        unix:/run/fcgiwrap.sock;
    }

    location @cgit {
      include             fastcgi_params;
      fastcgi_param       SCRIPT_FILENAME $document_root/cgit.cgi;
      fastcgi_param       PATH_INFO       $uri;
      fastcgi_param       QUERY_STRING    $args;
      fastcgi_param       HTTP_HOST       $server_name;
      fastcgi_pass        unix:/run/fcgiwrap.sock;
    }
  }
}

My cgit config is the following:

virtual-root=/
enable-git-config=1
project-list /var/lib/gitolite/projects.list
scan-path /var/lib/gitolite/repositories

Otherwise I have ufw, fail2ban, fcgiwrap.socket enabled. Not sure what I am missing here.

Last edited by H2R (2022-03-25 17:21:31)

Offline

Board footer

Powered by FluxBB