Pages custom domains can be added when not supported by the Pages daemon
Summary
As reported in omnibus-gitlab#2664 (comment 37162381)
We only support Pages custom domains if pages is configured with -listen-http or -listen-https. When access to Pages is solely through nginx (-listen-proxy), we cannot support custom domains and hide the details in the UI, using a check like Gitlab.config.pages.external_http || Gitlab.config.pages.external_https
What is the current bug behavior?
- The UI shows the functionality if an empty array is passed for either of
Gitlab.config.pages.external_httporgitlab.config.pages.external_https - Even when those config items are
nil, you can create custom domains by navigating to, e.g., http://localhost:4000/root/gitlab-shell/pages/domains/new and filling it in (Pages does need to be enabled, but custom domains support isn't checked).
What is the expected correct behavior?
Neither of those scenarios should be possible.
Possible fixes
- Hide the UI elements unless
(external_http || external_https).present? - Deny access to pages domains endpoints unless the same.
Probably want to refactor the check out as it's a bit byzantine
Or perhaps we should separate configuration of custom domains from the pages daemon serving configuration and give a checkbox for it in application_settings?
/cc @grzesiek