From 702e8cca7d455ba8186c25076c6fcea1f2b0cb86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Mon, 9 Mar 2020 13:18:02 +0100 Subject: [PATCH] Make it possible to run an Elasticsearch service on https This is useful when running elasticsearch from 3rd-party vendors. --- CHANGELOG.md | 4 ++++ docs/configuration.rst | 1 + tutor/templates/apps/openedx/config/cms.env.json | 1 + tutor/templates/apps/openedx/config/lms.env.json | 1 + tutor/templates/config.yml | 1 + tutor/templates/k8s/deployments.yml | 2 +- tutor/templates/local/docker-compose.yml | 2 +- 7 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2fe417..4877d07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ Note: Breaking changes between versions are indicated by "💥". +## Unreleased + +- [Improvement] Make it possible to run an Elasticsearch service on https + ## v3.11.5 (2020-02-27) - [Improvement] Switch edx-platform from open-release/ironwood.2 tag to the open-release/ironwood.master branch diff --git a/docs/configuration.rst b/docs/configuration.rst index 17ac81c..236ffbb 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -113,6 +113,7 @@ By default, a running Open edX platform deployed with Tutor includes all necessa Elasticsearch ************* +- ``ELASTICSEARCH_PROTOCOL`` (default: ``"http"``) - ``ELASTICSEARCH_HOST`` (default: ``"elasticsearch"``) - ``ELASTICSEARCH_PORT`` (default: ``9200``) - ``ELASTICSEARCH_HEAP_SIZE`` (default: ``"1g"``) diff --git a/tutor/templates/apps/openedx/config/cms.env.json b/tutor/templates/apps/openedx/config/cms.env.json index 3e559ae..3000dcc 100644 --- a/tutor/templates/apps/openedx/config/cms.env.json +++ b/tutor/templates/apps/openedx/config/cms.env.json @@ -26,6 +26,7 @@ "COMPREHENSIVE_THEME_DIRS": ["/openedx/themes"], "STATIC_ROOT_BASE": "/openedx/staticfiles", "ELASTIC_SEARCH_CONFIG": [{ + {% if ELASTICSEARCH_PROTOCOL == "https" %}"use_ssl": true,{% endif %} "host": "{{ ELASTICSEARCH_HOST }}", "port": {{ ELASTICSEARCH_PORT }} }], diff --git a/tutor/templates/apps/openedx/config/lms.env.json b/tutor/templates/apps/openedx/config/lms.env.json index 16b6c83..c3c6343 100644 --- a/tutor/templates/apps/openedx/config/lms.env.json +++ b/tutor/templates/apps/openedx/config/lms.env.json @@ -32,6 +32,7 @@ "COMPREHENSIVE_THEME_DIRS": ["/openedx/themes"], "STATIC_ROOT_BASE": "/openedx/staticfiles", "ELASTIC_SEARCH_CONFIG": [{ + {% if ELASTICSEARCH_PROTOCOL == "https" %}"use_ssl": true,{% endif %} "host": "{{ ELASTICSEARCH_HOST }}", "port": {{ ELASTICSEARCH_PORT }} }], diff --git a/tutor/templates/config.yml b/tutor/templates/config.yml index 9012d0e..4969475 100644 --- a/tutor/templates/config.yml +++ b/tutor/templates/config.yml @@ -43,6 +43,7 @@ DOCKER_REGISTRY: "docker.io/" LOCAL_PROJECT_NAME: "tutor_local" ELASTICSEARCH_HOST: "elasticsearch" ELASTICSEARCH_PORT: 9200 +ELASTICSEARCH_PROTOCOL: "http" ELASTICSEARCH_HEAP_SIZE: 1g FORUM_HOST: "forum" JWT_COMMON_AUDIENCE: "openedx" diff --git a/tutor/templates/k8s/deployments.yml b/tutor/templates/k8s/deployments.yml index 8fd1545..d41d586 100644 --- a/tutor/templates/k8s/deployments.yml +++ b/tutor/templates/k8s/deployments.yml @@ -108,7 +108,7 @@ spec: - containerPort: 4567 env: - name: SEARCH_SERVER - value: "http://{{ ELASTICSEARCH_HOST }}:{{ ELASTICSEARCH_PORT }}" + value: "{{ ELASTICSEARCH_PROTOCOL }}://{{ ELASTICSEARCH_HOST }}:{{ ELASTICSEARCH_PORT }}" - name: MONGODB_AUTH value: "{% if MONGODB_USERNAME and MONGODB_PASSWORD %}{{ MONGODB_USERNAME}}:{{ MONGODB_PASSWORD }}@{% endif %}" - name: MONGODB_HOST diff --git a/tutor/templates/local/docker-compose.yml b/tutor/templates/local/docker-compose.yml index 1c34da6..c2246b6 100644 --- a/tutor/templates/local/docker-compose.yml +++ b/tutor/templates/local/docker-compose.yml @@ -88,7 +88,7 @@ services: forum: image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_FORUM }} environment: - SEARCH_SERVER: "http://{{ ELASTICSEARCH_HOST }}:{{ ELASTICSEARCH_PORT }}" + SEARCH_SERVER: "{{ ELASTICSEARCH_PROTOCOL }}://{{ ELASTICSEARCH_HOST }}:{{ ELASTICSEARCH_PORT }}" MONGODB_AUTH: "{% if MONGODB_USERNAME and MONGODB_PASSWORD %}{{ MONGODB_USERNAME}}:{{ MONGODB_PASSWORD }}@{% endif %}" MONGODB_HOST: "{{ MONGODB_HOST }}" MONGODB_PORT: "{{ MONGODB_PORT }}"