0


docker中 gitlab 安装、配置和初始化

小笔记:gitlab配置文件 /etc/gitlab/gitlab.rb 配置项

jcLee95 的CSDN博客:https://blog.csdn.net/qq_28550263?spm=1001.2101.3001.5343
邮箱 :291148484@163.com
本文地址https://blog.csdn.net/qq_28550263/article/details/129100636


拉个 gitlab 镜像:

  1. sudodocker pull gitlab/gitlab-ce:latest

跑起来:

  1. sudodocker run -itd -p 80:80 -p 22:22 -p 25:25 -p 9943:443 -p 8000:8000 -v /usr/local/gitlab-test/etc:/etc/gitla -v /usr/local/gitlab-test/log:/var/log/gitlab -v /usr/local/gitlab-test/opt:/var/opt/gitlab --restart always --privileged=true --name gitlab gitlab/gitlab-ce

Note: 如果你的宿主机有其他应用你也可知指定自己的端口,比如我下面的页面用了9680替代80

现在你可以在宿主机访问你的 gitlab 页面了:
在这里插入图片描述

进容器:

  1. dockerexec -it gitlab /bin/bash

安装一个 vim

  1. apt update
  2. apt upgrade
  3. aptinstallvim

vim 打开配置文件 /etc/gitlab/gitlab.rb:

  1. vim /etc/gitlab/gitlab.rb

当然你也可以使用 桌面端的 VSCode 链接dockeer 打开,显示效果比 vim 更好:
在这里插入图片描述


然后今天主要记录以下这些配置项的注释都说了什么,下次好直接配置:

  1. # GitLab配置设置#! 该文件在初始安装过程中生成,在升级过程中 **不会** 被修改。#! 请查看该文件的最新版本,了解可以配置的不同设置,它们是何时引入的以及为什么引入:#! https://gitlab.com/gitlab-org/omnibus-gitlab/blame/master/files/gitlab-config-template/gitlab.rb.template#! 在本地,对应于已安装版本的完整模板可以在以下位置找到:#! /opt/gitlab/etc/gitlab.rb.template#! 您可以运行 `gitlab-ctl diff-config` ,将当前gitlab.rb的内容与当前运行版本的 gitlab.rb.template 进行比较。#! 您可以运行 `gitlab-ctl show-config` 来显示将通过运行 `gitlab-ctl reconfigure`生成的配置#! 通常,这里指定的值应该反映属性的默认值。#! 在某些情况下,这种行为是不可能的或不可取的。例如,在提供密码或连接到第三方服务时。#! 在这些情况下,我们尽力提供一个配置示例。# GitLab URL#! 可以访问GitLab的URL。#! 有关配置外部url的更多详细信息,请参见:#! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab#!#! 注意:在安装/升级期间,环境变量的值#! EXTERNAL_URL 将用于填充/替换该值。#! 在AWS EC2实例上,我们还尝试从AWS获取公共主机名/IP地址。有关更多详细信息,请参见:#! https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
  2. external_url 'GENERATED_EXTERNAL_URL'# 多实例GitLab的角色#! 默认情况下不启用任何角色,这导致GitLab作为一体化实例运行。#! 选项: #! redis_sentinel_role redis_master_role redis_replica_role geo_primary_role geo_secondary_role#! postgres_role consul_role application_role monitoring_role#! 有关每个角色的更多详细信息,请参见:#! https://docs.gitlab.com/omnibus/roles/index.html#roles#!
  3. roles ['redis_sentinel_role','redis_master_role']# Legend#! 每行开头的下列符号可用于区分该文件的组件,并使用正则表达式轻松选择它们。#! ## Titles, subtitles etc#! ##! 更多信息-描述,文档,链接,问题等。#! 配置设置的开头有一个 # 后跟一个空格;移除它们以启用设置。#! **以下配置设置是可选的。**############################################################################################################################################################### GitLab CE 和 EE的配置设置 ################################################################################################################################################################################################################################################ gitlab.yml 配置#! 文档: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/gitlab.yml.md###############################################################################
  4. gitlab_rails['gitlab_ssh_host']='ssh.host_example.com'
  5. gitlab_rails['gitlab_ssh_user']=''
  6. gitlab_rails['time_zone']='UTC'## Rails asset / CDN host##! 定义用于Rails资产的主机/cdn的url##! 文档:https://docs.gitlab.com/omnibus/settings/configuration.html#set-a-content-delivery-network-url
  7. gitlab_rails['cdn_host']='https://mycdnsubdomain.fictional-cdn.com'## 请求持续时间##! 告诉rails应用程序完成一个请求需要多长时间##! 该值需要低于puma中设置的工作超时。##! 默认情况下,我们将允许95%的工作超时
  8. gitlab_rails['max_request_duration_seconds']=57## GitLab电子邮件服务器设置##! 文档:https://docs.gitlab.com/omnibus/settings/smtp.html##! **使用smtp而不是sendmail/postfix。**
  9. gitlab_rails['smtp_enable']=true
  10. gitlab_rails['smtp_address']="smtp.server"
  11. gitlab_rails['smtp_port']=465
  12. gitlab_rails['smtp_user_name']="smtp user"
  13. gitlab_rails['smtp_password']="smtp password"
  14. gitlab_rails['smtp_domain']="example.com"
  15. gitlab_rails['smtp_authentication']="login"
  16. gitlab_rails['smtp_enable_starttls_auto']=true
  17. gitlab_rails['smtp_tls']=false
  18. gitlab_rails['smtp_pool']=false##! **可以是: 'none', 'peer', 'client_once', 'fail_if_no_peer_cert'**##! 文档:http://api.rubyonrails.org/classes/ActionMailer/Base.html
  19. gitlab_rails['smtp_openssl_verify_mode']='none'
  20. gitlab_rails['smtp_ca_path']="/etc/ssl/certs"
  21. gitlab_rails['smtp_ca_file']="/etc/ssl/certs/ca-certificates.crt"## Email 设置
  22. gitlab_rails['gitlab_email_enabled']=true#! 如果您的SMTP服务器不喜欢默认设置'From: gitlab@gitlab.example.com'#! 可以用此设置更改 'From' 。
  23. gitlab_rails['gitlab_email_from']='example@example.com'
  24. gitlab_rails['gitlab_email_display_name']='Example'
  25. gitlab_rails['gitlab_email_reply_to']='noreply@example.com'
  26. gitlab_rails['gitlab_email_subject_suffix']=''
  27. gitlab_rails['gitlab_email_smime_enabled']=false
  28. gitlab_rails['gitlab_email_smime_key_file']='/etc/gitlab/ssl/gitlab_smime.key'
  29. gitlab_rails['gitlab_email_smime_cert_file']='/etc/gitlab/ssl/gitlab_smime.crt'
  30. gitlab_rails['gitlab_email_smime_ca_certs_file']='/etc/gitlab/ssl/gitlab_smime_cas.crt'## GitLab 用户权限
  31. gitlab_rails['gitlab_default_can_create_group']=true
  32. gitlab_rails['gitlab_username_changing_enabled']=true## 默认主题## 可用值:#! `1` for Indigo#! `2` for Dark#! `3` for Light#! `4` for Blue#! `5` for Green#! `6` for Light Indigo#! `7` for Light Blue#! `8` for Light Green#! `9` for Red#! `10` for Light Red
  33. gitlab_rails['gitlab_default_theme']=2## 默认项目功能设置
  34. gitlab_rails['gitlab_default_projects_features_issues']=true
  35. gitlab_rails['gitlab_default_projects_features_merge_requests']=true
  36. gitlab_rails['gitlab_default_projects_features_wiki']=true
  37. gitlab_rails['gitlab_default_projects_features_snippets']=true
  38. gitlab_rails['gitlab_default_projects_features_builds']=true
  39. gitlab_rails['gitlab_default_projects_features_container_registry']=true## 自动关闭发行##! 参见 https://docs.gitlab.com/ee/customization/issue_closing.html 获得有关此模式的更多信息。
  40. gitlab_rails['gitlab_issue_closing_pattern']="\b((?:[Cc]los(?:e[sd]?|ing)|\b[Ff]ix(?:e[sd]|ing)?|\b[Rr]esolv(?:e[sd]?|ing)|\b[Ii]mplement(?:s|ed|ing)?)(:?) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?)|([A-Z][A-Z0-9_]+-\d+))+)"## 下载位置##! 例如,当用户点击项目上的 'Download zip' 时,会在以下目录中创建一个临时zip文件。##! 不应是相同的路径,也不应是任何 `git_data_dirs` 的子目录
  41. gitlab_rails['gitlab_repository_downloads_path']='tmp/repositories'## Gravatar Settings
  42. gitlab_rails['gravatar_plain_url']='http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'
  43. gitlab_rails['gravatar_ssl_url']='https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'## 辅助工作##! 定期执行的作业,以自我修复Gitlab,进行外部同步等。##! 文档:https://github.com/ondrejbartas/sidekiq-cron#adding-cron-job##! https://docs.gitlab.com/ee/ci/yaml/index.html#artifactsexpire_in
  44. gitlab_rails['stuck_ci_jobs_worker_cron']="0 0 * * *"
  45. gitlab_rails['expire_build_artifacts_worker_cron']="*/7 * * * *"
  46. gitlab_rails['environments_auto_stop_cron_worker_cron']="24 * * * *"
  47. gitlab_rails['pipeline_schedule_worker_cron']="19 * * * *"
  48. gitlab_rails['ci_archive_traces_cron_worker_cron']="17 * * * *"
  49. gitlab_rails['repository_check_worker_cron']="20 * * * *"
  50. gitlab_rails['admin_email_worker_cron']="0 0 * * 0"
  51. gitlab_rails['personal_access_tokens_expiring_worker_cron']="0 1 * * *"
  52. gitlab_rails['personal_access_tokens_expired_notification_worker_cron']="0 2 * * *"
  53. gitlab_rails['repository_archive_cache_worker_cron']="0 * * * *"
  54. gitlab_rails['pages_domain_verification_cron_worker']="*/15 * * * *"
  55. gitlab_rails['pages_domain_ssl_renewal_cron_worker']="*/10 * * * *"
  56. gitlab_rails['pages_domain_removal_cron_worker']="47 0 * * *"
  57. gitlab_rails['remove_unaccepted_member_invites_cron_worker']="10 15 * * *"
  58. gitlab_rails['schedule_migrate_external_diffs_worker_cron']="15 * * * *"
  59. gitlab_rails['ci_platform_metrics_update_cron_worker']='47 9 * * *'
  60. gitlab_rails['analytics_usage_trends_count_job_trigger_worker_cron']="50 23 */1 * *"
  61. gitlab_rails['member_invitation_reminder_emails_worker_cron']="0 0 * * *"
  62. gitlab_rails['user_status_cleanup_batch_worker_cron']="* * * * *"
  63. gitlab_rails['namespaces_in_product_marketing_emails_worker_cron']="0 9 * * *"
  64. gitlab_rails['ssh_keys_expired_notification_worker_cron']="0 2 * * *"
  65. gitlab_rails['ssh_keys_expiring_soon_notification_worker_cron']="0 1 * * *"
  66. gitlab_rails['loose_foreign_keys_cleanup_worker_cron']="*/5 * * * *"
  67. gitlab_rails['ci_runner_versions_reconciliation_worker_cron']="20 * * * *"## Webhook 设置##! 发送webhook HTTP POST后等待HTTP响应的秒数##! request (default: 10)
  68. gitlab_rails['webhook_timeout']=10## GraphQL 设置##! Tells the rails application how long it has to complete a GraphQL request.##! We suggest this value to be higher than the database timeout value##! and lower than the worker timeout set in puma. (default: 30)
  69. gitlab_rails['graphql_timeout']=30## 可信代理##! Customize if you have GitLab behind a reverse proxy which is running on a##! different machine.##! **Add the IP address for your reverse proxy to the list, otherwise users##! will appear signed in from that address.**
  70. gitlab_rails['trusted_proxies']=[]## 内容安全政策###! 如果要启用内容安全策略头,请进行自定义,这有助于阻止JavaScript跨站点脚本(XSS)攻击。###! 参见:https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
  71. gitlab_rails['content_security_policy']={'enabled'=>false,'report_only'=>false,# Each directive is a String (e.g. "'self'").'directives'=>{'base_uri'=>nil,'child_src'=>nil,'connect_src'=>nil,'default_src'=>nil,'font_src'=>nil,'form_action'=>nil,'frame_ancestors'=>nil,'frame_src'=>nil,'img_src'=>nil,'manifest_src'=>nil,'media_src'=>nil,'object_src'=>nil,'script_src'=>nil,'style_src'=>nil,'worker_src'=>nil,'report_uri'=>nil,}}## 允许的主机##! 定制应该由Rails应用程序提供的 `host` 头。默认情况下,一切都是允许的。
  72. gitlab_rails['allowed_hosts']=[]## Monitoring settings##! 控制对监控端点的访问的IP白名单
  73. gitlab_rails['monitoring_whitelist']=['127.0.0.0/8','::1/128']## Shutdown settings##! 定义阻止运行状况检查的时间间隔,但继续接受应用程序请求。
  74. gitlab_rails['shutdown_blackout_seconds']=10## Microsoft Graph Mailer##! 允许使用带有OAuth 2.0客户端凭据流的Microsoft Graph API发送电子邮件。##! 文档:https://docs.gitlab.com/omnibus/settings/microsoft_graph_mailer.html
  75. gitlab_rails['microsoft_graph_mailer_enabled']=false
  76. gitlab_rails['microsoft_graph_mailer_user_id']="YOUR-USER-ID"
  77. gitlab_rails['microsoft_graph_mailer_tenant']="YOUR-TENANT-ID"
  78. gitlab_rails['microsoft_graph_mailer_client_id']="YOUR-CLIENT-ID"
  79. gitlab_rails['microsoft_graph_mailer_client_secret']="YOUR-CLIENT-SECRET-ID"
  80. gitlab_rails['microsoft_graph_mailer_azure_ad_endpoint']="https://login.microsoftonline.com"
  81. gitlab_rails['microsoft_graph_mailer_graph_endpoint']="https://graph.microsoft.com"## Reply by email##! 允许用户通过回复通知电子邮件来评论问题和合并请求。##! 文档:https://docs.gitlab.com/ee/administration/reply_by_email.html
  82. gitlab_rails['incoming_email_enabled']=true### Incoming Email Address###! 包含“%{key}”占位符的电子邮件地址,该占位符将被替换以引用回复的项目。###! **占位符可以省略,但如果存在,它必须出现在地址的“用户”部分(在`@ '之前)。**
  83. gitlab_rails['incoming_email_address']="gitlab-incoming+%{key}@gmail.com"### Email account username###! **对于第三方提供商,这通常是完整的电子邮件地址。**###! **With self-hosted email servers, this is usually the user part of the###! email address.**
  84. gitlab_rails['incoming_email_email']="gitlab-incoming@gmail.com"### Email 账户密码
  85. gitlab_rails['incoming_email_password']="[REDACTED]"### IMAP Settings
  86. gitlab_rails['incoming_email_host']="imap.gmail.com"
  87. gitlab_rails['incoming_email_port']=993
  88. gitlab_rails['incoming_email_ssl']=true
  89. gitlab_rails['incoming_email_start_tls']=false### Incoming Mailbox Settings (via `mail_room`)###! The mailbox where incoming mail will end up. Usually "inbox".
  90. gitlab_rails['incoming_email_mailbox_name']="inbox"###! 空闲命令超时。
  91. gitlab_rails['incoming_email_idle_timeout']=60###! The file name for internal `mail_room` JSON logfile
  92. gitlab_rails['incoming_email_log_file']="/var/log/gitlab/mailroom/mail_room_json.log"###! Permanently remove messages from the mailbox when they are marked as deleted after delivery
  93. gitlab_rails['incoming_email_expunge_deleted']=false### Inbox options (for Microsoft Graph)
  94. gitlab_rails['incoming_email_inbox_method']='microsoft_graph'
  95. gitlab_rails['incoming_email_inbox_options']={'tenant_id':'YOUR-TENANT-ID','client_id':'YOUR-CLIENT-ID','client_secret':'YOUR-CLIENT-SECRET','poll_interval':60# Optional}### How incoming emails are delivered to Rails process. Accept either sidekiq### or webhook. The default config is webhook.
  96. gitlab_rails['incoming_email_delivery_method']="webhook"### Token to authenticate webhook requests. The token must be exactly 32 bytes,### encoded with base64
  97. gitlab_rails['incoming_email_auth_token']=nil###! The format of mail_room crash logs
  98. mailroom['exit_log_format']="plain"## Consolidated (simplified) object storage configuration##! This uses a single credential for object storage with multiple buckets.##! It also enables Workhorse to upload files directly with its own S3 client##! instead of using pre-signed URLs.##!##! This configuration will only take effect if the object_store##! sections are not defined within the types. For example, enabling##! gitlab_rails['artifacts_object_store_enabled'] or##! gitlab_rails['lfs_object_store_enabled'] will prevent the##! consolidated settings from being used.##!##! Be sure to use different buckets for each type of object.##! 文档:https://docs.gitlab.com/ee/administration/object_storage.html
  99. gitlab_rails['object_store']['enabled']=false
  100. gitlab_rails['object_store']['connection']={}
  101. gitlab_rails['object_store']['storage_options']={}
  102. gitlab_rails['object_store']['proxy_download']=false
  103. gitlab_rails['object_store']['objects']['artifacts']['bucket']=nil
  104. gitlab_rails['object_store']['objects']['external_diffs']['bucket']=nil
  105. gitlab_rails['object_store']['objects']['lfs']['bucket']=nil
  106. gitlab_rails['object_store']['objects']['uploads']['bucket']=nil
  107. gitlab_rails['object_store']['objects']['packages']['bucket']=nil
  108. gitlab_rails['object_store']['objects']['dependency_proxy']['bucket']=nil
  109. gitlab_rails['object_store']['objects']['terraform_state']['bucket']=nil
  110. gitlab_rails['object_store']['objects']['ci_secure_files']['bucket']=nil## Job Artifacts
  111. gitlab_rails['artifacts_enabled']=true
  112. gitlab_rails['artifacts_path']="/var/opt/gitlab/gitlab-rails/shared/artifacts"###! Job artifacts Object Store###! 文档:https://docs.gitlab.com/ee/administration/job_artifacts.html#using-object-storage
  113. gitlab_rails['artifacts_object_store_enabled']=false
  114. gitlab_rails['artifacts_object_store_proxy_download']=false
  115. gitlab_rails['artifacts_object_store_remote_directory']="artifacts"
  116. gitlab_rails['artifacts_object_store_connection']={'provider'=>'AWS','region'=>'eu-west-1','aws_access_key_id'=>'AWS_ACCESS_KEY_ID','aws_secret_access_key'=>'AWS_SECRET_ACCESS_KEY',# # 以下选项配置S3兼容主机,而不是AWS# 'aws_signature_version' => 4, # 用于创建签名的URL。如果提供程序不支持v4,则设置为2。# 'endpoint' => 'https://s3.amazonaws.com', # 默认:nil -适用于S3标准服务,如数字海洋空间# 'host' => 's3.amazonaws.com',# 'path_style' => false # Use 'host/bucket_name/object' instead of 'bucket_name.host/object'}## External merge request diffs
  117. gitlab_rails['external_diffs_enabled']=false
  118. gitlab_rails['external_diffs_when']=nil
  119. gitlab_rails['external_diffs_storage_path']="/var/opt/gitlab/gitlab-rails/shared/external-diffs"
  120. gitlab_rails['external_diffs_object_store_enabled']=false
  121. gitlab_rails['external_diffs_object_store_proxy_download']=false
  122. gitlab_rails['external_diffs_object_store_remote_directory']="external-diffs"
  123. gitlab_rails['external_diffs_object_store_connection']={'provider'=>'AWS','region'=>'eu-west-1','aws_access_key_id'=>'AWS_ACCESS_KEY_ID','aws_secret_access_key'=>'AWS_SECRET_ACCESS_KEY',# # 以下选项配置S3兼容主机,而不是AWS# 'aws_signature_version' => 4, # 用于创建签名的URL。如果提供程序不支持v4,则设置为2。# 'endpoint' => 'https://s3.amazonaws.com', # 默认:nil -适用于S3标准服务,如数字海洋空间# 'host' => 's3.amazonaws.com',# 'path_style' => false # Use 'host/bucket_name/object' instead of 'bucket_name.host/object'}## Git LFS
  124. gitlab_rails['lfs_enabled']=true
  125. gitlab_rails['lfs_storage_path']="/var/opt/gitlab/gitlab-rails/shared/lfs-objects"
  126. gitlab_rails['lfs_object_store_enabled']=false
  127. gitlab_rails['lfs_object_store_proxy_download']=false
  128. gitlab_rails['lfs_object_store_remote_directory']="lfs-objects"
  129. gitlab_rails['lfs_object_store_connection']={'provider'=>'AWS','region'=>'eu-west-1','aws_access_key_id'=>'AWS_ACCESS_KEY_ID','aws_secret_access_key'=>'AWS_SECRET_ACCESS_KEY',# # 以下选项配置S3兼容主机,而不是AWS# 'aws_signature_version' => 4, # 用于创建签名的URL。如果提供程序不支持v4,则设置为2。# 'endpoint' => 'https://s3.amazonaws.com', # 默认:nil -适用于S3标准服务,如数字海洋空间# 'host' => 's3.amazonaws.com',# 'path_style' => false # Use 'host/bucket_name/object' instead of 'bucket_name.host/object'}## GitLab uploads##! 文档:https://docs.gitlab.com/ee/administration/uploads.html
  130. gitlab_rails['uploads_directory']="/var/opt/gitlab/gitlab-rails/uploads"
  131. gitlab_rails['uploads_storage_path']="/opt/gitlab/embedded/service/gitlab-rails/public"
  132. gitlab_rails['uploads_base_dir']="uploads/-/system"
  133. gitlab_rails['uploads_object_store_enabled']=false
  134. gitlab_rails['uploads_object_store_proxy_download']=false
  135. gitlab_rails['uploads_object_store_remote_directory']="uploads"
  136. gitlab_rails['uploads_object_store_connection']={'provider'=>'AWS','region'=>'eu-west-1','aws_access_key_id'=>'AWS_ACCESS_KEY_ID','aws_secret_access_key'=>'AWS_SECRET_ACCESS_KEY',# # 以下选项配置S3兼容主机,而不是AWS# 'host' => 's3.amazonaws.com',# 'aws_signature_version' => 4, # 用于创建签名的URL。如果提供程序不支持v4,则设置为2。# 'endpoint' => 'https://s3.amazonaws.com', # 默认:nil -适用于S3标准服务,如数字海洋空间# 'path_style' => false # Use 'host/bucket_name/object' instead of 'bucket_name.host/object'}## Terraform state##! 文档:https://docs.gitlab.com/ee/administration/terraform_state
  137. gitlab_rails['terraform_state_enabled']=true
  138. gitlab_rails['terraform_state_storage_path']="/var/opt/gitlab/gitlab-rails/shared/terraform_state"
  139. gitlab_rails['terraform_state_object_store_enabled']=false
  140. gitlab_rails['terraform_state_object_store_remote_directory']="terraform"
  141. gitlab_rails['terraform_state_object_store_connection']={'provider'=>'AWS','region'=>'eu-west-1','aws_access_key_id'=>'AWS_ACCESS_KEY_ID','aws_secret_access_key'=>'AWS_SECRET_ACCESS_KEY',# # 以下选项配置S3兼容主机,而不是AWS# 'host' => 's3.amazonaws.com',# 'aws_signature_version' => 4, # 用于创建签名的URL。如果提供程序不支持v4,则设置为2。# 'endpoint' => 'https://s3.amazonaws.com', # 默认:nil -适用于S3标准服务,如数字海洋空间# 'path_style' => false # Use 'host/bucket_name/object' instead of 'bucket_name.host/object'}## CI Secure Files
  142. gitlab_rails['ci_secure_files_enabled']=false
  143. gitlab_rails['ci_secure_files_storage_path']="/var/opt/gitlab/gitlab-rails/shared/ci_secure_files"
  144. gitlab_rails['ci_secure_files_object_store_enabled']=false
  145. gitlab_rails['ci_secure_files_object_store_remote_directory']="ci-secure-files"
  146. gitlab_rails['ci_secure_files_object_store_connection']={'provider'=>'AWS','region'=>'eu-west-1','aws_access_key_id'=>'AWS_ACCESS_KEY_ID','aws_secret_access_key'=>'AWS_SECRET_ACCESS_KEY',# # 以下选项配置S3兼容主机,而不是AWS# 'host' => 's3.amazonaws.com',# 'aws_signature_version' => 4, # 用于创建签名的URL。如果提供程序不支持v4,则设置为2。# 'endpoint' => 'https://s3.amazonaws.com', # 默认:nil -适用于S3标准服务,如数字海洋空间# 'path_style' => false # Use 'host/bucket_name/object' instead of 'bucket_name.host/object'}## GitLab Pages
  147. gitlab_rails['pages_object_store_enabled']=false
  148. gitlab_rails['pages_object_store_remote_directory']="pages"
  149. gitlab_rails['pages_object_store_connection']={'provider'=>'AWS','region'=>'eu-west-1','aws_access_key_id'=>'AWS_ACCESS_KEY_ID','aws_secret_access_key'=>'AWS_SECRET_ACCESS_KEY',# # 以下选项配置S3兼容主机,而不是AWS# 'host' => 's3.amazonaws.com',# 'aws_signature_version' => 4, # 用于创建签名的URL。如果提供程序不支持v4,则设置为2。# 'endpoint' => 'https://s3.amazonaws.com', # 默认:nil -适用于S3标准服务,如数字海洋空间# 'path_style' => false # Use 'host/bucket_name/object' instead of 'bucket_name.host/object'}
  150. gitlab_rails['pages_local_store_enabled']=true
  151. gitlab_rails['pages_local_store_path']="/var/opt/gitlab/gitlab-rails/shared/pages"## Impersonation settings
  152. gitlab_rails['impersonation_enabled']=true## Disable jQuery and CSS animations
  153. gitlab_rails['disable_animations']=false## Application settings cache expiry in seconds. (default: 60)
  154. gitlab_rails['application_settings_cache_seconds']=60## Usage Statistics
  155. gitlab_rails['usage_ping_enabled']=true## GitLab Mattermost##! These settings are void if Mattermost is installed on the same omnibus##! install
  156. gitlab_rails['mattermost_host']="https://mattermost.example.com"## LDAP Settings##! 文档:https://docs.gitlab.com/omnibus/settings/ldap.html##! **Be careful not to break the indentation in the ldap_servers block. It is##! in yaml format and the spaces must be retained. Using tabs will not work.**
  157. gitlab_rails['ldap_enabled']=false
  158. gitlab_rails['prevent_ldap_sign_in']=false##! **remember to close this block with 'EOS' below**
  159. gitlab_rails['ldap_servers']=YAML.load <<-'EOS'
  160. main: # 'main' is the GitLab 'provider ID' of this LDAP server
  161. label: 'LDAP'
  162. host: '_your_ldap_server'
  163. port: 389
  164. uid: 'sAMAccountName'
  165. bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
  166. password: '_the_password_of_the_bind_user'
  167. encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
  168. verify_certificates: true
  169. smartcard_auth: false
  170. active_directory: true
  171. allow_username_or_email_login: false
  172. lowercase_usernames: false
  173. block_auto_created_users: false
  174. base: ''
  175. user_filter: ''
  176. ## EE only
  177. group_base: ''
  178. admin_group: ''
  179. sync_ssh_keys: false
  180. secondary: # 'secondary' is the GitLab 'provider ID' of second LDAP server
  181. label: 'LDAP'
  182. host: '_your_ldap_server'
  183. port: 389
  184. uid: 'sAMAccountName'
  185. bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
  186. password: '_the_password_of_the_bind_user'
  187. encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
  188. verify_certificates: true
  189. smartcard_auth: false
  190. active_directory: true
  191. allow_username_or_email_login: false
  192. lowercase_usernames: false
  193. block_auto_created_users: false
  194. base: ''
  195. user_filter: ''
  196. ## EE only
  197. group_base: ''
  198. admin_group: ''
  199. sync_ssh_keys: false
  200. EOS## Smartcard authentication settings##! 文档:https://docs.gitlab.com/ee/administration/auth/smartcard.html
  201. gitlab_rails['smartcard_enabled']=false
  202. gitlab_rails['smartcard_ca_file']="/etc/gitlab/ssl/CA.pem"
  203. gitlab_rails['smartcard_client_certificate_required_host']='smartcard.gitlab.example.com'
  204. gitlab_rails['smartcard_client_certificate_required_port']=3444
  205. gitlab_rails['smartcard_required_for_git_access']=false
  206. gitlab_rails['smartcard_san_extensions']=false## OmniAuth 设置##! 文档:https://docs.gitlab.com/ee/integration/omniauth.html
  207. gitlab_rails['omniauth_enabled']=nil
  208. gitlab_rails['omniauth_allow_single_sign_on']=['saml']
  209. gitlab_rails['omniauth_sync_email_from_provider']='saml'
  210. gitlab_rails['omniauth_sync_profile_from_provider']=['saml']
  211. gitlab_rails['omniauth_sync_profile_attributes']=['email']
  212. gitlab_rails['omniauth_auto_sign_in_with_provider']='saml'
  213. gitlab_rails['omniauth_block_auto_created_users']=true
  214. gitlab_rails['omniauth_auto_link_ldap_user']=false
  215. gitlab_rails['omniauth_auto_link_saml_user']=false
  216. gitlab_rails['omniauth_auto_link_user']=['twitter']
  217. gitlab_rails['omniauth_external_providers']=['twitter','google_oauth2']
  218. gitlab_rails['omniauth_allow_bypass_two_factor']=['google_oauth2']
  219. gitlab_rails['omniauth_providers']=[{"name"=>"google_oauth2","app_id"=>"YOUR APP ID","app_secret"=>"YOUR APP SECRET","args"=>{"access_type"=>"offline","approval_prompt"=>""}}]
  220. gitlab_rails['omniauth_cas3_session_duration']=28800
  221. gitlab_rails['omniauth_saml_message_max_byte_size']=250000## FortiAuthenticator authentication settings
  222. gitlab_rails['forti_authenticator_enabled']=false
  223. gitlab_rails['forti_authenticator_host']='forti_authenticator.example.com'
  224. gitlab_rails['forti_authenticator_port']=443
  225. gitlab_rails['forti_authenticator_username']='admin'
  226. gitlab_rails['forti_authenticator_access_token']='s3cr3t'## FortiToken Cloud authentication settings
  227. gitlab_rails['forti_token_cloud_enabled']=false
  228. gitlab_rails['forti_token_cloud_client_id']='forti_token_cloud_client_id'
  229. gitlab_rails['forti_token_cloud_client_secret']='s3cr3t'## 备份设置##! 文档:https://docs.gitlab.com/omnibus/settings/backups.html
  230. gitlab_rails['manage_backup_path']=true
  231. gitlab_rails['backup_path']="/var/opt/gitlab/backups"
  232. gitlab_rails['backup_gitaly_backup_path']="/opt/gitlab/embedded/bin/gitaly-backup"##! 文档:https://docs.gitlab.com/ee/raketasks/backup_restore.html#backup-archive-permissions
  233. gitlab_rails['backup_archive_permissions']=0644
  234. gitlab_rails['backup_pg_schema']='public'##! 允许删除备份之前保留备份的持续时间(秒)
  235. gitlab_rails['backup_keep_time']=604800
  236. gitlab_rails['backup_upload_connection']={'provider'=>'AWS','region'=>'eu-west-1','aws_access_key_id'=>'AKIAKIAKI','aws_secret_access_key'=>'secret123',# # 如果启用了 IAM 配置文件使用,请删除 aws_access_key_id 和 aws_secret_access_key'use_iam_profile'=>false}
  237. gitlab_rails['backup_upload_remote_directory']='my.s3.bucket'
  238. gitlab_rails['backup_multipart_chunk_size']=104857600##! **使用 亚马逊S3管理的密钥 为备份打开AWS服务器端加密**
  239. gitlab_rails['backup_encryption']='AES256'##! 用于AWS服务器端加密的加密密钥。##! 设置此值将使用客户提供的密钥启用服务器端加密;否则,使用S3管理的密钥。
  240. gitlab_rails['backup_encryption_key']='<base64-encoded encryption key>'##! **使用亚马逊SSE-KMS打开AWS服务器端加密(AWS管理但客户主密钥)
  241. gitlab_rails['backup_upload_storage_options']={'server_side_encryption'=>'aws:kms','server_side_encryption_kms_key_id'=>'arn:aws:kms:YOUR-KEY-ID-HERE'}##! **指定用于备份的亚马逊S3存储类别。有效值包括'STANDARD', 'STANDARD_IA', and 'REDUCED_REDUNDANCY'**
  242. gitlab_rails['backup_storage_class']='STANDARD'##! 跳过部分备份。逗号分隔。##! 文档:https://docs.gitlab.com/ee/raketasks/backup_restore.html#excluding-specific-directories-from-the-backup
  243. gitlab_rails['env']={"SKIP"=>"db,uploads,repositories,builds,artifacts,lfs,registry,pages"}## 用于设置不同的数据存储目录##! 文档:https://docs.gitlab.com/omnibus/settings/configuration.html#store-git-data-in-an-alternative-directory##! **如果您想使用一个非默认目录来存储git数据,请使用一个不包含符号链接的路径。**
  244. git_data_dirs({"default"=>{"path"=>"/mnt/nfs-01/git-data"}})## Gitaly 设置
  245. gitlab_rails['gitaly_token']='secret token'## 用于存储GitLab应用程序上传,如LFS对象,构建工件##! 文档:https://docs.gitlab.com/ee/development/shared_files.html
  246. gitlab_rails['shared_path']='/var/opt/gitlab/gitlab-rails/shared'## 用于存储加密的配置文件##! 文档:https://docs.gitlab.com/ee/administration/encrypted_configuration.html
  247. gitlab_rails['encrypted_settings_path']='/var/opt/gitlab/gitlab-rails/shared/encrypted_settings'## 等待安装文件系统##! 文档:https://docs.gitlab.com/omnibus/settings/configuration.html#only-start-omnibus-gitlab-services-after-a-given-file-system-is-mounted
  248. high_availability['mountpoint']=["/var/opt/gitlab/git-data","/var/opt/gitlab/gitlab-rails/shared"]## 用于 GitLab GitLab Shell 设置
  249. gitlab_rails['gitlab_shell_ssh_port']=22
  250. gitlab_rails['gitlab_shell_git_timeout']=800## Extra 用户化
  251. gitlab_rails['extra_google_analytics_id']='_your_tracking_id'
  252. gitlab_rails['extra_google_tag_manager_id']='_your_tracking_id'
  253. gitlab_rails['extra_one_trust_id']='_your_one_trust_id'
  254. gitlab_rails['extra_google_tag_manager_nonce_id']='_your_google_tag_manager_id'
  255. gitlab_rails['extra_bizible']=false
  256. gitlab_rails['extra_matomo_url']='_your_matomo_url'
  257. gitlab_rails['extra_matomo_site_id']='_your_matomo_site_id'
  258. gitlab_rails['extra_matomo_disable_cookies']=false
  259. gitlab_rails['extra_maximum_text_highlight_size_kilobytes']=512#! 文档:https://docs.gitlab.com/omnibus/settings/environment-variables.html
  260. gitlab_rails['env']={'BUNDLE_GEMFILE'=>"/opt/gitlab/embedded/service/gitlab-rails/Gemfile",'PATH'=>"/opt/gitlab/bin:/opt/gitlab/embedded/bin:/bin:/usr/bin"}
  261. gitlab_rails['rack_attack_git_basic_auth']={'enabled'=>false,'ip_whitelist'=>["127.0.0.1"],'maxretry'=>10,'findtime'=>60,'bantime'=>3600}
  262. gitlab_rails['dir']="/var/opt/gitlab/gitlab-rails"
  263. gitlab_rails['log_directory']="/var/log/gitlab/gitlab-rails"### 更改初始默认管理员密码和共享跑步者注册令牌。###! **仅适用于初始设置,在创建和植入数据库后更改这些设置不会产生任何变化。**
  264. gitlab_rails['initial_root_password']="password"
  265. gitlab_rails['initial_shared_runners_registration_token']="token"### 切换是否应该在初始化期间将超级用户密码输出到标准输出
  266. gitlab_rails['display_initial_root_password']=false### 切换初始根密码是否应写入/etc/gitlab/initial_root_password
  267. gitlab_rails['store_initial_root_password']=true### 设置引导GitLab时要使用的初始许可证的路径。###! **仅适用于初始设置,未来的许可证更新需要通过用户界面完成。###! 在第一次重新配置运行后,更新此路径中指定的文件不会产生任何更改。
  268. gitlab_rails['initial_license_file']='/etc/gitlab/company.gitlab-license'### 启用或禁用自动数据库迁移
  269. gitlab_rails['auto_migrate']=true### 这是大型gitlab部署使用的高级功能### 整个RAILS env要花很多时间。
  270. gitlab_rails['rake_cache_clear']=true## GitLab数据库设置##! 文档:https://docs.gitlab.com/omnibus/settings/database.html##! **只有在使用外部数据库时才需要。**
  271. gitlab_rails['db_adapter']="postgresql"
  272. gitlab_rails['db_encoding']="unicode"
  273. gitlab_rails['db_collation']=nil
  274. gitlab_rails['db_database']="gitlabhq_production"
  275. gitlab_rails['db_username']="gitlab"
  276. gitlab_rails['db_password']=nil
  277. gitlab_rails['db_host']=nil
  278. gitlab_rails['db_port']=5432
  279. gitlab_rails['db_socket']=nil
  280. gitlab_rails['db_sslmode']=nil
  281. gitlab_rails['db_sslcompression']=0
  282. gitlab_rails['db_sslrootcert']=nil
  283. gitlab_rails['db_sslcert']=nil
  284. gitlab_rails['db_sslkey']=nil
  285. gitlab_rails['db_prepared_statements']=false
  286. gitlab_rails['db_statements_limit']=1000
  287. gitlab_rails['db_connect_timeout']=nil
  288. gitlab_rails['db_keepalives']=nil
  289. gitlab_rails['db_keepalives_idle']=nil
  290. gitlab_rails['db_keepalives_interval']=nil
  291. gitlab_rails['db_keepalives_count']=nil
  292. gitlab_rails['db_tcp_user_timeout']=nil
  293. gitlab_rails['db_application_name']=nil
  294. gitlab_rails['db_database_tasks']=true## GitLab Redis 设置##! 连接到您自己的Redis实例##! 文档:https://docs.gitlab.com/omnibus/settings/redis.html### Redis TCP 连接
  295. gitlab_rails['redis_host']="127.0.0.1"
  296. gitlab_rails['redis_port']=6379
  297. gitlab_rails['redis_ssl']=false
  298. gitlab_rails['redis_password']=nil
  299. gitlab_rails['redis_database']=0
  300. gitlab_rails['redis_enable_client']=true### Redis local UNIX socket (will be disabled if TCP method is used)
  301. gitlab_rails['redis_socket']="/var/opt/gitlab/redis/redis.socket"### Sentinel 支持###! 要让Sentinel工作,您必须启用上面的Redis TCP连接支持,并在下面定义一些Sentinel主机(要获得至少3台主机的可靠设置)。###! **您不需要列出每个sentinel主机,但是没有列出的主机不会在故障转移情况下用于查询新的主主机。**
  302. gitlab_rails['redis_sentinels']=[{'host'=>'127.0.0.1','port'=>26379},]### 独立实例支持##! 文档:https://docs.gitlab.com/omnibus/settings/redis.html#running-with-multiple-redis-instances
  303. gitlab_rails['redis_cache_instance']=nil
  304. gitlab_rails['redis_cache_sentinels']=nil
  305. gitlab_rails['redis_queues_instance']=nil
  306. gitlab_rails['redis_queues_sentinels']=nil
  307. gitlab_rails['redis_shared_state_instance']=nil
  308. gitlab_rails['redis_shared_state_sentinels']=nil
  309. gitlab_rails['redis_trace_chunks_instance']=nil
  310. gitlab_rails['redis_trace_chunks_sentinels']=nil
  311. gitlab_rails['redis_actioncable_instance']=nil
  312. gitlab_rails['redis_actioncable_sentinels']=nil
  313. gitlab_rails['redis_rate_limiting_instance']=nil
  314. gitlab_rails['redis_rate_limiting_sentinels']=nil
  315. gitlab_rails['redis_sessions_instance']=nil
  316. gitlab_rails['redis_sessions_sentinels']=nil################################################################################ 容器注册表设置#! 文档:https://docs.gitlab.com/ee/administration/packages/container_registry.html###############################################################################
  317. registry_external_url 'https://registry.example.com'## GitLab应用程序使用的设置
  318. gitlab_rails['registry_enabled']=true
  319. gitlab_rails['registry_host']="registry.gitlab.example.com"
  320. gitlab_rails['registry_port']="5005"
  321. gitlab_rails['registry_path']="/var/opt/gitlab/gitlab-rails/shared/registry"
  322. 通知密码,用于验证GitLab应用程序的通知请求
  323. 您只需要在使用外部注册表服务时更改它,否则它将直接来自您的注册表的通知设置
  324. gitlab_rails['registry_notification_secret']=nil##! **除非你知道你在做什么,否则不要改变以下3个设置**
  325. gitlab_rails['registry_api_url']="http://127.0.0.1:5000"
  326. gitlab_rails['registry_key_path']="/var/opt/gitlab/gitlab-rails/certificate.key"
  327. gitlab_rails['registry_issuer']="omnibus-gitlab-issuer"## 注册表应用程序使用的设置
  328. registry['enable']=true
  329. registry['username']="registry"
  330. registry['group']="registry"
  331. registry['uid']=nil
  332. registry['gid']=nil
  333. registry['dir']="/var/opt/gitlab/registry"
  334. registry['registry_http_addr']="127.0.0.1:5000"
  335. registry['debug_addr']="localhost:5001"
  336. registry['log_directory']="/var/log/gitlab/registry"
  337. registry['env_directory']="/opt/gitlab/etc/registry/env"
  338. registry['env']={'SSL_CERT_DIR'=>"/opt/gitlab/embedded/ssl/certs/"}
  339. registry['log_level']="info"
  340. registry['log_formatter']="text"
  341. registry['rootcertbundle']="/var/opt/gitlab/registry/certificate.crt"
  342. registry['health_storagedriver_enabled']=true
  343. registry['middleware']=nil
  344. registry['storage_delete_enabled']=true
  345. registry['validation_enabled']=false
  346. registry['autoredirect']=false
  347. registry['compatibility_schema1_enabled']=false## 注册表后端存储##! 文档:https://docs.gitlab.com/ee/administration/packages/container_registry.html#configure-storage-for-the-container-registry
  348. registry['storage']={'s3'=>{'accesskey'=>'s3-access-key','secretkey'=>'s3-secret-key-for-access-key','bucket'=>'your-s3-bucket','region'=>'your-s3-region','regionendpoint'=>'your-s3-regionendpoint'},'redirect'=>{'disable'=>false}}## 注册表通知端点
  349. registry['notifications']=[{'name'=>'test_endpoint','url'=>'https://gitlab.example.com/notify2','timeout'=>'500ms','threshold'=>5,'backoff'=>'1s','headers'=>{"Authorization"=>["AUTHORIZATION_EXAMPLE_TOKEN"]}}]## 默认注册表通知
  350. registry['default_notifications_timeout']="500ms"
  351. registry['default_notifications_threshold']=5
  352. registry['default_notifications_backoff']="1s"
  353. registry['default_notifications_headers']={}################################################################################ 使用Sentry报告和记录错误###############################################################################
  354. gitlab_rails['sentry_enabled']=false
  355. gitlab_rails['sentry_dsn']='https://<key>@sentry.io/<project>'
  356. gitlab_rails['sentry_clientside_dsn']='https://<key>@sentry.io/<project>'
  357. gitlab_rails['sentry_environment']='production'################################################################################ CI_JOB_JWT################################################################################! RSA private key used to sign CI_JOB_JWT
  358. gitlab_rails['ci_jwt_signing_key']=nil# Will be generated if not set.################################################################################ GitLab Workhorse#! 文档:https://gitlab.com/gitlab-org/gitlab/-/blob/master/workhorse/README.md###############################################################################
  359. gitlab_workhorse['enable']=true
  360. gitlab_workhorse['ha']=false
  361. gitlab_workhorse['alt_document_root']=nil#! Duration to wait for all requests to finish (e.g. "10s" for 10#! seconds). By default this is disabled to preserve the existing#! behavior of fast shutdown. This should not be set higher than 30#! seconds, since gitlab-ctl will wait up to 30 seconds (as defined by#! the SVWAIT variable) and report a timeout error if the process has#! not shut down.
  362. gitlab_workhorse['shutdown_timeout']=nil
  363. gitlab_workhorse['listen_network']="unix"
  364. gitlab_workhorse['listen_umask']=000
  365. gitlab_workhorse['listen_addr']="/var/opt/gitlab/gitlab-workhorse/sockets/socket"
  366. gitlab_workhorse['auth_backend']="http://localhost:8080"#! 启用Redis keywatcher,如果该设置不存在,则默认为 true
  367. gitlab_workhorse['workhorse_keywatcher']=true#! 空字符串是gitlab-workhorse选项解析器中的缺省值
  368. gitlab_workhorse['auth_socket']="''"#! 在命令行上放一个空字符串
  369. gitlab_workhorse['pprof_listen_addr']="''"
  370. gitlab_workhorse['prometheus_listen_addr']="localhost:9229"
  371. gitlab_workhorse['dir']="/var/opt/gitlab/gitlab-workhorse"
  372. gitlab_workhorse['log_directory']="/var/log/gitlab/gitlab-workhorse"
  373. gitlab_workhorse['proxy_headers_timeout']="1m0s"#! limit number of concurrent API requests, defaults to 0 which is unlimited
  374. gitlab_workhorse['api_limit']=0#! 限制允许排队的API请求数,默认值为0,表示禁用排队
  375. gitlab_workhorse['api_queue_limit']=0#! 如果请求在队列中停留的时间太长,我们将在该时间后超时请求
  376. gitlab_workhorse['api_queue_duration']="30s"#! Long polling duration for job requesting for runners
  377. gitlab_workhorse['api_ci_long_polling_duration']="60s"#! Propagate X-Request-Id if available. Workhorse will generate a random value otherwise.
  378. gitlab_workhorse['propagate_correlation_id']=false#! A list of CIDR blocks to allow for propagation of correlation ID.#! propagate_correlation_id should also be set to true.#! For example: %w(127.0.0.1/32 192.168.0.1/32)
  379. gitlab_workhorse['trusted_cidrs_for_propagation']=nil#! A list of CIDR blocks that must match remote IP addresses to use#! X-Forwarded-For HTTP header for the actual client IP. Used in#! conjuction with propagate_correlation_id and#! trusted_cidrs_for_propagation.#! For example: %w(127.0.0.1/32 192.168.0.1/32)
  380. gitlab_workhorse['trusted_cidrs_for_x_forwarded_for']=nil#! Log format: default is json, can also be text or none.
  381. gitlab_workhorse['log_format']="json"
  382. gitlab_workhorse['env_directory']="/opt/gitlab/etc/gitlab-workhorse/env"
  383. gitlab_workhorse['env']={'PATH'=>"/opt/gitlab/bin:/opt/gitlab/embedded/bin:/bin:/usr/bin",'SSL_CERT_DIR'=>"/opt/gitlab/embedded/ssl/certs/"}#! Resource limitations for the dynamic image scaler.#! Exceeding these thresholds will cause Workhorse to serve images in their original size.#!#! Maximum number of scaler processes that are allowed to execute concurrently.#! It is recommended for this not to exceed the number of CPUs available.
  384. gitlab_workhorse['image_scaler_max_procs']=4#!#! Maximum file size in bytes for an image to be considered eligible for rescaling
  385. gitlab_workhorse['image_scaler_max_filesize']=250000#! Service name used to register GitLab Workhorse as a Consul service
  386. gitlab_workhorse['consul_service_name']='workhorse'#! Semantic metadata used when registering GitLab Workhorse as a Consul service
  387. gitlab_workhorse['consul_service_meta']={}################################################################################ GitLab User Settings#! Modify default git user.#! 文档:https://docs.gitlab.com/omnibus/settings/configuration.html#change-the-name-of-the-git-user-or-group###############################################################################
  388. user['username']="git"
  389. user['group']="git"
  390. user['uid']=nil
  391. user['gid']=nil#! The shell for the git user
  392. user['shell']="/bin/sh"#! The home directory for the git user
  393. user['home']="/var/opt/gitlab"
  394. user['git_user_name']="GitLab"
  395. user['git_user_email']="gitlab@#{node['fqdn']}"################################################################################ GitLab Puma#! Tweak puma settings.#! 文档:https://docs.gitlab.com/ee/administration/operations/puma.html###############################################################################
  396. puma['enable']=true
  397. puma['ha']=false
  398. puma['worker_timeout']=60
  399. puma['worker_processes']=2
  400. puma['min_threads']=4
  401. puma['max_threads']=4## 高级设置
  402. puma['listen']='127.0.0.1'
  403. puma['port']=8080
  404. puma['socket']='/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket'
  405. puma['somaxconn']=1024## SSL settings
  406. puma['ssl_listen']=nil
  407. puma['ssl_port']=nil
  408. puma['ssl_certificate']=nil
  409. puma['ssl_certificate_key']=nil
  410. puma['ssl_client_certificate']=nil
  411. puma['ssl_cipher_filter']=nil
  412. puma['ssl_verify_mode']='none'
  413. puma['pidfile']='/opt/gitlab/var/puma/puma.pid'
  414. puma['state_path']='/opt/gitlab/var/puma/puma.state'##! **We do not recommend changing this setting**
  415. puma['log_directory']="/var/log/gitlab/puma"## **Only change these settings if you understand well what they mean**##! 文档:https://github.com/schneems/puma_worker_killer
  416. puma['per_worker_max_memory_mb']=1024
  417. puma['exporter_enabled']=false
  418. puma['exporter_address']="127.0.0.1"
  419. puma['exporter_port']=8083
  420. puma['exporter_tls_enabled']=false
  421. puma['exporter_tls_cert_path']=""
  422. puma['exporter_tls_key_path']=""
  423. puma['prometheus_scrape_scheme']='http'
  424. puma['prometheus_scrape_tls_server_name']='localhost'
  425. puma['prometheus_scrape_tls_skip_verification']=false#! Service name used to register Puma as a Consul service
  426. puma['consul_service_name']='rails'#! Semantic metadata used when registering Puma as a Consul service
  427. puma['consul_service_meta']={}################################################################################ GitLab Sidekiq################################################################################! GitLab允许启动多个sidekiq进程。这些进程可用于消耗一组专用的队列。#! 这可用于确保某些队列能够处理额外的工作负载。#! https://docs.gitlab.com/ee/administration/operations/extra_sidekiq_processes.html
  428. sidekiq['log_directory']="/var/log/gitlab/sidekiq"
  429. sidekiq['log_format']="json"
  430. sidekiq['shutdown_timeout']=4
  431. sidekiq['queue_selector']=false
  432. sidekiq['interval']=nil
  433. sidekiq['max_concurrency']=20
  434. sidekiq['min_concurrency']=nil#! GitLab允许将作业路由到由 ##!路由规则。#! 每个路由规则都是队列选择器查询和相应队列的元组。默认情况下,不配置路由规则(空数组)
  435. sidekiq['routing_rules']=[]#! queue_groups 数组中的每个条目表示一组必须由Sidekiq 进程处理的队列。多个队列可以由同一个进程处理,#! 方法是在组条目中用逗号分隔它们,一个 `*` 将处理所有队列。
  436. sidekiq['queue_groups']=['*']#! 如果启用了求反,那么Sidekiq将处理所有与queue_groups中的队列不匹配的队列。
  437. sidekiq['negate']=false#! 指定Prometheus metrics端点可用于Sidekiq流程的位置。
  438. sidekiq['metrics_enabled']=true
  439. sidekiq['exporter_log_enabled']=false
  440. sidekiq['exporter_tls_enabled']=false
  441. sidekiq['exporter_tls_cert_path']=""
  442. sidekiq['exporter_tls_key_path']=""
  443. sidekiq['listen_address']="localhost"
  444. sidekiq['listen_port']=8082#! 指定运行状况检查端点在何处可用于 Sidekiq 进程。#! 默认为与 Prometheus 度量相同的设置(见上文)。
  445. sidekiq['health_checks_enabled']=true
  446. sidekiq['health_checks_listen_address']="localhost"
  447. sidekiq['health_checks_listen_port']=8092#! 用于将Sidekiq注册为 Consul 服务的服务名称
  448. sidekiq['consul_service_name']='sidekiq'#! Semantic metadata used when registering Sidekiq as a Consul service
  449. sidekiq['consul_service_meta']={}################################################################################ gitlab-shell###############################################################################
  450. gitlab_shell['audit_usernames']=false
  451. gitlab_shell['log_level']='INFO'
  452. gitlab_shell['log_format']='json'
  453. gitlab_shell['http_settings']={user:'username',password:'password',ca_file:'/etc/ssl/cert.pem',ca_path:'/etc/pki/tls/certs'}
  454. gitlab_shell['log_directory']="/var/log/gitlab/gitlab-shell/"
  455. gitlab_shell['auth_file']="/var/opt/gitlab/.ssh/authorized_keys"## Migration to Go feature flags##! 文档:https://gitlab.com/gitlab-org/gitlab-shell#migration-to-go-feature-flags
  456. gitlab_shell['migration']={enabled:true,features:[]}## Git跟踪日志文件。##! If set, git commands receive GIT_TRACE* environment variables##! 文档:https://git-scm.com/book/es/v2/Git-Internals-Environment-Variables#Debugging##! An absolute path starting with / – the trace output will be appended to##! that file. It needs to exist so we can check permissions and avoid##! throwing warnings to the users.
  457. gitlab_shell['git_trace_log_file']="/var/log/gitlab/gitlab-shell/gitlab-shell-git-trace.log"#! **我们不建议更改此目录。**
  458. gitlab_shell['dir']="/var/opt/gitlab/gitlab-shell"################################################################ GitLab PostgreSQL#################################################################! 更改这些设置需要重新启动postgresql。##! 默认情况下,如果postgresql正在运行,reconfigure会重新加载它。##! 如果您更改这些设置中的任何一项,##! 请确保在重新配置后运行 `gitlab-ctl restart postgresql` ,以使更改生效。
  459. postgresql['enable']=true
  460. postgresql['listen_address']=nil
  461. postgresql['port']=5432# 仅在启用Patroni时使用。这是PostgreSQL响应其他集群成员的端口。# Patroni使用此端口向集群通告PostgreSQL连接端点。# 默认情况下,它与 postgresql['port'] 相同。
  462. postgresql['connect_port']=5432#! **建议值为总RAM的1/4,最高14GB。**
  463. postgresql['shared_buffers']="256MB"## 高级设置
  464. postgresql['ha']=false
  465. postgresql['dir']="/var/opt/gitlab/postgresql"
  466. postgresql['log_directory']="/var/log/gitlab/postgresql"
  467. postgresql['log_destination']=nil
  468. postgresql['logging_collector']=nil
  469. postgresql['log_truncate_on_rotation']=nil
  470. postgresql['log_rotation_age']=nil
  471. postgresql['log_rotation_size']=nil#! 'username' affects the system and PostgreSQL user accounts created during installation and cannot be changed#! on an existing installation. See https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/3606 for more details.
  472. postgresql['username']="gitlab-psql"
  473. postgresql['group']="gitlab-psql"#! `SQL_USER_PASSWORD_HASH` can be generated using the command `gitlab-ctl pg-password-md5 gitlab`
  474. postgresql['sql_user_password']='SQL_USER_PASSWORD_HASH'
  475. postgresql['uid']=nil
  476. postgresql['gid']=nil
  477. postgresql['shell']="/bin/sh"
  478. postgresql['home']="/var/opt/gitlab/postgresql"
  479. postgresql['user_path']="/opt/gitlab/embedded/bin:/opt/gitlab/bin:$PATH"
  480. postgresql['sql_user']="gitlab"
  481. postgresql['max_connections']=400
  482. postgresql['md5_auth_cidr_addresses']=[]
  483. postgresql['trust_auth_cidr_addresses']=[]
  484. postgresql['wal_buffers']="-1"
  485. postgresql['autovacuum_max_workers']="3"
  486. postgresql['autovacuum_freeze_max_age']="200000000"
  487. postgresql['log_statement']=nil
  488. postgresql['track_activity_query_size']="1024"
  489. postgresql['shared_preload_libraries']=nil
  490. postgresql['dynamic_shared_memory_type']=nil
  491. postgresql['hot_standby']="off"## SSL 设置
  492. See https://www.postgresql.org/docs/12/static/runtime-config-connection.html#GUC-SSL-CERT-FILE for more details
  493. postgresql['ssl']='on'
  494. postgresql['hostssl']=false
  495. postgresql['ssl_ciphers']='HIGH:MEDIUM:+3DES:!aNULL:!SSLv3:!TLSv1'
  496. postgresql['ssl_cert_file']='server.crt'
  497. postgresql['ssl_key_file']='server.key'
  498. postgresql['ssl_ca_file']='/opt/gitlab/embedded/ssl/certs/cacert.pem'
  499. postgresql['ssl_crl_file']=nil
  500. postgresql['cert_auth_addresses']={'ADDRESS'=>{database:'gitlabhq_production',user:'gitlab'}}## 复制设置##! 注意,有些复制设置不需要完全重启。它们记录如下。
  501. postgresql['wal_level']="hot_standby"
  502. postgresql['wal_log_hints']='off'
  503. postgresql['max_wal_senders']=5
  504. postgresql['max_replication_slots']=0
  505. postgresql['max_locks_per_transaction']=128
  506. Backup/Archive settings
  507. postgresql['archive_mode']="off"##! 更改这些设置只需要重新加载postgresql。如果您更改其中任何一项并运行 reconfigure,则不需要重新启动 postgresql。
  508. postgresql['work_mem']="16MB"
  509. postgresql['maintenance_work_mem']="16MB"
  510. postgresql['checkpoint_timeout']="5min"
  511. postgresql['checkpoint_completion_target']=0.9
  512. postgresql['effective_io_concurrency']=1
  513. postgresql['checkpoint_warning']="30s"
  514. postgresql['effective_cache_size']="1MB"
  515. postgresql['shmmax']=17179869184# or 4294967295
  516. postgresql['shmall']=4194304# or 1048575
  517. postgresql['autovacuum']="on"
  518. postgresql['log_autovacuum_min_duration']="-1"
  519. postgresql['autovacuum_naptime']="1min"
  520. postgresql['autovacuum_vacuum_threshold']="50"
  521. postgresql['autovacuum_analyze_threshold']="50"
  522. postgresql['autovacuum_vacuum_scale_factor']="0.02"
  523. postgresql['autovacuum_analyze_scale_factor']="0.01"
  524. postgresql['autovacuum_vacuum_cost_delay']="20ms"
  525. postgresql['autovacuum_vacuum_cost_limit']="-1"
  526. postgresql['statement_timeout']="60000"
  527. postgresql['idle_in_transaction_session_timeout']="60000"
  528. postgresql['log_line_prefix']="%a"
  529. postgresql['max_worker_processes']=8
  530. postgresql['max_parallel_workers_per_gather']=0
  531. postgresql['log_lock_waits']=1
  532. postgresql['deadlock_timeout']='5s'
  533. postgresql['track_io_timing']=0
  534. postgresql['default_statistics_target']=1000## 在PostgreSQL 9.6和更高版本中可用
  535. postgresql['min_wal_size']="80MB"
  536. postgresql['max_wal_size']="1GB"
  537. Backup/Archive settings
  538. postgresql['archive_command']=nil
  539. postgresql['archive_timeout']="0"## 复制设置
  540. postgresql['sql_replication_user']="gitlab_replicator"
  541. postgresql['sql_replication_password']="md5 hash of postgresql password"# You can generate with `gitlab-ctl pg-password-md5 <dbuser>`
  542. postgresql['wal_keep_segments']=10
  543. postgresql['max_standby_archive_delay']="30s"
  544. postgresql['max_standby_streaming_delay']="30s"
  545. postgresql['synchronous_commit']= on
  546. postgresql['synchronous_standby_names']=''
  547. postgresql['hot_standby_feedback']='off'
  548. postgresql['random_page_cost']=2.0
  549. postgresql['log_temp_files']=-1
  550. postgresql['log_checkpoints']='off'
  551. To add custom entries to pg_hba.conf use the following
  552. postgresql['custom_pg_hba_entries']={APPLICATION:[# APPLICATION should identify what the settings are used for{type: example,database: example,user: example,cidr: example,method: example,option: example
  553. }]}
  554. See https://www.postgresql.org/docs/12/static/auth-pg-hba-conf.html for an explanation
  555. of the values
  556. ## Version settings
  557. Set this if you have disabled the bundled PostgreSQL but still want to use the backup rake tasks
  558. postgresql['version']=10#! Automatically restart PostgreSQL service when version changes.
  559. postgresql['auto_restart_on_version_change']=true################################################################################ GitLab Redis#! **如果您使用自己的Redis实例,则可以禁用。**#! 文档:https://docs.gitlab.com/omnibus/settings/redis.html###############################################################################
  560. redis['enable']=true
  561. redis['ha']=false
  562. redis['hz']=10
  563. redis['dir']="/var/opt/gitlab/redis"
  564. redis['log_directory']="/var/log/gitlab/redis"
  565. redis['username']="gitlab-redis"
  566. redis['group']="gitlab-redis"
  567. redis['maxclients']="10000"
  568. redis['maxmemory']="0"
  569. redis['maxmemory_policy']="noeviction"
  570. redis['maxmemory_samples']="5"
  571. redis['stop_writes_on_bgsave_error']=true
  572. redis['tcp_backlog']=511
  573. redis['tcp_timeout']="60"
  574. redis['tcp_keepalive']="300"
  575. redis['uid']=nil
  576. redis['gid']=nil## Redis TLS settings##! To run Redis over TLS, specify values for the following settings
  577. redis['tls_port']=nil
  578. redis['tls_cert_file']=nil
  579. redis['tls_key_file']=nil##! 其他与TLS相关的可选设置
  580. redis['tls_dh_params_file']=nil
  581. redis['tls_ca_cert_dir']='/opt/gitlab/embedded/ssl/certs/'
  582. redis['tls_ca_cert_file']='/opt/gitlab/embedded/ssl/certs/cacert.pem'
  583. redis['tls_auth_clients']='optional'
  584. redis['tls_replication']=nil
  585. redis['tls_cluster']=nil
  586. redis['tls_protocols']=nil
  587. redis['tls_ciphers']=nil
  588. redis['tls_ciphersuites']=nil
  589. redis['tls_prefer_server_ciphers']=nil
  590. redis['tls_session_caching']=nil
  591. redis['tls_session_cache_size']=nil
  592. redis['tls_session_cache_timeout']=nil## 禁用或模糊不必要的redis命令名称,取消注释并编辑此块以添加或删除条目。## See https://docs.gitlab.com/omnibus/settings/redis.html#renamed-commands## 详细用法##
  593. redis['rename_commands']={'KEYS':''}##! **要在此计算机上仅启用Redis服务,请取消下面一行的注释(选择主或副本实例类型)。**##! 文档:https://docs.gitlab.com/omnibus/settings/redis.html##! https://docs.gitlab.com/ee/administration/high_availability/redis.html
  594. redis_master_role['enable']=true
  595. redis_replica_role['enable']=true## Redis TCP support (will disable UNIX socket transport)
  596. redis['bind']='0.0.0.0'# or specify an IP to bind to a single one
  597. redis['port']=6379
  598. redis['password']='redis-password-goes-here'## Redis Sentinel support##! **You need a master replica Redis replication to be able to do failover**##! **Please read the documentation before enabling it to understand the##! caveats:**##! 文档:https://docs.gitlab.com/ee/administration/high_availability/redis.html## Replication support### Replica Redis instance
  599. redis['master']=false# by default this is true### Replica and Sentinel shared configuration###! **Both need to point to the master Redis instance to get replication and###! heartbeat monitoring**
  600. redis['master_name']='gitlab-redis'
  601. redis['master_ip']=nil
  602. redis['master_port']=6379### Support to run redis replicas in a Docker or NAT environment###! 文档:https://redis.io/topics/replication#configuring-replication-in-docker-and-nat
  603. redis['announce_ip']=nil
  604. redis['announce_port']=nil
  605. redis['announce_ip_from_hostname']=false###! **Master password should have the same value defined in###! redis['password'] to enable the instance to transition to/from###! master/replica in a failover event.**
  606. redis['master_password']='redis-password-goes-here'###! Increase these values when your replicas can't catch up with master
  607. redis['client_output_buffer_limit_normal']='0 0 0'
  608. redis['client_output_buffer_limit_replica']='256mb 64mb 60'
  609. redis['client_output_buffer_limit_pubsub']='32mb 8mb 60'####! Redis snapshotting frequency####! Set to [] to disable####! Set to [''] to clear previously set values
  610. redis['save']=['900 1','300 10','60 10000']####! Redis lazy freeing####! Defaults to false
  611. redis['lazyfree_lazy_eviction']=true
  612. redis['lazyfree_lazy_expire']=true
  613. redis['lazyfree_lazy_server_del']=true
  614. redis['replica_lazy_flush']=true####! Redis threaded I/O####! Defaults to disabled
  615. redis['io_threads']=4
  616. redis['io_threads_do_reads']=true################################################################################ GitLab Web server#! 文档:https://docs.gitlab.com/omnibus/settings/nginx.html#using-a-non-bundled-web-server################################################################################! When bundled nginx is disabled we need to add the external webserver user to#! the GitLab webserver group.
  617. web_server['external_users']=[]
  618. web_server['username']='gitlab-www'
  619. web_server['group']='gitlab-www'
  620. web_server['uid']=nil
  621. web_server['gid']=nil
  622. web_server['shell']='/bin/false'
  623. web_server['home']='/var/opt/gitlab/nginx'################################################################################ GitLab NGINX#! 文档:https://docs.gitlab.com/omnibus/settings/nginx.html###############################################################################
  624. nginx['enable']=true
  625. nginx['client_max_body_size']='250m'
  626. nginx['redirect_http_to_https']=false
  627. nginx['redirect_http_to_https_port']=80#! Most root CA's are included by default
  628. nginx['ssl_client_certificate']="/etc/gitlab/ssl/ca.crt"#! enable/disable 2-way SSL client authentication
  629. nginx['ssl_verify_client']="off"#! if ssl_verify_client on, verification depth in the client certificates chain
  630. nginx['ssl_verify_depth']="1"
  631. nginx['ssl_certificate']="/etc/gitlab/ssl/#{node['fqdn']}.crt"
  632. nginx['ssl_certificate_key']="/etc/gitlab/ssl/#{node['fqdn']}.key"
  633. nginx['ssl_ciphers']="ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384"
  634. nginx['ssl_prefer_server_ciphers']="off"#! **Recommended by: https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html#! https://cipherli.st/**
  635. nginx['ssl_protocols']="TLSv1.2 TLSv1.3"#! **Recommended in: https://nginx.org/en/docs/http/ngx_http_ssl_module.html**
  636. nginx['ssl_session_cache']="shared:SSL:10m"#! **Recommended in: https://ssl-config.mozilla.org/#server=nginx&version=1.17.7&config=intermediate&openssl=1.1.1d&ocsp=false&guideline=5.6**
  637. nginx['ssl_session_tickets']="off"#! **Default according to https://nginx.org/en/docs/http/ngx_http_ssl_module.html**
  638. nginx['ssl_session_timeout']="1d"
  639. nginx['ssl_dhparam']=nil# Path to dhparams.pem, eg. /etc/gitlab/ssl/dhparams.pem
  640. nginx['ssl_password_file']=nil# Path to file with passphrases for ssl certificate secret keys
  641. nginx['listen_addresses']=['*','[::]']#! **Defaults to forcing web browsers to always communicate using only HTTPS**#! 文档:https://docs.gitlab.com/omnibus/settings/nginx.html#setting-http-strict-transport-security
  642. nginx['hsts_max_age']=63072000
  643. nginx['hsts_include_subdomains']=false#! Defaults to stripping path information when making cross-origin requests
  644. nginx['referrer_policy']='strict-origin-when-cross-origin'#! **文档:http://nginx.org/en/docs/http/ngx_http_gzip_module.html**
  645. nginx['gzip_enabled']=true#! **Override only if you use a reverse proxy**#! 文档:https://docs.gitlab.com/omnibus/settings/nginx.html#setting-the-nginx-listen-port
  646. nginx['listen_port']=nil#! **Override only if your reverse proxy internally communicates over HTTP**#! 文档:https://docs.gitlab.com/omnibus/settings/nginx.html#supporting-proxied-ssl
  647. nginx['listen_https']=nil#! **Override only if you use a reverse proxy with proxy protocol enabled**#! 文档:https://docs.gitlab.com/omnibus/settings/nginx.html#configuring-proxy-protocol
  648. nginx['proxy_protocol']=false
  649. nginx['custom_gitlab_server_config']="location ^~ /foo-namespace/bar-project/raw/ {\n deny all;\n}\n"
  650. nginx['custom_nginx_config']="include /etc/nginx/conf.d/example.conf;"
  651. nginx['proxy_read_timeout']=3600
  652. nginx['proxy_connect_timeout']=300
  653. nginx['proxy_set_headers']={"Host"=>"$http_host_with_default","X-Real-IP"=>"$remote_addr","X-Forwarded-For"=>"$proxy_add_x_forwarded_for","X-Forwarded-Proto"=>"https","X-Forwarded-Ssl"=>"on","Upgrade"=>"$http_upgrade","Connection"=>"$connection_upgrade"}
  654. nginx['proxy_cache_path']='proxy_cache keys_zone=gitlab:10m max_size=1g levels=1:2'
  655. nginx['proxy_cache']='gitlab'
  656. nginx['proxy_custom_buffer_size']='4k'
  657. nginx['http2_enabled']=true
  658. nginx['real_ip_trusted_addresses']=[]
  659. nginx['real_ip_header']=nil
  660. nginx['real_ip_recursive']=nil
  661. nginx['custom_error_pages']={'404'=>{'title'=>'Example title','header'=>'Example header','message'=>'Example message'}}## 高级设置
  662. nginx['dir']="/var/opt/gitlab/nginx"
  663. nginx['log_directory']="/var/log/gitlab/nginx"
  664. nginx['error_log_level']="error"
  665. nginx['worker_processes']=4
  666. nginx['worker_connections']=10240
  667. nginx['log_format']='$remote_addr - $remote_user [$time_local] "$request_method $filtered_request_uri $server_protocol" $status $body_bytes_sent "$filtered_http_referer" "$http_user_agent" $gzip_ratio'
  668. nginx['sendfile']='on'
  669. nginx['tcp_nopush']='on'
  670. nginx['tcp_nodelay']='on'
  671. nginx['hide_server_tokens']='off'
  672. nginx['gzip_http_version']="1.0"
  673. nginx['gzip_comp_level']="2"
  674. nginx['gzip_proxied']="any"
  675. nginx['gzip_types']=["text/plain","text/css","application/x-javascript","text/xml","application/xml","application/xml+rss","text/javascript","application/json"]
  676. nginx['keepalive_timeout']=65
  677. nginx['keepalive_time']='1h'
  678. nginx['cache_max_size']='5000m'
  679. nginx['server_names_hash_bucket_size']=64#! These paths have proxy_request_buffering disabled
  680. nginx['request_buffering_off_path_regex']="/api/v\\d/jobs/\\d+/artifacts$|/import/gitlab_project$|\\.git/git-receive-pack$|\\.git/gitlab-lfs/objects|\\.git/info/lfs/objects/batch$"## Nginx status
  681. nginx['status']={"enable"=>true,"listen_addresses"=>["127.0.0.1"],"fqdn"=>"dev.example.com","port"=>9999,"vts_enable"=>true,"options"=>{"server_tokens"=>"off",# Don't show the version of NGINX"access_log"=>"off",# Disable logs for stats"allow"=>"127.0.0.1",# Only allow access from localhost"deny"=>"all"# Deny access to anyone else}}#! Service name used to register Nginx as a Consul service
  682. nginx['consul_service_name']='nginx'#! Semantic metadata used when registering NGINX as a Consul service
  683. nginx['consul_service_meta']={}################################################################################ GitLab Logging#! 文档:https://docs.gitlab.com/omnibus/settings/logs.html###############################################################################
  684. logging['svlogd_size']=200*1024*1024# rotate after 200 MB of log data
  685. logging['svlogd_num']=30# keep 30 rotated log files
  686. logging['svlogd_timeout']=24*60*60# rotate after 24 hours
  687. logging['svlogd_filter']="gzip"# compress logs with gzip
  688. logging['svlogd_udp']=nil# transmit log messages via UDP
  689. logging['svlogd_prefix']=nil# custom prefix for log messages
  690. logging['logrotate_frequency']="daily"# rotate logs daily
  691. logging['logrotate_maxsize']=nil# rotate logs when they grow bigger than size bytes even before the specified time interval (daily, weekly, monthly, or yearly)
  692. logging['logrotate_size']=nil# do not rotate by size by default
  693. logging['logrotate_rotate']=30# keep 30 rotated logs
  694. logging['logrotate_compress']="compress"# see 'man logrotate'
  695. logging['logrotate_method']="copytruncate"# see 'man logrotate'
  696. logging['logrotate_postrotate']=nil# no postrotate command by default
  697. logging['logrotate_dateformat']=nil# use date extensions for rotated files rather than numbers e.g. a value of "-%Y-%m-%d" would give rotated files like production.log-2016-03-09.gz## UDP log forwarding#! 文档:http://docs.gitlab.com/omnibus/settings/logs.html#udp-log-forwarding#! remote host to ship log messages to via UDP
  698. logging['udp_log_shipping_host']=nil#! override the hostname used when logs are shipped via UDP,# by default the system hostname will be used.
  699. logging['udp_log_shipping_hostname']=nil#! remote port to ship log messages to via UDP
  700. logging['udp_log_shipping_port']=514################################################################################ Logrotate#! 文档:https://docs.gitlab.com/omnibus/settings/logs.html#logrotate#! You can disable built in logrotate feature.###############################################################################
  701. logrotate['enable']=true
  702. logrotate['log_directory']="/var/log/gitlab/logrotate"################################################################################ Users and groups accounts#! Disable management of users and groups accounts.#! **Set only if creating accounts manually**#! 文档:https://docs.gitlab.com/omnibus/settings/configuration.html#disable-user-and-group-account-management###############################################################################
  703. manage_accounts['enable']=true################################################################################ Storage directories#! Disable managing storage directories#! 文档:https://docs.gitlab.com/omnibus/settings/configuration.html#disable-storage-directories-management################################################################################! **Set only if the select directories are created manually**
  704. manage_storage_directories['enable']=false
  705. manage_storage_directories['manage_etc']=false################################################################################ Runtime directory#! 文档:https://docs.gitlab.com//omnibus/settings/configuration.html#configuring-runtime-directory###############################################################################
  706. runtime_dir '/run'################################################################################ Git#! Advanced setting for configuring git system settings for omnibus-gitlab#! internal git################################################################################! The format of the Omnibus gitconfig is:#! { "section" => ["subsection = value"] }#! For example:#! { "pack" => ["threads = 1"] }#! For multiple options under one header use array of comma separated values,#! eg.:#! { "receive" => ["fsckObjects = true"], "alias" => ["st = status", "co = checkout"] }
  707. omnibus_gitconfig['system']={}################################################################################ GitLab Pages#! 文档:https://docs.gitlab.com/ee/administration/pages/################################################################################! Define to enable GitLab Pages
  708. pages_external_url "http://pages.example.com/"
  709. gitlab_pages['enable']=false#! Configure to expose GitLab Pages on external IP address, serving the HTTP
  710. gitlab_pages['external_http']=[]#! Configure to expose GitLab Pages on external IP address, serving the HTTPS
  711. gitlab_pages['external_https']=[]#! Configure to expose GitLab Pages on external IP address, serving the HTTPS over PROXYv2
  712. gitlab_pages['external_https_proxyv2']=[]#! Configure cert when using external IP address
  713. gitlab_pages['cert']="/etc/gitlab/ssl/#{Gitlab['gitlab_pages']['domain']}.crt"
  714. gitlab_pages['cert_key']="/etc/gitlab/ssl/#{Gitlab['gitlab_pages']['domain']}.key"#! Configure to use the default list of cipher suites
  715. gitlab_pages['insecure_ciphers']=false#! Configure to enable health check endpoint on GitLab Pages
  716. gitlab_pages['status_uri']="/@status"#! Tune the maximum number of concurrent connections GitLab Pages will handle.#! Default to 0 for unlimited connections.
  717. gitlab_pages['max_connections']=0#! Configure the maximum length of URIs accepted by GitLab Pages#! By default is limited for security reasons. Set 0 for unlimited
  718. gitlab_pages['max_uri_length']=1024#! Setting the propagate_correlation_id to true allows installations behind a reverse proxy#! generate and set a correlation ID to requests sent to GitLab Pages. If a reverse proxy#! sets the header value X-Request-ID, the value will be propagated in the request chain.
  719. gitlab_pages['propagate_correlation_id']=false#! Configure to use JSON structured logging in GitLab Pages
  720. gitlab_pages['log_format']="json"#! Configure verbose logging for GitLab Pages
  721. gitlab_pages['log_verbose']=false#! 使用Sentry报告和记录错误
  722. gitlab_pages['sentry_enabled']=false
  723. gitlab_pages['sentry_dsn']='https://<key>@sentry.io/<project>'
  724. gitlab_pages['sentry_environment']='production'#! Listen for requests forwarded by reverse proxy
  725. gitlab_pages['listen_proxy']="localhost:8090"
  726. gitlab_pages['redirect_http']=true
  727. gitlab_pages['use_http2']=true
  728. gitlab_pages['dir']="/var/opt/gitlab/gitlab-pages"
  729. gitlab_pages['log_directory']="/var/log/gitlab/gitlab-pages"
  730. gitlab_pages['artifacts_server']=true
  731. gitlab_pages['artifacts_server_url']=nil# Defaults to external_url + '/api/v4'
  732. gitlab_pages['artifacts_server_timeout']=10#! Prometheus metrics for Pages 文档:https://gitlab.com/gitlab-org/gitlab-pages/#enable-prometheus-metrics
  733. gitlab_pages['metrics_address']=":9235"#! Specifies the minimum TLS version ("tls1.2" or "tls1.3")
  734. gitlab_pages['tls_min_version']="tls1.2"#! Specifies the maximum TLS version ("tls1.2" or "tls1.3")
  735. gitlab_pages['tls_max_version']="tls1.3"#! Pages access control
  736. gitlab_pages['access_control']=false
  737. gitlab_pages['gitlab_id']=nil# Automatically generated if not present
  738. gitlab_pages['gitlab_secret']=nil# Generated if not present
  739. gitlab_pages['auth_redirect_uri']=nil# Defaults to projects subdomain of pages_external_url and + '/auth'
  740. gitlab_pages['gitlab_server']=nil# Defaults to external_url
  741. gitlab_pages['internal_gitlab_server']=nil# Defaults to gitlab_server, can be changed to internal load balancer
  742. gitlab_pages['auth_secret']=nil# Generated if not present
  743. gitlab_pages['auth_scope']=nil# Defaults to api, can be changed to read_api to increase security
  744. gitlab_pages['auth_cookie_session_timeout']="10m"# Authentication cookie session timeout (truncated to seconds). A zero value means the cookie will be deleted after the browser session ends#! GitLab Pages Server Shutdown Timeout#! Duration ("30s" for 30 seconds)
  745. gitlab_pages['server_shutdown_timeout']="30s"#! GitLab API HTTP client connection timeout
  746. gitlab_pages['gitlab_client_http_timeout']="10s"#! GitLab API JWT Token expiry time
  747. gitlab_pages['gitlab_client_jwt_expiry']="30s"#! 高级设置 for API-based configuration for GitLab Pages.#! The recommended default values are set inside GitLab Pages.#! Should be changed only if absolutely needed.#! The maximum time a domain's configuration is stored in the cache.
  748. gitlab_pages['gitlab_cache_expiry']="600s"#! The interval at which a domain's configuration is set to be due to refresh (default: 60s).
  749. gitlab_pages['gitlab_cache_refresh']="60s"#! The interval at which expired items are removed from the cache (default: 60s).
  750. gitlab_pages['gitlab_cache_cleanup']="60s"#! The maximum time to wait for a response from the GitLab API per request.
  751. gitlab_pages['gitlab_retrieval_timeout']="30s"#! The interval to wait before retrying to resolve a domain's configuration via the GitLab API.
  752. gitlab_pages['gitlab_retrieval_interval']="1s"#! The maximum number of times to retry to resolve a domain's configuration via the API
  753. gitlab_pages['gitlab_retrieval_retries']=3#! Define custom gitlab-pages HTTP headers for the whole instance
  754. gitlab_pages['headers']=[]#! Shared secret used for authentication between Pages and GitLab
  755. gitlab_pages['api_secret_key']=nil# Will be generated if not set. Base64 encoded and exactly 32 bytes long.#! 高级设置 for serving GitLab Pages from zip archives.#! The recommended default values are set inside GitLab Pages.#! Should be changed only if absolutely needed.#! The maximum time an archive will be cached in memory.
  756. gitlab_pages['zip_cache_expiration']="60s"#! Zip archive cache cleaning interval.
  757. gitlab_pages['zip_cache_cleanup']="30s"#! The interval to refresh a cache archive if accessed before expiring.
  758. gitlab_pages['zip_cache_refresh']="30s"#! The maximum amount of time it takes to open a zip archive from the file system or object storage.
  759. gitlab_pages['zip_open_timeout']="30s"#! Zip HTTP Client timeout
  760. gitlab_pages['zip_http_client_timeout']="30m"#! ReadTimeout is the maximum duration for reading the entire request, including the body. A zero or negative value means there will be no timeout.
  761. gitlab_pages['server_read_timeout']="5s"#! ReadHeaderTimeout is the amount of time allowed to read request headers. A zero or negative value means there will be no timeout.
  762. gitlab_pages['server_read_header_timeout']="1s"#! WriteTimeout is the maximum duration before timing out writes of the response. A zero or negative value means there will be no timeout.
  763. gitlab_pages['server_write_timeout']="5m"#! KeepAlive specifies the keep-alive period for network connections accepted by this listener. If zero, keep-alives are enabled if supported by the protocol and operating system. If negative, keep-alives are disabled.
  764. gitlab_pages['server_keep_alive']="15s"#! Enable serving content from disk instead of Object Storage
  765. gitlab_pages['enable_disk']=nil#! Rate-limiting options below work in report-only mode:#! they only count rejected requests, but don't reject them#! enable `FF_ENABLE_RATE_LIMITER=true` environment variable to#! reject requests.#! Rate limits as described in https://docs.gitlab.com/ee/administration/pages/#rate-limits#! Rate limit HTTP requests per second from a single IP, 0 means is disabled
  766. gitlab_pages['rate_limit_source_ip']=50.0#! Rate limit HTTP requests from a single IP, maximum burst allowed per second
  767. gitlab_pages['rate_limit_source_ip_burst']=600#! Rate limit HTTP requests per second to a single domain, 0 means is disabled
  768. gitlab_pages['rate_limit_domain']=0#! Rate limit HTTP requests to a single domain, maximum burst allowed per second
  769. gitlab_pages['rate_limit_domain_burst']=10000#! Rate limit new TLS connections per second from a single IP, 0 means is disabled
  770. gitlab_pages['rate_limit_tls_source_ip']=50.0#! Rate limit new TLS connections from a single IP, maximum burst allowed per second
  771. gitlab_pages['rate_limit_tls_source_ip_burst']=600#!Rate limit new TLS connections per second from to a single domain, 0 means is disabled
  772. gitlab_pages['rate_limit_tls_domain']=0#! Rate limit new TLS connections to a single domain, maximum burst allowed per second
  773. gitlab_pages['rate_limit_tls_domain_burst']=10000#! The maximum size of the _redirects file, in bytes
  774. gitlab_pages['redirects_max_config_size']=65536#! The maximum number of path segments allowed in _redirects rules URLs
  775. gitlab_pages['redirects_max_path_segments']=25#! The maximum number of rules allowed in _redirects
  776. gitlab_pages['redirects_max_rule_count']=1000
  777. gitlab_pages['env_directory']="/opt/gitlab/etc/gitlab-pages/env"
  778. gitlab_pages['env']={'SSL_CERT_DIR'=>"#{node['package']['install-dir']}/embedded/ssl/certs/"}################################################################################ GitLab Pages NGINX###############################################################################
  779. All the settings definedin the "GitLab Nginx" section are also available in
  780. this "GitLab Pages NGINX" section, using the key `pages_nginx`. However,
  781. those settings should be explicitly set. That is, settings given as
  782. `nginx['some_setting']`WILLNOT be automatically replicated as
  783. `pages_nginx['some_setting']`and should be set separately.
  784. Below you can find settings that are exclusive to "GitLab Pages NGINX"
  785. pages_nginx['enable']=true
  786. gitlab_rails['pages_path']="/var/opt/gitlab/gitlab-rails/shared/pages"################################################################################ GitLab CI#! 文档:https://docs.gitlab.com/ee/ci/quick_start/###############################################################################
  787. gitlab_ci['gitlab_ci_all_broken_builds']=true
  788. gitlab_ci['gitlab_ci_add_pusher']=true
  789. gitlab_ci['builds_directory']='/var/opt/gitlab/gitlab-ci/builds'################################################################################ GitLab Kubernetes Agent Server#! 文档:https://gitlab.com/gitlab-org/cluster-integration/gitlab-agent/blob/master/README.md################################################################################! Settings used by the GitLab application
  790. gitlab_rails['gitlab_kas_enabled']=true
  791. gitlab_rails['gitlab_kas_external_url']='ws://gitlab.example.com/-/kubernetes-agent/'
  792. gitlab_rails['gitlab_kas_internal_url']='grpc://localhost:8153'
  793. gitlab_rails['gitlab_kas_external_k8s_proxy_url']='https://gitlab.example.com/-/kubernetes-agent/'#! Enable GitLab KAS
  794. gitlab_kas['enable']=true#! Agent configuration for GitLab KAS
  795. gitlab_kas['agent_configuration_poll_period']=20
  796. gitlab_kas['agent_gitops_poll_period']=20
  797. gitlab_kas['agent_gitops_project_info_cache_ttl']=300
  798. gitlab_kas['agent_gitops_project_info_cache_error_ttl']=60
  799. gitlab_kas['agent_info_cache_ttl']=300
  800. gitlab_kas['agent_info_cache_error_ttl']=60#! Shared secret used for authentication between KAS and GitLab
  801. gitlab_kas['api_secret_key']=nil# Will be generated if not set. Base64 encoded and exactly 32 bytes long.#! Shared secret used for authentication between different KAS instances in a multi-node setup
  802. gitlab_kas['private_api_secret_key']=nil# Will be generated if not set. Base64 encoded and exactly 32 bytes long.#! Listen configuration for GitLab KAS
  803. gitlab_kas['listen_address']='localhost:8150'
  804. gitlab_kas['listen_network']='tcp'
  805. gitlab_kas['listen_websocket']=true
  806. gitlab_kas['certificate_file']="/path/to/certificate.pem"
  807. gitlab_kas['key_file']="/path/to/key.pem"
  808. gitlab_kas['observability_listen_network']='tcp'
  809. gitlab_kas['observability_listen_address']='localhost:8151'
  810. gitlab_kas['internal_api_listen_network']='tcp'
  811. gitlab_kas['internal_api_listen_address']='localhost:8153'
  812. gitlab_kas['internal_api_certificate_file']="/path/to/certificate.pem"
  813. gitlab_kas['internal_api_key_file']="/path/to/key.pem"
  814. gitlab_kas['kubernetes_api_listen_address']='localhost:8154'
  815. gitlab_kas['kubernetes_api_certificate_file']="/path/to/certificate.pem"
  816. gitlab_kas['kubernetes_api_key_file']="/path/to/key.pem"
  817. gitlab_kas['private_api_listen_network']='tcp'
  818. gitlab_kas['private_api_listen_address']='localhost:8155'
  819. gitlab_kas['private_api_certificate_file']="/path/to/certificate.pem"
  820. gitlab_kas['private_api_key_file']="/path/to/key.pem"#! Metrics configuration for GitLab KAS
  821. gitlab_kas['metrics_usage_reporting_period']=60#! Log configuration for GitLab KAS
  822. gitlab_kas['log_level']='info'#! Environment variables for GitLab KAS
  823. gitlab_kas['env']={'SSL_CERT_DIR'=>"/opt/gitlab/embedded/ssl/certs/",# In a multi-node setup, this address MUST be reachable from other KAS instances. In a single-node setup, it can be on localhost for simplicity'OWN_PRIVATE_API_URL'=>'grpc://localhost:8155'}#! 使用Sentry报告和记录错误
  824. gitlab_kas['sentry_dsn']='https://<key>@sentry.io/<project>'
  825. gitlab_kas['sentry_environment']='production'#! Directories for GitLab KAS
  826. gitlab_kas['dir']='/var/opt/gitlab/gitlab-kas'
  827. gitlab_kas['log_directory']='/var/log/gitlab/gitlab-kas'
  828. gitlab_kas['env_directory']='/opt/gitlab/etc/gitlab-kas/env'################################################################################ GitLab Suggested Reviewers (仅限EE)#! 文档:https://docs.gitlab.com/ee/user/project/merge_requests/reviews/#suggested-reviewers################################################################################! Shared secret used for authentication between Suggested Reviewers and GitLab
  829. suggested_reviewers['api_secret_key']=nil# Will be generated if not set. Base64 encoded and exactly 32 bytes long.################################################################################ GitLab Mattermost#! 文档:https://docs.gitlab.com/omnibus/gitlab-mattermost###############################################################################
  830. mattermost_external_url 'http://mattermost.example.com'
  831. mattermost['enable']=false
  832. mattermost['username']='mattermost'
  833. mattermost['group']='mattermost'
  834. mattermost['uid']=nil
  835. mattermost['gid']=nil
  836. mattermost['home']='/var/opt/gitlab/mattermost'
  837. mattermost['database_name']='mattermost_production'
  838. mattermost['env']={'SSL_CERT_DIR'=>"/opt/gitlab/embedded/ssl/certs/"}
  839. mattermost['service_address']="127.0.0.1"
  840. mattermost['service_port']="8065"
  841. mattermost['service_site_url']=nil
  842. mattermost['service_allowed_untrusted_internal_connections']=""
  843. mattermost['service_enable_api_team_deletion']=true
  844. mattermost['team_site_name']="GitLab Mattermost"
  845. mattermost['sql_driver_name']='mysql'
  846. mattermost['sql_data_source']="mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8"
  847. mattermost['log_file_directory']='/var/log/gitlab/mattermost/'
  848. mattermost['gitlab_enable']=false
  849. mattermost['gitlab_id']="12345656"
  850. mattermost['gitlab_secret']="123456789"
  851. mattermost['gitlab_scope']=""
  852. mattermost['gitlab_auth_endpoint']="http://gitlab.example.com/oauth/authorize"
  853. mattermost['gitlab_token_endpoint']="http://gitlab.example.com/oauth/token"
  854. mattermost['gitlab_user_api_endpoint']="http://gitlab.example.com/api/v4/user"
  855. mattermost['file_directory']="/var/opt/gitlab/mattermost/data"
  856. mattermost['plugin_directory']="/var/opt/gitlab/mattermost/plugins"
  857. mattermost['plugin_client_directory']="/var/opt/gitlab/mattermost/client-plugins"################################################################################ Mattermost NGINX###############################################################################
  858. All the settings definedin the "GitLab Nginx" section are also available in
  859. this "Mattermost NGINX" section, using the key `mattermost_nginx`. However,
  860. those settings should be explicitly set. That is, settings given as
  861. `nginx['some_setting']`WILLNOT be automatically replicated as
  862. `mattermost_nginx['some_setting']`and should be set separately.
  863. Below you can find settings that are exclusive to "Mattermost NGINX"
  864. mattermost_nginx['enable']=false
  865. mattermost_nginx['custom_gitlab_mattermost_server_config']="location ^~ /foo-namespace/bar-project/raw/ {\n deny all;\n}\n"
  866. mattermost_nginx['proxy_set_headers']={"Host"=>"$http_host","X-Real-IP"=>"$remote_addr","X-Forwarded-For"=>"$proxy_add_x_forwarded_for","X-Frame-Options"=>"SAMEORIGIN","X-Forwarded-Proto"=>"https","X-Forwarded-Ssl"=>"on","Upgrade"=>"$http_upgrade","Connection"=>"$connection_upgrade"}################################################################################ Registry NGINX###############################################################################
  867. All the settings definedin the "GitLab Nginx" section are also available in
  868. this "Registry NGINX" section, using the key `registry_nginx`. However, those
  869. settings should be explicitly set. That is, settings given as
  870. `nginx['some_setting']`WILLNOT be automatically replicated as
  871. `registry_nginx['some_setting']`and should be set separately.
  872. Below you can find settings that are exclusive to "Registry NGINX"
  873. registry_nginx['enable']=false
  874. registry_nginx['proxy_set_headers']={"Host"=>"$http_host","X-Real-IP"=>"$remote_addr","X-Forwarded-For"=>"$proxy_add_x_forwarded_for","X-Forwarded-Proto"=>"https","X-Forwarded-Ssl"=>"on"}
  875. When the registry is automatically enabled using the same domain as `external_url`,
  876. it listens on this port
  877. registry_nginx['listen_port']=5050################################################################################ Prometheus#! 文档:https://docs.gitlab.com/ee/administration/monitoring/prometheus/#################################################################################! **To enable only Monitoring service in this machine, uncomment##! the line below.**##! 文档:https://docs.gitlab.com/ee/administration/high_availability
  878. monitoring_role['enable']=true
  879. prometheus['enable']=true
  880. prometheus['monitor_kubernetes']=true
  881. prometheus['username']='gitlab-prometheus'
  882. prometheus['group']='gitlab-prometheus'
  883. prometheus['uid']=nil
  884. prometheus['gid']=nil
  885. prometheus['shell']='/bin/sh'
  886. prometheus['home']='/var/opt/gitlab/prometheus'
  887. prometheus['log_directory']='/var/log/gitlab/prometheus'
  888. prometheus['rules_files']=['/var/opt/gitlab/prometheus/rules/*.rules']
  889. prometheus['scrape_interval']=15
  890. prometheus['scrape_timeout']=15
  891. prometheus['external_labels']={}
  892. prometheus['env_directory']='/opt/gitlab/etc/prometheus/env'
  893. prometheus['env']={'SSL_CERT_DIR'=>"/opt/gitlab/embedded/ssl/certs/"}## Custom scrape configs
  894. Prometheus 可以通过 scrape_configs 抓取额外的作业。默认情况下,自动包含omnibus配置支持的所有导出器。
  895. 参见: https://prometheus.io/docs/operating/configuration/#<scrape_config>Example:
  896. prometheus['scrape_configs']=[{'job_name':'example','static_configs'=>['targets'=>['hostname:port'],],},]## 自定义警报管理器配置
  897. 要配置外部警报管理器,请创建一个警报管理器配置。
  898. 参见: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alertmanager_config
  899. prometheus['alertmanagers']=[{'static_configs'=>[{'targets'=>['hostname:port']}]}]## 自定义 Prometheus 标志
  900. prometheus['flags']={'storage.tsdb.path'=>"/var/opt/gitlab/prometheus/data",'storage.tsdb.retention.time'=>"15d",'config.file'=>"/var/opt/gitlab/prometheus/prometheus.yml"}#! 高级设置。只有在绝对必要的情况下才应该更改。
  901. prometheus['listen_address']='localhost:9090'#! Service name used to register Prometheus as a Consul service
  902. prometheus['consul_service_name']='prometheus'#! Semantic metadata used when registering Prometheus as a Consul service
  903. prometheus['consul_service_meta']={}#################################################################################! **Only needed if Prometheus and Rails are not on the same server.**## For example, in a multi-node architecture, Prometheus will be installed on the monitoring node, while Rails will be on the Rails node.## https://docs.gitlab.com/ee/administration/monitoring/prometheus/index.html#using-an-external-prometheus-server## This value should be the address at which Prometheus is available to a GitLab Rails(Puma, Sidekiq) node.###############################################################################
  904. gitlab_rails['prometheus_address']='your.prom:9090'################################################################################ Prometheus 警报管理器###############################################################################
  905. alertmanager['enable']=true
  906. alertmanager['home']='/var/opt/gitlab/alertmanager'
  907. alertmanager['log_directory']='/var/log/gitlab/alertmanager'
  908. alertmanager['admin_email']='admin@example.com'
  909. alertmanager['flags']={'web.listen-address'=>"localhost:9093",'storage.path'=>"/var/opt/gitlab/alertmanager/data",'config.file'=>"/var/opt/gitlab/alertmanager/alertmanager.yml"}
  910. alertmanager['env_directory']='/opt/gitlab/etc/alertmanager/env'
  911. alertmanager['env']={'SSL_CERT_DIR'=>"/opt/gitlab/embedded/ssl/certs/"}#! 高级设置。只有在绝对必要的情况下才应该更改。
  912. alertmanager['listen_address']='localhost:9093'
  913. alertmanager['global']={}################################################################################ Prometheus Node Exporter#! 文档: https://docs.gitlab.com/ee/administration/monitoring/prometheus/node_exporter.html###############################################################################
  914. node_exporter['enable']=true
  915. node_exporter['home']='/var/opt/gitlab/node-exporter'
  916. node_exporter['log_directory']='/var/log/gitlab/node-exporter'
  917. node_exporter['flags']={'collector.textfile.directory'=>"/var/opt/gitlab/node-exporter/textfile_collector"}
  918. node_exporter['env_directory']='/opt/gitlab/etc/node-exporter/env'
  919. node_exporter['env']={'SSL_CERT_DIR'=>"/opt/gitlab/embedded/ssl/certs/"}#! 高级设置。只有在绝对必要的情况下才应该更改。
  920. node_exporter['listen_address']='localhost:9100'#! Service name used to register Node Exporter as a Consul service
  921. node_exporter['consul_service_name']='node-exporter'#! Semantic metadata used when registering Node Exporter as a Consul service
  922. node_exporter['consul_service_meta']={}################################################################################ Prometheus Redis exporter#! 文档:https://docs.gitlab.com/ee/administration/monitoring/prometheus/redis_exporter.html###############################################################################
  923. redis_exporter['enable']=true
  924. redis_exporter['log_directory']='/var/log/gitlab/redis-exporter'
  925. redis_exporter['flags']={'redis.addr'=>"unix:///var/opt/gitlab/redis/redis.socket",}
  926. redis_exporter['env_directory']='/opt/gitlab/etc/redis-exporter/env'
  927. redis_exporter['env']={'SSL_CERT_DIR'=>"/opt/gitlab/embedded/ssl/certs/"}#! 高级设置。只有在绝对必要的情况下才应该更改。
  928. redis_exporter['listen_address']='localhost:9121'#! Service name used to register Redis Exporter as a Consul service
  929. redis_exporter['consul_service_name']='redis-exporter'#! Semantic metadata used when registering Redis Exporter as a Consul service
  930. redis_exporter['consul_service_meta']={}################################################################################ Prometheus Postgres exporter#! 文档:https://docs.gitlab.com/ee/administration/monitoring/prometheus/postgres_exporter.html###############################################################################
  931. postgres_exporter['enable']=true
  932. postgres_exporter['home']='/var/opt/gitlab/postgres-exporter'
  933. postgres_exporter['log_directory']='/var/log/gitlab/postgres-exporter'
  934. postgres_exporter['flags']={}
  935. postgres_exporter['listen_address']='localhost:9187'
  936. postgres_exporter['env_directory']='/opt/gitlab/etc/postgres-exporter/env'
  937. postgres_exporter['env']={'SSL_CERT_DIR'=>"/opt/gitlab/embedded/ssl/certs/"}
  938. postgres_exporter['sslmode']=nil
  939. postgres_exporter['per_table_stats']=false#! Service name used to register Postgres Exporter as a Consul service
  940. postgres_exporter['consul_service_name']='postgres-exporter'#! Semantic metadata used when registering Postgres Exporter as a Consul service
  941. postgres_exporter['consul_service_meta']={}################################################################################ Prometheus PgBouncer exporter (仅限EE)#! 文档: https://docs.gitlab.com/ee/administration/monitoring/prometheus/pgbouncer_exporter.html###############################################################################
  942. pgbouncer_exporter['enable']=false
  943. pgbouncer_exporter['log_directory']="/var/log/gitlab/pgbouncer-exporter"
  944. pgbouncer_exporter['listen_address']='localhost:9188'
  945. pgbouncer_exporter['env_directory']='/opt/gitlab/etc/pgbouncer-exporter/env'
  946. pgbouncer_exporter['env']={'SSL_CERT_DIR'=>"/opt/gitlab/embedded/ssl/certs/"}################################################################################ Prometheus Gitlab exporter#! 文档: https://docs.gitlab.com/ee/administration/monitoring/prometheus/gitlab_exporter.html###############################################################################
  947. gitlab_exporter['enable']=true
  948. gitlab_exporter['log_directory']="/var/log/gitlab/gitlab-exporter"
  949. gitlab_exporter['home']="/var/opt/gitlab/gitlab-exporter"#! 高级设置。只有在绝对必要的情况下才应该更改。
  950. gitlab_exporter['server_name']='webrick'
  951. gitlab_exporter['listen_address']='localhost'
  952. gitlab_exporter['listen_port']='9168'#! TLS settings.
  953. gitlab_exporter['tls_enabled']=false
  954. gitlab_exporter['tls_cert_path']='/etc/gitlab/ssl/gitlab-exporter.crt'
  955. gitlab_exporter['tls_key_path']='/etc/gitlab/ssl/gitlab-exporter.key'#! Prometheus scrape related configs
  956. gitlab_exporter['prometheus_scrape_scheme']='http'
  957. gitlab_exporter['prometheus_scrape_tls_server_name']='localhost'
  958. gitlab_exporter['prometheus_scrape_tls_skip_verification']=false#! Manage gitlab-exporter sidekiq probes. false by default when Sentinels are#! found.
  959. gitlab_exporter['probe_sidekiq']=true#! Manage gitlab-exporter elasticsearch probes. Add authorization header if security#! is enabled.
  960. gitlab_exporter['probe_elasticsearch']=false
  961. gitlab_exporter['elasticsearch_url']='http://localhost:9200'
  962. gitlab_exporter['elasticsearch_authorization']='Basic <yourbase64encodedcredentials>'#! Service name used to register GitLab Exporter as a Consul service
  963. gitlab_exporter['consul_service_name']='gitlab-exporter'#! Semantic metadata used when registering GitLab Exporter as a Consul service
  964. gitlab_exporter['consul_service_meta']={}# To completely disable prometheus, and all of it's exporters, set to false
  965. prometheus_monitoring['enable']=true################################################################################ Grafana Dashboards#! 文档:https://docs.gitlab.com/ee/administration/monitoring/prometheus/#prometheus-as-a-grafana-data-source###############################################################################
  966. grafana['enable']=false
  967. grafana['log_directory']='/var/log/gitlab/grafana'
  968. grafana['home']='/var/opt/gitlab/grafana'
  969. grafana['admin_password']='admin'
  970. grafana['allow_user_sign_up']=false
  971. grafana['basic_auth_enabled']=false
  972. grafana['disable_login_form']=true
  973. grafana['gitlab_application_id']='GITLAB_APPLICATION_ID'
  974. grafana['gitlab_secret']='GITLAB_SECRET'
  975. grafana['env_directory']='/opt/gitlab/etc/grafana/env'
  976. grafana['allowed_groups']=[]
  977. grafana['gitlab_auth_sign_up']=true
  978. grafana['env']={'SSL_CERT_DIR'=>"#{node['package']['install-dir']}/embedded/ssl/certs/"}
  979. grafana['metrics_enabled']=false
  980. grafana['metrics_basic_auth_username']='grafana_metrics'# default: nil
  981. grafana['metrics_basic_auth_password']='please_set_a_unique_password'# default: nil
  982. grafana['alerting_enabled']=false## SMTP Configuration# # 参见: http://docs.grafana.org/administration/configuration/#smtp
  983. grafana['smtp']={'enabled'=>true,'host'=>'localhost:25','user'=>nil,'password'=>nil,'cert_file'=>nil,'key_file'=>nil,'skip_verify'=>false,'from_address'=>'admin@grafana.localhost','from_name'=>'Grafana','ehlo_identity'=>'dashboard.example.com','startTLS_policy'=>nil}# Grafana使用报告默认为 gitlab_rails['usage_ping_enabled']
  984. grafana['reporting_enabled']=true## Dashboards# # 参见: http://docs.grafana.org/administration/provisioning/#dashboards# # 注意:设置此项将覆盖默认值。
  985. grafana['dashboards']=[{'name'=>'GitLab Omnibus','orgId'=>1,'folder'=>'GitLab Omnibus','type'=>'file','disableDeletion'=>true,'updateIntervalSeconds'=>600,'options'=>{'path'=>'/opt/gitlab/embedded/service/grafana-dashboards',}}]## 数据源# # 参见:http://docs.grafana.org/administration/provisioning/#example-datasource-config-file# # 注意:设置此项将覆盖默认值。
  986. grafana['datasources']=[{'name'=>'GitLab Omnibus','type'=>'prometheus','access'=>'proxy','url'=>'http://localhost:9090'}]#! 高级设置。只有在绝对必要的情况下才应该更改。
  987. grafana['http_addr']='localhost'
  988. grafana['http_port']=3000################################################################################ Gitaly#! 文档:################################################################################ # gitaly['enable'] 选项用于集群部署,# 参见 https://docs.gitlab.com/ee/administration/gitaly/index.html .
  989. gitaly['enable']=true
  990. gitaly['dir']="/var/opt/gitlab/gitaly"
  991. gitaly['log_directory']="/var/log/gitlab/gitaly"
  992. gitaly['bin_path']="/opt/gitlab/embedded/bin/gitaly"
  993. gitaly['env_directory']="/opt/gitlab/etc/gitaly/env"
  994. gitaly['env']={'PATH'=>"/opt/gitlab/bin:/opt/gitlab/embedded/bin:/bin:/usr/bin",'HOME'=>'/var/opt/gitlab','TZ'=>':/etc/localtime','PYTHONPATH'=>"/opt/gitlab/embedded/lib/python3.9/site-packages",'ICU_DATA'=>"/opt/gitlab/embedded/share/icu/current",'SSL_CERT_DIR'=>"/opt/gitlab/embedded/ssl/certs/",'WRAPPER_JSON_LOGGING'=>true}
  995. gitaly['runtime_dir']="/var/opt/gitlab/gitaly/run"
  996. gitaly['socket_path']="/var/opt/gitlab/gitaly/gitaly.socket"
  997. gitaly['listen_addr']="localhost:8075"
  998. gitaly['tls_listen_addr']="localhost:9075"
  999. gitaly['certificate_path']="/var/opt/gitlab/gitaly/certificate.pem"
  1000. gitaly['key_path']="/var/opt/gitlab/gitaly/key.pem"
  1001. gitaly['gpg_signing_key_path']="/var/opt/gitlab/gitaly/signing_key.gpg"
  1002. gitaly['prometheus_listen_addr']="localhost:9236"
  1003. gitaly['logging_level']="warn"
  1004. gitaly['logging_format']="json"
  1005. gitaly['logging_sentry_dsn']="https://<key>:<secret>@sentry.io/<project>"
  1006. gitaly['logging_ruby_sentry_dsn']="https://<key>:<secret>@sentry.io/<project>"
  1007. gitaly['logging_sentry_environment']="production"
  1008. gitaly['prometheus_grpc_latency_buckets']="[0.001, 0.005, 0.025, 0.1, 0.5, 1.0, 10.0, 30.0, 60.0, 300.0, 1500.0]"
  1009. gitaly['auth_token']='<secret>'
  1010. gitaly['auth_transitioning']=false# When true, auth is logged to Prometheus but NOT enforced
  1011. gitaly['graceful_restart_timeout']='1m'# Grace time for a gitaly process to finish ongoing requests
  1012. gitaly['git_catfile_cache_size']=100# Number of 'git cat-file' processes kept around for re-use
  1013. gitaly['git_bin_path']="/opt/gitlab/embedded/bin/git"# A custom path for the 'git' executable
  1014. gitaly['use_bundled_git']=true# Whether to use bundled Git.
  1015. gitaly['open_files_ulimit']=15000# Maximum number of open files allowed for the gitaly process
  1016. gitaly['ruby_max_rss']=300000000# RSS threshold in bytes for triggering a gitaly-ruby restart
  1017. gitaly['ruby_graceful_restart_timeout']='10m'# Grace time for a gitaly-ruby process to finish ongoing requests
  1018. gitaly['ruby_restart_delay']='5m'# Period of sustained high RSS that needs to be observed before restarting gitaly-ruby
  1019. gitaly['ruby_num_workers']=3# Number of gitaly-ruby worker processes. Minimum 2, default 2.
  1020. gitaly['concurrency']=[{'rpc'=>"/gitaly.SmartHTTPService/PostReceivePack",'max_per_repo'=>20},{'rpc'=>"/gitaly.SSHService/SSHUploadPack",'max_per_repo'=>5}]
  1021. gitaly['rate_limiting']=[{'rpc'=>"/gitaly.SmartHTTPService/PostReceivePack",'interval'=>'1m','burst'=>10},{'rpc'=>"/gitaly.SSHService/SSHUploadPack",'interval'=>'1m','burst'=>5}]# Gitaly知道为生成的Git命令自动设置所需的默认配置。因此,这里不需要配置任何东西,除非在非常特殊的情况下,例如,您必须调整特定的性能相关设置或启用调试工具。一般来说,设置Git配置是不安全的,它可能会以Gitaly无法预料的方式改变Git输出。
  1022. gitaly['gitconfig']=[{'section':'pack','key':'threads','value':'4'}{'section':'http','subsection':'http://example.com','key':'proxy','value':'http://example.proxy.com'}]
  1023. gitaly['daily_maintenance_start_hour']=22
  1024. gitaly['daily_maintenance_start_minute']=30
  1025. gitaly['daily_maintenance_duration']='30m'
  1026. gitaly['daily_maintenance_storages']=["default"]
  1027. gitaly['daily_maintenance_disabled']=false
  1028. gitaly['cgroups_mountpoint']='/sys/fs/cgroup'
  1029. gitaly['cgroups_hierarchy_root']='gitaly'
  1030. gitaly['cgroups_memory_bytes']=1048576
  1031. gitaly['cgroups_cpu_shares']=512
  1032. gitaly['cgroups_repositories_count']=1000
  1033. gitaly['cgroups_repositories_memory_bytes']=12884901888
  1034. gitaly['cgroups_repositories_cpu_shares']=128
  1035. gitaly['pack_objects_cache_enabled']=true
  1036. gitaly['pack_objects_cache_dir']='/var/opt/gitlab/git-data/repositories/+gitaly/PackObjectsCache'
  1037. gitaly['pack_objects_cache_max_age']='5m'
  1038. gitaly['custom_hooks_dir']="/var/opt/gitlab/gitaly/custom_hooks"#! Service name used to register Gitaly as a Consul service
  1039. gitaly['consul_service_name']='gitaly'#! Semantic metadata used when registering Gitaly as a Consul service
  1040. gitaly['consul_service_meta']={}################################################################################ Praefect#! 文档:https://gitlab.com/gitlab-org/gitaly/blob/master/doc/design_ha.md###############################################################################
  1041. praefect['enable']=false
  1042. praefect['dir']="/var/opt/gitlab/praefect"
  1043. praefect['log_directory']="/var/log/gitlab/praefect"
  1044. praefect['env_directory']="/opt/gitlab/etc/praefect/env"
  1045. praefect['env']={'SSL_CERT_DIR'=>"/opt/gitlab/embedded/ssl/certs/",'GITALY_PID_FILE'=>"/var/opt/gitlab/praefect/praefect.pid",'WRAPPER_JSON_LOGGING'=>true}
  1046. praefect['wrapper_path']="/opt/gitlab/embedded/bin/gitaly-wrapper"
  1047. praefect['failover_enabled']=true
  1048. praefect['failover_timeout']="10s"
  1049. praefect['auth_token']=""
  1050. praefect['auth_transitioning']=false
  1051. praefect['listen_addr']="localhost:2305"
  1052. praefect['tls_listen_addr']="localhost:3305"
  1053. praefect['certificate_path']="/var/opt/gitlab/prafect/certificate.pem"
  1054. praefect['key_path']="/var/opt/gitlab/prafect/key.pem"
  1055. praefect['prometheus_listen_addr']="localhost:9652"
  1056. praefect['prometheus_grpc_latency_buckets']="[0.001, 0.005, 0.025, 0.1, 0.5, 1.0, 10.0, 30.0, 60.0, 300.0, 1500.0]"
  1057. praefect['logging_level']="warn"
  1058. praefect['logging_format']="json"
  1059. praefect['virtual_storages']={'default'=>{'default_replication_factor'=>3,'nodes'=>{'praefect-internal-0'=>{'address'=>'tcp://10.23.56.78:8075','token'=>'abc123'},'praefect-internal-1'=>{'address'=>'tcp://10.76.23.31:8075','token'=>'xyz456'}}},'alternative'=>{'nodes'=>{'praefect-internal-2'=>{'address'=>'tcp://10.34.1.16:8075','token'=>'abc321'},'praefect-internal-3'=>{'address'=>'tcp://10.23.18.6:8075','token'=>'xyz890'}}}}
  1060. praefect['background_verification_verification_interval']="72h"
  1061. praefect['background_verification_delete_invalid_records']=false
  1062. praefect['sentry_dsn']="https://<key>:<secret>@sentry.io/<project>"
  1063. praefect['sentry_environment']="production"
  1064. praefect['auto_migrate']=true
  1065. praefect['database_host']='postgres.external'
  1066. praefect['database_port']=6432
  1067. praefect['database_user']='praefect'
  1068. praefect['database_password']='secret'
  1069. praefect['database_dbname']='praefect_production'
  1070. praefect['database_sslmode']='disable'
  1071. praefect['database_sslcert']='/path/to/client-cert'
  1072. praefect['database_sslkey']='/path/to/client-key'
  1073. praefect['database_sslrootcert']='/path/to/rootcert'
  1074. praefect['reconciliation_scheduling_interval']='5m'
  1075. praefect['reconciliation_histogram_buckets']='[0.001, 0.005, 0.025, 0.1, 0.5, 1.0, 10.0]'
  1076. praefect['database_direct_host']='postgres.internal'
  1077. praefect['database_direct_port']=5432
  1078. praefect['database_direct_user']='praefect'
  1079. praefect['database_direct_password']='secret'
  1080. praefect['database_direct_dbname']='praefect_production_direct'
  1081. praefect['database_direct_sslmode']='disable'
  1082. praefect['database_direct_sslcert']='/path/to/client-cert'
  1083. praefect['database_direct_sslkey']='/path/to/client-key'
  1084. praefect['database_direct_sslrootcert']='/path/to/rootcert'
  1085. praefect['graceful_stop_timeout']='1m'#! Service name used to register Praefect as a Consul service
  1086. praefect['consul_service_name']='praefect'#! Semantic metadata used when registering Praefect as a Consul service
  1087. praefect['consul_service_meta']={}################################################################################ 存储检查###############################################################################
  1088. storage_check['enable']=false
  1089. storage_check['target']='unix:///var/opt/gitlab/gitlab-rails/sockets/gitlab.socket'
  1090. storage_check['log_directory']='/var/log/gitlab/storage-check'################################################################################ 让我们加密集成###############################################################################
  1091. letsencrypt['enable']=nil
  1092. letsencrypt['contact_emails']=[]# 这应该是要添加为联系人的电子邮件地址的数组
  1093. letsencrypt['group']='root'
  1094. letsencrypt['key_size']=2048
  1095. letsencrypt['owner']='root'
  1096. letsencrypt['wwwroot']='/var/opt/gitlab/nginx/www'# 参见 http://docs.gitlab.com/omnibus/settings/ssl.html#automatic-renewal 获取有关这些设置的更多信息
  1097. letsencrypt['auto_renew']=true
  1098. letsencrypt['auto_renew_hour']=0
  1099. letsencrypt['auto_renew_minute']=nil# 如果指定,应为数字或cron表达式。
  1100. letsencrypt['auto_renew_day_of_month']="*/4"
  1101. letsencrypt['auto_renew_log_directory']='/var/log/gitlab/lets-encrypt'#! 关闭自动初始化系统检测。跳过非docker容器中的初始化检测。建议不要换。
  1102. package['detect_init']=true#! 试图修改内核参数。要在相关文件系统为只读的容器中跳过这一步,请将该值设置为false。
  1103. package['modify_kernel_parameters']=true#! Specify maximum number of tasks that can be created by the systemd unit#! Will be populated as TasksMax value to the unit file if user is on a systemd#! version that supports it (>= 227). Will be a no-op if user is not on systemd.
  1104. package['systemd_tasks_max']=4915#! Settings to configure order of GitLab's systemd unit.#! Note: We do not recommend changing these values unless absolutely necessary
  1105. package['systemd_after']='multi-user.target'
  1106. package['systemd_wanted_by']='multi-user.target'############################################################################################################################################################### 仅GitLab EE的配置设置 ################################################################################################################################################################################################################################################ 辅助cron作业仅适用于GitLab EE###############################################################################
  1107. gitlab_rails['geo_repository_sync_worker_cron']="*/5 * * * *"
  1108. gitlab_rails['geo_secondary_registry_consistency_worker']="* * * * *"
  1109. gitlab_rails['geo_secondary_usage_data_cron_worker']="0 0 * * 0"
  1110. gitlab_rails['geo_prune_event_log_worker_cron']="*/5 * * * *"
  1111. gitlab_rails['geo_repository_verification_primary_batch_worker_cron']="*/5 * * * *"
  1112. gitlab_rails['geo_repository_verification_secondary_scheduler_worker_cron']="*/5 * * * *"
  1113. gitlab_rails['ldap_sync_worker_cron']="30 1 * * *"
  1114. gitlab_rails['ldap_group_sync_worker_cron']="0 * * * *"
  1115. gitlab_rails['historical_data_worker_cron']="0 12 * * *"
  1116. gitlab_rails['elastic_index_bulk_cron']="*/1 * * * *"
  1117. gitlab_rails['analytics_devops_adoption_create_all_snapshots_worker_cron']="0 4 * * 0"
  1118. gitlab_rails['ci_runners_stale_group_runners_prune_worker_cron']="30 * * * *"################################################################################ 包存储库#! 文档: https://docs.gitlab.com/ee/integration/kerberos.html#http-git-access###############################################################################
  1119. gitlab_rails['kerberos_enabled']=true
  1120. gitlab_rails['kerberos_keytab']=/etc/http.keytab
  1121. gitlab_rails['kerberos_service_principal_name']=HTTP/gitlab.example.com@EXAMPLE.COM
  1122. gitlab_rails['kerberos_simple_ldap_linking_allowed_realms']=['example.com','kerberos.example.com']
  1123. gitlab_rails['kerberos_use_dedicated_port']=true
  1124. gitlab_rails['kerberos_port']=8443
  1125. gitlab_rails['kerberos_https']=true################################################################################ 包存储库#! 文档: https://docs.gitlab.com/ee/administration/packages/###############################################################################
  1126. gitlab_rails['packages_enabled']=true
  1127. gitlab_rails['packages_storage_path']="/var/opt/gitlab/gitlab-rails/shared/packages"
  1128. gitlab_rails['packages_object_store_enabled']=false
  1129. gitlab_rails['packages_object_store_proxy_download']=false
  1130. gitlab_rails['packages_object_store_remote_directory']="packages"
  1131. gitlab_rails['packages_object_store_connection']={'provider'=>'AWS','region'=>'eu-west-1','aws_access_key_id'=>'AWS_ACCESS_KEY_ID','aws_secret_access_key'=>'AWS_SECRET_ACCESS_KEY',# # 以下选项配置S3兼容主机,而不是AWS# 'host' => 's3.amazonaws.com',# 'aws_signature_version' => 4, # 用于创建签名的URL。如果提供程序不支持v4,则设置为2。# 'endpoint' => 'https://s3.amazonaws.com', # 默认:nil -适用于S3标准服务,如数字海洋空间# 'path_style' => false # Use 'host/bucket_name/object' instead of 'bucket_name.host/object'}################################################################################ 依赖代理#! 文档:https://docs.gitlab.com/ee/administration/packages/dependency_proxy.html###############################################################################
  1132. gitlab_rails['dependency_proxy_enabled']=true
  1133. gitlab_rails['dependency_proxy_storage_path']="/var/opt/gitlab/gitlab-rails/shared/dependency_proxy"
  1134. gitlab_rails['dependency_proxy_object_store_enabled']=false
  1135. gitlab_rails['dependency_proxy_object_store_proxy_download']=false
  1136. gitlab_rails['dependency_proxy_object_store_remote_directory']="dependency_proxy"
  1137. gitlab_rails['dependency_proxy_object_store_connection']={'provider'=>'AWS','region'=>'eu-west-1','aws_access_key_id'=>'AWS_ACCESS_KEY_ID','aws_secret_access_key'=>'AWS_SECRET_ACCESS_KEY',# # 以下选项配置S3兼容主机,而不是AWS# 'host' => 's3.amazonaws.com',# 'aws_signature_version' => 4, # 用于创建签名的URL。如果提供程序不支持v4,则设置为2。# 'endpoint' => 'https://s3.amazonaws.com', # 默认:nil -适用于S3标准服务,如数字海洋空间# 'path_style' => false # Use 'host/bucket_name/object' instead of 'bucket_name.host/object'}################################################################################ GitLab Sentinel (仅限EE)#! 文档:http://docs.gitlab.com/ce/administration/high_availability/redis.html#high-availability-with-sentinel################################################################################! **在继续之前,请确保您配置了上述所有 redis['master_*'] 键。**#! 要在这台机器上启用Sentinel并禁用所有其他服务,请取消对下面一行的注释(如果您启用了Redis角色,它将保留它)。#! 文档:https://docs.gitlab.com/ee/administration/high_availability/redis.html
  1138. redis_sentinel_role['enable']=true
  1139. sentinel['enable']=true#! 绑定到所有接口,取消注释以指定一个IP并绑定到单个IP
  1140. sentinel['bind']='0.0.0.0'#! 取消注释以更改默认端口
  1141. sentinel['port']=26379### 支持在 Docker 或 NAT 环境中运行 sentinels####! 文档:https://redis.io/topics/sentinel#sentinel-docker-nat-and-possible-issues# 在标准情况下,Sentinel将在与Redis相同的网络服务中运行,因此Redis和Sentinel将使用相同的IP地址# 仅当需要为Sentinel宣布不同于Redis的IP服务时,才定义这些值
  1142. sentinel['announce_ip']=nil# 如果未定义,其值将取自 redis['announce_ip'] ,如果不存在,则为 nil
  1143. sentinel['announce_port']=nil# 如果未定义,其值将取自 sentinel['port'] 或nil(如果 redis['announce_ip'] 不存在)#! quorum 必须反映启动故障转移所需的投票人数。#! **值不能大于 sentinels 数量。**#! quorum 可用于以两种方式调整 Sentinel:#! 1. 如果 quorum 被设置为小于我们部署的大多数 Sentinels 的值,我们基本上是使 Sentinels 对主节点故障更敏感,一旦即使只有少数 Sentinels 不再能够与主节点通信,就会触发故障转移。#! 2. 如果 quorum 设置为大于多数Sentinel的值,我们将使Sentinel仅在有大量(大于多数)连接良好的Sentinel同意主服务器关闭时才能够进行故障转移。
  1144. sentinel['quorum']=1## x毫秒后,考虑无响应的服务器关闭。
  1145. sentinel['down_after_milliseconds']=10000## 以毫秒为单位指定故障转移超时。#! 它有多种用途:#!#! - 在给定的Sentinel已经针对同一主服务器尝试了前一次故障转移之后,重新启动故障转移所需的时间是#! 故障转移超时的两倍。#!#! - 根据Sentinel当前配置,副本复制到错误的主服务器,然后被强制复制到正确的主服务器所需的时间正#! 好是故障转移超时(从Sentinel检测到错误配置的时刻开始计算)。#!#! - 取消已在进行但未产生任何配置更改的故障切换所需的时间(提升的复制副本尚未确认任何人的复制副本)。#!#! - 正在进行的故障转移等待所有副本重新配置为新主服务器副本的最长时间。#! 然而,即使在这个时间之后,副本也将被哨兵重新配置,但是不具有指定的精确的并行同步进程。
  1146. sentinel['failover_timeout']=60000## Sentinel TLS 设置##! 要在TLS上运行Sentinel,请指定以下设置的值
  1147. sentinel['tls_port']=nil
  1148. sentinel['tls_cert_file']=nil
  1149. sentinel['tls_key_file']=nil##! 其他与TLS相关的可选设置
  1150. sentinel['tls_dh_params_file']=nil
  1151. sentinel['tls_ca_cert_dir']='/opt/gitlab/embedded/ssl/certs/'
  1152. sentinel['tls_ca_cert_file']='/opt/gitlab/embedded/ssl/certs/cacert.pem'
  1153. sentinel['tls_auth_clients']='optional'
  1154. sentinel['tls_replication']=nil
  1155. sentinel['tls_cluster']=nil
  1156. sentinel['tls_protocols']=nil
  1157. sentinel['tls_ciphers']=nil
  1158. sentinel['tls_ciphersuites']=nil
  1159. sentinel['tls_prefer_server_ciphers']=nil
  1160. sentinel['tls_session_caching']=nil
  1161. sentinel['tls_session_cache_size']=nil
  1162. sentinel['tls_session_cache_timeout']=nil## Sentinel主机名支持##! 启用后,Redis将利用主机名支持##! 一般来说,这不需要更改,因为我们是根据 `redis['announce_ip']` 提供的输入来确定的##! * 当提供了完全限定的主机名时,这被配置为 `true` ##! * 当提供了IP地址时,这被配置为`false`
  1163. sentinel['use_hostnames']=<calculated>################################################################################ 附加数据库设置(仅限EE)#! 文档: https://docs.gitlab.com/ee/administration/database_load_balancing.html###############################################################################
  1164. gitlab_rails['db_load_balancing']={'hosts'=>['secondary1.example.com']}################################################################################ GitLab Geo#! 文档: https://docs.gitlab.com/ee/gitlab-geo################################################################################! Geo 角色 'geo_primary_role' 和 'geo_secondary_role' 与其他角色一起设置在上面。 #! 参见:https://docs.gitlab.com/omnibus/roles/index.html#roles 获取跟多信息# 这是一个可选的标识符,Geo节点可以使用它来标识自己。# 例如,如果两个辅助节点的external_url相同,则必须为这些辅助节点指定唯一的Geo节点名称。# 如果为空,则默认为 external_url。
  1165. gitlab_rails['geo_node_name']=nil
  1166. gitlab_rails['geo_registry_replication_enabled']=true
  1167. gitlab_rails['geo_registry_replication_primary_api_url']='https://example.com:5050'################################################################################ GitLab Geo Secondary (仅限EE)###############################################################################
  1168. geo_secondary['auto_migrate']=true
  1169. geo_secondary['db_adapter']="postgresql"
  1170. geo_secondary['db_encoding']="unicode"
  1171. geo_secondary['db_collation']=nil
  1172. geo_secondary['db_database']="gitlabhq_geo_production"
  1173. geo_secondary['db_username']="gitlab_geo"
  1174. geo_secondary['db_password']=nil
  1175. geo_secondary['db_host']="/var/opt/gitlab/geo-postgresql"
  1176. geo_secondary['db_port']=5431
  1177. geo_secondary['db_socket']=nil
  1178. geo_secondary['db_sslmode']=nil
  1179. geo_secondary['db_sslcompression']=0
  1180. geo_secondary['db_sslrootcert']=nil
  1181. geo_secondary['db_sslca']=nil
  1182. geo_secondary['db_prepared_statements']=false
  1183. geo_secondary['db_database_tasks']=true################################################################################ GitLab Geo Secondary Tracking Database (仅限EE)###############################################################################
  1184. geo_postgresql['enable']=false
  1185. geo_postgresql['ha']=false
  1186. geo_postgresql['dir']='/var/opt/gitlab/geo-postgresql'
  1187. geo_postgresql['pgbouncer_user']=nil
  1188. geo_postgresql['pgbouncer_user_password']=nil#! `SQL_USER_PASSWORD_HASH` can be generated using the command `gitlab-ctl pg-password-md5 gitlab`
  1189. geo_postgresql['sql_user_password']='SQL_USER_PASSWORD_HASH'
  1190. geo_postgresql['log_directory']='/var/log/gitlab/geo-postgresql'#! Automatically restart PostgreSQL service when version changes.
  1191. geo_postgresql['auto_restart_on_version_change']=true################################################################################ GitLab Geo Log Cursor Daemon (仅限EE)###############################################################################
  1192. geo_logcursor['log_directory']='/var/log/gitlab/geo-logcursor'################################################################################ Unleash#! These settings are for GitLab internal use.#! They are used to control feature flags during GitLab development.#! 文档:https://docs.gitlab.com/ee/development/feature_flags###############################################################################
  1193. gitlab_rails['feature_flags_unleash_enabled']=false
  1194. gitlab_rails['feature_flags_unleash_url']=nil
  1195. gitlab_rails['feature_flags_unleash_app_name']=nil
  1196. gitlab_rails['feature_flags_unleash_instance_id']=nil################################################################################ Pgbouncer (仅限EE)# 参见 [GitLab PgBouncer documentation](http://docs.gitlab.com/omnibus/settings/database.html#enabling-pgbouncer-ee-only)# 参见[PgBouncer 页面](https://pgbouncer.github.io/config.html) for details###############################################################################
  1197. pgbouncer['enable']=false
  1198. pgbouncer['log_directory']='/var/log/gitlab/pgbouncer'
  1199. pgbouncer['data_directory']='/var/opt/gitlab/pgbouncer'
  1200. pgbouncer['env_directory']='/opt/gitlab/etc/pgbouncer/env'
  1201. pgbouncer['env']={'SSL_CERT_DIR'=>"/opt/gitlab/embedded/ssl/certs/"}
  1202. pgbouncer['listen_addr']='0.0.0.0'
  1203. pgbouncer['listen_port']='6432'
  1204. pgbouncer['pool_mode']='transaction'
  1205. pgbouncer['server_reset_query']='DISCARD ALL'
  1206. pgbouncer['application_name_add_host']='1'
  1207. pgbouncer['max_client_conn']='2048'
  1208. pgbouncer['default_pool_size']='100'
  1209. pgbouncer['min_pool_size']='0'
  1210. pgbouncer['reserve_pool_size']='5'
  1211. pgbouncer['reserve_pool_timeout']='5.0'
  1212. pgbouncer['server_round_robin']='0'
  1213. pgbouncer['log_connections']='0'
  1214. pgbouncer['server_idle_timeout']='30'
  1215. pgbouncer['dns_max_ttl']='15.0'
  1216. pgbouncer['dns_zone_check_period']='0'
  1217. pgbouncer['dns_nxdomain_ttl']='15.0'
  1218. pgbouncer['admin_users']=%w(gitlab-psql postgres pgbouncer)
  1219. pgbouncer['stats_users']=%w(gitlab-psql postgres pgbouncer)
  1220. pgbouncer['ignore_startup_parameters']='extra_float_digits'
  1221. pgbouncer['databases']={DATABASE_NAME:{host:HOSTNAME,port:PORTuser:USERNAME,password:PASSWORD##! 使用 `echo -n '$password + $username' | md5sum` 生成此消息}...}
  1222. pgbouncer['logfile']=nil
  1223. pgbouncer['unix_socket_dir']=nil
  1224. pgbouncer['unix_socket_mode']='0777'
  1225. pgbouncer['unix_socket_group']=nil
  1226. pgbouncer['auth_type']='md5'
  1227. pgbouncer['auth_hba_file']=nil
  1228. pgbouncer['auth_query']='SELECT username, password FROM public.pg_shadow_lookup($1)'
  1229. pgbouncer['users']={USERNAME:{'password':MD5_PASSWORD_HASH,}}
  1230. postgresql['pgbouncer_user']=nil
  1231. postgresql['pgbouncer_user_password']=nil
  1232. pgbouncer['server_reset_query_always']=0
  1233. pgbouncer['server_check_query']='select 1'
  1234. pgbouncer['server_check_delay']=30
  1235. pgbouncer['max_db_connections']=nil
  1236. pgbouncer['max_user_connections']=nil
  1237. pgbouncer['syslog']=0
  1238. pgbouncer['syslog_facility']='daemon'
  1239. pgbouncer['syslog_ident']='pgbouncer'
  1240. pgbouncer['log_disconnections']=1
  1241. pgbouncer['log_pooler_errors']=1
  1242. pgbouncer['stats_period']=60
  1243. pgbouncer['verbose']=0
  1244. pgbouncer['server_lifetime']=3600
  1245. pgbouncer['server_connect_timeout']=15
  1246. pgbouncer['server_login_retry']=15
  1247. pgbouncer['query_timeout']=0
  1248. pgbouncer['query_wait_timeout']=120
  1249. pgbouncer['client_idle_timeout']=0
  1250. pgbouncer['client_login_timeout']=60
  1251. pgbouncer['autodb_idle_timeout']=3600
  1252. pgbouncer['suspend_timeout']=10
  1253. pgbouncer['idle_transaction_timeout']=0
  1254. pgbouncer['pkt_buf']=4096
  1255. pgbouncer['listen_backlog']=128
  1256. pgbouncer['sbuf_loopcnt']=5
  1257. pgbouncer['max_packet_size']=2147483647
  1258. pgbouncer['tcp_defer_accept']=0
  1259. pgbouncer['tcp_socket_buffer']=0
  1260. pgbouncer['tcp_keepalive']=1
  1261. pgbouncer['tcp_keepcnt']=0
  1262. pgbouncer['tcp_keepidle']=0
  1263. pgbouncer['tcp_keepintvl']=0
  1264. pgbouncer['disable_pqexec']=0# Pgbouncer客户端TLS选项
  1265. pgbouncer['client_tls_sslmode']='disable'
  1266. pgbouncer['client_tls_ca_file']=nil
  1267. pgbouncer['client_tls_key_file']=nil
  1268. pgbouncer['client_tls_cert_file']=nil
  1269. pgbouncer['client_tls_protocols']='all'
  1270. pgbouncer['client_tls_dheparams']='auto'
  1271. pgbouncer['client_tls_ecdhcurve']='auto'# Pgbouncer server TLS options
  1272. pgbouncer['server_tls_sslmode']='disable'
  1273. pgbouncer['server_tls_ca_file']=nil
  1274. pgbouncer['server_tls_key_file']=nil
  1275. pgbouncer['server_tls_cert_file']=nil
  1276. pgbouncer['server_tls_protocols']='all'
  1277. pgbouncer['server_tls_ciphers']='fast'################################################################################ Patroni (仅EE)###############################################################################
  1278. patroni['enable']=false
  1279. patroni['dir']='/var/opt/gitlab/patroni'
  1280. patroni['ctl_command']='/opt/gitlab/embedded/bin/patronictl'# Patroni 动态配置设置
  1281. patroni['loop_wait']=10
  1282. patroni['ttl']=30
  1283. patroni['retry_timeout']=10
  1284. patroni['maximum_lag_on_failover']=1_048_576
  1285. patroni['max_timelines_history']=0
  1286. patroni['master_start_timeout']=300
  1287. patroni['use_pg_rewind']=true
  1288. patroni['remove_data_directory_on_rewind_failure']=false
  1289. patroni['remove_data_directory_on_diverged_timelines']=false
  1290. patroni['use_slots']=true
  1291. patroni['replication_password']=nil
  1292. patroni['replication_slots']={}
  1293. patroni['callbacks']={}
  1294. patroni['recovery_conf']={}
  1295. patroni['tags']={}# 备用群集复制设置
  1296. patroni['standby_cluster']['enable']=false
  1297. patroni['standby_cluster']['host']=nil
  1298. patroni['standby_cluster']['port']=5432
  1299. patroni['standby_cluster']['primary_slot_name']=nil# Global/Universal 设置
  1300. patroni['scope']='gitlab-postgresql-ha'
  1301. patroni['name']=nil# 日志设置
  1302. patroni['log_directory']='/var/log/gitlab/patroni'
  1303. patroni['log_level']='INFO'# Consul specific settings
  1304. patroni['consul']['url']='http://127.0.0.1:8500'
  1305. patroni['consul']['service_check_interval']='10s'
  1306. patroni['consul']['register_service']=true
  1307. patroni['consul']['checks']=[]# PostgreSQL 配置覆盖
  1308. patroni['postgresql']['hot_standby']='on'# 以下内容必须在所有节点上保持相同的值。# 未指定使用PostgreSQL的默认值。
  1309. patroni['postgresql']['wal_level']='replica'
  1310. patroni['postgresql']['wal_log_hints']='on'
  1311. patroni['postgresql']['max_worker_processes']=8
  1312. patroni['postgresql']['max_locks_per_transaction']=64
  1313. patroni['postgresql']['max_connections']=400
  1314. patroni['postgresql']['checkpoint_timeout']=30# 以下内容可以在所有节点上保存不同的值。# 未指定使用PostgreSQL的默认值。
  1315. patroni['postgresql']['wal_keep_segments']=8
  1316. patroni['postgresql']['max_wal_senders']=5
  1317. patroni['postgresql']['max_replication_slots']=5# 用于流式复制的永久复制插槽
  1318. patroni['replication_slots']={'geo_secondary'=>{'type'=>'physical'}}# Patroni API绑定并监听的地址和端口。
  1319. patroni['listen_address']=nil
  1320. patroni['port']='8008'# 通知给其他集群成员以与其API和PostgreSQL通信的父节点的地址。如果没有指定,# 它会尝试使用第一个可用的私有IP,并退回到默认 IP 网络接口。
  1321. patroni['connect_address']=nil# Patroni API 响应其他集群成员的端口。此端口被通告,默认情况下与 patroni['port'] 相同
  1322. patroni['connect_port']='8008'# 指定允许调用不安全REST API端点的主机集。# 每项都可以是主机名、IP地址或CIDR地址。# 如果未设置,则允许所有主机。
  1323. patroni['allowlist']=[]
  1324. patroni['allowlist_include_members']=false# 用于对Patroni API执行基本的写时验证命令的用户名和密码。如果未指定,则API不使用基本身份验证。
  1325. patroni['username']=nil
  1326. patroni['password']=nil# Patroni API绑定并监听的地址和端口。Patroni API的TLS配置。启用TLS需要证书和密钥文件。# 如果没有指定,那么API使用普通HTTP。
  1327. patroni['tls_certificate_file']=nil
  1328. patroni['tls_key_file']=nil
  1329. patroni['tls_key_password']=nil
  1330. patroni['tls_ca_file']=nil
  1331. patroni['tls_ciphers']=nil
  1332. patroni['tls_client_mode']=nil
  1333. patroni['tls_client_certificate_file']=nil
  1334. patroni['tls_client_key_file']=nil
  1335. patroni['tls_verify']=true################################################################################ Consul (仅限EEP)###############################################################################
  1336. consul['enable']=false
  1337. consul['dir']='/var/opt/gitlab/consul'
  1338. consul['username']='gitlab-consul'
  1339. consul['group']='gitlab-consul'
  1340. consul['config_file']='/var/opt/gitlab/consul/config.json'
  1341. consul['config_dir']='/var/opt/gitlab/consul/config.d'
  1342. consul['data_dir']='/var/opt/gitlab/consul/data'
  1343. consul['log_directory']='/var/log/gitlab/consul'
  1344. consul['env_directory']='/opt/gitlab/etc/consul/env'
  1345. consul['env']={'SSL_CERT_DIR'=>"/opt/gitlab/embedded/ssl/certs/"}
  1346. consul['monitoring_service_discovery']=false
  1347. consul['node_name']=nil
  1348. consul['script_directory']='/var/opt/gitlab/consul/scripts'
  1349. consul['configuration']={'client_addr'=>nil,'datacenter'=>'gitlab_consul','enable_script_checks'=>true,'server'=>false}
  1350. consul['services']=[]
  1351. consul['service_config']={'postgresql'=>{'service'=>{'name'=>"postgresql",'address'=>'','port'=>5432,'checks'=>[{'script'=>"/var/opt/gitlab/consul/scripts/check_postgresql",'interval'=>"10s"}]}}}
  1352. consul['watchers']=[]
  1353. consul['custom_config_dir']='/path/to/service/configs/directory'### HTTP API 端口
  1354. consul['http_port']=nil
  1355. consul['https_port']=nil### Gossip 加密
  1356. consul['encryption_key']=nil
  1357. consul['encryption_verify_incoming']=nil
  1358. consul['encryption_verify_outgoing']=nil### TLS 设置
  1359. consul['use_tls']=false
  1360. consul['tls_ca_file']=nil
  1361. consul['tls_certificate_file']=nil
  1362. consul['tls_key_file']=nil
  1363. consul['tls_verify_client']=nil################################################################################ Se服务台电子邮件设置################################################################################# 服务台电子邮件##! 允许用户通过向服务台地址发送电子邮件来创建新的服务台问题。##! 文档:https://docs.gitlab.com/ee/user/project/service_desk.html
  1364. gitlab_rails['service_desk_email_enabled']=false### 服务台邮箱设置(通过 `mail_room`)服务台电子邮件地址###! 包含 `%{key}` 占位符的电子邮件地址,该占位符将被替换以引用回复的项目。###! **占位符可以省略,但如果存在,它必须出现在地址的“用户”部分(在`@`之前)。**
  1365. gitlab_rails['service_desk_email_address']="contact_project+%{key}@gmail.com"### 服务台电子邮件帐户用户名###! **对于第三方提供商,这通常是完整的电子邮件地址。**###! **对于自托管电子邮件服务器,这通常是电子邮件地址的用户部分。**
  1366. gitlab_rails['service_desk_email_email']="contact_project@gmail.com"### 服务台电子邮件帐户密码
  1367. gitlab_rails['service_desk_email_password']="[REDACTED]"###! 服务台邮件的最终邮箱。通常是 "inbox"。
  1368. gitlab_rails['service_desk_email_mailbox_name']="inbox"###! 空闲命令超时。
  1369. gitlab_rails['service_desk_email_idle_timeout']=60###! The file name for internal `mail_room` JSON logfile
  1370. gitlab_rails['service_desk_email_log_file']="/var/log/gitlab/mailroom/mail_room_json.log"### 服务台IMAP设置
  1371. gitlab_rails['service_desk_email_host']="imap.gmail.com"
  1372. gitlab_rails['service_desk_email_port']=993
  1373. gitlab_rails['service_desk_email_ssl']=true
  1374. gitlab_rails['service_desk_email_start_tls']=false### 收件箱选项(用于Microsoft Graph)
  1375. gitlab_rails['service_desk_email_inbox_method']='microsoft_graph'
  1376. gitlab_rails['service_desk_email_inbox_options']={'tenant_id':'YOUR-TENANT-ID','client_id':'YOUR-CLIENT-ID','client_secret':'YOUR-CLIENT-SECRET','poll_interval':60# 可选}### 服务台电子邮件如何发送到Rails流程。接受sidekiq或webhook。默认配置是webhook。
  1377. gitlab_rails['service_desk_email_delivery_method']="webhook"### 验证webhook请求的令牌。令牌必须正好是32字节,用base64编码
  1378. gitlab_rails['service_desk_email_auth_token']=nil################################################################################ Spamcheck(仅EE)################################################################################
  1379. spamcheck['enable']=false
  1380. spamcheck['dir']='/var/opt/gitlab/spamcheck'
  1381. spamcheck['port']=8001
  1382. spamcheck['external_port']=nil
  1383. spamcheck['monitoring_address']=':8003'
  1384. spamcheck['log_level']='info'
  1385. spamcheck['log_format']='json'
  1386. spamcheck['log_output']='stdout'
  1387. spamcheck['monitor_mode']=false
  1388. spamcheck['allowlist']={}
  1389. spamcheck['denylist']={}
  1390. spamcheck['log_directory']="/var/log/gitlab/spamcheck"
  1391. spamcheck['env_directory']="/opt/gitlab/etc/spamcheck/env"
  1392. spamcheck['env']={'SSL_CERT_DIR'=>'/opt/gitlab/embedded/ssl/cers'}
  1393. spamcheck['classifier']['log_directory']="/var/log/gitlab/spam-classifier"

我们不一定需要更改所有的配置项,不过有必要设置一个邮箱供 github 使用,这个邮箱相用于管理该gitlab,发送邮件等等使用。

这里我们为邮箱配置 SMTP 服务器信息,需要你有一个可用的邮箱如163邮箱。

  1. gitlab_rails['smtp_enable']=true
  2. gitlab_rails['smtp_address']="smtp.163.com"
  3. gitlab_rails['smtp_port']=465
  4. gitlab_rails['smtp_user_name']="291148484@163.com"
  5. gitlab_rails['smtp_password']="KWJDHFGBKJSCREWKJHBAP"
  6. gitlab_rails['smtp_domain']="163.com"
  7. gitlab_rails['smtp_authentication']="login"
  8. gitlab_rails['smtp_enable_starttls_auto']=true
  9. gitlab_rails['smtp_tls']=false
  10. gitlab_rails['smtp_pool']=false# 如果您的SMTP服务器不是默认的“From: gitlab@localhost ”,您可以使用此设置更改“From”。
  11. gitlab_rails['gitlab_email_from']='gitlab@example.com'
  12. gitlab_rails['gitlab_email_reply_to']='noreply@example.com'# 如果您的SMTP服务器使用自签名证书或由默认情况下不受信任的ca签名的证书,您可以指定自定义CA文件。# 请注意,来自/etc/gitlab/trusted-certs/的证书不用于验证SMTP服务器证书。
  13. gitlab_rails['smtp_ca_file']='/path/to/your/cacert.pem'

其中,对于 gitlab_rails[‘smtp_password’] 字段,其实不论你使用的是 163 还是 QQ 等邮箱,目前都不会允许直接使用密码登陆这样一个应用,需要使用授权码。以 163 邮箱为例,需要先登陆到你的邮箱。

在邮箱的首页点击 “设置”:

在这里插入图片描述
选择 POP3/SMPT/IMAP
在这里插入图片描述
授权码管理 点击 新增授权密码

在这里插入图片描述
然后使用你的手机扫码,自动到发送短信的页面:

在这里插入图片描述
注意需要使用你登陆邮箱相绑定的手机发送才可生效。发送后,点击 我已发送,页面便会弹出授权码。

在这里插入图片描述

对于大企业里自己真实的高配高性能服务器就不用担心了,不过对于个人试验学习和小团队开发开说可以根据自己的需要进行相应的调整某些配置。

由于我的阿里云服务器配置实在太低,提升配置价格不菲,只能通过关掉如监控、减少并发等牺牲功能的方式来实现正常访问。

  1. puma['worker_processes']=0
  2. puma['min_threads']=1
  3. puma['max_threads']=2
  4. sidekiq['max_concurrency']=5
  5. sentinel['enable']=false
  6. mattermost['enable']=false
  7. alertmanager['enable']=false
  8. prometheus_monitoring['enable']=false
  9. prometheus['enable']=false
  10. alertmanager['enable']=false
  11. sidekiq['metrics_enabled']=false
  12. unicorn['worker_processes']=1
  13. nginx['worker_processes']=4
  14. sidekiq['concurrency']=1
  15. postgresql['shared_buffers']="128MB"
  16. postgresql['max_worker_processes']=4
  17. unicorn['worker_timeout']=10

保存后然后使用新的配置重新运行一下:

  1. gitlab-ctl reconfigure
标签: gitlab vim git

本文转载自: https://blog.csdn.net/qq_28550263/article/details/129100636
版权归原作者 jcLee95 所有, 如有侵权,请联系我们删除。

“docker中 gitlab 安装、配置和初始化”的评论:

还没有评论