I installed a server with, nginx -v nginx version: nginx/1.17.3 uwsgi --version 2.0.18 cgit/cgit.cgi --version CGit v1.2.1 | https://git.zx2c4.com/cgit/ Compiled in features: [-] Lua scripting [+] Linux sendfile() usage cd gitolite git log | head commit ef9ab68412cbee93c24eb920dbabbb6daa8b1c08 Author: Sitaram Chamarty <sitaramc at gmail.com> Date: Tue Jun 11 11:53:30 2019 +0530 Users/groups are setup as id wwwrun uid=30(wwwrun) gid=8(www) groups=8(www),475(gitolite) id wwwrun-cgit uid=474(wwwrun-cgit) gid=8(www) groups=8(www),475(gitolite) id gitolite uid=475(gitolite) gid=475(gitolite) groups=475(gitolite) where, nginx/webserver user:group are wwwrun:www gitolite initial repo's are installed ls -al /data/git/gitolite/repositories/ total 16K drwxr-x--- 4 gitolite gitolite 4.0K Aug 12 20:05 ./ drwxr-x--- 9 gitolite gitolite 4.0K Aug 12 20:06 ../ drwxr-x--- 8 gitolite gitolite 4.0K Aug 12 20:05 gitolite-admin.git/ drwxr-x--- 7 gitolite gitolite 4.0K Aug 12 20:05 testing.git/ cat /data/git/gitolite/projects.list testing.git from desktop, I can checkout from gitolite directly git clone git01:gitolite-admin Cloning into 'gitolite-admin'... remote: Enumerating objects: 6, done. remote: Counting objects: 100% (6/6), done. remote: Compressing objects: 100% (4/4), done. remote: Total 6 (delta 0), reused 0 (delta 0) Receiving objects: 100% (6/6), done. cat conf/gitolite.conf repo gitolite-admin RW+ = pgnd repo testing RW+ = @all i can mod, push, etc, git clone git01:testing cd testing touch git-daemon-export-ok echo "test1 description" > description git add . git commit -m 'initial testing commit' -a git push origin master , and changes are correctly reflected @ gitolite server's repo tree. for cgit web access, uwsgi's cgit config is /etc/uwsgi/apps-available/cgit.ini [uwsgi] master = true cheap = true idle = 600 manage-script-name = true plugins = cgi,logfile cgi = /srv/www/cgi-bin/cgit/cgit.cgi in browser, @ cgit site page, I see the CGit UI https://i.imgur.com/2zhl7ax.png but there's no repo content, it simply displays No repositories found generated by cgit v1.2.1 (git 2.18.1) at 2019-08-13 17:44:46 +0000 iiuc, this is a perm problem. atm, I see no related errors in nginx logs uwsgi logs systemd journal what's a likely cause of the "no repositories found"?
> could you please also provide your cgit config? Also, which user is > executing cgit my current config is cat /etc/cgitrc virtual-root=/ css=/cgit.css logo=/cgit.png cache-size=1000 enable-index-links=1 enable-log-filecount=1 enable-log-linecount=1 root-title=git repositories robots=noindex, nofollow mimetype.git=image/git mimetype.html=text/html mimetype.jpg=image/jpeg mimetype.jpeg=image/jpeg mimetype.pdf=application/pdf mimetype.png=image/png mimetype.svg=image/svg+xml snapshots=tar.gz tar.bz2 tar.xz zip source-filter=/usr/lib/cgit/filters/syntax-highlighting-EDITED.sh scan-path=/data/git/gitolite/repositories/ cat /usr/lib/cgit/filters/syntax-highlighting-EDITED.sh | grep -v ^# BASENAME="$1" EXTENSION="${BASENAME##*.}" [ "${BASENAME}" = "${EXTENSION}" ] && EXTENSION=txt [ -z "${EXTENSION}" ] && EXTENSION=txt [ "${BASENAME%%.*}" = "Makefile" ] && EXTENSION=mk exec highlight --force -f -I -O xhtml -S "$EXTENSION" 2>/dev/null > can he access repositories owned by gitolite? that was the _intention_, at least, with > Users/groups are setup as > > id wwwrun > uid=30(wwwrun) gid=8(www) groups=8(www),475(gitolite) > id wwwrun-cgit > uid=474(wwwrun-cgit) gid=8(www) groups=8(www),475(gitolite) > id gitolite > uid=475(gitolite) gid=475(gitolite) groups=475(gitolite) the systemd units for uwsgi service & socket are templated, /etc/systemd/system/uwsgi-app at .service [Unit] Description=%i uWSGI app After=syslog.target [Service] ExecStart=/usr/sbin/uwsgi \ --ini /etc/uwsgi/apps-available/%i.ini \ --socket /run/uwsgi/%i.sock User=wwwrun-%i Group=www Restart=on-failure KillSignal=SIGQUIT Type=notify StandardError=syslog NotifyAccess=all /etc/systemd/system/uwsgi-app at .socket [Unit] Description=Socket for uWSGI app %i [Socket] ListenStream=/run/uwsgi/%i.sock SocketUser=wwwrun-%i SocketGroup=www SocketMode=0660 [Install] WantedBy=sockets.target so that, in the case of app == 'cgit', they get enabled/started as systemctl enable uwsgi-app at cgit.socket and, uwsgi/cgit execs as wwwrun-cgit:www which, i thought, should make it behave with gitolite repos. if not a bug, it's certainly possible i've missed some config, perm, etc.
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 ...