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 09f171736b5f3b3fe86a32433b8d486edbac1a0e..b5ffae06cc56e4441f6b905413c9a933ed8b7b41 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 @@ -155,7 +155,8 @@ to provide help, news and informations on your deployment. Or you can just ignor interface_protocol = 'http', interface_transport = 'tcp/ip', supports_custom_interface_port = True, - supports_interface_auth = True) + supports_interface_auth = True, + interface_auth_user = None) # Jupyter Notebook @@ -171,12 +172,13 @@ to provide help, news and informations on your deployment. Or you can just ignor interface_protocol = 'http', interface_transport = 'tcp/ip', supports_custom_interface_port = True, - supports_interface_auth = True) + supports_interface_auth = True, + interface_auth_user = None) # SSH server Container.objects.create(user = None, name = 'SSH server', - description = 'A SSH server supporting X forwarding as well.', + description = 'An SSH server supporting X forwarding as well.', registry = 'docker.io', image = 'sarusso/ssh', tag = 'v0.2.0', @@ -186,7 +188,8 @@ to provide help, news and informations on your deployment. Or you can just ignor interface_protocol = 'ssh', interface_transport = 'tcp/ip', supports_custom_interface_port = True, - supports_interface_auth = True) + supports_interface_auth = True, + interface_auth_user = 'metauser') #===================== # Testuser containers diff --git a/services/webapp/code/rosetta/core_app/migrations/0021_container_interface_auth_user.py b/services/webapp/code/rosetta/core_app/migrations/0021_container_interface_auth_user.py new file mode 100644 index 0000000000000000000000000000000000000000..34781fe38e0974eddc9c651a055e9989ce9c40b3 --- /dev/null +++ b/services/webapp/code/rosetta/core_app/migrations/0021_container_interface_auth_user.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.1 on 2021-11-16 00:44 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core_app', '0020_profile_auth'), + ] + + operations = [ + migrations.AddField( + model_name='container', + name='interface_auth_user', + field=models.CharField(blank=True, max_length=36, null=True, verbose_name='Interface auth fixed user if any'), + ), + ] diff --git a/services/webapp/code/rosetta/core_app/models.py b/services/webapp/code/rosetta/core_app/models.py index daed8e165b032b5132eb177aaa2ee3d955225115..77514a195336d0f778c95a0318ea50c6e6f4c07b 100644 --- a/services/webapp/code/rosetta/core_app/models.py +++ b/services/webapp/code/rosetta/core_app/models.py @@ -135,6 +135,7 @@ class Container(models.Model): # Capabilities supports_custom_interface_port = models.BooleanField('Supports custom interface port', default=False) # BASE_PORT supports_interface_auth = models.BooleanField('Supports interface auth', default=False) # AUTH_USER / AUTH_PASS + interface_auth_user = models.CharField('Interface auth fixed user if any', max_length=36, blank=True, null=True) class Meta: ordering = ['name'] 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 3c517f2b1a0ac9604b0a058de40a8b8d47cc76ef..a618660768330a35f467547d5f5adcbf3de6a487 100644 --- a/services/webapp/code/rosetta/core_app/templates/task_connect.html +++ b/services/webapp/code/rosetta/core_app/templates/task_connect.html @@ -13,7 +13,16 @@ <h2> Connecting to task <b>{{ data.task.name }}</b></h2> <p style="font-size: 16px;"> <br /> + + {% if not data.task.requires_proxy_auth %} + {% if data.task.container.interface_auth_user %} + User: <input style="margin-bottom:15px;" type="username" class="form-control" value="{{ data.task.container.interface_auth_user }}"name='username' readonly > + {% else %} + + {% endif %} + {% else %} User: <input style="margin-bottom:15px;" type="username" class="form-control" value="{{ request.user.email }}"name='username' readonly > + {% endif %} {% if data.task.requires_proxy_auth %} @@ -34,13 +43,21 @@ Password: <input type="text" class="form-control" placeholder="" value="{{data.task.auth_token}}" name='password' readonly> <p style="margin-left:10px; font-size:0.9em; color:#484848"> <i class="fa fa-info-circle" style="color:#337ab7"></i> + {% if not data.task.requires_proxy_auth and data.task.container.interface_auth_user %} This task will require to manually enter the above user and password token + {% else %} + This task will require to manually enter the above password token + {% endif %} </p> {% else %} Password: <input type="password" class="form-control" placeholder="" value="placeholder" name='password' readonly> <p style="margin-left:10px; font-size:0.9em; color:#484848"> <i class="fa fa-info-circle" style="color:#337ab7"></i> + {% if not data.task.requires_proxy_auth and data.task.container.interface_auth_user %} This task will require to manually enter the above user and the password set up when creating the task + {% else %} + This task will require to manually enter the password set up when creating the task + {% endif %} </p> {% endif %}