Featured image of post Introduction to gitlab.rb Configuration File Parameters

Introduction to gitlab.rb Configuration File Parameters

The gitlab.rb configuration file is a crucial component of GitLab, allowing users to edit the file to add or modify various options for GitLab…

The gitlab.rb configuration file is an essential file in GitLab that enables users to add or modify various options by editing the file. Below is a detailed introduction to the parameters found in gitlab.rb:

  1. external_url
    This parameter specifies the URL address for GitLab, with a default value of http://localhost. For example:

    1
    
    external_url 'https://gitlab.example.com'  
    

    If GitLab is using a custom domain or IP address, it should be configured in external_url.

  2. gitlab_rails['smtp_enable']
    This parameter is used to enable SMTP email sending functionality. The default value is false. For example:

    1
    
    gitlab_rails['smtp_enable'] = true  
    

    Before enabling SMTP, related parameters must also be configured.

  3. gitlab_rails['smtp_address']
    This parameter specifies the address of the SMTP server. For example:

    1
    
    gitlab_rails['smtp_address'] = "smtp.mailgun.org"  
    
  4. gitlab_rails['smtp_port']
    This parameter specifies the port number for the SMTP server, with a default value of 25. For example:

    1
    
    gitlab_rails['smtp_port'] = 587  
    
  5. gitlab_rails['smtp_user_name']
    This parameter specifies the SMTP email account. For example:

    1
    
    gitlab_rails['smtp_user_name'] = "[email protected]"  
    
  6. gitlab_rails['smtp_password']
    This parameter specifies the password for the SMTP email account. For example:

    1
    
    gitlab_rails['smtp_password'] = "password"  
    
  7. gitlab_rails['smtp_domain']
    This parameter specifies the domain for the SMTP email. For example:

    1
    
    gitlab_rails['smtp_domain'] = "example.com"  
    
  8. gitlab_rails['smtp_authentication']
    This parameter specifies the SMTP authentication method, with the options being login and plain, defaulting to login. For example:

    1
    
    gitlab_rails['smtp_authentication'] = "plain"  
    
  9. gitlab_rails['smtp_tls']
    This parameter dictates whether to enable SMTP TLS encryption, with a default value of false. For example:

    1
    
    gitlab_rails['smtp_tls'] = true  
    
  10. gitlab_rails['backup_path']
    This parameter specifies the path where GitLab backup files will be stored. The default value is /var/opt/gitlab/backups. For example:

1
gitlab_rails['backup_path'] = "/mnt/backups"  
  1. unicorn['worker_processes']
    This parameter specifies the number of worker processes that Unicorn will run. The default value is 2, and it should be adjusted based on the server configuration. For example:
1
unicorn['worker_processes'] = 4  
  1. postgresql['shared_buffers']
    This parameter specifies the size of the PostgreSQL shared buffer, defaulting to 256MB, and should be adjusted according to the server’s memory size. For example:
1
postgresql['shared_buffers'] = "512MB"  
  1. sidekiq['max_concurrency']
    This parameter specifies the maximum concurrency for Sidekiq. The default value is 25, and it should be adjusted based on the server configuration. For example:
1
sidekiq['max_concurrency'] = 50  
  1. nginx['worker_processes']
    This parameter specifies the number of worker processes that Nginx will run. The default value is detected automatically, and it should be adjusted based on the server configuration. For example:
1
nginx['worker_processes'] = 8  
  1. Data Warehouse Storage Location
1
git_data_dirs({"default" => {"path" => "/server/gitlab-data" } })  

/server/gitlab-data is a newly created directory, and the target path and its subdirectories must not be symlinks.

These are some commonly used parameters in the gitlab.rb configuration file. There are other configuration items available, which can be referenced in the official GitLab documentation.

Licensed under CC BY-NC-SA 4.0