Commit 5abfc57e authored by Marcel Amirault's avatar Marcel Amirault Committed by Achilleas Pipinellis

Fix spacing of code blocks

Code blocks should not be spaced 4 times, as this will
prevent the code from being colored. They should
also be spaced the same as the lists they are a part
of, to make reading easier.
parent 84b49ef3
This diff is collapsed.
...@@ -74,9 +74,9 @@ the following. This will balance the load between `host1.example.com` and ...@@ -74,9 +74,9 @@ the following. This will balance the load between `host1.example.com` and
1. Edit `/etc/gitlab/gitlab.rb` and add the following line: 1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
```ruby ```ruby
gitlab_rails['db_load_balancing'] = { 'hosts' => ['host1.example.com', 'host2.example.com'] } gitlab_rails['db_load_balancing'] = { 'hosts' => ['host1.example.com', 'host2.example.com'] }
``` ```
1. Save the file and [reconfigure GitLab][] for the changes to take effect. 1. Save the file and [reconfigure GitLab][] for the changes to take effect.
...@@ -86,16 +86,16 @@ the following. This will balance the load between `host1.example.com` and ...@@ -86,16 +86,16 @@ the following. This will balance the load between `host1.example.com` and
1. Edit `/home/git/gitlab/config/database.yml` and add or amend the following lines: 1. Edit `/home/git/gitlab/config/database.yml` and add or amend the following lines:
```yaml ```yaml
production: production:
username: gitlab username: gitlab
database: gitlab database: gitlab
encoding: unicode encoding: unicode
load_balancing: load_balancing:
hosts: hosts:
- host1.example.com - host1.example.com
- host2.example.com - host2.example.com
``` ```
1. Save the file and [restart GitLab][] for the changes to take effect. 1. Save the file and [restart GitLab][] for the changes to take effect.
......
...@@ -102,16 +102,16 @@ for a real-world example of this exploit. ...@@ -102,16 +102,16 @@ for a real-world example of this exploit.
1. Reconfigure GitLab for the changes to take effect: 1. Reconfigure GitLab for the changes to take effect:
```sh ```sh
sudo gitlab-ctl reconfigure sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart sudo gitlab-ctl restart
``` ```
1. Verify that everything is configured correctly: 1. Verify that everything is configured correctly:
```sh ```sh
sudo gitlab-rake gitlab:incoming_email:check sudo gitlab-rake gitlab:incoming_email:check
``` ```
Reply by email should now be working. Reply by email should now be working.
...@@ -119,31 +119,31 @@ Reply by email should now be working. ...@@ -119,31 +119,31 @@ Reply by email should now be working.
1. Go to the GitLab installation directory: 1. Go to the GitLab installation directory:
```sh ```sh
cd /home/git/gitlab cd /home/git/gitlab
``` ```
1. Find the `incoming_email` section in `config/gitlab.yml`, enable the feature 1. Find the `incoming_email` section in `config/gitlab.yml`, enable the feature
and fill in the details for your specific IMAP server and email account (see [examples](#config-examples) below). and fill in the details for your specific IMAP server and email account (see [examples](#config-examples) below).
1. Enable `mail_room` in the init script at `/etc/default/gitlab`: 1. Enable `mail_room` in the init script at `/etc/default/gitlab`:
```sh ```sh
sudo mkdir -p /etc/default sudo mkdir -p /etc/default
echo 'mail_room_enabled=true' | sudo tee -a /etc/default/gitlab echo 'mail_room_enabled=true' | sudo tee -a /etc/default/gitlab
``` ```
1. Restart GitLab: 1. Restart GitLab:
```sh ```sh
sudo service gitlab restart sudo service gitlab restart
``` ```
1. Verify that everything is configured correctly: 1. Verify that everything is configured correctly:
```sh ```sh
sudo -u git -H bundle exec rake gitlab:incoming_email:check RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:incoming_email:check RAILS_ENV=production
``` ```
Reply by email should now be working. Reply by email should now be working.
......
...@@ -27,9 +27,10 @@ Because Rubular doesn't understand `%{issue_ref}`, you can replace this by ...@@ -27,9 +27,10 @@ Because Rubular doesn't understand `%{issue_ref}`, you can replace this by
1. Change the value of `gitlab_rails['gitlab_issue_closing_pattern']` to a regular 1. Change the value of `gitlab_rails['gitlab_issue_closing_pattern']` to a regular
expression of your liking: expression of your liking:
```ruby ```ruby
gitlab_rails['gitlab_issue_closing_pattern'] = "\b((?:[Cc]los(?:e[sd]|ing)|\b[Ff]ix(?:e[sd]|ing)?) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?))+)" gitlab_rails['gitlab_issue_closing_pattern'] = "\b((?:[Cc]los(?:e[sd]|ing)|\b[Ff]ix(?:e[sd]|ing)?) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?))+)"
``` ```
1. [Reconfigure] GitLab for the changes to take effect. 1. [Reconfigure] GitLab for the changes to take effect.
**For installations from source** **For installations from source**
...@@ -37,9 +38,9 @@ Because Rubular doesn't understand `%{issue_ref}`, you can replace this by ...@@ -37,9 +38,9 @@ Because Rubular doesn't understand `%{issue_ref}`, you can replace this by
1. Open `gitlab.yml` with your editor. 1. Open `gitlab.yml` with your editor.
1. Change the value of `issue_closing_pattern`: 1. Change the value of `issue_closing_pattern`:
```yaml ```yaml
issue_closing_pattern: "\b((?:[Cc]los(?:e[sd]|ing)|\b[Ff]ix(?:e[sd]|ing)?) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?))+)" issue_closing_pattern: "\b((?:[Cc]los(?:e[sd]|ing)|\b[Ff]ix(?:e[sd]|ing)?) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?))+)"
``` ```
1. [Restart] GitLab for the changes to take effect. 1. [Restart] GitLab for the changes to take effect.
......
# Jobs artifacts administration # Jobs artifacts administration
> **Notes:**
>
> - Introduced in GitLab 8.2 and GitLab Runner 0.7.0. > - Introduced in GitLab 8.2 and GitLab Runner 0.7.0.
> - Starting with GitLab 8.4 and GitLab Runner 1.0, the artifacts archive format changed to `ZIP`. > - Starting with GitLab 8.4 and GitLab Runner 1.0, the artifacts archive format changed to `ZIP`.
> - Starting with GitLab 8.17, builds are renamed to jobs. > - Starting with GitLab 8.17, builds are renamed to jobs.
...@@ -21,9 +19,9 @@ To disable artifacts site-wide, follow the steps below. ...@@ -21,9 +19,9 @@ To disable artifacts site-wide, follow the steps below.
1. Edit `/etc/gitlab/gitlab.rb` and add the following line: 1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
```ruby ```ruby
gitlab_rails['artifacts_enabled'] = false gitlab_rails['artifacts_enabled'] = false
``` ```
1. Save the file and [reconfigure GitLab][] for the changes to take effect. 1. Save the file and [reconfigure GitLab][] for the changes to take effect.
...@@ -33,10 +31,10 @@ To disable artifacts site-wide, follow the steps below. ...@@ -33,10 +31,10 @@ To disable artifacts site-wide, follow the steps below.
1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following lines: 1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following lines:
```yaml ```yaml
artifacts: artifacts:
enabled: false enabled: false
``` ```
1. Save the file and [restart GitLab][] for the changes to take effect. 1. Save the file and [restart GitLab][] for the changes to take effect.
...@@ -61,9 +59,9 @@ _The artifacts are stored by default in ...@@ -61,9 +59,9 @@ _The artifacts are stored by default in
1. To change the storage path for example to `/mnt/storage/artifacts`, edit 1. To change the storage path for example to `/mnt/storage/artifacts`, edit
`/etc/gitlab/gitlab.rb` and add the following line: `/etc/gitlab/gitlab.rb` and add the following line:
```ruby ```ruby
gitlab_rails['artifacts_path'] = "/mnt/storage/artifacts" gitlab_rails['artifacts_path'] = "/mnt/storage/artifacts"
``` ```
1. Save the file and [reconfigure GitLab][] for the changes to take effect. 1. Save the file and [reconfigure GitLab][] for the changes to take effect.
...@@ -77,18 +75,16 @@ _The artifacts are stored by default in ...@@ -77,18 +75,16 @@ _The artifacts are stored by default in
1. To change the storage path for example to `/mnt/storage/artifacts`, edit 1. To change the storage path for example to `/mnt/storage/artifacts`, edit
`/home/git/gitlab/config/gitlab.yml` and add or amend the following lines: `/home/git/gitlab/config/gitlab.yml` and add or amend the following lines:
```yaml ```yaml
artifacts: artifacts:
enabled: true enabled: true
path: /mnt/storage/artifacts path: /mnt/storage/artifacts
``` ```
1. Save the file and [restart GitLab][] for the changes to take effect. 1. Save the file and [restart GitLab][] for the changes to take effect.
### Using object storage ### Using object storage
> **Notes:**
>
> - [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1762) in > - [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1762) in
> [GitLab Premium](https://about.gitlab.com/pricing/) 9.4. > [GitLab Premium](https://about.gitlab.com/pricing/) 9.4.
> - Since version 9.5, artifacts are [browsable](../user/project/pipelines/job_artifacts.md#browsing-artifacts), > - Since version 9.5, artifacts are [browsable](../user/project/pipelines/job_artifacts.md#browsing-artifacts),
...@@ -141,35 +137,35 @@ _The artifacts are stored by default in ...@@ -141,35 +137,35 @@ _The artifacts are stored by default in
1. Edit `/etc/gitlab/gitlab.rb` and add the following lines by replacing with 1. Edit `/etc/gitlab/gitlab.rb` and add the following lines by replacing with
the values you want: the values you want:
```ruby ```ruby
gitlab_rails['artifacts_enabled'] = true gitlab_rails['artifacts_enabled'] = true
gitlab_rails['artifacts_object_store_enabled'] = true gitlab_rails['artifacts_object_store_enabled'] = true
gitlab_rails['artifacts_object_store_remote_directory'] = "artifacts" gitlab_rails['artifacts_object_store_remote_directory'] = "artifacts"
gitlab_rails['artifacts_object_store_connection'] = { gitlab_rails['artifacts_object_store_connection'] = {
'provider' => 'AWS', 'provider' => 'AWS',
'region' => 'eu-central-1', 'region' => 'eu-central-1',
'aws_access_key_id' => 'AWS_ACCESS_KEY_ID', 'aws_access_key_id' => 'AWS_ACCESS_KEY_ID',
'aws_secret_access_key' => 'AWS_SECRET_ACCESS_KEY' 'aws_secret_access_key' => 'AWS_SECRET_ACCESS_KEY'
} }
``` ```
NOTE: For GitLab 9.4+, if you are using AWS IAM profiles, be sure to omit the NOTE: For GitLab 9.4+, if you are using AWS IAM profiles, be sure to omit the
AWS access key and secret access key/value pairs. For example: AWS access key and secret access key/value pairs. For example:
```ruby ```ruby
gitlab_rails['artifacts_object_store_connection'] = { gitlab_rails['artifacts_object_store_connection'] = {
'provider' => 'AWS', 'provider' => 'AWS',
'region' => 'eu-central-1', 'region' => 'eu-central-1',
'use_iam_profile' => true 'use_iam_profile' => true
} }
``` ```
1. Save the file and [reconfigure GitLab][] for the changes to take effect. 1. Save the file and [reconfigure GitLab][] for the changes to take effect.
1. Migrate any existing local artifacts to the object storage: 1. Migrate any existing local artifacts to the object storage:
```bash ```bash
gitlab-rake gitlab:artifacts:migrate gitlab-rake gitlab:artifacts:migrate
``` ```
--- ---
...@@ -181,25 +177,25 @@ _The artifacts are stored by default in ...@@ -181,25 +177,25 @@ _The artifacts are stored by default in
1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following 1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following
lines: lines:
```yaml ```yaml
artifacts: artifacts:
enabled: true enabled: true
object_store: object_store:
enabled: true enabled: true
remote_directory: "artifacts" # The bucket name remote_directory: "artifacts" # The bucket name
connection: connection:
provider: AWS # Only AWS supported at the moment provider: AWS # Only AWS supported at the moment
aws_access_key_id: AWS_ACCESS_KEY_ID aws_access_key_id: AWS_ACCESS_KEY_ID
aws_secret_access_key: AWS_SECRET_ACCESS_KEY aws_secret_access_key: AWS_SECRET_ACCESS_KEY
region: eu-central-1 region: eu-central-1
``` ```
1. Save the file and [restart GitLab][] for the changes to take effect. 1. Save the file and [restart GitLab][] for the changes to take effect.
1. Migrate any existing local artifacts to the object storage: 1. Migrate any existing local artifacts to the object storage:
```bash ```bash
sudo -u git -H bundle exec rake gitlab:artifacts:migrate RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:artifacts:migrate RAILS_ENV=production
``` ```
## Expiring artifacts ## Expiring artifacts
...@@ -217,9 +213,9 @@ steps below. ...@@ -217,9 +213,9 @@ steps below.
1. Edit `/etc/gitlab/gitlab.rb` and comment out or add the following line 1. Edit `/etc/gitlab/gitlab.rb` and comment out or add the following line
```ruby ```ruby
gitlab_rails['expire_build_artifacts_worker_cron'] = "50 * * * *" gitlab_rails['expire_build_artifacts_worker_cron'] = "50 * * * *"
``` ```
1. Save the file and [reconfigure GitLab][] for the changes to take effect. 1. Save the file and [reconfigure GitLab][] for the changes to take effect.
...@@ -230,10 +226,10 @@ steps below. ...@@ -230,10 +226,10 @@ steps below.
1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following 1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following
lines: lines:
```yaml ```yaml
expire_build_artifacts_worker: expire_build_artifacts_worker:
cron: "50 * * * *" cron: "50 * * * *"
``` ```
1. Save the file and [restart GitLab][] for the changes to take effect. 1. Save the file and [restart GitLab][] for the changes to take effect.
...@@ -250,15 +246,15 @@ you can flip the feature flag from a Rails console. ...@@ -250,15 +246,15 @@ you can flip the feature flag from a Rails console.
1. Enter the Rails console: 1. Enter the Rails console:
```sh ```sh
sudo gitlab-rails console sudo gitlab-rails console
``` ```
1. Flip the switch and disable it: 1. Flip the switch and disable it:
```ruby ```ruby
Feature.enable('ci_disable_validates_dependencies') Feature.enable('ci_disable_validates_dependencies')
``` ```
--- ---
...@@ -266,16 +262,16 @@ you can flip the feature flag from a Rails console. ...@@ -266,16 +262,16 @@ you can flip the feature flag from a Rails console.
1. Enter the Rails console: 1. Enter the Rails console:
```sh ```sh
cd /home/git/gitlab cd /home/git/gitlab
RAILS_ENV=production sudo -u git -H bundle exec rails console RAILS_ENV=production sudo -u git -H bundle exec rails console
``` ```
1. Flip the switch and disable it: 1. Flip the switch and disable it:
```ruby ```ruby
Feature.enable('ci_disable_validates_dependencies') Feature.enable('ci_disable_validates_dependencies')
``` ```
## Set the maximum file size of the artifacts ## Set the maximum file size of the artifacts
......
...@@ -25,11 +25,11 @@ To change the location where the job logs will be stored, follow the steps below ...@@ -25,11 +25,11 @@ To change the location where the job logs will be stored, follow the steps below
**In Omnibus installations:** **In Omnibus installations:**
1. Edit `/etc/gitlab/gitlab.rb` and add or amend the following line: 1. Edit `/etc/gitlab/gitlab.rb` and add or amend the following line:
``` ```ruby
gitlab_ci['builds_directory'] = '/mnt/to/gitlab-ci/builds' gitlab_ci['builds_directory'] = '/mnt/to/gitlab-ci/builds'
``` ```
1. Save the file and [reconfigure GitLab][] for the changes to take effect. 1. Save the file and [reconfigure GitLab][] for the changes to take effect.
...@@ -39,12 +39,12 @@ To change the location where the job logs will be stored, follow the steps below ...@@ -39,12 +39,12 @@ To change the location where the job logs will be stored, follow the steps below
1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following lines: 1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following lines:
```yaml ```yaml
gitlab_ci: gitlab_ci:
# The location where build traces are stored (default: builds/). # The location where build traces are stored (default: builds/).
# Relative paths are relative to Rails.root. # Relative paths are relative to Rails.root.
builds_path: path/to/builds/ builds_path: path/to/builds/
``` ```
1. Save the file and [restart GitLab][] for the changes to take effect. 1. Save the file and [restart GitLab][] for the changes to take effect.
...@@ -67,24 +67,24 @@ To archive those legacy job traces, please follow the instruction below. ...@@ -67,24 +67,24 @@ To archive those legacy job traces, please follow the instruction below.
1. Execute the following command 1. Execute the following command
```bash ```bash
gitlab-rake gitlab:traces:archive gitlab-rake gitlab:traces:archive
``` ```
After you executed this task, GitLab instance queues up Sidekiq jobs (asynchronous processes) After you executed this task, GitLab instance queues up Sidekiq jobs (asynchronous processes)
for migrating job trace files from local storage to object storage. for migrating job trace files from local storage to object storage.
It could take time to complete the all migration jobs. You can check the progress by the following command It could take time to complete the all migration jobs. You can check the progress by the following command
```bash ```bash
sudo gitlab-rails console sudo gitlab-rails console
``` ```
```bash ```bash
[1] pry(main)> Sidekiq::Stats.new.queues['pipeline_background:archive_trace'] [1] pry(main)> Sidekiq::Stats.new.queues['pipeline_background:archive_trace']
=> 100 => 100
``` ```
If the count becomes zero, the archiving processes are done If the count becomes zero, the archiving processes are done
## How to migrate archived job traces to object storage ## How to migrate archived job traces to object storage
......
...@@ -21,18 +21,18 @@ To enable external storage of merge request diffs, follow the instructions below ...@@ -21,18 +21,18 @@ To enable external storage of merge request diffs, follow the instructions below
1. Edit `/etc/gitlab/gitlab.rb` and add the following line: 1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
```ruby ```ruby
gitlab_rails['external_diffs_enabled'] = true gitlab_rails['external_diffs_enabled'] = true
``` ```
1. _The external diffs will be stored in in 1. _The external diffs will be stored in in
`/var/opt/gitlab/gitlab-rails/shared/external-diffs`._ To change the path, `/var/opt/gitlab/gitlab-rails/shared/external-diffs`._ To change the path,
for example, to `/mnt/storage/external-diffs`, edit `/etc/gitlab/gitlab.rb` for example, to `/mnt/storage/external-diffs`, edit `/etc/gitlab/gitlab.rb`
and add the following line: and add the following line:
```ruby ```ruby
gitlab_rails['external_diffs_storage_path'] = "/mnt/storage/external-diffs" gitlab_rails['external_diffs_storage_path'] = "/mnt/storage/external-diffs"
``` ```
1. Save the file and [reconfigure GitLab](restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect. 1. Save the file and [reconfigure GitLab](restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
...@@ -41,21 +41,21 @@ To enable external storage of merge request diffs, follow the instructions below ...@@ -41,21 +41,21 @@ To enable external storage of merge request diffs, follow the instructions below
1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following 1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following
lines: lines:
```yaml ```yaml
external_diffs: external_diffs:
enabled: true enabled: true
``` ```
1. _The external diffs will be stored in 1. _The external diffs will be stored in
`/home/git/gitlab/shared/external-diffs`._ To change the path, for example, `/home/git/gitlab/shared/external-diffs`._ To change the path, for example,
to `/mnt/storage/external-diffs`, edit `/home/git/gitlab/config/gitlab.yml` to `/mnt/storage/external-diffs`, edit `/home/git/gitlab/config/gitlab.yml`
and add or amend the following lines: and add or amend the following lines:
```yaml ```yaml
external_diffs: external_diffs:
enabled: true enabled: true
storage_path: /mnt/storage/external-diffs storage_path: /mnt/storage/external-diffs
``` ```
1. Save the file and [restart GitLab](restart_gitlab.md#installations-from-source) for the changes to take effect. 1. Save the file and [restart GitLab](restart_gitlab.md#installations-from-source) for the changes to take effect.
...@@ -101,28 +101,28 @@ The connection settings match those provided by [Fog](https://github.com/fog), a ...@@ -101,28 +101,28 @@ The connection settings match those provided by [Fog](https://github.com/fog), a
1. Edit `/etc/gitlab/gitlab.rb` and add the following lines by replacing with 1. Edit `/etc/gitlab/gitlab.rb` and add the following lines by replacing with
the values you want: the values you want:
```ruby ```ruby
gitlab_rails['external_diffs_enabled'] = true gitlab_rails['external_diffs_enabled'] = true
gitlab_rails['external_diffs_object_store_enabled'] = true gitlab_rails['external_diffs_object_store_enabled'] = true
gitlab_rails['external_diffs_object_store_remote_directory'] = "external-diffs" gitlab_rails['external_diffs_object_store_remote_directory'] = "external-diffs"
gitlab_rails['external_diffs_object_store_connection'] = { gitlab_rails['external_diffs_object_store_connection'] = {
'provider' => 'AWS', 'provider' => 'AWS',
'region' => 'eu-central-1', 'region' => 'eu-central-1',
'aws_access_key_id' => 'AWS_ACCESS_KEY_ID', 'aws_access_key_id' => 'AWS_ACCESS_KEY_ID',
'aws_secret_access_key' => 'AWS_SECRET_ACCESS_KEY' 'aws_secret_access_key' => 'AWS_SECRET_ACCESS_KEY'
} }
``` ```
Note that, if you are using AWS IAM profiles, be sure to omit the Note that, if you are using AWS IAM profiles, be sure to omit the
AWS access key and secret access key/value pairs. For example: AWS access key and secret access key/value pairs. For example:
```ruby ```ruby
gitlab_rails['external_diffs_object_store_connection'] = { gitlab_rails['external_diffs_object_store_connection'] = {
'provider' => 'AWS', 'provider' => 'AWS',
'region' => 'eu-central-1', 'region' => 'eu-central-1',
'use_iam_profile' => true 'use_iam_profile' => true
} }
``` ```
1. Save the file and [reconfigure GitLab](restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect. 1. Save the file and [reconfigure GitLab](restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
...@@ -131,18 +131,18 @@ The connection settings match those provided by [Fog](https://github.com/fog), a ...@@ -131,18 +131,18 @@ The connection settings match those provided by [Fog](https://github.com/fog), a
1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following 1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following
lines: lines:
```yaml ```yaml
external_diffs: external_diffs:
enabled: true enabled: true
object_store: object_store:
enabled: true enabled: true
remote_directory: "external-diffs" # The bucket name remote_directory: "external-diffs" # The bucket name
connection: connection:
provider: AWS # Only AWS supported at the moment provider: AWS # Only AWS supported at the moment
aws_access_key_id: AWS_ACCESS_KEY_ID aws_access_key_id: AWS_ACCESS_KEY_ID
aws_secret_access_key: AWS_SECRET_ACCESS_KEY aws_secret_access_key: AWS_SECRET_ACCESS_KEY
region: eu-central-1 region: eu-central-1
``` ```
1. Save the file and [restart GitLab](restart_gitlab.md#installations-from-source) for the changes to take effect. 1. Save the file and [restart GitLab](restart_gitlab.md#installations-from-source) for the changes to take effect.
...@@ -157,11 +157,11 @@ To enable this feature, perform the following steps: ...@@ -157,11 +157,11 @@ To enable this feature, perform the following steps:
**In Omnibus installations:** **In Omnibus installations:**
1. Edit `/etc/gitlab/gitlab.rb` and add the following line: 1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
```ruby ```ruby
gitlab_rails['external_diffs_when'] = 'outdated' gitlab_rails['external_diffs_when'] = 'outdated'
``` ```
1. Save the file and [reconfigure GitLab](restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect. 1. Save the file and [reconfigure GitLab](restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
...@@ -170,11 +170,11 @@ To enable this feature, perform the following steps: ...@@ -170,11 +170,11 @@ To enable this feature, perform the following steps:
1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following 1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following
lines: lines:
```yaml ```yaml
external_diffs: external_diffs:
enabled: true enabled: true
when: outdated when: outdated
``` ```
1. Save the file and [restart GitLab](restart_gitlab.md#installations-from-source) for the changes to take effect. 1. Save the file and [restart GitLab](restart_gitlab.md#installations-from-source) for the changes to take effect.
......
...@@ -28,9 +28,9 @@ To enable the Packages feature: ...@@ -28,9 +28,9 @@ To enable the Packages feature:
1. Edit `/etc/gitlab/gitlab.rb` and add the following line: 1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
```ruby ```ruby
gitlab_rails['packages_enabled'] = true gitlab_rails['packages_enabled'] = true
``` ```
1. Save the file and [reconfigure GitLab][] for the changes to take effect. 1. Save the file and [reconfigure GitLab][] for the changes to take effect.
...@@ -39,10 +39,11 @@ To enable the Packages feature: ...@@ -39,10 +39,11 @@ To enable the Packages feature:
1. After the installation is complete, you will have to configure the `packages` 1. After the installation is complete, you will have to configure the `packages`
section in `config/gitlab.yml`. Set to `true` to enable it: section in `config/gitlab.yml`. Set to `true` to enable it:
```yaml ```yaml
packages: packages:
enabled: true enabled: true
``` ```
1. [Restart GitLab] for the changes to take effect. 1. [Restart GitLab] for the changes to take effect.
## Changing the storage path ## Changing the storage path
...@@ -61,9 +62,9 @@ To change the local storage path: ...@@ -61,9 +62,9 @@ To change the local storage path:
1. Edit `/etc/gitlab/gitlab.rb` and add the following line: 1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
```ruby ```ruby
gitlab_rails['packages_storage_path'] = "/mnt/packages" gitlab_rails['packages_storage_path'] = "/mnt/packages"
``` ```
1. Save the file and [reconfigure GitLab][] for the changes to take effect. 1. Save the file and [reconfigure GitLab][] for the changes to take effect.
...@@ -71,11 +72,12 @@ To change the local storage path: ...@@ -71,11 +72,12 @@ To change the local storage path:
1. Edit the `packages` section in `config/gitlab.yml`: 1. Edit the `packages` section in `config/gitlab.yml`:
```yaml ```yaml
packages: packages:
enabled: true enabled: true
storage_path: shared/packages storage_path: shared/packages
``` ```
1. [Restart GitLab] for the changes to take effect. 1. [Restart GitLab] for the changes to take effect.
### Using object storage ### Using object storage
...@@ -88,31 +90,31 @@ upload packages: ...@@ -88,31 +90,31 @@ upload packages:
1. Edit `/etc/gitlab/gitlab.rb` and add the following lines (uncomment where 1. Edit `/etc/gitlab/gitlab.rb` and add the following lines (uncomment where
necessary): necessary):
```ruby ```ruby
gitlab_rails['packages_enabled'] = true gitlab_rails['packages_enabled'] = true
gitlab_rails['packages_storage_path'] = "/var/opt/gitlab/gitlab-rails/shared/packages" gitlab_rails['packages_storage_path'] = "/var/opt/gitlab/gitlab-rails/shared/packages"
gitlab_rails['packages_object_store_enabled'] = true gitlab_rails['packages_object_store_enabled'] = true
gitlab_rails['packages_object_store_remote_directory'] = "packages" # The bucket name. gitlab_rails['packages_object_store_remote_directory'] = "packages" # The bucket name.
gitlab_rails['packages_object_store_direct_upload'] = false # Use Object Storage directly for uploads instead of background uploads if enabled (Default: false). gitlab_rails['packages_object_store_direct_upload'] = false # Use Object Storage directly for uploads instead of background uploads if enabled (Default: false).
gitlab_rails['packages_object_store_background_upload'] = true # Temporary option to limit automatic upload (Default: true). gitlab_rails['packages_object_store_background_upload'] = true # Temporary option to limit automatic upload (Default: true).
gitlab_rails['packages_object_store_proxy_download'] = false # Passthrough all downloads via GitLab instead of using Redirects to Object Storage. gitlab_rails['packages_object_store_proxy_download'] = false # Passthrough all downloads via GitLab instead of using Redirects to Object Storage.
gitlab_rails['packages_object_store_connection'] = { gitlab_rails['packages_object_store_connection'] = {
## ##
## If the provider is AWS S3, uncomment the following ## If the provider is AWS S3, uncomment the following
## ##
#'provider' => 'AWS', #'provider' => 'AWS',
#'region' => 'eu-west-1', #'region' => 'eu-west-1',
#'aws_access_key_id' => 'AWS_ACCESS_KEY_ID', #'aws_access_key_id' => 'AWS_ACCESS_KEY_ID',
#'aws_secret_access_key' => 'AWS_SECRET_ACCESS_KEY', #'aws_secret_access_key' => 'AWS_SECRET_ACCESS_KEY',
## ##
## If the provider is other than AWS (an S3-compatible one), uncomment the following ## If the provider is other than AWS (an S3-compatible one), uncomment the following
## ##
#'host' => 's3.amazonaws.com', #'host' => 's3.amazonaws.com',
#'aws_signature_version' => 4 # For creation of signed URLs. Set to 2 if provider does not support v4. #'aws_signature_version' => 4 # For creation of signed URLs. Set to 2 if provider does not support v4.
#'endpoint' => 'https://s3.amazonaws.com' # Useful for S3-compliant services such as DigitalOcean Spaces. #'endpoint' => 'https://s3.amazonaws.com' # Useful for S3-compliant services such as DigitalOcean Spaces.
#'path_style' => false # If true, use 'host/bucket_name/object' instead of 'bucket_name.host/object'. #'path_style' => false # If true, use 'host/bucket_name/object' instead of 'bucket_name.host/object'.
} }
``` ```
1. Save the file and [reconfigure GitLab][] for the changes to take effect. 1. Save the file and [reconfigure GitLab][] for the changes to take effect.
...@@ -120,35 +122,35 @@ upload packages: ...@@ -120,35 +122,35 @@ upload packages:
1. Edit the `packages` section in `config/gitlab.yml` (uncomment where necessary): 1. Edit the `packages` section in `config/gitlab.yml` (uncomment where necessary):
```yaml ```yaml
packages: packages:
enabled: true enabled: true
## ##
## The location where build packages are stored (default: shared/packages). ## The location where build packages are stored (default: shared/packages).
## ##
#storage_path: shared/packages #storage_path: shared/packages
object_store: object_store:
enabled: false enabled: false
remote_directory: packages # The bucket name. remote_directory: packages # The bucket name.
#direct_upload: false # Use Object Storage directly for uploads instead of background uploads if enabled (Default: false). #direct_upload: false # Use Object Storage directly for uploads instead of background uploads if enabled (Default: false).
#background_upload: true # Temporary option to limit automatic upload (Default: true). #background_upload: true # Temporary option to limit automatic upload (Default: true).
#proxy_download: false # Passthrough all downloads via GitLab instead of using Redirects to Object Storage. #proxy_download: false # Passthrough all downloads via GitLab instead of using Redirects to Object Storage.
connection: connection:
## ##
## If the provider is AWS S3, uncomment the following ## If the provider is AWS S3, uncomment the following
## ##
#provider: AWS #provider: AWS
#region: us-east-1 #region: us-east-1
#aws_access_key_id: AWS_ACCESS_KEY_ID #aws_access_key_id: AWS_ACCESS_KEY_ID
#aws_secret_access_key: AWS_SECRET_ACCESS_KEY #aws_secret_access_key: AWS_SECRET_ACCESS_KEY
## ##
## If the provider is other than AWS (an S3-compatible one), uncomment the following ## If the provider is other than AWS (an S3-compatible one), uncomment the following
## ##
#host: 's3.amazonaws.com' # default: s3.amazonaws.com. #host: 's3.amazonaws.com' # default: s3.amazonaws.com.
#aws_signature_version: 4 # For creation of signed URLs. Set to 2 if provider does not support v4. #aws_signature_version: 4 # For creation of signed URLs. Set to 2 if provider does not support v4.
#endpoint: 'https://s3.amazonaws.com' # Useful for S3-compliant services such as DigitalOcean Spaces. #endpoint: 'https://s3.amazonaws.com' # Useful for S3-compliant services such as DigitalOcean Spaces.
#path_style: false # If true, use 'host/bucket_name/object' instead of 'bucket_name.host/object'. #path_style: false # If true, use 'host/bucket_name/object' instead of 'bucket_name.host/object'.
``` ```
1. [Restart GitLab] for the changes to take effect. 1. [Restart GitLab] for the changes to take effect.
......
...@@ -31,27 +31,27 @@ To configure the pseudonymizer, you need to: ...@@ -31,27 +31,27 @@ To configure the pseudonymizer, you need to:
1. Edit `/etc/gitlab/gitlab.rb` and add the following lines by replacing with 1. Edit `/etc/gitlab/gitlab.rb` and add the following lines by replacing with
the values you want: the values you want:
```ruby ```ruby
gitlab_rails['pseudonymizer_manifest'] = 'config/pseudonymizer.yml' gitlab_rails['pseudonymizer_manifest'] = 'config/pseudonymizer.yml'
gitlab_rails['pseudonymizer_upload_remote_directory'] = 'gitlab-elt' # bucket name gitlab_rails['pseudonymizer_upload_remote_directory'] = 'gitlab-elt' # bucket name
gitlab_rails['pseudonymizer_upload_connection'] = { gitlab_rails['pseudonymizer_upload_connection'] = {
'provider' => 'AWS', 'provider' => 'AWS',
'region' => 'eu-central-1', 'region' => 'eu-central-1',
'aws_access_key_id' => 'AWS_ACCESS_KEY_ID', 'aws_access_key_id' => 'AWS_ACCESS_KEY_ID',
'aws_secret_access_key' => 'AWS_SECRET_ACCESS_KEY' 'aws_secret_access_key' => 'AWS_SECRET_ACCESS_KEY'
} }
``` ```
NOTE: **Note:** NOTE: **Note:**
If you are using AWS IAM profiles, be sure to omit the AWS access key and secret access key/value pairs. If you are using AWS IAM profiles, be sure to omit the AWS access key and secret access key/value pairs.
```ruby ```ruby
gitlab_rails['pseudonymizer_upload_connection'] = { gitlab_rails['pseudonymizer_upload_connection'] = {
'provider' => 'AWS', 'provider' => 'AWS',
'region' => 'eu-central-1', 'region' => 'eu-central-1',
'use_iam_profile' => true 'use_iam_profile' => true
} }
``` ```
1. Save the file and [reconfigure GitLab](restart_gitlab.md#omnibus-gitlab-reconfigure) 1. Save the file and [reconfigure GitLab](restart_gitlab.md#omnibus-gitlab-reconfigure)
for the changes to take effect. for the changes to take effect.
...@@ -63,17 +63,17 @@ To configure the pseudonymizer, you need to: ...@@ -63,17 +63,17 @@ To configure the pseudonymizer, you need to:
1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following 1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following
lines: lines:
```yaml ```yaml
pseudonymizer: pseudonymizer:
manifest: config/pseudonymizer.yml manifest: config/pseudonymizer.yml
upload: upload:
remote_directory: 'gitlab-elt' # bucket name remote_directory: 'gitlab-elt' # bucket name
connection: connection:
provider: AWS provider: AWS
aws_access_key_id: AWS_ACCESS_KEY_ID aws_access_key_id: AWS_ACCESS_KEY_ID
aws_secret_access_key: AWS_SECRET_ACCESS_KEY aws_secret_access_key: AWS_SECRET_ACCESS_KEY
region: eu-central-1 region: eu-central-1
``` ```
1. Save the file and [restart GitLab](restart_gitlab.md#installations-from-source) 1. Save the file and [restart GitLab](restart_gitlab.md#installations-from-source)
for the changes to take effect. for the changes to take effect.
......
...@@ -68,18 +68,18 @@ NOTE: **Note:** This example uses NFS and CephFS. We do not recommend using EFS ...@@ -68,18 +68,18 @@ NOTE: **Note:** This example uses NFS and CephFS. We do not recommend using EFS
1. Edit `gitlab.yml` and add the storage paths: 1. Edit `gitlab.yml` and add the storage paths:
```yaml ```yaml
repositories: repositories:
# Paths where repositories can be stored. Give the canonicalized absolute pathname. # Paths where repositories can be stored. Give the canonicalized absolute pathname.
# NOTE: REPOS PATHS MUST NOT CONTAIN ANY SYMLINK!!! # NOTE: REPOS PATHS MUST NOT CONTAIN ANY SYMLINK!!!
storages: # You must have at least a 'default' storage path. storages: # You must have at least a 'default' storage path.
default: default:
path: /home/git/repositories path: /home/git/repositories
nfs: nfs:
path: /mnt/nfs/repositories path: /mnt/nfs/repositories
cephfs: cephfs:
path: /mnt/cephfs/repositories path: /mnt/cephfs/repositories
``` ```
1. [Restart GitLab][restart-gitlab] for the changes to take effect. 1. [Restart GitLab][restart-gitlab] for the changes to take effect.
...@@ -97,16 +97,16 @@ working, you can remove the `repos_path` line. ...@@ -97,16 +97,16 @@ working, you can remove the `repos_path` line.
1. Edit `/etc/gitlab/gitlab.rb` by appending the rest of the paths to the 1. Edit `/etc/gitlab/gitlab.rb` by appending the rest of the paths to the
default one: default one:
```ruby ```ruby
git_data_dirs({ git_data_dirs({
"default" => { "path" => "/var/opt/gitlab/git-data" }, "default" => { "path" => "/var/opt/gitlab/git-data" },
"nfs" => { "path" => "/mnt/nfs/git-data" }, "nfs" => { "path" => "/mnt/nfs/git-data" },
"cephfs" => { "path" => "/mnt/cephfs/git-data" } "cephfs" => { "path" => "/mnt/cephfs/git-data" }
}) })
``` ```
Note that Omnibus stores the repositories in a `repositories` subdirectory Note that Omnibus stores the repositories in a `repositories` subdirectory
of the `git-data` directory. of the `git-data` directory.
## Choose where new project repositories will be stored ## Choose where new project repositories will be stored
......
...@@ -23,10 +23,10 @@ _The uploads are stored by default in `/var/opt/gitlab/gitlab-rails/uploads`._ ...@@ -23,10 +23,10 @@ _The uploads are stored by default in `/var/opt/gitlab/gitlab-rails/uploads`._
1. To change the storage path for example to `/mnt/storage/uploads`, edit 1. To change the storage path for example to `/mnt/storage/uploads`, edit
`/etc/gitlab/gitlab.rb` and add the following line: `/etc/gitlab/gitlab.rb` and add the following line:
```ruby ```ruby
gitlab_rails['uploads_storage_path'] = "/mnt/storage/" gitlab_rails['uploads_storage_path'] = "/mnt/storage/"
gitlab_rails['uploads_base_dir'] = "uploads" gitlab_rails['uploads_base_dir'] = "uploads"
``` ```
1. Save the file and [reconfigure GitLab][] for the changes to take effect. 1. Save the file and [reconfigure GitLab][] for the changes to take effect.
...@@ -40,11 +40,11 @@ _The uploads are stored by default in ...@@ -40,11 +40,11 @@ _The uploads are stored by default in
1. To change the storage path for example to `/mnt/storage/uploads`, edit 1. To change the storage path for example to `/mnt/storage/uploads`, edit
`/home/git/gitlab/config/gitlab.yml` and add or amend the following lines: `/home/git/gitlab/config/gitlab.yml` and add or amend the following lines:
```yaml ```yaml
uploads: uploads:
storage_path: /mnt/storage storage_path: /mnt/storage
base_dir: uploads base_dir: uploads
``` ```
1. Save the file and [restart GitLab][] for the changes to take effect. 1. Save the file and [restart GitLab][] for the changes to take effect.
...@@ -97,27 +97,27 @@ _The uploads are stored by default in ...@@ -97,27 +97,27 @@ _The uploads are stored by default in
1. Edit `/etc/gitlab/gitlab.rb` and add the following lines by replacing with 1. Edit `/etc/gitlab/gitlab.rb` and add the following lines by replacing with
the values you want: the values you want:
```ruby ```ruby
gitlab_rails['uploads_object_store_enabled'] = true gitlab_rails['uploads_object_store_enabled'] = true
gitlab_rails['uploads_object_store_remote_directory'] = "uploads" gitlab_rails['uploads_object_store_remote_directory'] = "uploads"
gitlab_rails['uploads_object_store_connection'] = { gitlab_rails['uploads_object_store_connection'] = {
'provider' => 'AWS', 'provider' => 'AWS',
'region' => 'eu-central-1', 'region' => 'eu-central-1',
'aws_access_key_id' => 'AWS_ACCESS_KEY_ID', 'aws_access_key_id' => 'AWS_ACCESS_KEY_ID',
'aws_secret_access_key' => 'AWS_SECRET_ACCESS_KEY' 'aws_secret_access_key' => 'AWS_SECRET_ACCESS_KEY'
} }
``` ```
>**Note:** >**Note:**
If you are using AWS IAM profiles, be sure to omit the AWS access key and secret access key/value pairs. >If you are using AWS IAM profiles, be sure to omit the AWS access key and secret access key/value pairs.
```ruby ```ruby
gitlab_rails['uploads_object_store_connection'] = { gitlab_rails['uploads_object_store_connection'] = {
'provider' => 'AWS', 'provider' => 'AWS',
'region' => 'eu-central-1', 'region' => 'eu-central-1',
'use_iam_profile' => true 'use_iam_profile' => true
} }
``` ```
1. Save the file and [reconfigure GitLab][] for the changes to take effect. 1. Save the file and [reconfigure GitLab][] for the changes to take effect.
1. Migrate any existing local uploads to the object storage using [`gitlab:uploads:migrate` rake task](raketasks/uploads/migrate.md). 1. Migrate any existing local uploads to the object storage using [`gitlab:uploads:migrate` rake task](raketasks/uploads/migrate.md).
...@@ -132,17 +132,17 @@ _The uploads are stored by default in ...@@ -132,17 +132,17 @@ _The uploads are stored by default in
1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following 1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following
lines: lines:
```yaml ```yaml
uploads: uploads:
object_store: object_store:
enabled: true enabled: true
remote_directory: "uploads" # The bucket name remote_directory: "uploads" # The bucket name
connection: connection:
provider: AWS # Only AWS supported at the moment provider: AWS # Only AWS supported at the moment
aws_access_key_id: AWS_ACESS_KEY_ID aws_access_key_id: AWS_ACESS_KEY_ID
aws_secret_access_key: AWS_SECRET_ACCESS_KEY aws_secret_access_key: AWS_SECRET_ACCESS_KEY
region: eu-central-1 region: eu-central-1
``` ```
1. Save the file and [restart GitLab][] for the changes to take effect. 1. Save the file and [restart GitLab][] for the changes to take effect.
1. Migrate any existing local uploads to the object storage using [`gitlab:uploads:migrate` rake task](raketasks/uploads/migrate.md). 1. Migrate any existing local uploads to the object storage using [`gitlab:uploads:migrate` rake task](raketasks/uploads/migrate.md).
......
...@@ -311,9 +311,9 @@ By default, impersonation is enabled. To disable impersonation: ...@@ -311,9 +311,9 @@ By default, impersonation is enabled. To disable impersonation:
1. Edit `/etc/gitlab/gitlab.rb`: 1. Edit `/etc/gitlab/gitlab.rb`:
```ruby ```ruby
gitlab_rails['impersonation_enabled'] = false gitlab_rails['impersonation_enabled'] = false
``` ```
1. Save the file and [reconfigure](../administration/restart_gitlab.md#omnibus-gitlab-reconfigure) 1. Save the file and [reconfigure](../administration/restart_gitlab.md#omnibus-gitlab-reconfigure)
GitLab for the changes to take effect. GitLab for the changes to take effect.
...@@ -326,10 +326,10 @@ To re-enable impersonation, remove this configuration and reconfigure GitLab. ...@@ -326,10 +326,10 @@ To re-enable impersonation, remove this configuration and reconfigure GitLab.
1. Edit `config/gitlab.yml`: 1. Edit `config/gitlab.yml`:
```yaml ```yaml
gitlab: gitlab:
impersonation_enabled: false impersonation_enabled: false
``` ```
1. Save the file and [restart](../administration/restart_gitlab.md#installations-from-source) 1. Save the file and [restart](../administration/restart_gitlab.md#installations-from-source)
GitLab for the changes to take effect. GitLab for the changes to take effect.
......
...@@ -22,30 +22,30 @@ Example responses: ...@@ -22,30 +22,30 @@ Example responses:
- Valid content: - Valid content:
```json ```json
{ {
"status": "valid", "status": "valid",
"errors": [] "errors": []
} }
``` ```
- Invalid content: - Invalid content:
```json ```json
{ {
"status": "invalid", "status": "invalid",
"errors": [ "errors": [
"variables config should be a hash of key value pairs" "variables config should be a hash of key value pairs"
] ]
} }
``` ```
- Without the content attribute: - Without the content attribute:
```json ```json
{ {
"error": "content is missing" "error": "content is missing"
} }
``` ```
[ce-5953]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5953 [ce-5953]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5953
...@@ -121,9 +121,9 @@ Parameters: ...@@ -121,9 +121,9 @@ Parameters:
- `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user - `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user
- `sha` (optional) - The commit SHA to download. A tag, branch reference, or SHA can be used. This defaults to the tip of the default branch if not specified. For example: - `sha` (optional) - The commit SHA to download. A tag, branch reference, or SHA can be used. This defaults to the tip of the default branch if not specified. For example:
```sh ```sh
curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.com/api/v4/projects/<project_id>/repository/archive?sha=<commit_sha> curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.com/api/v4/projects/<project_id>/repository/archive?sha=<commit_sha>
``` ```
## Compare branches, tags or commits ## Compare branches, tags or commits
......
...@@ -20,10 +20,10 @@ Here's an example of how the two tokens are used in Runner registration: ...@@ -20,10 +20,10 @@ Here's an example of how the two tokens are used in Runner registration:
1. You use that authentication token and add it to the 1. You use that authentication token and add it to the
[Runner's configuration file](https://docs.gitlab.com/runner/commands/#configuration-file): [Runner's configuration file](https://docs.gitlab.com/runner/commands/#configuration-file):
```toml ```toml
[[runners]] [[runners]]
token = "<authentication_token>" token = "<authentication_token>"
``` ```
GitLab and Runner are then connected. GitLab and Runner are then connected.
......
...@@ -79,14 +79,14 @@ correctly with your CI jobs: ...@@ -79,14 +79,14 @@ correctly with your CI jobs:
1. If you are using an older version of `gitlab-runner`, then use 1. If you are using an older version of `gitlab-runner`, then use
`git submodule sync/update` in `before_script`: `git submodule sync/update` in `before_script`:
```yaml ```yaml
before_script: before_script:
- git submodule sync --recursive - git submodule sync --recursive
- git submodule update --init --recursive - git submodule update --init --recursive
``` ```
`--recursive` should be used in either both or none (`sync/update`) depending on `--recursive` should be used in either both or none (`sync/update`) depending on
whether you have recursive submodules. whether you have recursive submodules.
The rationale to set the `sync` and `update` in `before_script` is because of The rationale to set the `sync` and `update` in `before_script` is because of
the way Git submodules work. On a fresh Runner workspace, Git will set the the way Git submodules work. On a fresh Runner workspace, Git will set the
......
...@@ -484,9 +484,11 @@ When making a request to an HTTP Endpoint (think `/users/sign_in`) the request w ...@@ -484,9 +484,11 @@ When making a request to an HTTP Endpoint (think `/users/sign_in`) the request w
Below we describe the different pathing that HTTP vs. SSH Git requests will take. There is some overlap with the Web Request Cycle but also some differences. Below we describe the different pathing that HTTP vs. SSH Git requests will take. There is some overlap with the Web Request Cycle but also some differences.
### Web Request (80/443) ### Web Request (80/443)
TODO TODO
### SSH Request (22) ### SSH Request (22)
TODO TODO
## System Layout ## System Layout
...@@ -505,7 +507,9 @@ To summarize here's the [directory structure of the `git` user home directory](. ...@@ -505,7 +507,9 @@ To summarize here's the [directory structure of the `git` user home directory](.
### Processes ### Processes
ps aux | grep '^git' ```sh
ps aux | grep '^git'
```
GitLab has several components to operate. As a system user (i.e. any user that is not the `git` user) it requires a persistent database (MySQL/PostreSQL) and redis database. It also uses Apache httpd or Nginx to proxypass Unicorn. As the `git` user it starts Sidekiq and Unicorn (a simple ruby HTTP server running on port `8080` by default). Under the GitLab user there are normally 4 processes: `unicorn_rails master` (1 process), `unicorn_rails worker` (2 processes), `sidekiq` (1 process). GitLab has several components to operate. As a system user (i.e. any user that is not the `git` user) it requires a persistent database (MySQL/PostreSQL) and redis database. It also uses Apache httpd or Nginx to proxypass Unicorn. As the `git` user it starts Sidekiq and Unicorn (a simple ruby HTTP server running on port `8080` by default). Under the GitLab user there are normally 4 processes: `unicorn_rails master` (1 process), `unicorn_rails worker` (2 processes), `sidekiq` (1 process).
......
...@@ -182,52 +182,52 @@ There are a few gotchas with it: ...@@ -182,52 +182,52 @@ There are a few gotchas with it:
pattern](https://en.wikipedia.org/wiki/Template_method_pattern). pattern](https://en.wikipedia.org/wiki/Template_method_pattern).
For example, given this base: For example, given this base:
```ruby ```ruby
class Base class Base
def execute def execute
return unless enabled? return unless enabled?
# ... # ...
# ... # ...
end
end end
``` end
```
Instead of just overriding `Base#execute`, we should update it and extract Instead of just overriding `Base#execute`, we should update it and extract
the behaviour into another method: the behaviour into another method:
```ruby ```ruby
class Base class Base
def execute def execute
return unless enabled? return unless enabled?
do_something do_something
end end
private private
def do_something def do_something
# ... # ...
# ... # ...
end
end end
``` end
```
Then we're free to override that `do_something` without worrying about the Then we're free to override that `do_something` without worrying about the
guards: guards:
```ruby ```ruby
module EE::Base module EE::Base
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
override :do_something override :do_something
def do_something def do_something
# Follow the above pattern to call super and extend it # Follow the above pattern to call super and extend it
end
end end
``` end
```
This would require updating CE first, or make sure this is back ported to CE. This would require updating CE first, or make sure this is back ported to CE.
When prepending, place them in the `ee/` specific sub-directory, and When prepending, place them in the `ee/` specific sub-directory, and
wrap class or module in `module EE` to avoid naming conflicts. wrap class or module in `module EE` to avoid naming conflicts.
...@@ -1038,8 +1038,8 @@ to avoid conflicts during CE to EE merge. ...@@ -1038,8 +1038,8 @@ to avoid conflicts during CE to EE merge.
Until the work completed to merge the ce and ee codebases, which is tracked on [epic &802](https://gitlab.com/groups/gitlab-org/-/epics/802), there exists times in which some changes for EE require specific changes to the CE Until the work completed to merge the ce and ee codebases, which is tracked on [epic &802](https://gitlab.com/groups/gitlab-org/-/epics/802), there exists times in which some changes for EE require specific changes to the CE
code base. Examples of backports include the following: code base. Examples of backports include the following:
* Features intended or originally built for EE that are later decided to move to CE - Features intended or originally built for EE that are later decided to move to CE
* Sometimes some code in CE may impact the EE feature - Sometimes some code in CE may impact the EE feature
Here is a workflow to make sure those changes end up backported safely into CE too. Here is a workflow to make sure those changes end up backported safely into CE too.
......
...@@ -26,51 +26,51 @@ See the [Rails guides] for more info. ...@@ -26,51 +26,51 @@ See the [Rails guides] for more info.
feature and fill in the details for your specific IMAP server and email feature and fill in the details for your specific IMAP server and email
account: account:
Configuration for Gmail / Google Apps, assumes mailbox gitlab-incoming@gmail.com Configuration for Gmail / Google Apps, assumes mailbox `gitlab-incoming@gmail.com`:
```yaml ```yaml
incoming_email: incoming_email:
enabled: true enabled: true
# The email address including the `%{key}` placeholder that will be replaced to reference the item being replied to. # The email address including the `%{key}` placeholder that will be replaced to reference the item being replied to.
# The placeholder can be omitted but if present, it must appear in the "user" part of the address (before the `@`). # The placeholder can be omitted but if present, it must appear in the "user" part of the address (before the `@`).
address: "gitlab-incoming+%{key}@gmail.com" address: "gitlab-incoming+%{key}@gmail.com"
# Email account username # Email account username
# With third party providers, this is usually the full email address. # With third party providers, this is usually the full email address.
# With self-hosted email servers, this is usually the user part of the email address. # With self-hosted email servers, this is usually the user part of the email address.
user: "gitlab-incoming@gmail.com" user: "gitlab-incoming@gmail.com"
# Email account password # Email account password
password: "[REDACTED]" password: "[REDACTED]"
# IMAP server host # IMAP server host
host: "imap.gmail.com" host: "imap.gmail.com"
# IMAP server port # IMAP server port
port: 993 port: 993
# Whether the IMAP server uses SSL # Whether the IMAP server uses SSL
ssl: true ssl: true
# Whether the IMAP server uses StartTLS # Whether the IMAP server uses StartTLS
start_tls: false start_tls: false
# The mailbox where incoming mail will end up. Usually "inbox". # The mailbox where incoming mail will end up. Usually "inbox".
mailbox: "inbox" mailbox: "inbox"
# The IDLE command timeout. # The IDLE command timeout.
idle_timeout: 60 idle_timeout: 60
``` ```
As mentioned, the part after `+` is ignored, and this will end up in the mailbox for `gitlab-incoming@gmail.com`. As mentioned, the part after `+` is ignored, and this will end up in the mailbox for `gitlab-incoming@gmail.com`.
1. Run this command in the GitLab root directory to launch `mail_room`: 1. Run this command in the GitLab root directory to launch `mail_room`:
```sh ```sh
bundle exec mail_room -q -c config/mail_room.yml bundle exec mail_room -q -c config/mail_room.yml
``` ```
1. Verify that everything is configured correctly: 1. Verify that everything is configured correctly:
```sh ```sh
bundle exec rake gitlab:incoming_email:check RAILS_ENV=development bundle exec rake gitlab:incoming_email:check RAILS_ENV=development
``` ```
1. Reply by email should now be working. 1. Reply by email should now be working.
...@@ -91,10 +91,10 @@ for the format of the email key: ...@@ -91,10 +91,10 @@ for the format of the email key:
Examples of valid email keys: Examples of valid email keys:
- `gitlab-org-gitlab-ce-20-Author_Token12345678-issue` (create a new issue) - `gitlab-org-gitlab-ce-20-Author_Token12345678-issue` (create a new issue)
- `gitlab-org-gitlab-ce-20-Author_Token12345678-merge-request` (create a new merge request) - `gitlab-org-gitlab-ce-20-Author_Token12345678-merge-request` (create a new merge request)
- `1234567890abcdef1234567890abcdef-unsubscribe` (unsubscribe from a conversation) - `1234567890abcdef1234567890abcdef-unsubscribe` (unsubscribe from a conversation)
- `1234567890abcdef1234567890abcdef` (reply to a conversation) - `1234567890abcdef1234567890abcdef` (reply to a conversation)
Please note that the action `-issue-` is used in GitLab Premium as the handler for the Service Desk feature. Please note that the action `-issue-` is used in GitLab Premium as the handler for the Service Desk feature.
...@@ -103,10 +103,10 @@ Please note that the action `-issue-` is used in GitLab Premium as the handler f ...@@ -103,10 +103,10 @@ Please note that the action `-issue-` is used in GitLab Premium as the handler f
Although we continue to support the older legacy format, no new features should use a legacy format. Although we continue to support the older legacy format, no new features should use a legacy format.
These are the only valid legacy formats for an email handler: These are the only valid legacy formats for an email handler:
- `path/to/project+namespace` - `path/to/project+namespace`
- `path/to/project+namespace+action` - `path/to/project+namespace+action`
- `namespace` - `namespace`
- `namespace+action` - `namespace+action`
Please note that `path/to/project` is used in GitLab Premium as handler for the Service Desk feature. Please note that `path/to/project` is used in GitLab Premium as handler for the Service Desk feature.
......
...@@ -101,10 +101,10 @@ end ...@@ -101,10 +101,10 @@ end
in a prepended module, which is very likely the case in EE. We could see in a prepended module, which is very likely the case in EE. We could see
error like this: error like this:
``` ```
1.1) Failure/Error: expect_any_instance_of(ApplicationSetting).to receive_messages(messages) 1.1) Failure/Error: expect_any_instance_of(ApplicationSetting).to receive_messages(messages)
Using `any_instance` to stub a method (elasticsearch_indexing) that has been defined on a prepended module (EE::ApplicationSetting) is not supported. Using `any_instance` to stub a method (elasticsearch_indexing) that has been defined on a prepended module (EE::ApplicationSetting) is not supported.
``` ```
### Alternative: `expect_next_instance_of` ### Alternative: `expect_next_instance_of`
......
...@@ -30,8 +30,8 @@ Completed 200 OK in 166ms (Views: 117.4ms | ActiveRecord: 27.2ms) ...@@ -30,8 +30,8 @@ Completed 200 OK in 166ms (Views: 117.4ms | ActiveRecord: 27.2ms)
These logs suffer from a number of problems: These logs suffer from a number of problems:
1. They often lack timestamps or other contextual information (e.g. project ID, user) 1. They often lack timestamps or other contextual information (e.g. project ID, user)
2. They may span multiple lines, which make them hard to find via Elasticsearch. 1. They may span multiple lines, which make them hard to find via Elasticsearch.
3. They lack a common structure, which make them hard to parse by log 1. They lack a common structure, which make them hard to parse by log
forwarders, such as Logstash or Fluentd. This also makes them hard to forwarders, such as Logstash or Fluentd. This also makes them hard to
search. search.
...@@ -67,46 +67,46 @@ importer progresses. Here's what to do: ...@@ -67,46 +67,46 @@ importer progresses. Here's what to do:
make it easy for people to search pertinent logs in one place. For make it easy for people to search pertinent logs in one place. For
example, `geo.log` contains all logs pertaining to GitLab Geo. example, `geo.log` contains all logs pertaining to GitLab Geo.
To create a new file: To create a new file:
1. Choose a filename (e.g. `importer_json.log`). 1. Choose a filename (e.g. `importer_json.log`).
1. Create a new subclass of `Gitlab::JsonLogger`: 1. Create a new subclass of `Gitlab::JsonLogger`:
```ruby ```ruby
module Gitlab module Gitlab
module Import module Import
class Logger < ::Gitlab::JsonLogger class Logger < ::Gitlab::JsonLogger
def self.file_name_noext def self.file_name_noext
'importer' 'importer'
end
end end
end end
end end
``` end
```
1. In your class where you want to log, you might initialize the logger as an instance variable: 1. In your class where you want to log, you might initialize the logger as an instance variable:
```ruby ```ruby
attr_accessor :logger attr_accessor :logger
def initialize def initialize
@logger = Gitlab::Import::Logger.build @logger = Gitlab::Import::Logger.build
end end
``` ```
Note that it's useful to memoize this because creating a new logger Note that it's useful to memoize this because creating a new logger
each time you log will open a file, adding unnecessary overhead. each time you log will open a file, adding unnecessary overhead.
1. Now insert log messages into your code. When adding logs, 1. Now insert log messages into your code. When adding logs,
make sure to include all the context as key-value pairs: make sure to include all the context as key-value pairs:
```ruby ```ruby
# BAD # BAD
logger.info("Unable to create project #{project.id}") logger.info("Unable to create project #{project.id}")
``` ```
```ruby ```ruby
# GOOD # GOOD
logger.info(message: "Unable to create project", project_id: project.id) logger.info(message: "Unable to create project", project_id: project.id)
``` ```
1. Be sure to create a common base structure of your log messages. For example, 1. Be sure to create a common base structure of your log messages. For example,
all messages might have `current_user_id` and `project_id` to make it easier all messages might have `current_user_id` and `project_id` to make it easier
...@@ -116,16 +116,16 @@ importer progresses. Here's what to do: ...@@ -116,16 +116,16 @@ importer progresses. Here's what to do:
logs properly if you [mix integer and string logs properly if you [mix integer and string
types](https://www.elastic.co/guide/en/elasticsearch/guide/current/mapping.html#_avoiding_type_gotchas): types](https://www.elastic.co/guide/en/elasticsearch/guide/current/mapping.html#_avoiding_type_gotchas):
```ruby ```ruby
# BAD # BAD
logger.info(message: "Import error", error: 1) logger.info(message: "Import error", error: 1)
logger.info(message: "Import error", error: "I/O failure") logger.info(message: "Import error", error: "I/O failure")
``` ```
```ruby ```ruby
# GOOD # GOOD
logger.info(message: "Import error", error_code: 1, error: "I/O failure") logger.info(message: "Import error", error_code: 1, error: "I/O failure")
``` ```
## Additional steps with new log files ## Additional steps with new log files
......
...@@ -95,7 +95,9 @@ Sherlock is a custom profiling tool built into GitLab. Sherlock is _only_ ...@@ -95,7 +95,9 @@ Sherlock is a custom profiling tool built into GitLab. Sherlock is _only_
available when running GitLab in development mode _and_ when setting the available when running GitLab in development mode _and_ when setting the
environment variable `ENABLE_SHERLOCK` to a non empty value. For example: environment variable `ENABLE_SHERLOCK` to a non empty value. For example:
ENABLE_SHERLOCK=1 bundle exec rails s ```sh
ENABLE_SHERLOCK=1 bundle exec rails s
```
Recorded transactions can be found by navigating to `/sherlock/transactions`. Recorded transactions can be found by navigating to `/sherlock/transactions`.
...@@ -106,7 +108,9 @@ Bullet adds quite a bit of logging noise it's disabled by default. To enable ...@@ -106,7 +108,9 @@ Bullet adds quite a bit of logging noise it's disabled by default. To enable
Bullet, set the environment variable `ENABLE_BULLET` to a non-empty value before Bullet, set the environment variable `ENABLE_BULLET` to a non-empty value before
starting GitLab. For example: starting GitLab. For example:
ENABLE_BULLET=true bundle exec rails s ```sh
ENABLE_BULLET=true bundle exec rails s
```
Bullet will log query problems to both the Rails log as well as the Chrome Bullet will log query problems to both the Rails log as well as the Chrome
console. console.
......
...@@ -7,11 +7,15 @@ support subgroups, GitLab project and group routes use the wildcard ...@@ -7,11 +7,15 @@ support subgroups, GitLab project and group routes use the wildcard
character to match project and group routes. For example, we might have character to match project and group routes. For example, we might have
a path such as: a path such as:
/gitlab-com/customer-success/north-america/west/customerA ```
/gitlab-com/customer-success/north-america/west/customerA
```
However, paths can be ambiguous. Consider the following example: However, paths can be ambiguous. Consider the following example:
/gitlab-com/edit ```
/gitlab-com/edit
```
It's ambiguous whether there is a subgroup named `edit` or whether It's ambiguous whether there is a subgroup named `edit` or whether
this is a special endpoint to edit the `gitlab-com` group. this is a special endpoint to edit the `gitlab-com` group.
...@@ -25,8 +29,10 @@ number of [reserved names](../user/reserved_names.md). ...@@ -25,8 +29,10 @@ number of [reserved names](../user/reserved_names.md).
We have a number of global routes. For example: We have a number of global routes. For example:
/-/health ```
/-/metrics /-/health
/-/metrics
```
## Group routes ## Group routes
...@@ -34,10 +40,12 @@ Every group route must be under the `/-/` scope. ...@@ -34,10 +40,12 @@ Every group route must be under the `/-/` scope.
Examples: Examples:
gitlab-org/-/edit ```
gitlab-org/-/activity gitlab-org/-/edit
gitlab-org/-/security/dashboard gitlab-org/-/activity
gitlab-org/serverless/-/activity gitlab-org/-/security/dashboard
gitlab-org/serverless/-/activity
```
To achieve that, use the `scope '-'` method. To achieve that, use the `scope '-'` method.
...@@ -48,10 +56,12 @@ client or other software requires something different. ...@@ -48,10 +56,12 @@ client or other software requires something different.
Examples: Examples:
gitlab-org/gitlab-ce/-/activity ```
gitlab-org/gitlab-ce/-/jobs/123 gitlab-org/gitlab-ce/-/activity
gitlab-org/gitlab-ce/-/settings/repository gitlab-org/gitlab-ce/-/jobs/123
gitlab-org/serverless/runtimes/-/settings/repository gitlab-org/gitlab-ce/-/settings/repository
gitlab-org/serverless/runtimes/-/settings/repository
```
Currently, only some project routes are placed under the `/-/` scope. However, Currently, only some project routes are placed under the `/-/` scope. However,
you can help us migrate more of them! To migrate project routes: you can help us migrate more of them! To migrate project routes:
......
...@@ -94,7 +94,9 @@ on the amount of data indexed). ...@@ -94,7 +94,9 @@ on the amount of data indexed).
To keep naming of these indexes consistent please use the following naming To keep naming of these indexes consistent please use the following naming
pattern: pattern:
index_TABLE_on_COLUMN_trigram ```
index_TABLE_on_COLUMN_trigram
```
For example, a GIN/trigram index for `issues.title` would be called For example, a GIN/trigram index for `issues.title` would be called
`index_issues_on_title_trigram`. `index_issues_on_title_trigram`.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment