···
+
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="module-services-gitlab">
+
GitLab is a feature-rich git hosting service.
+
<section xml:id="module-services-gitlab-prerequisites">
+
<title>Prerequisites</title>
+
The <literal>gitlab</literal> service exposes only an Unix socket
+
at <literal>/run/gitlab/gitlab-workhorse.socket</literal>. You
+
need to configure a webserver to proxy HTTP requests to the
+
For instance, the following configuration could be used to use
+
nginx as frontend proxy:
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
+
virtualHosts."git.example.com" = {
+
locations."/".proxyPass = "http://unix:/run/gitlab/gitlab-workhorse.socket";
+
<section xml:id="module-services-gitlab-configuring">
+
<title>Configuring</title>
+
GitLab depends on both PostgreSQL and Redis and will automatically
+
enable both services. In the case of PostgreSQL, a database and a
+
The default state dir is <literal>/var/gitlab/state</literal>.
+
This is where all data like the repositories and uploads will be
+
A basic configuration with some custom settings could look like
+
databasePasswordFile = "/var/keys/gitlab/db_password";
+
initialRootPasswordFile = "/var/keys/gitlab/root_password";
+
host = "git.example.com";
+
user = "git";
+
group = "git";
+
address = "localhost";
+
dbFile = "/var/keys/gitlab/db";
+
secretFile = "/var/keys/gitlab/secret";
+
otpFile = "/var/keys/gitlab/otp";
+
jwsFile = "/var/keys/gitlab/jws";
+
email_from = "gitlab-no-reply@example.com";
+
email_display_name = "Example GitLab";
+
email_reply_to = "gitlab-no-reply@example.com";
default_projects_features = { builds = false; };
+
If you're setting up a new GitLab instance, generate new secrets.
+
<literal>tr -dc A-Za-z0-9 < /dev/urandom | head -c 128 > /var/keys/gitlab/db</literal>
+
to generate a new db secret. Make sure the files can be read by,
+
and only by, the user specified by
+
<link linkend="opt-services.gitlab.user">services.gitlab.user</link>.
+
GitLab encrypts sensitive data stored in the database. If you're
+
restoring an existing GitLab instance, you must specify the
+
secrets secret from <literal>config/secrets.yml</literal> located
+
in your GitLab state folder.
+
When <literal>incoming_mail.enabled</literal> is set to
+
<literal>true</literal> in
+
<link linkend="opt-services.gitlab.extraConfig">extraConfig</link>
+
an additional service called <literal>gitlab-mailroom</literal> is
+
enabled for fetching incoming mail.
+
Refer to <xref linkend="ch-options"></xref> for all available
+
configuration options for the
+
<link linkend="opt-services.gitlab.enable">services.gitlab</link>
+
<section xml:id="module-services-gitlab-maintenance">
+
<title>Maintenance</title>
+
<section xml:id="module-services-gitlab-maintenance-backups">
+
Backups can be configured with the options in
+
<link linkend="opt-services.gitlab.backup.keepTime">services.gitlab.backup</link>.
+
<link linkend="opt-services.gitlab.backup.startAt">services.gitlab.backup.startAt</link>
+
option to configure regular backups.
+
To run a manual backup, start the
+
<literal>gitlab-backup</literal> service:
+
$ systemctl start gitlab-backup.service
+
<section xml:id="module-services-gitlab-maintenance-rake">
+
<title>Rake tasks</title>
+
You can run GitLab's rake tasks with
+
<literal>gitlab-rake</literal> which will be available on the
+
system when GitLab is enabled. You will have to run the command
+
as the user that you configured to run GitLab with.
+
A list of all available rake tasks can be obtained by running:
+
$ sudo -u git -H gitlab-rake -T