Skip to content

Add support for custom instance domains

Matjaz Gregoric requested to merge mtyaka/external-domains into master

Background

We want customers to be able to access their instances from their own custom domains which we don't control. We have to use custom domains in edx-platform ansible configuration when provisioning new app servers, but we still need to set DNS entries for the internal (*.opencraft.hosting) domains. The customer will create a CNAME entry pointing their custom domains to the internal *.opencraft.hosting domain.

The patch adds three new fields to instance configuration:

  • external_lms_domain
  • external_lms_preview_domain
  • external_studio_domain

When set, the external domains are used instead of the internal (opencraft-controlled) domains in ansible configuration and the UI.

Regardless of the presence of external domains, each instance is still assigned an internal domain and the DNS entry for the internal domain is always updated to point to the current active appserver.

Customers who use external domains will have to set a CNAME record that points to the main internal domain.

Testing

  1. Create a new OpenEdXInstance (or use an existing one) and set external_lms_domain, external_lms_preview_domain, and external_studio_domain to custom values (for example courses.mydomain.org, preview.mydomain.org, studio.mydomain.org). You can do that either using the django console or the django admin UI.
  2. Make sure that LMS and Studio URLs displayed in the UI point to the external domain.
  3. Provision a new appserver and make sure that COMMON_HOSTNAME, EDXAPP_LMS_BASE, EDXAPP_PREVIEW_LMS_BASE, and EDXAPP_CMS_BASE are using external rather than internal domains.
  4. Activate the new app server and make sure that it uses the internal domain rather than external domain when setting DNS entries.
  5. Check that everything still works correctly for instances without external domains (internal domains should be used everywhere).

Merge request reports