gitlab.rb.j2 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # GitLab Configuration
  2. external_url '{{ external_url }}'
  3. # GitLab Shell SSH settings
  4. gitlab_rails['gitlab_shell_ssh_port'] = {{ ssh_port }}
  5. # Internal web service settings
  6. {% if traefik_enabled %}
  7. # Traefik handles TLS/SSL certificates
  8. letsencrypt['enable'] = false
  9. nginx['listen_port'] = 80
  10. nginx['listen_https'] = false
  11. {% else %}
  12. # Let's Encrypt certificate management (when not using Traefik)
  13. letsencrypt['enable'] = true
  14. letsencrypt['contact_emails'] = ['{{ email_from|default("admin@example.com") }}']
  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'] = {{ registry_port }}
  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 %}