···231231 overriden by anything else.</para>
232232 </listitem>
233233234234+ <listitem>
235235+ <para>Large parts of the <literal>services.gitlab</literal> module has been
236236+ been rewritten. There are new configuration options available. The
237237+ <literal>stateDir</literal> option was renamned to
238238+ <literal>statePath</literal> and the <literal>satellitesDir</literal> option
239239+ was removed. Please review the currently available options.</para>
240240+ </listitem>
241241+234242</itemizedlist>
235243236244
···11+<chapter xmlns="http://docbook.org/ns/docbook"
22+ xmlns:xlink="http://www.w3.org/1999/xlink"
33+ xmlns:xi="http://www.w3.org/2001/XInclude"
44+ version="5.0"
55+ xml:id="module-services-gitlab">
66+77+<title>Gitlab</title>
88+99+<para>Gitlab is a feature-rich git hosting service.</para>
1010+1111+<section><title>Prerequisites</title>
1212+1313+<para>The gitlab service exposes only an Unix socket at
1414+<literal>/run/gitlab/gitlab-workhorse.socket</literal>. You need to configure a
1515+webserver to proxy HTTP requests to the socket.</para>
1616+1717+<para>For instance, this could be used for Nginx:
1818+1919+<programlisting>
2020+services.nginx.httpConfig = ''
2121+ server {
2222+ server_name git.example.com;
2323+ listen 443 ssl spdy;
2424+ listen [::]:443 ssl spdy;
2525+2626+ ssl_certificate /var/lib/acme/git.example.com/fullchain.pem;
2727+ ssl_certificate_key /var/lib/acme/git.example.com/key.pem;
2828+2929+ location / {
3030+ proxy_http_version 1.1;
3131+ proxy_set_header Host $http_host;
3232+ proxy_set_header X-Real-IP $remote_addr;
3333+ proxy_set_header X-Forwarded-Ssl on;
3434+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
3535+ proxy_set_header X-Forwarded-Proto $scheme;
3636+3737+ proxy_pass http://unix:/run/gitlab/gitlab-workhorse.socket;
3838+ }
3939+ }
4040+'';
4141+</programlisting>
4242+</para>
4343+4444+</section>
4545+4646+<section><title>Configuring</title>
4747+4848+<para>Gitlab depends on both PostgreSQL and Redis and will automatically enable
4949+both services. In the case of PostgreSQL, a database and a role will be created.
5050+</para>
5151+5252+<para>The default state dir is /var/gitlab/state. This is where all data like
5353+the repositories and uploads will be stored.</para>
5454+5555+<para>A basic configuration could look like this:
5656+5757+<programlisting>
5858+services.gitlab = {
5959+ enable = true;
6060+ databasePassword = "eXaMpl3";
6161+ initialRootPassword = "UseNixOS!";
6262+ https = true;
6363+ host = "git.example.com";
6464+ port = 443;
6565+ user = "git";
6666+ group = "git";
6767+ extraConfig = {
6868+ gitlab = {
6969+ default_projects_features = { builds = false; };
7070+ };
7171+ };
7272+};
7373+</programlisting>
7474+</para>
7575+7676+<para>Refer to <xref linkend="ch-options" /> for all available configuration
7777+options for the <literal>services.gitlab</literal> module.</para>
7878+7979+</section>
8080+8181+<section><title>Maintenance</title>
8282+8383+<para>You can run all Gitlab related commands like rake tasks with
8484+<literal>gitlab-runner</literal> which will be available on the system
8585+when gitlab is enabled. You will have to run the commands as the user that
8686+you configured to run gitlab.</para>
8787+8888+<para>For instance, to backup a Gitlab instance:
8989+9090+<programlisting>
9191+$ sudo -u git -H gitlab-runner exec rake gitlab:backup:create
9292+</programlisting>
9393+9494+A list of all availabe rake tasks can be obtained by running:
9595+9696+<programlisting>
9797+$ sudo -u git -H gitlab-runner exec rake -T
9898+</programlisting>
9999+</para>
100100+101101+</section>
102102+103103+</chapter>
···11+diff --git a/lib/gitlab_projects.rb b/lib/gitlab_projects.rb
22+index c1d175a..7f7fd2f 100644
33+--- a/lib/gitlab_projects.rb
44++++ b/lib/gitlab_projects.rb
55+@@ -5,7 +5,7 @@ require_relative 'gitlab_config'
66+ require_relative 'gitlab_logger'
77+88+ class GitlabProjects
99+- GLOBAL_HOOKS_DIRECTORY = File.join(ROOT_PATH, 'hooks')
1010++ GLOBAL_HOOKS_DIRECTORY = ENV['GITLAB_SHELL_HOOKS_PATH'] || File.join(ROOT_PATH, 'hooks')
1111+1212+ # Project name is a directory name for repository with .git at the end
1313+ # It may be namespaced or not. Like repo.git or gitlab/repo.git