Explorar el Código

added draft for gitlab

xcad hace 6 meses
padre
commit
6573edd1ed

+ 1 - 1
library/compose/gitlab/compose.yaml.j2

@@ -37,7 +37,7 @@ services:
       - traefik.http.routers.{{ container_name }}-https.tls.certresolver={{ traefik_tls_certresolver }}
       {% endif %}
 {% if registry_enabled %}
-      - traefik.http.services.{{ container_name }}-registry.loadbalancer.server.port={{ registry_port }}
+      - traefik.http.services.{{ container_name }}-registry.loadbalancer.server.port={{ ports_registry }}
       - traefik.http.services.{{ container_name }}-registry.loadbalancer.server.scheme=http
       - traefik.http.routers.{{ container_name }}-registry-http.service={{ container_name }}-registry
       - traefik.http.routers.{{ container_name }}-registry-http.rule=Host(`{{ registry_hostname }}`)

+ 4 - 7
library/compose/gitlab/config/gitlab.rb.j2

@@ -4,16 +4,11 @@ external_url '{{ external_url }}'
 # GitLab Shell SSH settings
 gitlab_rails['gitlab_shell_ssh_port'] = {{ ssh_port }}
 
-# Internal web service settings
 {% if traefik_enabled %}
-# Traefik handles TLS/SSL certificates
+# Traefik settings
 letsencrypt['enable'] = false
 nginx['listen_port']  = 80
 nginx['listen_https'] = false
-{% else %}
-# Let's Encrypt certificate management (when not using Traefik)
-letsencrypt['enable'] = true
-letsencrypt['contact_emails'] = ['{{ email_from|default("admin@example.com") }}']
 nginx['redirect_http_to_https'] = true
 {% endif %}
 
@@ -21,8 +16,10 @@ nginx['redirect_http_to_https'] = true
 # Container Registry settings
 registry_external_url '{{ registry_external_url }}'
 gitlab_rails['registry_enabled']  = true
+{% if traefik_enabled %}
 registry_nginx['listen_https']    = false
-registry_nginx['listen_port']     = {{ registry_port }}
+{% endif %}
+registry_nginx['listen_port']     = {{ ports_registry }}
 {% endif %}
 
 {% if authentik_enabled %}

+ 9 - 11
library/compose/gitlab/template.yaml

@@ -19,6 +19,7 @@ metadata:
   tags:
     - git
     - ci-cd
+  draft: true
 spec:
   general:
     vars:
@@ -38,16 +39,21 @@ spec:
     vars:
       ports_enabled:
         type: bool
-        description: Expose HTTP/HTTPS ports (disabled if using Traefik)
+        description: Expose HTTP/HTTPS ports
         default: true
       ports_http:
         type: int
-        description: HTTP port (disabled if using Traefik)
+        description: HTTP port
         default: 80
       ports_https:
         type: int
-        description: HTTPS port (disabled if using Traefik)
+        description: HTTPS port
         default: 443
+      ports_registry:
+        type: int
+        description: Port for Container Registry
+        default: 5678
+
   traefik:
     vars:
       traefik_host:
@@ -65,11 +71,3 @@ spec:
         type: str
         description: External URL for Container Registry
         default: 'https://registry.example.com'
-      registry_hostname:
-        type: str
-        description: Hostname for Container Registry (when using Traefik)
-        default: registry.example.com
-      registry_port:
-        type: int
-        description: Internal port for Container Registry
-        default: 5678