gitlab: Add options for port and entrypoint to registry config

This patch enables users to customize the entrypoint and port that is shown for external access (only supplied so gitlab can still show valid registry links).
This commit is contained in:
saibotk 2021-08-15 23:57:13 +02:00
parent 19eb9e1196
commit 47f4de58d7
Signed by: saibotk
GPG key ID: 67585F0065E261D5
2 changed files with 6 additions and 4 deletions

View file

@ -102,6 +102,8 @@ gitlab_csp:
# Gitlab docker registry settings
gitlab_registry:
enabled: false
# external_port: 5050 # Defines the port that is appended to the registry domain used by gitlab.
# traefik_entrypoint: "websecure" # Defines the entrypoint that traefik should use for the registry. Can be useful to use another port while still using the certificate of the domain.
# Gitlab telegraf configuration, allows to configure a monitoring setup for Gitlab
gitlab_telegraf:

View file

@ -115,8 +115,8 @@ services:
# Gitlab registry
gitlab_rails['registry_enabled'] = true
gitlab_rails['registry_host'] = "{{ gitlab_registry_domain }}"
registry_external_url "https://{{ gitlab_registry_domain }}"
registry_nginx['listen_port'] = 5050
registry_external_url "https://{{ gitlab_registry_domain }}{% if gitlab_registry.external_port is defined %}:{{ gitlab_registry.external_port }}{% endif %}"
registry_nginx['listen_port'] = 5040
registry_nginx['listen_https'] = false
{% endif %}
@ -196,12 +196,12 @@ services:
{% if gitlab_registry.enabled %}
- "traefik.http.routers.gitlab-registry.rule=Host(`{{ gitlab_registry_domain }}`) && PathPrefix(`/`)"
- "traefik.http.routers.gitlab-registry.entrypoints=websecure"
- "traefik.http.routers.gitlab-registry.entrypoints={{ gitlab_registry.traefik_entrypoint | default('websecure') }}"
- "traefik.http.routers.gitlab-registry.tls=true"
- "traefik.http.routers.gitlab-registry.tls.certresolver={{ gitlab_traefik_certresolver }}"
- "traefik.http.routers.gitlab-registry.middlewares=gitlab,compress"
- "traefik.http.routers.gitlab-registry.service=gitlab-registry"
- "traefik.http.services.gitlab-registry.loadbalancer.server.port=5050"
- "traefik.http.services.gitlab-registry.loadbalancer.server.port=5040"
{% endif %}
- "traefik.http.middlewares.gitlab.headers.sslredirect=true"