Cannot see repositories

2019-07-13 15:45发布

Installed GitWeb and CGit to tryout web interfaces to my Git/Gitosis repositories. Runing on Fedora 13 and my Gitosis is working great. I installed gitweb and cgit and setup the configs to point to my repositories but neither gitweb or cgi will list the repositories. Gitweb shows the gitweb page but shows:

404 - No projects found

I have the proper directory listed in the /etc/gitweb.conf file of:

 $projectroot = "/var/lib/gitosis/repositories";
 $projects_list = "/var/lib/gitosis/gitosis/projects.list";
 $export_ok="";
 $strict_export = "true";

CGit shows the cgit page but shows:

Not a git repository: '/var/lib/gitosis/repositories/code/test.git'

when I click on this test repository link (yes it exists). I have the proper directory listed in the /etc/cgitrc file of:

 repo.url=Test Repo
 repo.path=/var/lib/gitosis/repositories/code/test.git
 repo.desc=master test repository
 repo.owner=gitosis@gitserv
 repo.readme=info/web/about.html

Because both do not list the repositories I feel it must be my configuration but I can not seem to figure out what to config to get these to display. I have my repositories SymLinked in /var/lib/gitosis/repositories which points to a directory /home/git. I also have my repositories set under /var/lib/gitosis/repositories as code and conf and docs which you check out with code/test.git or conf/test.git or docs/test.git. I thought this might be the problem and copied the repos directly into /var/lib/gitosis/repositories dir but they still did not display. Please can anyone point me at anything I can try to get this working. Been at it for days.

标签: git gitweb
2条回答
别忘想泡老子
2楼-- · 2019-07-13 16:25

Just a note, the issue with the home directory is very likely due to SELinux being enabled. Try disabling in /etc/sysconfig/selinux.

查看更多
倾城 Initia
3楼-- · 2019-07-13 16:35

Since these repositories are actually inside your home directory, it may be a matter of permissions. Maybe your home is chmodded not to be readable by "others"?

Are the permissions for those repositories' directories (in your home, not the symlinks) wide enough to allow the webserver to see them? For the webserver to see your repositories, the full path to the repository and the repositories themselves bust be able to be read by the webserver, and the directories need to be r+x by the webserver.

Use some ls -la to see the permissions, and chmod using good judgement.

Or, probably better... just move the repositories somewhere else like /opt or /gitrepo, and set the permissions correctly there. I am suggesting this as there are good reasons why your home should not be world-readable.

查看更多
登录 后发表回答