如何在浏览器中正确提供 Mercurial 存储库?
我正在设置我的自由服务器,它将使用 Mercurial 进行所有版本控制。每个项目都有自己的文件夹和存储库。然后,我可以通过转到该特定文件夹从我的家庭计算机、工作计算机或任何其他计算机进行克隆。
我想将这些存储库提供给网络浏览器,以便我在需要时可以直观地浏览。我环顾四周,看到了这个: https://www.mercurial-scm.org/wiki /HgServeNginx
看起来一切都在正确的轨道上,因为无论如何我都会在这个服务器上使用 Nginx。但我很想知道如何正确设置它。为了通过 Web 浏览器在我的服务器上有效地提供多个存储库,我需要做什么?
对此的任何帮助或经验丰富的见解都将非常有助于确保我正确地执行此操作。
非常感谢。
I'm setting up my freelance server which will be using Mercurial for all the version controlling. Each project will have it's own folder, with it's own repository. Which I can then clone from my home computer, work computer or any other computer by going to that particular folder.
I'm wanting to serve these repositories up into a web browser for me to browse visually when I need to. I've looked around and seen this: https://www.mercurial-scm.org/wiki/HgServeNginx
That looks like it's along the right tracks, as I will be using Nginx on this server anyhow. But I'm curious to know how I would correctly set this up. What do I need to do in particular to efficiently serve up multiple repositories on my server through the web browser?
Any help or experienced insight on this would be very helpful to make sure I'm doing this correctly.
Many thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用该链接,您可以配置尽可能多的存储库位置。在每个 repo 目录中,您需要运行 hgserve:
然后您可以通过 nginx 将所有请求代理到正在运行的 hg 服务器。这不是一个很好的办法。此方法需要手动编辑 nginx 配置,运行 hgserve 等。但此方法允许您为每个存储库创建单独的身份验证设置。因此,如果您计划与客户共享存储库,您可以轻松管理。
相反,您可以使用由 Mercurial 提供的特殊脚本 - hgwebdir。
详细信息,您可以在此页面上查看:https://www.mercurial-scm。 org/wiki/PublishingRepositories#Publishing_Multiple_Repositories
更新: 我在服务器上有 Mercurial 版本 1.6,对于 runnung repo Web UI,我们使用此脚本 hgwebdir.py:
hgwebdir .conf 看起来像这样:
要运行:nohup hgwebdir.py &,你需要 flup python 模块,所以: easy_install flup
相关的 nginx.conf 部分是:
Using that link, you can configure as many locations as you will have repos. In every repo directory, you need to run hg serve:
Then you can just proxy all request via nginx to that running hg servers. This is not very good way. This method need manually edit nginx config, run hg serve etc. But this method allow to you create separate auth settings for each repo. So if you plan to share repo with customer, you can easily manage this.
Instead, you can use special script, which is contributed with mercurial -- hgwebdir.
Detailed info, you can fine on this page: https://www.mercurial-scm.org/wiki/PublishingRepositories#Publishing_Multiple_Repositories
UPDATE: I have mercurial version 1.6 on server, and for runnung repo web UI we use this script hgwebdir.py:
hgwebdir.conf is looks like this:
To run: nohup hgwebdir.py &, you need flup python module, so: easy_install flup
Related nginx.conf part is: