diff --git a/services/webapp/code/rosetta/core_app/management/commands/core_app_populate.py b/services/webapp/code/rosetta/core_app/management/commands/core_app_populate.py index 984295beadaf112dd19c370e828cce02837cdf3a..6b835411660e24d0d7eee92ffbbf56e81c2136e2 100644 --- a/services/webapp/code/rosetta/core_app/management/commands/core_app_populate.py +++ b/services/webapp/code/rosetta/core_app/management/commands/core_app_populate.py @@ -126,7 +126,7 @@ class Command(BaseCommand): supports_custom_interface_port = True, supports_interface_auth = True) - # Jupyter Notebook + # SSH server Container.objects.create(user = None, name = 'SSH server', description = 'A SSH server supporting X forwarding as well.', @@ -136,7 +136,7 @@ class Command(BaseCommand): arch = 'x86_64', os = 'linux', interface_port = '22', - interface_protocol = 'http', + interface_protocol = 'ssh', interface_transport = 'tcp/ip', supports_custom_interface_port = True, supports_interface_auth = True) diff --git a/services/webapp/code/rosetta/core_app/templates/task_connect.html b/services/webapp/code/rosetta/core_app/templates/task_connect.html index b4cbda01595632e58a006c069e20433dbcfd9de5..3c517f2b1a0ac9604b0a058de40a8b8d47cc76ef 100644 --- a/services/webapp/code/rosetta/core_app/templates/task_connect.html +++ b/services/webapp/code/rosetta/core_app/templates/task_connect.html @@ -52,9 +52,11 @@ {% if data.task.container.interface_protocol == 'http' or data.task.container.interface_protocol == 'https' %} <input type='submit' style="width:110px" class="btn btn-lg btn-success btn-block" value='Log in' /> {% else %} - To connect, open the program suitable for this task interface protocol ({{data.task.container.interface_protocol}}) with:<br /> - IP: <code>{{ data.task.tcp_tunnel_host}}</code><br /> - Port: <code>{{ data.task.tcp_tunnel_port}}</code> + To connect, use a program suitable for this task interface protocol ({{data.task.container.interface_protocol}}) with:<br /> + <p style="margin-top:5px; line-height:1.8em"> + <b>Host:</b> <code>{{ data.task.tcp_tunnel_host}}</code><br /> + <b>Port:</b> <code>{{ data.task.tcp_tunnel_port}}</code> + </p> {% endif %} diff --git a/services/webapp/code/rosetta/core_app/views.py b/services/webapp/code/rosetta/core_app/views.py index 298c86d4fe52f093f8bf9a28d119a544e695ed83..685b60cd0e22e4b47c9fcf66bc4fe6f9ec5dfba4 100644 --- a/services/webapp/code/rosetta/core_app/views.py +++ b/services/webapp/code/rosetta/core_app/views.py @@ -994,12 +994,14 @@ def task_connect(request): # Get the task - #task = Task.objects.get(uuid__startswith=short_uuid) task = Task.objects.get(uuid=task_uuid) if task.user != request.user: raise ErrorMessage('You do not have access to this task.') - + + # Ensure that the tunnel and proxy are set up + setup_tunnel_and_proxy(task) + data ={} data['task'] = task @@ -1020,7 +1022,7 @@ def direct_connection_handler(request, uuid): if task.user != request.user: raise ErrorMessage('You do not have access to this task.') - # First ensure that the tunnel and proxy are set up + # Ensure that the tunnel and proxy are set up setup_tunnel_and_proxy(task) # Get task and tunnel proxy host