"no repositories found": cgit + gitolite + nginx -- git/ssh access OK, web access OK, no errors, but no repos found/displayed?

PGNet Dev pgnet.dev at gmail.com
Thu Aug 15 04:52:01 CEST 2019


a number of popular refs, e.g.,

	https://wiki.archlinux.org/index.php/Cgit#Using_uwsgi

recommend an nginx config similar to,

	location / {

		try_files $uri @cgit;

	}

	location @cgit {

		gzip off;

		include uwsgi_params;

		uwsgi_modifier1 9;

		uwsgi_pass unix:/run/uwsgi/cgit.sock;

	}

which is what I've been using so far.

reading here,

	https://uwsgi-docs.readthedocs.io/en/latest/Nginx.html#hosting-multiple-apps-in-the-same-process-aka-managing-script-name-and-path-info

suggests (?) a script path rewrite issue, though it's not clear to me WHAT's needed.

this post

	https://lists.zx2c4.com/pipermail/cgit/2018-April/003784.html

has a working solution.
editing my nginx config,

	location / {

-		try_files $uri @cgit;

+		try_files $uri /cgit.cgi?url=$uri&$args;
	}

-	location @cgit {

+	location /cgit.cgi {

+		internal;
		gzip off;

		include uwsgi_params;

		uwsgi_modifier1 9;

		uwsgi_pass unix:/run/uwsgi/cgit.sock;

	}

now, I see repos/content in the UI; e.g., @

	https://cgit.dev.loc/testing.git/diff/

nicely displays

	https://i.imgur.com/qCeYHnz.png

if that^^ required rewrite is explicitly/clearly in docs somewhere, I've missed it.

reading @ cgit manpage,

	https://git.zx2c4.com/cgit/tree/cgitrc.5.txt#n441
		virtual-root::

			Url which, if specified, will be used as root for all cgit links. It

			will also cause cgit to generate 'virtual urls', i.e. urls like

			'/cgit/tree/README' as opposed to '?r=cgit&p=tree&path=README'. Default

			value: none.

			NOTE: cgit has recently learned how to use PATH_INFO to achieve the

			same kind of virtual urls, so this option will probably be deprecated.

suggests that PATH_INFO can (should?) be used to avoid the try/rewrite.

on my sys, nginx's 'uwsgi_params' contains

	uwsgi_param  PATH_INFO          $document_uri;

and, as above, I have

	/etc/cgitrc
		...
		virtual-root=/
		...

I haven't yet found the docs for PATH_INFO usage to do so ...


More information about the CGit mailing list