Skip to content

Commit

Permalink
update opensearch config
Browse files Browse the repository at this point in the history
  • Loading branch information
delcroip committed Nov 1, 2024
1 parent 3517475 commit 9114a57
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
| PHOTO_ROOT_PATH | String | Define the path for the photos of insurees. This setting is used in the Insuree module. The value set here will be overwritten by the InsureeConfig file. |
| DJANGO_MIGRATE | True, False | Based on the value set, application runs the migration command before starting up. If the SITE_ROOT value is set to api then the migration will always run regardless of the value |
| SCHEDULER_AUTOSTART | True, False | All the modules will be searched for the scheduled tasks, if the value is set to True |
| OPENSEARCH_HOST | String | Define the opensearch host |
| OPENSEARCH_HOSTS | String | Define the opensearch hosts, comma separated http://opensearch:9200 |
| OPENSEARCH_ADMIN | String | Define the login name for open search |
| OPENSEARCH_PASSWORD | String | Define the admin password to login to open search |
| BE_BRANCH | String | Define the github branch for the Backend form which you wan to install the module. Default is develop. |
Expand Down
7 changes: 5 additions & 2 deletions openIMIS/openIMIS/settings/opensearch.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import os


OPENSEARCH_HOST = os.environ.get("OPENSEARCH_HOST", "0.0.0.0")

os_hosts = os.environ.get("OPENSEARCH_HOSTS", "http://opensearch:9200")


OPEN_SEARCH_HTTP_PORT = os.environ.get("OPEN_SEARCH_HTTP_PORT", "9200")
OPENSEARCH_DSL_AUTOSYNC = os.environ.get('OPENSEARCH_DSL_AUTOSYNC', 'True') == 'True'

OPENSEARCH_DSL = {
'default': {
'hosts': f"{OPENSEARCH_HOST}:{OPEN_SEARCH_HTTP_PORT}",
'hosts': ','.split(os_hosts),
'http_auth': (
f"{os.environ.get('OPENSEARCH_ADMIN')}",
f"{os.environ.get('OPENSEARCH_PASSWORD')}"
Expand Down
1 change: 0 additions & 1 deletion openIMIS/openIMIS/settings/queue_cache.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
import json


# Celery message broker configuration for RabbitMQ. One can also use Redis on AWS SQS
CELERY_BROKER_URL = os.environ.get("CELERY_BROKER_URL", "amqp://rabitmq")
if 'CELERY_RESULT_BACKEND' in os.environ:
Expand Down

0 comments on commit 9114a57

Please sign in to comment.