gitlab: Slapos'ify / tweak gitconfig and hook it into the system
authorKirill Smelkov <kirr@nexedi.com>
Thu, 7 Jan 2016 21:19:54 +0000 (00:19 +0300)
committerKirill Smelkov <kirr@nexedi.com>
Sun, 17 Jan 2016 21:39:29 +0000 (00:39 +0300)
commit264d785a34eee54645aac16db4af398cbf509806
treeb46f3ae8d9ec92c78633078c958432f30781ce92
parent8f945bd28bf2e8a084d2867665066a9aeebaf4b1
gitlab: Slapos'ify / tweak gitconfig and hook it into the system

Convert gitconfig template to jinja2 (reusing already-there
`email_display_name` and `email_from` parameters for commits generated by
gitlab).

System-level git config from gitlab-omnibus is also imported to this
file (on slapos we cannot tweak system-level git config -
software/.../parts/git/... is read-only for programs in instance
partitions - so we move all gitlab's system-wide git settings to this
"user-level" gitconfig.

System gitconfig in omnibus is defined here:

    https://gitlab.com/gitlab-org/omnibus-gitlab/blob/8eda093/files/gitlab-cookbooks/gitlab/attributes/default.rb#L23

so it is

    pack.threads = 1    and
    receive.fsckObjects = true

which makes sense to not waste a lot of memory when packing and not to
allow corrupt objects to enter to system by evil users intentionally.

To make the file foundable by git - we put it into partition root
directory and set $HOME to point to partition root when running
appropriate programs / services.

NOTE we'll need to upgrade gitlab-shell and gitlab-workhorse to
    propagate $HOME for this setting to actually have effect.
    See the next patch.

/cc @kazuhiko, @jerome
software/gitlab/instance-gitlab.cfg.in
software/gitlab/instance.cfg.in
software/gitlab/software.cfg
software/gitlab/template/gitconfig.erb [deleted file]
software/gitlab/template/gitconfig.in [new file with mode: 0644]