Skip to content
Snippets Groups Projects
Commit 79fed45c authored by Stefano Alberto Russo's avatar Stefano Alberto Russo
Browse files

Parametrised the tunnel host.

parent 7e246d98
No related branches found
No related tags found
No related merge requests found
......@@ -45,6 +45,7 @@ services:
- SAFEMODE=False
- DJANGO_LOG_LEVEL=CRITICAL
- ROSETTA_LOG_LEVEL=DEBUG
#- ROSETTA_TUNNEL_HOST=
#- ROSETTA_WEBAPP_HOST=
#- ROSETTA_WEBAPP_PORT=8080
#- LOCAL_DOCKER_REGISTRY_HOST=
......
......@@ -452,7 +452,9 @@ def get_local_docker_registry_conn_string():
local_docker_registry_conn_string = '{}:{}'.format(local_docker_registry_host, local_docker_registry_port)
return local_docker_registry_conn_string
def get_tunnel_host():
tunnel_host = os.environ.get('ROSETTA_TUNNEL_HOST', 'localhost')
return tunnel_host
......
......@@ -339,7 +339,9 @@ def tasks(request):
subprocess.Popen(background_tunnel_command, shell=True)
# Ok, now redirect to the task through the tunnel
return redirect('http://localhost:{}'.format(task.tunnel_port))
from utils import get_tunnel_host
tunnel_host = get_tunnel_host()
return redirect('http://{}:{}'.format(tunnel_host,task.tunnel_port))
except Exception as e:
data['error'] = 'Error in getting the task or performing the required action'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment