gitlab.rb.j2 2.7 KB

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