From e35efa3302724971976f3478a3402650d3ed8a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Wed, 20 Mar 2019 19:02:39 +0100 Subject: [PATCH] Configurable Rabbitmq authentication --- CHANGELOG.md | 2 +- docs/configuration.rst | 2 ++ tutor/templates/apps/openedx/config/cms.env.json | 4 +++- tutor/templates/apps/openedx/config/lms.env.json | 4 +++- tutor/templates/apps/xqueue/settings/tutor.py | 2 -- tutor/templates/config-defaults.yml | 2 ++ 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09ea840..1ea54fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Latest -- [Improvement] Add configurable SMTP authentication +- [Improvement] Add configurable SMTP and Rabbitmq authentication - [Improvement] Harmonize mysql username/password configuration parameters - [Feature] Configurable and pluggable data storage backends (#114) diff --git a/docs/configuration.rst b/docs/configuration.rst index 98587a7..4a52685 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -92,6 +92,8 @@ Rabbitmq ~~~~~~~~ - ``RABBITMQ_HOST`` (default: ``"rabbitmq"``) +- ``RABBITMQ_USERNAME`` (default: ``""``) +- ``RABBITMQ_PASSWORD`` (default: ``""``) SMTP ~~~~ diff --git a/tutor/templates/apps/openedx/config/cms.env.json b/tutor/templates/apps/openedx/config/cms.env.json index 7d8d983..38bae8d 100644 --- a/tutor/templates/apps/openedx/config/cms.env.json +++ b/tutor/templates/apps/openedx/config/cms.env.json @@ -16,8 +16,10 @@ "CMS_BASE": "{{ CMS_HOST }}", "LMS_BASE": "{{ LMS_HOST }}", "CONTACT_EMAIL": "{{ CONTACT_EMAIL }}", - "CELERY_BROKER_HOSTNAME": "{{ RABBITMQ_HOST }}", "CELERY_BROKER_TRANSPORT": "amqp", + "CELERY_BROKER_HOSTNAME": "{{ RABBITMQ_HOST }}", + "CELERY_BROKER_USER": "{{ RABBITMQ_USERNAME }}", + "CELERY_BROKER_PASSWORD": "{{ RABBITMQ_PASSWORD }}", "COMPREHENSIVE_THEME_DIRS": ["/openedx/themes"], "MEDIA_ROOT": "/openedx/data/uploads/", "STATIC_ROOT_BASE": "/openedx/staticfiles", diff --git a/tutor/templates/apps/openedx/config/lms.env.json b/tutor/templates/apps/openedx/config/lms.env.json index 4ef3746..11c6602 100644 --- a/tutor/templates/apps/openedx/config/lms.env.json +++ b/tutor/templates/apps/openedx/config/lms.env.json @@ -21,8 +21,10 @@ "CMS_BASE": "{{ CMS_HOST }}", "LMS_BASE": "{{ LMS_HOST }}", "CONTACT_EMAIL": "{{ CONTACT_EMAIL }}", - "CELERY_BROKER_HOSTNAME": "{{ RABBITMQ_HOST }}", "CELERY_BROKER_TRANSPORT": "amqp", + "CELERY_BROKER_HOSTNAME": "{{ RABBITMQ_HOST }}", + "CELERY_BROKER_USER": "{{ RABBITMQ_USERNAME }}", + "CELERY_BROKER_PASSWORD": "{{ RABBITMQ_PASSWORD }}", "COMMENTS_SERVICE_URL": "http://forum:4567", "COMMENTS_SERVICE_KEY": "forumapikey", "COMPREHENSIVE_THEME_DIRS": ["/openedx/themes"], diff --git a/tutor/templates/apps/xqueue/settings/tutor.py b/tutor/templates/apps/xqueue/settings/tutor.py index c93075b..b688110 100644 --- a/tutor/templates/apps/xqueue/settings/tutor.py +++ b/tutor/templates/apps/xqueue/settings/tutor.py @@ -17,8 +17,6 @@ LOGGING = get_logger_config( dev_env=True, ) -RABBIT_HOST = '{{ RABBITMQ_HOST }}' -RABBIT_PORT = 5672 SECRET_KEY = '{{ XQUEUE_SECRET_KEY }}' XQUEUE_USERS = { diff --git a/tutor/templates/config-defaults.yml b/tutor/templates/config-defaults.yml index 647d401..32564f3 100644 --- a/tutor/templates/config-defaults.yml +++ b/tutor/templates/config-defaults.yml @@ -36,6 +36,8 @@ NGINX_HTTPS_PORT: 443 NOTES_MYSQL_DATABASE: "notes" NOTES_MYSQL_USERNAME: "notes" RABBITMQ_HOST: "rabbitmq" +RABBITMQ_USERNAME: "" +RABBITMQ_PASSWORD: "" SMTP_HOST: "smtp" SMTP_PORT: 25 SMTP_USERNAME: ""