gitlab-ce: change clone url without using external_url in gitlab.rb

Viewed 37

I have set up a default install of gitlab-ce with docker-compose

services:
  gitlab:
    image: gitlab/gitlab-ce:latest
    restart: always
    container_name: gitlab
    ports:
      - 127.0.0.0:80:80
      - 127.0.0.0:443:443
      - 127.0.0.0:22:22
    volumes:
      - gitlab-config:/etc/gitlab:z
      - gitlab-logs:/var/log/gitlab:z
      - gitlab-data:/var/opt/gitlab:z

My issue is, that the generated "Clone with Http" url of every project contains an incorrect path.

Example "Clone with HTTP"-URL

I dont know how i can change this without using the parameter external_url in etc\gitlab\gitlab.rb?

The problem with this approach is that it also activates the built in nginx component of gitlab, which i do not want since I am using my own nginx server as a reverse proxy for 2 gitlab instances.

It all works if I manually change the url before copying, but there must be a better solution.

1 Answers

You must use the external_url parameter for this value in the UI to be correct.

The problem with this approach is that it also activates the built in nginx component of gitlab

You can explicitly disable this in the gitlab.rb:

nginx['enable'] = false

It is also possible to change the SSH address independently of the HTTPS address using gitlab_rails['gitlab_ssh_host'] setting in the gitlab.rb.

For more information on available settings, see the gitlab.rb template.

Related