1
votes

I'm setting up a VM with centos 7, gitlab-ce and redmine. Everything is installed and running, but I'm unable to setup integration: When I try to access http://redmine/projects/myproject/repository, it shows me the (in)famous message:

404 The entry or revision was not found in the repository.

Apache's error log (/var/log/htttpd/error_log) says:

App 3122 stderr: fatal: Not a git repository: '/var/opt/gitlab/git-data/repositories/mygroup/myproject.git'

This is the right path to the project. Following the tip posted by user @sk1p in https://serverfault.com/questions/565030/redmine-not-finding-my-git-repo-on-debian-7-3, I get "permission denied" messages.

So there's my problem: I'm affraid to change these directories permissions and make everything unsafe. My apache user can only open /var/opt/gitlab:

bash-4.2$ cd /var/opt/gitlab
bash-4.2$ ls -la
total 16
drwxr-xr-x. 11 root         root       4096 Jul 17 16:12 .
drwxr-xr-x.  3 root         root         19 Jul 17 10:17 ..
drwx------.  2 git          root         41 Jul 23 14:57 backups
-rw-------.  1 root         root         38 Jul 17 10:18 bootstrapped
-rw-r--r--.  1 git          git         264 Jul 17 16:12 .gitconfig
drwx------.  4 git          root         49 Jul 17 10:17 git-data
drwxr-xr-x.  7 git          root         82 Jul 27 10:04 gitlab-rails
drwx------.  2 git          root         49 Jul 17 10:17 gitlab-shell
drwx------.  3 root         root         45 Jul 17 10:18 logrotate
drwxr-x---.  8 root         gitlab-www 4096 Jul 28 09:09 nginx
drwxr-xr-x.  3 gitlab-psql  root         77 Jul 28 09:09 postgresql
drwxr-x---.  2 gitlab-redis git          57 Jul 28 09:19 redis
drwx------.  2 git          git          55 Jul 17 16:06 .ssh
bash-4.2$ cd git-data/
bash: cd: git-data/: Permission denied
bash-4.2$ cd git-data/repositories/mygroup/myproject.git
bash: cd: git-data/repositories/mygroup/myproject.git: Permission denied

Browsing the directories as root, these are the permissions for the project dir:

[root@srv mygroup]# ls -l
total XX
(...)
drwxrwxrwx. 6 git git 4096 Jul 28 07:48 myproject.git

As you can see, I tried 777ing the whole thing. No success. I will revert it later, promisse. I also tried adding apache user to groups:

[root@srv mygroup]# groups apache
apache : apache root git

So how can I make it right? I did try searching for a solution at the webs (actually doing it since yesterday), the thing I didn't tried yet is chowning the repo to apache.apache, because I'm affraid it breaks something for gitlab.

Sorry for my broken english. =]

1
I don't know the possibles interactions between Redmine & GitLab's git repo, but isn't it possible to give to Redmine the HTTP URL of this repo? e.g. http://your_gitlab/mygroup/myproject.git ? Like this you won't have to change permissions in your filesystemPierreF
Yes, I think it's possible. But that would be different of what I'm doing: Being both gitlab and redmine on same server, I'm trying to save space by telling redmine to watch the gitlab files. If I clone the repos (either by ssh or http), they would be stored twice in the server. The approach I'm trying is tested and documented, but probably not with gitlab and/or the ce automatized install I did. I discovered an intermediary solution, wich is cloning the repo as "mirror" (goo.gl/PnYaa3). I will try it and report here if works.Bruno Lamps

1 Answers

1
votes

I've found a different solution. I don't think it's optimal and I'm still looking for a better way, but here's what I did:

There's a guide at http://www.redmine.org/projects/redmine/wiki/HowTo_Easily_integrate_a_%28SSH_secured%29_GIT_repository_into_redmine explaining how to integrate a git repo to redmine using ssh. This guide creates just a "mirror" of each repo, so I hope it doesn't consume much space (I'll find out soon). I got some trouble to create my apache user's ssh key and authenticate, but this other troubleshoot (Gitlab prompts for password while push for git user, @VonC tips) helped me a lot.