7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-10 09:42:23 +00:00

Configurable mongodb username/password/port

This commit is contained in:
Régis Behmo 2019-03-20 19:18:46 +01:00
parent e35efa3302
commit a85ee37682
7 changed files with 37 additions and 11 deletions

View File

@ -2,7 +2,7 @@
## Latest
- [Improvement] Add configurable SMTP and Rabbitmq authentication
- [Improvement] Add configurable mongodb, SMTP and rabbitmq authentication
- [Improvement] Harmonize mysql username/password configuration parameters
- [Feature] Configurable and pluggable data storage backends (#114)

View File

@ -87,6 +87,9 @@ Mongodb
- ``ACTIVATE_MONGODB`` (default: ``true``)
- ``MONGODB_HOST`` (default: ``"mongodb"``)
- ``MONGODB_DATABASE`` (default: ``"openedx"``)
- ``MONGODB_PORT`` (default: ``27017``)
- ``MONGODB_USERNAME`` (default: ``""``)
- ``MONGODB_PASSWORD`` (default: ``""``)
Rabbitmq
~~~~~~~~

View File

@ -12,13 +12,23 @@
"CONTENTSTORE": {
"ENGINE": "xmodule.contentstore.mongo.MongoContentStore",
"DOC_STORE_CONFIG": {
"db": "{{ MONGODB_DATABASE }}",
"host": "{{ MONGODB_HOST }}"
"host": "{{ MONGODB_HOST }}",
"port": {{ MONGODB_PORT }},
{% if MONGODB_USERNAME and MONGODB_PASSWORD %}
"user": "{{ MONGODB_USERNAME }}",
"password": "{{ MONGODB_PASSWORD }}",
{% endif %}
"db": "{{ MONGODB_DATABASE }}"
}
},
"DOC_STORE_CONFIG": {
"db": "{{ MONGODB_DATABASE }}",
"host": "{{ MONGODB_HOST }}"
"host": "{{ MONGODB_HOST }}",
"port": {{ MONGODB_PORT }},
{% if MONGODB_USERNAME and MONGODB_PASSWORD %}
"user": "{{ MONGODB_USERNAME }}",
"password": "{{ MONGODB_PASSWORD }}",
{% endif %}
"db": "{{ MONGODB_DATABASE }}"
},
"DATABASES": {
"default": {

View File

@ -12,13 +12,23 @@
"CONTENTSTORE": {
"ENGINE": "xmodule.contentstore.mongo.MongoContentStore",
"DOC_STORE_CONFIG": {
"db": "{{ MONGODB_DATABASE }}",
"host": "{{ MONGODB_HOST }}"
"host": "{{ MONGODB_HOST }}",
"port": {{ MONGODB_PORT }},
{% if MONGODB_USERNAME and MONGODB_PASSWORD %}
"user": "{{ MONGODB_USERNAME }}",
"password": "{{ MONGODB_PASSWORD }}",
{% endif %}
"db": "{{ MONGODB_DATABASE }}"
}
},
"DOC_STORE_CONFIG": {
"db": "{{ MONGODB_DATABASE }}",
"host": "{{ MONGODB_HOST }}"
"host": "{{ MONGODB_HOST }}",
"port": {{ MONGODB_PORT }},
{% if MONGODB_USERNAME and MONGODB_PASSWORD %}
"user": "{{ MONGODB_USERNAME }}",
"password": "{{ MONGODB_PASSWORD }}",
{% endif %}
"db": "{{ MONGODB_DATABASE }}"
},
"DATABASES": {
"default": {

View File

@ -27,6 +27,9 @@ MEMCACHED_HOST: "memcached"
MEMCACHED_PORT: 11211
MONGODB_HOST: "mongodb"
MONGODB_DATABASE: "openedx"
MONGODB_PORT: 27017
MONGODB_USERNAME: ""
MONGODB_PASSWORD: ""
OPENEDX_MYSQL_DATABASE: "openedx"
OPENEDX_MYSQL_USERNAME: "openedx"
MYSQL_HOST: "mysql"

View File

@ -70,7 +70,7 @@ spec:
- name: SEARCH_SERVER
value: "http://{{ ELASTICSEARCH_HOST }}:{{ ELASTICSEARCH_PORT }}"
- name: MONGOHQ_URL
value: "mongodb://{{ MONGODB_HOST }}/cs_comments_service"
value: "mongodb://{% if MONGODB_USERNAME and MONGODB_PASSWORD %}{{ MONGODB_USERNAME}}:{{ MONGODB_PASSWORD }}@{% endif %}{{ MONGODB_HOST }}:{{ MONGODB_PORT }}/cs_comments_service"
---
apiVersion: apps/v1

View File

@ -87,7 +87,7 @@ services:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_FORUM }}
environment:
SEARCH_SERVER: "http://{{ ELASTICSEARCH_HOST }}:{{ ELASTICSEARCH_PORT }}"
MONGOHQ_URL: "mongodb://{{ MONGODB_HOST }}/cs_comments_service"
MONGOHQ_URL: "mongodb://{% if MONGODB_USERNAME and MONGODB_PASSWORD %}{{ MONGODB_USERNAME}}:{{ MONGODB_PASSWORD }}@{% endif %}{{ MONGODB_HOST }}:{{ MONGODB_PORT }}/cs_comments_service"
restart: unless-stopped
depends_on:
{% if ACTIVATE_ELASTICSEARCH %}- elasticsearch{% endif %}