在 Mercurial 的allow_read、allow_push 等中使用组
我想知道是否可以使用在allow_read和/或allow_push等中的apache authgroup文件中指定的组。
所以基本上我所做的就是使用带有authfile和authgroup文件的apache来对用户进行身份验证。 现在我想限制使用allow_read 的某些存储库向authgroup 文件中指定的特定组中的用户显示。
假设我的 auth 文件中有 sam、frodo 和 sauron,并且我有一个 authgroup 文件中包含 sam 和 frodo 的霍比特人组。
因此,我没有写:
allow_read = frodo, sam,
而是尝试了
allow_read = @hobbits
,但这似乎不起作用。有人知道这是否真的受支持吗?这个想法是,如果我说 10 个仅霍比特人可读的存储库,并且我添加了一个霍比特人,我只需更改 authgroup 和 auth 文件,而不是每个存储库 hgrc 文件。
I was wondering if it is possible to use groups specified in e.g., an apache authgroup file in allow_read and/or allow_push etc.
So basically what I do is I am using apache with an authfile and authgroup file to authenticate users.
Now I want to restrict some repositories using allow_read from being shown to users in a specific group specified in the authgroup file.
Let's say I have sam, frodo and sauron in my auth file and I have a group hobbits containing sam and frodo in the authgroup file.
So instead of writing:
allow_read = frodo, sam
I tried
allow_read = @hobbits
but that does not seem to work. Does anybody know whether this is actually supported? The idea is if I have say 10 Repositories only readable for hobbits and I add a hobbit I only have to change the authgroup and auth file and not each repository hgrc file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Mercurial 没有任何内置的组支持。有一个用户提供了一个补丁,添加了组支持,但编码人员似乎不愿意默认包含它,他们希望贡献者用它制作一个插件。截至 2013 年 4 月,他们似乎已接受它< /a>,但我在当前 Ubuntu (2.7) 附带的版本中仍然看不到它的踪迹。
正如 Joel 所建议的那样,当您拥有多个存储库时,控制 Apache 中的组不会为您提供任何细粒度的控制,因此它没有用(至少对我而言)。
我最终使用了开源工具 SCM-Manager 。 SCM-Manager 充当 SVN、Git 和 Mercurial 的前端,支持各种用户目录(包括 LDAP 和 Crowd)以及自己的用户目录。
我正在使用 mod_proxy 将其集成到我的 Apache 配置中,并且效果很好。
Mercurial does not have any builtin support for groups. There is a patch from a user that adds group support, but the coders seemed hesitant to include it by default, they want the contributor to make a plugin out of it instead. As of April 2013 they seem to have accepted it, but I still see no trace of it in the version currently shipped with Ubuntu (2.7).
Controlling groups in Apache, as suggested by Joel, doesn't give you any fine granular control when you have more than one repository, so it's no use (at least not for me).
I ended up using the open source tool SCM-Manager for it. SCM-Manager acts as a frontend for SVN, Git and Mercurial and has support for various user directories (including LDAP and Crowd) as well as its own user directory.
I'm using mod_proxy to integrate it in my Apache configuration and it works quite well.
看来您需要在 Apache 中而不是在 hgrc 文件中进行组控制,因为
hgrc
的文档仅提及用户名。您需要阅读“发布存储库”页面上的配置 Apache。 7.4 部分似乎包含您设置所需内容所需的信息。
It appears you'll need to do your group controlling in Apache rather than in
hgrc
files, as the documentation forhgrc
mentions only user names.You'll want to have a read of Configuring Apache on the Publishing Repositories page. Section 7.4 seems to contain the information you'll need to set up what you want.