Commit 79fed45c authored by Stefano Alberto Russo's avatar Stefano Alberto Russo
Browse files

Parametrised the tunnel host.

parent 7e246d98
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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=
+3 −1
Original line number Diff line number Diff line
@@ -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



+3 −1
Original line number Diff line number Diff line
@@ -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'