0

我正在寻找一种解决方案,用于在支持脚本的标准网络空间上托管一个私有(闭源)多用户协作 git 存储库,然后可以通过 HTTP 访问该存储库,但我找不到。

SSH ( gitolite ) 也存在同样的情况,它已被证明是一个有价值的工具。然而,SSH 在许多网络空间上不可用,即使是,网络空间所有者也不想共享他的登录凭据,因为这将是一个主要的安全问题。

我发现的所有脚本都涉及以各种方式查看 git 存储库,通常是公开存储库。在读写操作的开发过程中,我找不到用于访问存储库的脚本。

我认为创建一个服务器端脚本应该很简单,它负责强制执行对服务器上多用户 git 存储库的访问权限。这样,读写操作可以在标准的支持脚本的 web 空间上通过 HTTP 访问进行处理,这将导致成本更低,并且更容易设置基于服务器的、功能齐全的 git 存储库以进行多用户协作。

我想知道为什么这不是存储库的标准解决方案。当前对 git 存储库的 HTTP 访问没有优化,并且仅广泛用于读取访问,因为启用写入访问太困难或现有基础架构上不可用该技术(WebDAV)。

这个想法是否存在内在问题,或者有一个很好的解决方案,只是还没有写出来?

4

2 回答 2

0

"Unoptimized HTTP access" is a thing of the past. The speed of fetching/pushing using SmartHTTP is roughly the same as with SSH if not better (due to not encrypting the traffic, unless TLS is used for HTTP).

WebDAV is not needed for pushes over HTTP: the native Git's HTTP backend supports all kinds of operations. The authentication is provided by the web server, and can be set up in a way to be rather flexible and, say, allow unauthenticated fetches but authenticated pushes.

Gitolite v3 can also be put between the web server and the Git's HTTP backend to get the best of both worlds. I have this working on Debian Squeeze: gitolite v3 accessed both via SSH and via HTTP.

See this for more info.

于 2014-11-03T17:52:39.380 回答
0

工具cgit是开源的,可用于设置您自己的托管存储库。它通过 CGI 为您服务器上的一个或多个 git 存储库提供 Web 前端。

也可以设置用户认证/授权。例如,请参见此处

于 2014-11-03T11:40:42.387 回答