These settings are made before the instance is handed over to its users. Changes in the /etc/gitlab/gitlab.rb file are applied with the sudo gitlab-ctl reconfigure command.
Interface language
The language is set for the whole instance by an administrator and separately by each user for themselves.
The instance language applies to the sign-in page and to every user who has not chosen a language manually. Sign in as an administrator, select “Admin” in the top right corner, go to “Settings” → “Preferences” in the left pane, scroll to the “Localization” section, select the language in the “Default language” field, for example “Russian - русский”, and click “Save changes”.
A user changes the language for themselves: the avatar in the top right corner → “Preferences” → “Localization” → “Language” → the language → “Save changes”. The interface switches after the page is reloaded. The personal choice takes precedence over the instance language.
Email (SMTP)
Without email, password reset, invitations and notifications do not work. Set the connection parameters of the mail server in the /etc/gitlab/gitlab.rb file:
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "<SMTP_HOST>"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "<SMTP_USER>"
gitlab_rails['smtp_password'] = "<SMTP_PASSWORD>"
gitlab_rails['smtp_domain'] = "<DOMAIN>"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['gitlab_email_from'] = "deckhouse-code@<DOMAIN>"Apply the configuration and send a test message to your own address:
sudo gitlab-ctl reconfigure
sudo gitlab-rails runner \
"Notify.test_email('<ADMIN_EMAIL>', 'Test', 'It works').deliver_now"Network access (firewall)
The instance needs ports 22 (Git over SSH through the system sshd), 80 (redirect to HTTPS) and 443 (web interface and Git over HTTPS). Open them with the tools of your OS.
- firewalld (RED OS)
- ufw (Ubuntu)
sudo systemctl enable --now firewalld
sudo firewall-cmd --permanent --add-service={ssh,http,https}
sudo firewall-cmd --reloadsudo ufw allow OpenSSH
sudo ufw allow 80,443/tcp
sudo ufw enableResources
With 6 to 8 GB of memory, fix the number of worker processes so that the automatic tuning does not take all the memory. Set the values in the /etc/gitlab/gitlab.rb file:
puma['worker_processes'] = 2
sidekiq['concurrency'] = 10Apply the configuration:
sudo gitlab-ctl reconfigureCheck that a swap partition is configured on the server: it covers the memory peaks during the migrations of an upgrade and during heavy repository operations.
SSH port
If the SSH service of the instance listens on a port other than 22, name it in /etc/gitlab/gitlab.rb, so that the clone URLs in the web interface carry that port:
gitlab_rails['gitlab_shell_ssh_port'] = 2222Apply the configuration:
sudo gitlab-ctl reconfigureAdvanced search (OpenSearch)
Advanced search runs on an external OpenSearch cluster. Set the connection in /etc/gitlab/gitlab.rb and route the indexing jobs to their own Sidekiq queue:
gitlab_rails['fe_search'] = {
'advanced_search_enabled' => true,
'opensearch' => {
'url' => 'https://<OPENSEARCH_HOST>:9200',
'username' => '<OPENSEARCH_USER>',
'password' => '<OPENSEARCH_PASSWORD>'
}
}
sidekiq['routing_rules'] = [
['feature_category=fe_global_search', 'global-search-indexing'],
['*', 'default']
]<OPENSEARCH_HOST> is the address of the OpenSearch cluster, <OPENSEARCH_USER> and <OPENSEARCH_PASSWORD> are the credentials of the account that owns the indexes. Apply the configuration:
sudo gitlab-ctl reconfigureThen reindex the instance and enable advanced search in the settings, as described in Advanced search.