1

I have just installed Gitolite and Gitlab and I am very happy with it. Everything works fine so far.
I can create repos, push to them, clone them on other clients on the network. Great!

But now I wanted to do some post-receive hooks.
I.e. when I push to some repo, this repo should be checked out on the server in the /var/www/repos directory.

I did this with Gitlabs Deploy Hooks and this Endpoint-Script.

The problem is that the scripts are run under the user "www-data" which has no access to gitlab/gitolite.

How do I change this?
I need to be able to checkout repos with www-data user and using git@server/repo.git syntax.

VonC
  • 2,683
  • 5
  • 30
  • 49

2 Answers2

1

You don't need to use ssh for his. If you add the www-data user to the gitolite group your webserver should be able to read the repositories from the filesystem.

sciurus
  • 12,678
  • 2
  • 31
  • 49
0

You can use a sudo in order to execute the script with the appropriate rights (if you can modify the sudoers file).

See for illustration "Deploying Node Apps via Gitolite and post-receive hook".

VonC
  • 2,683
  • 5
  • 30
  • 49
  • Thanks for your answer! But I am getting stuck a litte bit ealier: My Problem was that the www-data user has no ssh pub/private key-pair that I could enter in gitlab. So gitolite(?) prompts me to enter the password for the user "git"... – mblaettermann Sep 21 '12 at 16:00
  • @mblaettermann any chance to generate the ssh keys for that www-data users and storing them in the standard path `~www-data/.ssh`? And publish that public key on GitLab through the GitLab GUI? – VonC Sep 21 '12 at 17:55
  • Will try that...! – mblaettermann Sep 21 '12 at 19:21
  • [I will try this... Sounds good!](http://serverfault.com/a/260786/135681) – mblaettermann Sep 21 '12 at 19:25