如何在 gitosis 中跟踪接收后钩子
有没有办法通过 gitosis-admin 管理接收后挂钩,以便可以跟踪它的更改?
我在远程服务器上运行了几个可以推送到的存储库。这两个存储库是通过 gitosis-admin 设置的,每个存储库都有一个不同的 post-receive 挂钩,这是通过 ssh 到远程服务器手动设置的。我突然意识到这些应该在 git 的某个地方,这样对它们的任何更改都可以被跟踪。
Is there are way of managing a post-receive hook via gitosis-admin so that changes to it can be tracked?
I gitosis on a remote server with a couple of repositories that I can push to. The 2 repositories are setup via gitosis-admin and each have a different post-receive hook, which was setup manually by ssh'ing to the remote server. It strikes me that these should be in git somewhere so any changes to them can be tracked.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
出于安全原因,您无法跟踪挂钩文件本身。但你可以绕过这个:
用你的钩子文件创建一个 git 存储库,然后在服务器上检查它。然后只需将钩子文件符号链接到您需要的存储库中即可。如果您不直接推送的话,您可能还想添加另一个钩子操作,该操作会拉动钩子存储库的结账。
确保严格控制对该存储库的访问,因为如果攻击者可以推送它,那么您就完蛋了。
You can't track the hookfiles themselves, for security reasons. But you can sneak around that:
Make a git repo with your hookfiles and check it out on the server. Then just symlink the hookfiles in the repos where you need them. You might also want to add another hook action that does a pull on the checkout of the hook repo, if you don't push directly to it.
Make sure you tightly control access to that repo, because if an attacker can push to it, you're toast.