You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -119,24 +119,36 @@ If you have any issues, see the [troubleshooting section](#relative-url-troubles
119
119
Linux package installations load all configuration from `/etc/gitlab/gitlab.rb` file.
120
120
This file has strict file permissions and is owned by the `root` user. The reason for strict permissions
121
121
and ownership is that `/etc/gitlab/gitlab.rb` is being executed as Ruby code by the `root` user during `gitlab-ctl reconfigure`. This means
122
-
that users who have to write access to `/etc/gitlab/gitlab.rb` can add a configuration that is executed as code by `root`.
122
+
that users who have write access to `/etc/gitlab/gitlab.rb` can add a configuration that is executed as code by `root`.
123
123
124
124
In certain organizations, it is allowed to have access to the configuration files but not as the root user.
125
125
You can include an external configuration file inside `/etc/gitlab/gitlab.rb` by specifying the path to the file:
126
126
127
-
```ruby
128
-
from_file "/home/admin/external_gitlab.rb"
129
-
```
127
+
1. Edit `/etc/gitlab/gitlab.rb`:
128
+
129
+
```ruby
130
+
from_file "/home/admin/external_gitlab.rb"
131
+
```
130
132
131
-
Code you include into `/etc/gitlab/gitlab.rb` using `from_file` runs with `root` privileges when you run `sudo gitlab-ctl reconfigure`.
132
-
Any configuration that is set in `/etc/gitlab/gitlab.rb` after `from_file` is included, takes precedence over the configuration from the included file.
133
+
1. Reconfigure GitLab:
134
+
135
+
```shell
136
+
sudo gitlab-ctl reconfigure
137
+
```
138
+
139
+
When you use `from_file`:
140
+
141
+
- Code you include into `/etc/gitlab/gitlab.rb` using `from_file` runs with
142
+
`root` privileges when you reconfigure GitLab.
143
+
- Any configuration that is set in `/etc/gitlab/gitlab.rb` after `from_file` is
144
+
included, takes precedence over the configuration from the included file.
133
145
134
146
## Read certificate from file
135
147
136
148
Certificates can be stored as separate files and loaded into memory when running `sudo gitlab-ctl reconfigure`. Files containing
137
149
certificates must be plaintext.
138
150
139
-
In this example, the PostgreSQL server certificate is read directly from a file rather than copy and pasting into the `gitlab.rb` directly.
151
+
In this example, the [PostgreSQL server certificate](database.md#configuring-ssl) is read directly from a file rather than copying and pasting into `/etc/gitlab/gitlab.rb` directly.
| `gitlab-www` | Yes | Web server user/group | `/var/opt/gitlab/nginx` | `/bin/false` |
330
+
| `gitlab-prometheus` | Yes | Prometheus user/group for Prometheus monitoring and various exporters | `/var/opt/gitlab/prometheus` | `/bin/sh` |
331
+
| `gitlab-redis` | Only when using the packaged Redis | Redis user/group for GitLab| `/var/opt/gitlab/redis` | `/bin/false` |
332
+
| `gitlab-psql` | Only when using the packaged PostgreSQL | PostgreSQL user/group | `/var/opt/gitlab/postgresql` | `/bin/sh` |
333
+
| `gitlab-consul` | Only when using GitLab Consul| GitLab Consul user/group | `/var/opt/gitlab/consul` | `/bin/sh` |
334
+
| `registry` | Only when using GitLab Registry | GitLab Registry user/group | `/var/opt/gitlab/registry` | `/bin/sh` |
335
+
| `mattermost` | Only when using GitLab Mattermost | GitLab Mattermost user/group | `/var/opt/gitlab/mattermost` | `/bin/sh` |
309
336
310
337
To disable user and group accounts management:
311
338
@@ -319,8 +346,8 @@ To disable user and group accounts management:
319
346
320
347
```ruby
321
348
# GitLab
322
-
user['username'] = "custom-gitlab"
323
-
user['group'] = "custom-gitlab"
349
+
user['username'] = "git"
350
+
user['group'] = "git"
324
351
user['shell'] = "/bin/sh"
325
352
user['home'] = "/var/opt/custom-gitlab"
326
353
@@ -330,19 +357,38 @@ To disable user and group accounts management:
330
357
web_server['shell'] = '/bin/false'
331
358
web_server['home'] = '/var/opt/gitlab/webserver'
332
359
333
-
# Postgresql (not needed when using external Postgresql)
334
-
postgresql['username'] = "postgres-gitlab"
335
-
postgresql['group'] = "postgres-gitlab"
336
-
postgresql['shell'] = "/bin/sh"
337
-
postgresql['home'] = "/var/opt/postgres-gitlab"
360
+
# Prometheus
361
+
prometheus['username'] = 'gitlab-prometheus'
362
+
prometheus['group'] = 'gitlab-prometheus'
363
+
prometheus['shell'] = '/bin/sh'
364
+
prometheus['home'] = '/var/opt/gitlab/prometheus'
338
365
339
366
# Redis (not needed when using external Redis)
340
367
redis['username'] = "redis-gitlab"
341
368
redis['group'] = "redis-gitlab"
342
369
redis['shell'] = "/bin/false"
343
370
redis['home'] = "/var/opt/redis-gitlab"
344
371
345
-
# And so on for users/groups for GitLab Mattermost
372
+
# Postgresql (not needed when using external Postgresql)
373
+
postgresql['username'] = "postgres-gitlab"
374
+
postgresql['group'] = "postgres-gitlab"
375
+
postgresql['shell'] = "/bin/sh"
376
+
postgresql['home'] = "/var/opt/postgres-gitlab"
377
+
378
+
# Consul
379
+
consul['username'] = 'gitlab-consul'
380
+
consul['group'] = 'gitlab-consul'
381
+
consul['dir'] = "/var/opt/gitlab/registry"
382
+
383
+
# Registry
384
+
registry['username'] = "registry"
385
+
registry['group'] = "registry"
386
+
registry['dir'] = "/var/opt/gitlab/registry"
387
+
388
+
# Mattermost
389
+
mattermost['username'] = 'mattermost'
390
+
mattermost['group'] = 'mattermost'
391
+
mattermost['home'] = '/var/opt/gitlab/mattermost'
346
392
```
347
393
348
394
1. Reconfigure GitLab:
@@ -363,7 +409,7 @@ To move an existing home directory, GitLab services need to be stopped and some
363
409
1. Stop GitLab:
364
410
365
411
```shell
366
-
gitlab-ctl stop
412
+
sudo gitlab-ctl stop
367
413
```
368
414
369
415
1. Stop the runit server:
@@ -375,7 +421,7 @@ To move an existing home directory, GitLab services need to be stopped and some
375
421
1. Change the home directory:
376
422
377
423
```shell
378
-
usermod -d /path/to/home <username>
424
+
sudo usermod -d /path/to/home <username>
379
425
```
380
426
381
427
If you had existing data, you need to manually copy/rsync it to the new location:
@@ -473,7 +519,8 @@ To disable the management of storage directories:
473
519
## Start Linux package installation services only after a given file system is mounted
474
520
475
521
If you want to prevent Linux package installation services (NGINX, Redis, Puma, etc.)
476
-
from starting before a given file system is mounted:
522
+
from starting before a given file system is mounted, you can set the
523
+
`high_availability['mountpoint']` setting:
477
524
478
525
1. Edit `/etc/gitlab/gitlab.rb`:
479
526
@@ -488,6 +535,9 @@ from starting before a given file system is mounted:
488
535
sudo gitlab-ctl reconfigure
489
536
```
490
537
538
+
NOTE:
539
+
If the mount point doesn't exist, GitLab fails to reconfigure.
540
+
491
541
## Configure the runtime directory
492
542
493
543
When Prometheus monitoring is enabled, the GitLab Exporter conducts measurements
@@ -522,8 +572,22 @@ To enable the Rails metrics again:
522
572
523
573
## Configure a failed authentication ban
524
574
525
-
You can configure a [failed authentication ban](https://docs.gitlab.com/ee/security/rate_limits.html#failed-authentication-ban-for-git-and-container-registry)
|`enabled`|`false` by default. Set this to `true` to enable the Git and registry authentication ban. |
585
+
|`ip_whitelist`| IPs to not block. They must be formatted as strings in a Ruby array. You can use either single IPs or CIDR notation, for example, `["127.0.0.1", "127.0.0.2", "127.0.0.3", "192.168.0.1/24"]`. |
586
+
|`maxretry`| The maximum amount of times a request can be made in the specified time. |
587
+
|`findtime`| The maximum amount of timein seconds that failed requests can count against an IP before it's added to the denylist. |
588
+
| `bantime` | The total amount of time in seconds that an IP is blocked. |
589
+
590
+
To configure the Git and container registry authentication ban:
527
591
528
592
1. Edit `/etc/gitlab/gitlab.rb`:
529
593
@@ -543,18 +607,6 @@ for Git and the container registry:
543
607
sudo gitlab-ctl reconfigure
544
608
```
545
609
546
-
The following settings can be configured:
547
-
548
-
- `enabled`: By default, this is set to `false`. Set this to `true` to enable Rack Attack.
549
-
- `ip_whitelist`: IPs to not block. They must be formatted as strings in a
550
-
Ruby array. CIDR notation is supported in GitLab 12.1 and later.
551
-
For example, `["127.0.0.1", "127.0.0.2", "127.0.0.3", "192.168.0.1/24"]`.
552
-
- `maxretry`: The maximum amount of times a request can be made in the
553
-
specified time.
554
-
- `findtime`: The maximum amount of time that failed requests can count against an IP
555
-
before it's added to the denylist (in seconds).
556
-
- `bantime`: The total amount of time that an IP is blocked (in seconds).
557
-
558
610
## Disable automatic cache cleaning during installation
559
611
560
612
If you have a large GitLab installation, you might not want to run a `rake cache:clear` task
@@ -579,22 +631,27 @@ To disable automatic cache cleaning during installation:
579
631
580
632
## Error Reporting and Logging with Sentry
581
633
582
-
[Sentry](https://sentry.io) is an error reporting and logging tool which can be
583
-
used as SaaS or on-premise. It's Open Source, and you can
584
-
[browse its source code repositories](https://github.com/getsentry).
585
-
586
634
WARNING:
587
-
From GitLab 17.0, only Sentry versions 21.5.0 or later will be supported. If you use an earlier version of a Sentry instance that you host, you must
588
-
[upgrade Sentry](https://develop.sentry.dev/self-hosted/releases/) to continue collecting errors from your GitLab environments.
635
+
From GitLab 17.0, only Sentry versions 21.5.0 or later will be supported. If
636
+
you use an earlier version of a Sentry instance that you host, you must
637
+
[upgrade Sentry](https://develop.sentry.dev/self-hosted/releases/) to continue
638
+
collecting errors from your GitLab environments.
639
+
640
+
Sentry is an open source error reporting and logging tool which can be used as
641
+
SaaS (<https://sentry.io>) or [host it yourself](https://develop.sentry.dev/self-hosted/).
589
642
590
643
To configure Sentry:
591
644
645
+
1. Create a project in Sentry.
646
+
1. Find the
647
+
[Data Source Name (DSN)](https://docs.sentry.io/product/sentry-basics/concepts/dsn-explainer/)
0 commit comments