Changing GitLab URL in gitlab.rb does not update Mattermost GitLab OAUTH configuration
Summary
Changing GitLab URL in gitlab.rb does not update Mattermost GitLab OAUTH configuration. Mattermost continues to attempt oauth through original URL. Updating /var/opt/gitlab/mattermost/config.json manually works, but is clobbered by a gitlab-ctl reconfigure with the old url.
Steps to reproduce
- Setup a new omnibus install and enable Mattermost using GitLab authentication
- Change the URL of the GitLab in etc/gitlab/gitlab.rb
- gitlab-ctl reconfigure && gitlab-ctl restart
- Attempt to login to mattermost.
- Notice OAUTH url is still original gitlab url. Auth fails if this URL is unavailable.
- Update /var/opt/gitlab/mattermost/config.json to reflect new gitlab URL
- gitlab-ctl restart
- Notice authentication now works
- gitlab-ctl reconfigure && gitlab-ctl restart
- Notice /var/opt/gitlab/mattermost/config.json has been clobbered and now contains original OAUTH url.
- Notice mattermost auth now fails.
What is the current bug behavior?
There seems to be no way to update this config to make it stick. Please see above
What is the expected correct behavior?
gitlab-ctl reconfigure should maintain the correct URL to GitLab OAUTH based on the GitLab url in gitlab.rb
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Ubuntu 16.04 Current User: git Using RVM: no Ruby Version: 2.3.6p384 Gem Version: 2.6.13 Bundler Version:1.13.7 Rake Version: 12.3.0 Redis Version: 3.2.11 Git Version: 2.14.3 Sidekiq Version:5.0.5 Go Version: unknown GitLab information Version: 10.4.3 Revision: 183dd5d Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: http://192.168.25.16 HTTP Clone URL: http://192.168.25.16/some-group/some-project.git SSH Clone URL: git@192.168.25.16:some-group/some-project.git Using LDAP: no Using Omniauth: no GitLab Shell Version: 5.11.0 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
Expand for output related to the GitLab application check
Checking GitLab Shell ... GitLab Shell version >= 5.11.0 ? ... OK (5.11.0) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 4/1 ... ok 4/2 ... ok 4/3 ... ok 2/5 ... ok 4/6 ... ok 4/7 ... ok 4/8 ... ok 4/9 ... ok 4/10 ... ok 4/11 ... ok 4/12 ... ok 4/13 ... ok 4/14 ... ok 4/15 ... ok 4/16 ... ok 2/17 ... ok 4/18 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful Checking GitLab Shell ... Finished Checking Sidekiq ... Running? ... yes Number of Sidekiq processes ... 1 Checking Sidekiq ... Finished Reply by email is disabled in config/gitlab.yml Checking LDAP ... LDAP is disabled in config/gitlab.yml Checking LDAP ... Finished Checking GitLab ... Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 4/1 ... yes 4/2 ... yes 4/3 ... yes 2/5 ... yes 4/6 ... yes 4/7 ... yes 4/8 ... yes 4/9 ... yes 4/10 ... yes 4/11 ... yes 4/12 ... yes 4/13 ... yes 4/14 ... yes 4/15 ... yes 4/16 ... yes 2/17 ... yes 4/18 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.3.6) Git version >= 2.7.3 ? ... yes (2.14.3) Git user has default SSH configuration? ... yes Active users: ... 7 Checking GitLab ... Finished