gitlab.rb.j2 2.6 KB

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