通过 hgweb.config 控制访问
我希望能够控制对我的服务器上的一些 Mercurial 存储库的访问。我认为一个简单的解决方案是让所有受限用户都有一个以“_external”结尾的用户名。然后,我会更改某些 .hgrc 文件上的 Deny_push 和 Deny_read,以根据需要授予它们访问权限。我像下面一样设置 hgweb.config 文件,但拒绝推送和拒绝读取行被忽略。 这是正确的语法吗?有没有更好的方法来实现我的目标(我研究了 Rhodecode,但它在 Windows 上似乎相当崩溃)。
[web]
style = gitweb
baseurl = /hg
allow_push = *
push_ssl = false
deny_push = *_external
deny_read = *_external
I would like to be able to control access to some mercurial repositories on my server. I thought an easy solution would be to have all limited users have a username that ends with "_external". I would then change the deny_push and deny_read on some .hgrc files to give them access as needed. I setup up my hgweb.config file like below, but the deny_push and deny_read lines are ignored. Is this the correct syntax? Is there a better way to accomplish my goal (I looked into Rhodecode, but it seems to be pretty crashy on Windows).
[web]
style = gitweb
baseurl = /hg
allow_push = *
push_ssl = false
deny_push = *_external
deny_read = *_external
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最好的选择是设置一个包含用户名的列表:
语法的问题是,您首先允许所有人推送,然后尝试限制用户。
The best option you have is to setup a list with the usernames:
The problem with your syntax is that, you are first allowing push for everybody and then trying to limit the users.
mercurial-server 可以为您做到这一点。这意味着通过 ssh 而不是通过 http 连接到您的存储库,并使用 ssh 密钥对进行身份验证,但根据我的经验,无论如何这要方便得多。
mercurial-server can do this for you. This means connecting to your repository over ssh rather than over http, and authenticating using ssh keypairs, but in my experience that's far more convenient anyway.