我必须如何配置 gitweb 和 gitolite 以便它们能够协同工作?
我正在尝试让 gitweb 与 gitolite 一起工作...但到目前为止不成功。
我正在 RedHat Linux 机器上工作。存在一个名为 git
的用户。
gitolite 安装在:/home/git
存储库位置:/home/git/repositories
请注意,gitweb 可以与普通 git 一起正常工作。现在我正在尝试让它与 gitolite 一起工作。
我的文件如下所示:
/etc/gitweb.conf
$projectroot = "/home/git/repositories"; @git_base_url_list = qw(ssh://[MyHostName]/home/git/projects.list); $projects_list = "/home/git/projects.list"
/home/git/projects.list
myrepo1.git myrepo2.git
/home/git/.gitolite.rc
:$PROJECTS_LIST = $ENV{HOME} 。 “/projects.list”; $GL_GITCONFIG_KEYS = "gitweb.url receive.denyNonFastforwards receive.denyDeletes";
我错过了哪些配置? 我没有对 Apache 进行任何更改。
网址:http://MyHostName/git
这会出现 404 错误:未找到存储库。
I am trying to make gitweb work with gitolite... but unsuccessful so far.
I am working on a RedHat Linux machine. A user called git
exists.
gitolite is installed under: /home/git
Repository location: /home/git/repositories
Please note that, gitweb was working fine with plain vanilla git. Now i am trying to make it work with gitolite.
Here are what my files look like:
/etc/gitweb.conf
$projectroot = "/home/git/repositories"; @git_base_url_list = qw(ssh://[MyHostName]/home/git/projects.list); $projects_list = "/home/git/projects.list"
/home/git/projects.list
myrepo1.git myrepo2.git
/home/git/.gitolite.rc
:$PROJECTS_LIST = $ENV{HOME} . "/projects.list"; $GL_GITCONFIG_KEYS = "gitweb.url receive.denyNonFastforwards receive.denyDeletes";
What configuration have I missed?
I have not made any changes to Apache.
Web URL: http://MyHostName/git
This gives a 404 error saying - No repositories found.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我最近设置了 gitolite 和 gitweb,发现
/etc/gitweb.conf
需要非常很少的配置。你所拥有的对我来说看起来很合适。/home/git/repositories
的权限是什么?您可能会发现它们限制太多。试试这个:这就是为我解决问题的方法(尽管我想有一种更安全的方法来设置权限)。如果可行,我建议您考虑一下为 Apache(或正在执行 gitweb 的任何用户帐户)提供对存储库目录的更细粒度的权限。
我的
.gitolite.rc
中也有这个:这样以下内容就可以在
/conf/gitolite.conf
中工作:I recently set up gitolite and gitweb and found that
/etc/gitweb.conf
required very little configuration. What you have looks right to me. What are the permissions like on/home/git/repositories
? You may find they are too restrictive. Try this out:That's what solved the issue for me, (though I imagine there's a more secure way to set up the permissions). If that works, I'd recommend just having a look into giving Apache (or whatever user account gitweb is being executed under) more fine-grained permissions over the repositories directory.
I also have this in my
.gitolite.rc
:so that the following works in
<gitolite-admin>/conf/gitolite.conf
:您需要添加 Gitolite
contrib/gitweb.conf< /code>
位于
/etc/gitweb_config.perl
末尾。换句话说,您需要从
gitweb.conf
perl 文件调用 Gitolite 函数,否则集成 GitWeb-Gitolite 将永远无法工作。(这里
repo_rights
是来自 gitolite 的方法.pm)检查“帮助 gitweb"。
您需要在 gitweb_config.perl 末尾添加的最后几行是:
这样,您将避免 /etc/gitweb.conf 中出现任何“
500 - Internal Server Error 语法错误””错误消息。
如果您没有声明
gitweb.conf.pl
的gitweb_config.perl
,而是直接声明“gitweb.conf.pl
” ,然后添加“use lib (".");
”作为该文件的第一行。You need to add the Gitolite
contrib/gitweb.conf
at the end of/etc/gitweb_config.perl
.In other words, you need to call a Gitolite function from your
gitweb.conf
perl file, otherwise the integration GitWeb-Gitolite will never work.(here
repo_rights
is a method from gitolite.pm)Check the section "helping with gitweb".
The last lines you need to add at then end of
gitweb_config.perl
are:That way, you will avoid any "
500 - Internal Server Error syntax error at /etc/gitweb.conf
" error message.If you don't have a
gitweb_config.perl
in which you declaregitweb.conf.pl
, but directly "gitweb.conf.pl
", then add "use lib (".");
" as the first line of that file.1/安装
gitolite
并进行设置。然后,只需确保/home/git/.gitolite.rc
包含未注释的部分,如下所示:2/正确设置
$projectroot
和$projects_list/etc/gitweb.conf
的 code> 指令(以匹配projects.list
文件和repositories
目录的位置)。类似:3/ 确保当前存储库文件也可由网络服务器用户读取。这些示例来自基于 debian 的系统,因此 YMMV:
4/ 最后在
gitolite-admin< 的
/conf/gitolite.conf
文件中配置gitweb
用户的访问权限/code> 客户端计算机上的存储库,并通过提交和推送它们(标准方式)来应用它们。我们希望通过 gitweb 查看和管理的存储库必须具有如下访问权限设置:注意:
...
仅表明文件中还有其他配置指令。不要把它们放在那里!无需其他更改即可使
gitlab
可视化gitolite
存储库。(至少)适用于
gitolite
3.6.6 和gitweb
2.1.41/ install
gitolite
and set it up. Then it suffices to make sure/home/git/.gitolite.rc
contains uncommented parts that look like:2/ set correctly
$projectroot
and$projects_list
directives of/etc/gitweb.conf
(to match location ofprojects.list
file andrepositories
dir). Like:3/ Make sure current repository files are also readable by webserver user. These examples are from debian based systems, so YMMV:
4/ Finally configure access for
gitweb
user within your/conf/gitolite.conf
file ofgitolite-admin
repository on a client machine and apply them by committing and pushing them (the standard way). A repository we would like to see and manage viagitweb
has to have the access set like this:Note: The
...
only suggests there are other configuration directives within the files. Do not put them there!No other chages are necessary to make
gitlab
visualize thegitolite
repositories.Applies (at least) for
gitolite
3.6.6 andgitweb
2.1.4