GitLab Pages without DNS wildcard
Description
Currently, creating a GitLab pages project would require a domain of the form name.example.io
or name.pages.example.io
. This setup forces admins to setup wildcard DNS records and SSL/TLS certificates (i.e. *.pages.example.io
). Some services typically used by small structures or individuals (such as Let's Encrypt) disallow this.
Removing the requirement for wildcard certificates would allow using services like Let's Encrypt on the main GitLab pages domain, without the need to setup a custom domain. It would also allow for easy configuration of custom HTTP(S) proxies like Apache. Finally, IMHO having an exponential amount of off-the-radar subdomains is really bad when you try to keep your DNS space clean and tidy.
~"feature proposal" ~"pages"
Proposal
In order to remove the need for wildcard dns, the namespace can be included in the URL path instead of the domain.
Thus, https://name.pages.example.io/index.html
would become https://pages.example.io/name/index.html
.
This could be done by setting a specific variable in /etc/gitlab/gitlab.rb
, e.g.
gitlab_pages["namespace_in_path"] = true;
This variable would then change the URL parsing rule used by GitLab pages so that it will look for the namespace in the URL path instead of the subdomain.
In order to ensure compatibility with existing setups, this feature would obviously be turned off by default.
Links / references
Reserves
This setup might have security or technical issues I do not know of. I have not been able to find the reasons behind the choice to include namespaces as subdomains, and I would be interested to know about them.