Allow use of bare pages domain (gitlab.io) as "custom domain"
Context
This is a follow-up on Incorrect test for suffix when setting custom p... (#349066) and Fix check for valid custom pages domains (!77247 - merged); see also the discussion here: !77247 (comment 805797712).
The GitLab Pages feature is configured with a "Pages Domain" (gitlab.io
in the case gitlab.com) and by default uses subdomains of that (<namespace>.<pages domain>
) for projects. In addition, users can configure their project to be published at a custom domain. There is a check that ensures that subdomains of the Pages Domain cannot be used to prevent conflicts.
Currently (and also after !77247 (merged)), this check includes the Pages Domain itself, even though this is not used for anything by itself.
Proposal
There are several possible use cases for using the Pages Domain as a custom domain; for example, to publish documentation about GitLab Pages or the GitLab instance. Due to the check described above, this is currently impossible.
I propose to allow the Pages Domain to be usable as a custom domain in such cases. I see two main ways to achieve this:
- Simply remove the check that currently prevents the use; in this case, anyone who controls the corresponding DNS zone (e.g.,
gitlab.io
) can use this domain as a custom pages domain. This option was already discussed in !77247 (comment 805797712) - Reserve this page for administrators. For example, add a form in the admin UI where the Pages Domain can be assigned to one specific project.
The first option is much simpler, but the second one more closely fits the use cases described above.