diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 406c3c670c9f4c7b87ace3961e41337b321a8beb..403f40fb476680a9386c78faf91ec9e3e5fd6826 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -69,8 +69,9 @@ services: - DJANGO_DEBUG=True - DJANGO_LOG_LEVEL=CRITICAL - ROSETTA_LOG_LEVEL=DEBUG - #- ROSETTA_WEBAPP_HOST=localhost # Internal, for the agent - #- ROSETTA_WEBAPP_PORT=8080 # Internal, for the agent + #- ROSETTA_WEBAPP_SSL=False # Used for the agent. + #- ROSETTA_WEBAPP_HOST= # Used for the agent, can be internal. Defaults to webapp IP. + #- ROSETTA_WEBAPP_PORT=8080 # Used for the agent, can be internal. #- ROSETTA_REGISTRY_HOST=proxy #- ROSETTA_REGISTRY_PORT=5000 #- DJANGO_EMAIL_APIKEY="" diff --git a/services/webapp/code/rosetta/core_app/utils.py b/services/webapp/code/rosetta/core_app/utils.py index 51f40d63514f3897f154e0763291c5d0916ad2c8..bef643ec17417f16c758ad55c89c5f27390c06fb 100644 --- a/services/webapp/code/rosetta/core_app/utils.py +++ b/services/webapp/code/rosetta/core_app/utils.py @@ -504,9 +504,13 @@ def get_my_ip(): return my_ip def get_webapp_conn_string(): + webapp_ssl = booleanize(os.environ.get('ROSETTA_WEBAPP_SSL', False)) webapp_host = os.environ.get('ROSETTA_WEBAPP_HOST', get_my_ip()) webapp_port = os.environ.get('ROSETTA_WEBAPP_PORT', '8080') - webapp_conn_string = 'http://{}:{}'.format(webapp_host, webapp_port) + if webapp_ssl: + webapp_conn_string = 'https://{}:{}'.format(webapp_host, webapp_port) + else: + webapp_conn_string = 'http://{}:{}'.format(webapp_host, webapp_port) return webapp_conn_string def get_platform_registry():