docksal / ci-agent

CI agent Docker image for Docksal Sandboxes
MIT License
9 stars 16 forks source link

Domain names should be all lowercase #25

Closed lmakarov closed 6 years ago

lmakarov commented 6 years ago

Per https://en.wikipedia.org/wiki/Domain_name:

Domain names may be formed from the set of alphanumeric ASCII characters (a-z, A-Z, 0-9), but characters are case-insensitive. In addition the hyphen (U+002D) is permitted if it is surrounded by characters, digits or hyphens, although it is not to start or end a label. Labels are always separated by the full stop (period) character in the textual name representation.

Even though uppercase letters are allowed in domain names, modern browsers convert domain names to all lowercase. In nginx, server_name is case sensitive and uppercase letters in it will always result in a virtual host miss.

In docksal/ci-agent domain (virtual host's server_name) is generated as $BRANCH_NAME_SAFE.$REPO_NAME_SAFE.$DOCKSAL_DOMAIN

The lowercase conversion is only applied to BRANCH_NAME_SAFE. It should also be applied to REPO_NAME_SAFE and DOCKSAL_DOMAIN.

Related to https://github.com/docksal/docksal/issues/430