Tech:Custom domains

This page is a how-to for setting up custom domains for wikis in nginx. This tutorial requires that you are able to edit the ansible-playbook (or able to edit your fork of it and push a pull request to master) and DNS access to the custom domain (the wiki owner should be able to do this, Orain won't manage custom domains). Please know that this is serious business, read this careful before doing any changes.

Process

 * 1) Identify the wiki which domain should be changed. You only need it's DBname;
 * 2) Custom domains pointing to wikis can be set up in many ways. Like wiki.someproject.org, but also just someproject.org(/wiki). This is very important to know;
 * 3) The DNS records needs to be changed. A records will be added/changed here. The value for the A record will be "@" (root domain) or "[subdomain]" (like "wiki" for wiki.someproject.org), the A record should point to   (recommended) or   (IP can change, be careful!);
 * 4) If the wiki owner wants the www-form to work as well, a CNAME record should point to the A record;
 * 5) Okay, DNS is set up, but the domain doesn't work yet because MediaWiki still serves the wiki to [a string].orain.org. Now we need to change the MediaWiki and nginx settings;
 * 6) If you have a GitHub account, you can edit directly the nginx/MediaWiki settings, otherwise you can use git to do that. In LocalSettings.php, the variables who should are $wgCentralAuthAutoLoginWikis, $wgServer and $wgUrlShortenerDomainsWhitelist - you can look at the already present entries in these variables so you know how to correctly add the domain name. Done? Save the file, and open the nginx sites-enabled file. Search for Line 15, and add the custom domain there (if the DNS allows use of the www-form, add it here also, but be sure you create two separate (one with the www-suffix and one without) entries!) and save the file;
 * 7) You are not done yet, though the biggest part is done now. Please check all your changes (you can use this pull request to verify the used syntax), and commit them/do a pull request including these changes to master. Are the edits now in the ansible-playbook? Verify the wiki works as expected. If not, revert your changes immediately and fix the problem that causes problems;