gitlab.rb.j2 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # GitLab Configuration
  2. external_url '{{ external_url }}'
  3. # Initial root user configuration (only used on first initialization)
  4. gitlab_rails['initial_root_password'] = ENV['GITLAB_ROOT_PASSWORD']
  5. gitlab_rails['initial_root_email'] = '{{ root_email }}'
  6. # GitLab Shell SSH settings
  7. gitlab_rails['gitlab_shell_ssh_port'] = {{ ports_ssh }}
  8. # Let's Encrypt and built-in TLS settings are currently not supported by the template
  9. # as we are using Traefik as a reverse proxy
  10. letsencrypt['enable'] = false
  11. nginx['listen_port'] = 80
  12. nginx['listen_https'] = false
  13. {% if traefik_tls_enabled %}
  14. # Traefik settings, to redirect http to https
  15. nginx['redirect_http_to_https'] = true
  16. {% endif %}
  17. {% if registry_enabled %}
  18. # Container Registry settings
  19. registry_external_url '{{ registry_external_url }}'
  20. gitlab_rails['registry_enabled'] = true
  21. registry_nginx['listen_https'] = false
  22. registry_nginx['listen_port'] = 5000
  23. {% endif %}
  24. {% if authentik_enabled %}
  25. # Authentik SSO settings
  26. gitlab_rails['omniauth_auto_link_user'] = ['openid_connect']
  27. gitlab_rails['omniauth_providers'] = [
  28. {
  29. name: "openid_connect",
  30. label: "Authentik",
  31. icon: "https://avatars.githubusercontent.com/u/82976448?s=200&v=4",
  32. args: {
  33. name: "openid_connect",
  34. scope: ["openid","profile","email"],
  35. response_type: "code",
  36. issuer: "{{ authentik_url }}/application/o/{{ authentik_slug }}/",
  37. discovery: true,
  38. client_auth_method: "query",
  39. uid_field: "email",
  40. send_scope_to_token_endpoint: "false",
  41. pkce: true,
  42. client_options: {
  43. identifier: "{{ authentik_client_id }}",
  44. secret: "{{ authentik_client_secret }}",
  45. redirect_uri: "{{ external_url }}/users/auth/openid_connect/callback"
  46. }
  47. }
  48. }
  49. ]
  50. {% endif %}
  51. {% if email_enabled %}
  52. # SMTP settings
  53. gitlab_rails['smtp_enable'] = true
  54. gitlab_rails['smtp_address'] = "{{ email_host }}"
  55. gitlab_rails['smtp_port'] = {{ email_port }}
  56. gitlab_rails['smtp_user_name'] = "{{ email_username }}"
  57. gitlab_rails['smtp_password'] = "{{ email_password }}"
  58. gitlab_rails['smtp_authentication'] = "login"
  59. {% if email_use_ssl %}
  60. gitlab_rails['smtp_ssl'] = true
  61. gitlab_rails['smtp_force_ssl'] = true
  62. {% elif email_use_tls %}
  63. gitlab_rails['smtp_tls'] = true
  64. {% endif %}
  65. gitlab_rails['gitlab_email_from'] = '{{ email_from }}'
  66. gitlab_rails['gitlab_email_reply_to'] = '{{ email_from }}'
  67. {% endif %}
  68. {% if performance_preset == 'homelab' %}
  69. # Performance optimizations for homelab/low-resource environments
  70. # NOTE: These settings reduce resource usage but may impact performance under high load
  71. postgresql['shared_buffers'] = "256MB"
  72. sidekiq['max_concurrency'] = 4
  73. sidekiq['concurrency'] = 1
  74. puma['worker_timeout'] = 120
  75. puma['worker_processes'] = 1
  76. {% endif %}
  77. # Prometheus monitoring
  78. prometheus_monitoring['enable'] = {{ prometheus_enabled | lower }}
  79. # Default UI settings
  80. gitlab_rails['gitlab_default_theme'] = {{ default_theme }}
  81. gitlab_rails['gitlab_default_color_mode'] = {{ default_color_mode }}
  82. # Product usage data
  83. gitlab_rails['initial_gitlab_product_usage_data'] = {{ 'false' if disable_usage_data else 'true' }}