Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP url for clone is wrong in GitLab

PROBLEM:

When I create a repository in GitLab, it shows different HTTP URL and SSH URL of the repository by some reason.
eg)

HTTP: http://anotherexample.com/myrepo.git
SSH: [email protected]/myrepo.git

My gitlab URL is: https: //gitlab.example.com, so SSH is correct and HTTP is wrong.

( anotherexample.com is the URL of my server before I set DNS.)


I looked at /var/opt/gitlab/gitlab-rails/etc/gitlab.yml, then found:

# 1. GitLab app settings
# ==========================
host: anotherexample.com
port: 80
https: false

ssh_host: gitlab.example.com

then I manually changed this host and it's temporarily solved.

However, gitlab.yml will be updated when I do gitlab-ctl reconfigure.


QUESTION:
How can I set this host name for HTTP in /etc/gitlab/gitlab.rb
?

I've already had two lines below:

external_url 'https://gitlab.example.com'
gitlab_rails['gitlab_ssh_host'] = 'gitlab.example.com'

but it seems not work for HTTP url.


My GitLab version : 8.8.3
My server : CentOS 6.8 + nginx 1.10.1


Thanks in advance.

like image 378
leccmo Avatar asked Dec 19 '22 16:12

leccmo


1 Answers

For people like me who had entirely the wrong URL you will need to update just

external_url "http://gitlab.example.com"

in /etc/gitlab/gitlab.rb and then run

sudo gitlab-ctl reconfigure

for the changes to take effect. You can read more in the official docs here

like image 111
Jack Avatar answered Dec 21 '22 18:12

Jack