Github login not working if Gitlab configured at non-default port
Summary
If Gitlab is configured at non-default port, e.g. 8888, the Github authentication does not work bur Crowd works.
Steps to reproduce
- Install Gitlab using Omnibus with default port
- Configure Github integration as per https://docs.gitlab.com/ce/integration/github.html and make sure it works properly
- Configure the Gitlab instance to run on 8888 port by editing
/etc/gitlab/gitlab.rb
to have the entry like below. ReplaceHOSTNAME
with your actual hostname.
external_url 'http://HOSTNAME:8888'
- Restart/reconfigure Gitlab service
- Click the Github button on the Gitlab login page
What is the current bug behavior?
On a new page the error message is "the site could not be reached" since it's accessing the redirected URL "http://HOSTNAME/?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fv3%2Foauth%2F%23redirect-uri-mismatch&state=033ae1bc587fe8eaba32843ae7b6b487c1a0528db210d5aa" without the new port.
What is the expected correct behavior?
Login properly with Github or redirect to Github login page
Relevant logs and/or screenshots
N/A
Output of checks
N/A
Results of GitLab environment info
System information
System: Ubuntu 14.04
Proxy: no
Current User: git
Using RVM: no
Ruby Version: 2.3.3p222
Gem Version: 2.6.6
Bundler Version:1.13.7
Rake Version: 10.5.0
Redis Version: 3.2.5
Sidekiq Version:4.2.7
GitLab information
Version: 8.17.2-ee
Revision: 474978d
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
DB Version: 9.2.18
URL: http://172.16.81.151:8888
HTTP Clone URL: http://172.16.81.151:8888/some-group/some-project.git
SSH Clone URL: git@172.16.81.151:some-group/some-project.git
Elasticsearch: no
Geo: no
Using LDAP: no
Using Omniauth: yes
Omniauth Providers: github, crowd
GitLab Shell
Version: 4.1.1
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Checking GitLab Shell ...
GitLab Shell version >= 4.1.1 ? ... OK (4.1.1)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
1/14 ... ok
29/15 ... ok
32/16 ... ok
1/17 ... ok
1/18 ... ok
33/20 ... ok
29/21 ... repository is empty
25/34 ... ok
35/54 ... ok
1/56 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Possible fixes
N/A