···
1
-
<chapter xmlns="http://docbook.org/ns/docbook"
2
-
xmlns:xlink="http://www.w3.org/1999/xlink"
3
-
xmlns:xi="http://www.w3.org/2001/XInclude"
5
-
xml:id="module-services-gitlab">
6
-
<title>GitLab</title>
8
-
GitLab is a feature-rich git hosting service.
10
-
<section xml:id="module-services-gitlab-prerequisites">
11
-
<title>Prerequisites</title>
1
+
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="module-services-gitlab">
2
+
<title>GitLab</title>
14
-
The <literal>gitlab</literal> service exposes only an Unix socket at
15
-
<literal>/run/gitlab/gitlab-workhorse.socket</literal>. You need to
16
-
configure a webserver to proxy HTTP requests to the socket.
4
+
GitLab is a feature-rich git hosting service.
20
-
For instance, the following configuration could be used to use nginx as
6
+
<section xml:id="module-services-gitlab-prerequisites">
7
+
<title>Prerequisites</title>
9
+
The <literal>gitlab</literal> service exposes only an Unix socket
10
+
at <literal>/run/gitlab/gitlab-workhorse.socket</literal>. You
11
+
need to configure a webserver to proxy HTTP requests to the
15
+
For instance, the following configuration could be used to use
16
+
nginx as frontend proxy:
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
29
-
virtualHosts."git.example.com" = {
25
+
virtualHosts."git.example.com" = {
32
-
locations."/".proxyPass = "http://unix:/run/gitlab/gitlab-workhorse.socket";
28
+
locations."/".proxyPass = "http://unix:/run/gitlab/gitlab-workhorse.socket";
38
-
<section xml:id="module-services-gitlab-configuring">
39
-
<title>Configuring</title>
42
-
GitLab depends on both PostgreSQL and Redis and will automatically enable
43
-
both services. In the case of PostgreSQL, a database and a role will be
48
-
The default state dir is <literal>/var/gitlab/state</literal>. This is where
49
-
all data like the repositories and uploads will be stored.
53
-
A basic configuration with some custom settings could look like this:
33
+
<section xml:id="module-services-gitlab-configuring">
34
+
<title>Configuring</title>
36
+
GitLab depends on both PostgreSQL and Redis and will automatically
37
+
enable both services. In the case of PostgreSQL, a database and a
38
+
role will be created.
41
+
The default state dir is <literal>/var/gitlab/state</literal>.
42
+
This is where all data like the repositories and uploads will be
46
+
A basic configuration with some custom settings could look like
57
-
databasePasswordFile = "/var/keys/gitlab/db_password";
58
-
initialRootPasswordFile = "/var/keys/gitlab/root_password";
52
+
databasePasswordFile = "/var/keys/gitlab/db_password";
53
+
initialRootPasswordFile = "/var/keys/gitlab/root_password";
60
-
host = "git.example.com";
55
+
host = "git.example.com";
57
+
user = "git";
58
+
group = "git";
66
-
address = "localhost";
61
+
address = "localhost";
70
-
dbFile = "/var/keys/gitlab/db";
71
-
secretFile = "/var/keys/gitlab/secret";
72
-
otpFile = "/var/keys/gitlab/otp";
73
-
jwsFile = "/var/keys/gitlab/jws";
65
+
dbFile = "/var/keys/gitlab/db";
66
+
secretFile = "/var/keys/gitlab/secret";
67
+
otpFile = "/var/keys/gitlab/otp";
68
+
jwsFile = "/var/keys/gitlab/jws";
77
-
email_from = "gitlab-no-reply@example.com";
78
-
email_display_name = "Example GitLab";
79
-
email_reply_to = "gitlab-no-reply@example.com";
72
+
email_from = "gitlab-no-reply@example.com";
73
+
email_display_name = "Example GitLab";
74
+
email_reply_to = "gitlab-no-reply@example.com";
default_projects_features = { builds = false; };
88
-
If you're setting up a new GitLab instance, generate new
89
-
secrets. You for instance use <literal>tr -dc A-Za-z0-9 <
90
-
/dev/urandom | head -c 128 > /var/keys/gitlab/db</literal> to
91
-
generate a new db secret. Make sure the files can be read by, and
92
-
only by, the user specified by <link
93
-
linkend="opt-services.gitlab.user">services.gitlab.user</link>. GitLab
94
-
encrypts sensitive data stored in the database. If you're restoring
95
-
an existing GitLab instance, you must specify the secrets secret
96
-
from <literal>config/secrets.yml</literal> located in your GitLab
101
-
When <literal>incoming_mail.enabled</literal> is set to <literal>true</literal>
102
-
in <link linkend="opt-services.gitlab.extraConfig">extraConfig</link> an additional
103
-
service called <literal>gitlab-mailroom</literal> is enabled for fetching incoming mail.
107
-
Refer to <xref linkend="ch-options" /> for all available configuration
109
-
<link linkend="opt-services.gitlab.enable">services.gitlab</link> module.
112
-
<section xml:id="module-services-gitlab-maintenance">
113
-
<title>Maintenance</title>
115
-
<section xml:id="module-services-gitlab-maintenance-backups">
116
-
<title>Backups</title>
118
-
Backups can be configured with the options in <link
119
-
linkend="opt-services.gitlab.backup.keepTime">services.gitlab.backup</link>. Use
121
-
linkend="opt-services.gitlab.backup.startAt">services.gitlab.backup.startAt</link>
122
-
option to configure regular backups.
126
-
To run a manual backup, start the <literal>gitlab-backup</literal> service:
128
-
<prompt>$ </prompt>systemctl start gitlab-backup.service
81
+
If you're setting up a new GitLab instance, generate new secrets.
82
+
You for instance use
83
+
<literal>tr -dc A-Za-z0-9 < /dev/urandom | head -c 128 > /var/keys/gitlab/db</literal>
84
+
to generate a new db secret. Make sure the files can be read by,
85
+
and only by, the user specified by
86
+
<link linkend="opt-services.gitlab.user">services.gitlab.user</link>.
87
+
GitLab encrypts sensitive data stored in the database. If you're
88
+
restoring an existing GitLab instance, you must specify the
89
+
secrets secret from <literal>config/secrets.yml</literal> located
90
+
in your GitLab state folder.
93
+
When <literal>incoming_mail.enabled</literal> is set to
94
+
<literal>true</literal> in
95
+
<link linkend="opt-services.gitlab.extraConfig">extraConfig</link>
96
+
an additional service called <literal>gitlab-mailroom</literal> is
97
+
enabled for fetching incoming mail.
100
+
Refer to <xref linkend="ch-options"></xref> for all available
101
+
configuration options for the
102
+
<link linkend="opt-services.gitlab.enable">services.gitlab</link>
133
-
<section xml:id="module-services-gitlab-maintenance-rake">
134
-
<title>Rake tasks</title>
137
-
You can run GitLab's rake tasks with <literal>gitlab-rake</literal>
138
-
which will be available on the system when GitLab is enabled. You
139
-
will have to run the command as the user that you configured to run
144
-
A list of all available rake tasks can be obtained by running:
146
-
<prompt>$ </prompt>sudo -u git -H gitlab-rake -T
106
+
<section xml:id="module-services-gitlab-maintenance">
107
+
<title>Maintenance</title>
108
+
<section xml:id="module-services-gitlab-maintenance-backups">
109
+
<title>Backups</title>
111
+
Backups can be configured with the options in
112
+
<link linkend="opt-services.gitlab.backup.keepTime">services.gitlab.backup</link>.
114
+
<link linkend="opt-services.gitlab.backup.startAt">services.gitlab.backup.startAt</link>
115
+
option to configure regular backups.
118
+
To run a manual backup, start the
119
+
<literal>gitlab-backup</literal> service:
122
+
$ systemctl start gitlab-backup.service
125
+
<section xml:id="module-services-gitlab-maintenance-rake">
126
+
<title>Rake tasks</title>
128
+
You can run GitLab's rake tasks with
129
+
<literal>gitlab-rake</literal> which will be available on the
130
+
system when GitLab is enabled. You will have to run the command
131
+
as the user that you configured to run GitLab with.
134
+
A list of all available rake tasks can be obtained by running:
137
+
$ sudo -u git -H gitlab-rake -T