From 90650b691a6fd6ea5924f215831821f18df487c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Sun, 7 Jul 2019 10:02:03 +0800 Subject: [PATCH] Rename SECRET_KEY to OPENEDX_SECRET_KEY --- CHANGELOG.md | 1 + tutor/config.py | 4 +++- tutor/templates/apps/openedx/config/partials/auth.json | 2 +- tutor/templates/config.yml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb3cb24..dcb4e7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Note: Breaking changes between versions are indicated by "💥". ## Latest +- [Improvement] Rename ``SECRET_KEY`` configuration parameter to ``OPENEDX_SECRET_KEY`` - [Improvement] Add support for TLS in external SMTP server (#231) - [Bugfix] Fix missing video transcripts in LMS (#229) - [Improvement] Make it possible to enable/disable multiple plugins at once diff --git a/tutor/config.py b/tutor/config.py index 0be9739..85e683a 100644 --- a/tutor/config.py +++ b/tutor/config.py @@ -93,7 +93,7 @@ def load_required(config, defaults): that are generated once and must be kept after that, such as passwords. """ for key in [ - "SECRET_KEY", + "OPENEDX_SECRET_KEY", "MYSQL_ROOT_PASSWORD", "OPENEDX_MYSQL_PASSWORD", "ANDROID_OAUTH2_SECRET", @@ -145,6 +145,8 @@ def upgrade_obsolete(config): if config["ACTIVATE_XQUEUE"]: plugins.enable(config, "xqueue") config.pop("ACTIVATE_XQUEUE") + if "SECRET_KEY" in config: + config["OPENEDX_SECRET_KEY"] = config.pop("SECRET_KEY") def convert_json2yml(root): diff --git a/tutor/templates/apps/openedx/config/partials/auth.json b/tutor/templates/apps/openedx/config/partials/auth.json index c849062..589876f 100644 --- a/tutor/templates/apps/openedx/config/partials/auth.json +++ b/tutor/templates/apps/openedx/config/partials/auth.json @@ -1,5 +1,5 @@ { - "SECRET_KEY": "{{ SECRET_KEY }}", + "SECRET_KEY": "{{ OPENEDX_SECRET_KEY }}", "AWS_ACCESS_KEY_ID": "{{ OPENEDX_AWS_ACCESS_KEY }}", "AWS_SECRET_ACCESS_KEY": "{{ OPENEDX_AWS_SECRET_ACCESS_KEY }}", {{ patch("openedx-auth", separator=",\n", suffix=",")|indent(2) }} diff --git a/tutor/templates/config.yml b/tutor/templates/config.yml index f194bd6..ac7f697 100644 --- a/tutor/templates/config.yml +++ b/tutor/templates/config.yml @@ -1,8 +1,8 @@ --- # These configuration values must be stored in the user's config.yml. -SECRET_KEY: "{{ 24|random_string }}" MYSQL_ROOT_PASSWORD: "{{ 8|random_string }}" OPENEDX_MYSQL_PASSWORD: "{{ 8|random_string }}" +OPENEDX_SECRET_KEY: "{{ 24|random_string }}" ANDROID_OAUTH2_SECRET: "{{ 24|random_string }}" ID: "{{ 24|random_string }}"