(这是ssh的问题,不是gitolite)
我已经在我的家庭服务器(ubuntu 12.04 服务器,open-ssh)上配置了 gitolite。我想要一个特殊的身份文件来管理存储库,因此我需要使用两个不同的身份密钥通过 ssh 访问我自己的主机。
这是我的 .ssh/config 文件的内容:
Host gitadmin.gammu.com
User git
IdentityFile /home/alvaro/.ssh/id_gitolite_mantra
Host git.gammu.com
User git
IdentityFile /home/alvaro/.ssh/id_alvaro_mantra
Run Code Online (Sandbox Code Playgroud)
这是我的主机文件的内容:
# Git
127.0.0.1 gitadmin.gammu.com
127.0.0.1 git.gammu.com
Run Code Online (Sandbox Code Playgroud)
所以我应该能够通过这种方式与 gitolite 通信以访问“正常”帐户:
$ssh git.gammu.com
Run Code Online (Sandbox Code Playgroud)
以及通过管理帐户访问的这种方式:
$ssh gitadmin.gammu.com
Run Code Online (Sandbox Code Playgroud)
当我尝试使用普通帐户访问时,一切正常:
alvaro@mantra:~/.ssh$ ssh git.gammu.com
PTY allocation request failed on channel 0
hello alvaro, this is gitolite 2.2-1 (Debian) running on git 1.7.9.5
the gitolite config gives you the following access:
@R_ @W_ testing
Connection to git.gammu.com closed.
Run Code Online (Sandbox Code Playgroud)
当我对管理帐户执行相同操作时:
alvaro@mantra:~$ ssh gitadmin.gammu.com
PTY allocation …Run Code Online (Sandbox Code Playgroud) 如果我使用 gitolite 之类的东西来处理访问控制,authorized_keys 的扩展性如何?意思是如果我说 50,000 个用户,性能会是什么样的(我猜不是很好)。有哪些替代方案?
更新: 我决定自己做一些测试(我本来应该做的)。我编写了一个简单的脚本来生成 SSH 密钥并将它们添加到一个 authorized_keys 文件中。我的电脑没有那么快,所以我只生成了 8,061 个密钥,然后将自己的密钥添加到最后,文件最终为 3.1MB。然后我添加了一个带有一个文件的 git 存储库并运行了 git clone 三次:
With 8,061 keys (Mine is at the end of the file)
real 0m0.442s
real 0m0.447s
real 0m0.458s
With just a single key:
real 0m0.248s
real 0m0.264s
real 0m0.255s
Run Code Online (Sandbox Code Playgroud)
性能比我想象的要好得多。对于 50,000+ 的一大组密钥,我仍然对任何可能更快更有效的替代方案非常感兴趣。
我正在尝试设置一个可以通过 HTTP(S) 访问我的 git repo 的服务器。
我正在使用 gitolite 和 nginx(以及用于 Web 界面的 gitlab,但我怀疑它有什么区别)。
我搜索了整个下午,我想我被卡住了。
我想我已经明白 nginx 需要 fcgiwrap 才能与 gitolite 一起工作,所以我尝试了几种配置,但都没有工作。
我的存储库位于 /home/git/repositories。
这是我尝试过的三种 nginx 配置。
1:
location ~ /git(/.*) {
gzip off;
root /usr/lib/git-core;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
include /etc/nginx/fcgiwrap.conf;
fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
fastcgi_param DOCUMENT_ROOT /usr/lib/git-core/;
fastcgi_param SCRIPT_NAME git-http-backend;
fastcgi_param GIT_HTTP_EXPORT_ALL "";
fastcgi_param GIT_PROJECT_ROOT /home/git/repositories;
fastcgi_param PATH_INFO $1;
#fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
}
Run Code Online (Sandbox Code Playgroud)
结果:
> git clone http://myservername/projectname.git test/
Cloning into test...
fatal: http://myservername/projectname.git/info/refs not found: did you run git update-server-info on …Run Code Online (Sandbox Code Playgroud) 安装 gitolite 时,我发现:
# aptitude install gitolite
The following NEW packages will be installed:
gitolite
0 packages upgraded, 1 newly installed, 0 to remove and 29 not upgraded.
Need to get 114 kB of archives. After unpacking 348 kB will be used.
Get:1 http://security.debian.org/ squeeze/updates/main gitolite all 1.5.4-2+squeeze1 [114 kB]
Fetched 114 kB in 0s (202 kB/s)
Preconfiguring packages ...
Selecting previously deselected package gitolite.
(Reading database ... 30593 files and directories currently installed.)
Unpacking gitolite (from .../gitolite_1.5.4-2+squeeze1_all.deb) ...
Setting …Run Code Online (Sandbox Code Playgroud) 我正在服务器上安装 gitolite3,使用 ssh 和 http pull/pushing/alltherest。在此过程中,会创建一个用户和组 gitolite3。
当我运行时:
$ ssh gitolite3@server info
Run Code Online (Sandbox Code Playgroud)
我得到了正确的 gitolite3 消息和 RW repo 信息。
问题是,我想要普通用户 git 而不是笨重的 gitolite3,而不会将其全部拆散。其他一些线程提到使用相同的 uid ang gid 创建用户 git,但这并没有给出与上面相同的结果。
当我登录时(使用传统的图形登录屏幕),有我常用的管理员用户,还有 gitolite3 用户名(但我不确定这是 gitolite3 还是我创建的 git 用户别名)。
如何创建 git 用户/替换 gitolite3 用户,以便 ssh git@server 信息与 gitolite3 一起使用?什么决定了用户何时可以使用登录屏幕登录,以及如何关闭它?
我正在运行 Debian 系统,最近使用 DEB 包安装了 gitolite。
这是我的问题:
我试图克隆 gitolite-admin.git 存储库(用于为您希望 gitolite 为您管理的所有存储库配置 gitolite 安装)。
我的第一次尝试正是说明如何说明:
git clone gitolite@server:gitolite-admin
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
fatal: 'gitolite-admin' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)
注意:如果我用 gitolite-admin.git 替换 gitolite-admin 会发生同样的事情
,当我执行以下操作时:
git clone gitolite@server:~/repositories/gitolite-admin.git
Run Code Online (Sandbox Code Playgroud)
这一行成功地将存储库克隆到我的本地工作站。
现在,我可以将额外的文本添加到文件路径中,但我被告知这是不正确的文档。
以下链接(http://sitaramc.github.com/gitolite/doc/3-faq-tips-etc.html)指出“在 git clone 中的存储库名称开头添加存储库/”是一个常见错误/错误。它还指出“实际上 gitolite 在内部预先添加了 $REPO_BASE,所以你不应该也做同样的事情!”
我的 .gitolite.rc 文件包含 $REPO_BASE 的以下行:
[Located in /home/gitolite/.gitolite.rc]
$REPO_BASE="repositories";
Run Code Online (Sandbox Code Playgroud)
我的问题是,我的配置有什么问题,导致 $REPO_BASE 没有在我的 git clone 前面加上?
如果您需要任何进一步的信息,请发表评论说明您需要什么信息,我将很乐意提供帮助。
其他注意事项:
我正在运行 Gitolite 服务器,我想每个存储库有 1 个配置文件。
现在我有这个 gitolite.conf 文件:
@php_dev = userA userB
@int_dev = userC
@lead = userD
@admin = @php_dev
repo gitolite-admin
RW+ = @admin
repo testing
RW+ = @all
include "repositories/*.conf"
Run Code Online (Sandbox Code Playgroud)
然后我有 gitolite-admin/conf/repositories/cms/admin/repoA.conf 文件:
repo cms/admin/repoA
RW+ = @php_dev
RW = @int_dev
R = @lead
Run Code Online (Sandbox Code Playgroud)
当我提交时,我只有以下警告:
remote: the following users have no pubkeys:
remote: userC
Run Code Online (Sandbox Code Playgroud)
确实如此,userC 还没有公钥。(我只是提一下,以防万一)
然后我查看服务器,在 /home/git/repositories/ 文件夹中:
git@FX55TMP:~/repositories$ ls -la
total 16
drwx------ 4 git git 4096 2011-04-03 22:16 .
drwxr-xr-x 6 git git 4096 …Run Code Online (Sandbox Code Playgroud) 现在,我的 ubuntu 服务器上运行着 gitlab 和 gitolite。但是,这台服务器太慢了,我的公司希望将服务器移到另一台机器上。有没有办法将 gitlab 和 gitolite 服务器(整个文件、用户和设置)移动到另一台机器上?
再次安装和创建所有用户和存储库将是我的最后选择。先感谢您。
我正在为我的客户端从 CentOS 软件包安装gitolite。该包创建了一个gitolite用户,该用户将在“git clone”操作期间显式可见。客户想要使用“git”而不是“gitolite”,以防我们以后改用更花哨的东西。我对 CentOS 不是很熟悉,所以我不想尝试从源代码自己构建包。我想知道是否有办法执行以下操作之一:
yum update操作我很感激详细的说明或指示。