Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/20250910_165903_sorlanczyk_release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[Feature] Added a variable `REDIS_TRANSPORT` (defaults to `redis`) that allows to change the redis transport protocol to secure redis (i.e `rediss`). (by @so-jd)
2 changes: 2 additions & 0 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ Redis
- ``REDIS_PORT`` (default: ``6379``)
- ``REDIS_USERNAME`` (default: ``""``)
- ``REDIS_PASSWORD`` (default: ``""``)
- ``REDIS_TRANSPORT`` (default: ``redis``)


Note that Redis has replaced Rabbitmq as the Celery message broker since Tutor v11.0.0.

Expand Down
2 changes: 1 addition & 1 deletion tutor/templates/apps/openedx/config/cms.env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CMS_ROOT_URL: "{{ "https" if ENABLE_HTTPS else "http" }}://{{ CMS_HOST }}"
CMS_BASE: "{{ CMS_HOST }}"
LMS_BASE: "{{ LMS_HOST }}"
CONTACT_EMAIL: "{{ CONTACT_EMAIL }}"
CELERY_BROKER_TRANSPORT: "redis"
CELERY_BROKER_TRANSPORT: "{{ REDIS_TRANSPORT }}"
CELERY_BROKER_HOSTNAME: "{{ REDIS_HOST }}:{{ REDIS_PORT }}"
CELERY_BROKER_VHOST: "{{ OPENEDX_CELERY_REDIS_DB }}"
CELERY_BROKER_USER: "{{ REDIS_USERNAME }}"
Expand Down
2 changes: 1 addition & 1 deletion tutor/templates/apps/openedx/config/lms.env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CMS_ROOT_URL: "{{ "https" if ENABLE_HTTPS else "http" }}://{{ CMS_HOST }}"
CMS_BASE: "{{ CMS_HOST }}"
LMS_BASE: "{{ LMS_HOST }}"
CONTACT_EMAIL: "{{ CONTACT_EMAIL }}"
CELERY_BROKER_TRANSPORT: "redis"
CELERY_BROKER_TRANSPORT: "{{ REDIS_TRANSPORT }}"
CELERY_BROKER_HOSTNAME: "{{ REDIS_HOST }}:{{ REDIS_PORT }}"
CELERY_BROKER_VHOST: "{{ OPENEDX_CELERY_REDIS_DB }}"
CELERY_BROKER_USER: "{{ REDIS_USERNAME }}"
Expand Down
15 changes: 8 additions & 7 deletions tutor/templates/apps/openedx/settings/partials/common_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,47 +42,48 @@
MEILISEARCH_API_KEY = "{{ MEILISEARCH_API_KEY }}"
MEILISEARCH_MASTER_KEY = "{{ MEILISEARCH_MASTER_KEY }}"
SEARCH_ENGINE = "search.meilisearch.MeilisearchEngine"
REDIS_TRANSPORT = "{{ REDIS_TRANSPORT }}"

# Common cache config
CACHES = {
"default": {
"KEY_PREFIX": "default",
"VERSION": "1",
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}",
"LOCATION": "{{ REDIS_TRANSPORT }}://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}",
},
"general": {
"KEY_PREFIX": "general",
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}",
"LOCATION": "{{ REDIS_TRANSPORT }}://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}",
},
"mongo_metadata_inheritance": {
"KEY_PREFIX": "mongo_metadata_inheritance",
"TIMEOUT": 300,
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}",
"LOCATION": "{{ REDIS_TRANSPORT }}://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}",
},
"configuration": {
"KEY_PREFIX": "configuration",
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}",
"LOCATION": "{{ REDIS_TRANSPORT }}://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}",
},
"celery": {
"KEY_PREFIX": "celery",
"TIMEOUT": 7200,
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}",
"LOCATION": "{{ REDIS_TRANSPORT }}://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}",
},
"course_structure_cache": {
"KEY_PREFIX": "course_structure",
"TIMEOUT": 604800, # 1 week
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}",
"LOCATION": "{{ REDIS_TRANSPORT }}://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}",
},
"ora2-storage": {
"KEY_PREFIX": "ora2-storage",
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}",
"LOCATION": "{{ REDIS_TRANSPORT }}://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}",
}
}

Expand Down
1 change: 1 addition & 0 deletions tutor/templates/config/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ NPM_REGISTRY: "https://registry.npmjs.org/"
PLATFORM_NAME: "My Open edX"
PREVIEW_LMS_HOST: "preview.{{ LMS_HOST }}"
REDIS_HOST: "redis"
REDIS_TRANSPORT: "redis"
REDIS_PORT: 6379
REDIS_USERNAME: ""
REDIS_PASSWORD: ""
Expand Down