2

I've set up a Virtualbox VM (debian 7.6) on my MacMini (10.9). I've successfully installed Gitlab (7.1) in the VM and I'm able to access it from all machines in my network. I'm able to log in and create a user.

However, I'd like the git repositories to be a directory on a shared folder rather than somewhere within the VM. I've added user 'git' to the vboxsf group and as this user I can create directories in the shared folder just fine.

I've tried symlinking /var/opt/gitlab/git-data/repositories to a directory within my shared folder. but I'm getting permission denied when trying to add a user or a group.

Any ideas?

hepabolu
  • 159
  • 1
  • 5

1 Answers1

0

If you look in the file ~git/gitlab/config/gitlab.yml it says:

  ## GitLab Shell settings
  gitlab_shell:
    path: /home/git/gitlab-shell/

    # REPOS_PATH MUST NOT BE A SYMLINK!!!
    repos_path: /home/git/repositories/
    hooks_path: /home/git/gitlab-shell/hooks/

So no symlink :-)

But you can modify the file and the repos_path setting to point to a folder under your shared folder. You will also need to modify this file: ~git/gitlab-shell/config.yml as it contains a duplicated setting (with the same name) which is generated from the above file during the "installation" process.

Once done, restart your Gitlab services (at least gitlab-sidekiq gitlab-unicorn).

Huygens
  • 1,708
  • 3
  • 20
  • 36
  • Thanks for the answer. I've followed your instructions. For posterity: when gitlab is installed using one of the packages as described on the Gitlab page, the gitlab.yml file is under `/var/opt/gitlab/gitlab-rails/etc`, the other is under `/var/opt/gitlab/gitlab-shell/config.yml`. I've changed the repos_path to `/media/sf_develop/repositories` (a subfolder of my shared folder) and restarted the VM to make sure everything is restarted as necessary. After that, I can access the users I've created, but I can't create a new project, i.e. no folder on disk is created :-(. – hepabolu Jul 30 '14 at 13:24
  • And I guess you can do `sudo -u git touch /media/sf_develop/repositories/testfile` assuming the GitLab user for the packages is also "git". If you can't then you have a permission problem, or there is something else... – Huygens Jul 30 '14 at 13:57
  • Maybe there is one more step to do after modifying the file. In the manual installation, we need to do `cd ~git/gitlab; sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production` to regenerate configurations. Looking at the path of the package installation I would guess you need to `cd /var/opt/gitlab` instead. Once done, you need to just restart the services (on Ubuntu it seems that `sudo /etc/init.d/gitlab restart` is enough). – Huygens Jul 30 '14 at 14:06
  • Ho and finally, try `sudo -u git -H /home/git/gitlab-shell/bin/check` (check the path on your installation) this should tell you if anything regarding repositories directory is misconfigured. – Huygens Jul 30 '14 at 14:08
  • For posterity, the rake command can be executed as `sudo -u git -H /opt/gitlab/bin/gitlab-rake assets:precompile`. This results in: `chpst: fatal: unable to setgroups: permission denied`. `sudo -u git -H /opt/gitlab/embedded/service/gitlab-shell/bin/check` results in 'OK'. – hepabolu Jul 30 '14 at 16:44
  • I will modify my config of GitLab to test my answer and report to you soon. – Huygens Jul 30 '14 at 20:41
  • Did someone find a solution for this problem? – tellob Feb 16 '16 at 10:58