Cannot see repositories

别等时光非礼了梦想. 提交于 2019-12-11 03:40:09

问题


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.


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/4005795/cannot-see-repositories

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!