2

我安装并配置了 GitLab。我将我的公钥添加到我的帐户中,然后添加了一个项目。不幸的是,该项目似乎不存在于 Gitolite 中,我的密钥似乎也没有被添加(不在 .gitolite/keydir 或 .ssh/authorized_keys 中)

GitLab 没有抱怨,项目创建得很好。根据 gitlab:app:status,权限是正确的,但它说项目缺少 post_receive 文件。这并不奇怪,因为 /home/git/repositories 中没有项目

gitlab@server:~$ bundle exec rake gitlab:app:status RAILS_ENV=production
Starting diagnostics
config/database.yml............exists
config/gitlab.yml............exists
/home/git/repositories/............exists
/home/git/repositories/ is writable?............YES
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6/6), done.
Can clone gitolite-admin?............YES
UMASK for .gitolite.rc is 0007? ............YES
/home/git/.gitolite/hooks/common/post-receive exists? ............YES
Validating projects repositories:
Herp.....post-receive file missing
rake aborted!
unexpected return

Tasks: TOP => gitlab:app:status
(See full trace by running task with --trace)

编辑: gitolite-admin repo 确实存在。我能够克隆 gitolite-admin 存储库并在该目录中写入:

gitlab@server:~$ git clone git@localhost:gitolite-admin.git /tmp/gitolite-admin
Cloning into '/tmp/gitolite-admin'...
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (4/4), done.
Receiving objects: 100% (6/6), 751 bytes, done.
remote: Total 6 (delta 0), reused 0 (delta 0)

gitlab@server:~$ mkdir /home/git/repositories/test
gitlab@server:~$ touch /home/git/repositories/test/asdf

我不知所措,因此 GitLab 无法使用。我该怎么办?我不知道从哪里开始寻找。

提前致谢。

4

1 回答 1

3

对我来说,这个问题的根源是对 gitolite-admin 存储库的提交被拒绝:

2012-11-05.18:54:07     gitlab  127.0.0.1       git-receive-pack 'gitolite-admin'
2012-11-05.18:54:07     gitlab  127.0.0.1       Die generated at line 251 in /home/git/bin/gl-compile-conf : <<newline>>                ***** ABORTING *****<<newline>>        git config core.sharedRepository not allowed<<newline>>check GL_GITCONFIG_KEYS in the rc file for how to allow it<<newline>> <<newline>>

当我检查是否为时/home/git/.gitolite.rcGL_GITCONFIG_KEYS我发现该变量的值为空字符串。我不得不手动更改它:

$GL_GITCONFIG_KEYS = ".*";

(我从issue 1769中指定的迁移 sed 行推断- 我认为给定的 sed 行已损坏)

对于 gitolite v3,您可能需要设置此变量

$GIT_CONFIG_KEYS = '.*';

添加这个变量为我解决了这个问题。

编辑: japgolly 建议的替代问题和解决方案是安装说明忘记了一个步骤:

sudo -u gitlab git config --global user.name Gitlab
sudo -u gitlab git config --global user.email gitlab@localhost

这也会导致对 gitolite-admin 的提交失败(静默)

于 2012-11-05T18:11:59.727 回答