How do I force gitlab to use a different user than git?

I am trying to run gitlab with a different user and I could not find the location where it is configured.

I tried this because I need to use the NIS account to run it and in fact I even deleted the local git user, created it in NIS and tried to restart it like this (after fixing the owner rights due to UID and GID).

STDERR: usermod: user 'git' does not exist in /etc/passwd
---- End output of ["usermod", "-g", "10032", "-s", "/bin/sh", "git"] ----
Ran ["usermod", "-g", "10032", "-s", "/bin/sh", "git"] returned 6

      

Full log: https://gist.github.com/ssbarnea/83b9c07678187dfe238f

It is perfectly normal that the git user should not be inside the passwd file, it is a NIS user. Also, I was unable to find where gitlab is getting the value 10032 for the user group, why it is trying to reconfigure it, or how I can tweak or work around this.

+3


source to share


2 answers


First you need to create / have another user .

And you will replace all instances in the installation documentation :

  • sudo -u git

    from sudo -u yourNewUser

  • user git

    with the desired user, as in /home/git/

    replaced by/home/yourNewUser/



Check the config file also config/gitlab.yml

:

# Uncomment and customize if you can't use the default user to run GitLab (default: 'git')
# user: git

      

+2


source


Here is a bug report for this issue, relatively recent activity: https://gitlab.com/gitlab-org/omnibus-gitlab/issues/737

The solution for me was this: /etc/gitlab/gitlab.rb:

user['username'] = "git"
user['group'] = "git"
user['uid'] = 1040
user['gid'] = 1034
# # The shell for the git user
user['shell'] = "/bin/bash"
# # The home directory for the git user
user['home'] = "/var/home/git"

      



Adjust each value to suit your existing NIS git user.

Then run gitlab-ctl reconfigure

Repeat some of the comments on this bug report. Basically setting these values ​​will cause gitlab to decide not to create users.

+2


source







All Articles