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

Added support for fixing a user in the container interface auth.

parent 0b618b59
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
# 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'),
),
]
......@@ -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']
......
......@@ -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 %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment