Incorrect url in emails - using server hostname instead of external_url
Summary
We are running gitlab CE Omnibus version 10.8.4 (gitlab-ce@2268d0cf6e9dbde91f73c8f63473a667658c98a9) on our own server.
We are using git.ourdomain.net for gitlab on the server who's hostname is hostname.ourdomain.net. (git.ourdomain.net has been assigned the same IP of the server.)
This has been specified with
external_url='https://git.ourdomain.net'
in /etc/gitlab/gitlab.rb
as documented here: https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
This works as expected for the web-frontend and repository urls. normal git operations (over SSH) work as expected.
However, when emails are sent (e.g. "Access to the FOO group was granted"), the links in the email use hostname.ourdomain.net .
There doesn't appear to be another option in gitlab.rb where the external url/host must be specified, nor is there an option in the admin panel.
Steps to reproduce
- Have external_url to be different from hostname of server.
- Perform an action that sends an automtic email (e.g. add user to project)
- Inspect the links inside the email
What is the current bug behavior?
As given in summary.
What is the expected correct behavior?
Links inside the emails should use external_url for generating the link, not the server's hostname.
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Current User: git Using RVM: no Ruby Version: 2.3.7p456 Gem Version: 2.6.14 Bundler Version:1.13.7 Rake Version: 12.3.1 Redis Version: 3.2.11 Git Version: 2.16.4 Sidekiq Version:5.0.5 Go Version: unknownGitLab information Version: 10.8.4 Revision: 2268d0c Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: http://hostname.ourdomain.net HTTP Clone URL: http://hostname.ourdomain.net/some-group/some-project.git SSH Clone URL: ssh://git@git.ourdomain.net:14482/some-group/some-project.git Using LDAP: no Using Omniauth: no
GitLab Shell Version: 7.1.2 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
hecking GitLab Shell ...GitLab Shell version >= 7.1.2 ? ... OK (7.1.2) 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: ... 3/2 ... ok 5/3 ... ok 5/4 ... ok 10/5 ... repository is empty 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: ... 3/2 ... yes 5/3 ... yes 5/4 ... yes 10/5 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.3.7) Git version >= 2.9.5 ? ... yes (2.16.4) Git user has default SSH configuration? ... yes Active users: ... 5
Checking GitLab ... Finished