add option to disable mesh autologin

This commit is contained in:
sadnub 2022-04-12 16:18:31 -04:00
parent 96a72a2cd7
commit b5e3b16e3a
5 changed files with 35 additions and 5 deletions

View File

@ -25,7 +25,7 @@ urllib3==1.26.9
validators==0.18.2
websockets==10.2
drf_spectacular==0.22.0
meshctrl==0.1.13
meshctrl==0.1.15
hiredis==2.0.0
# dev

View File

@ -224,11 +224,17 @@ class AgentMeshCentral(APIView):
agent = get_object_or_404(Agent, agent_id=agent_id)
core = get_core_settings()
token = get_login_token(key=core.mesh_token, user=f"user//{core.mesh_username}")
if not core.mesh_disable_auto_login:
token = get_login_token(
key=core.mesh_token, user=f"user//{core.mesh_username}"
)
token_param = f"login={token}&"
else:
token_param = ""
control = f"{core.mesh_site}/?login={token}&gotonode={agent.mesh_node_id}&viewmode=11&hide=31"
terminal = f"{core.mesh_site}/?login={token}&gotonode={agent.mesh_node_id}&viewmode=12&hide=31"
file = f"{core.mesh_site}/?login={token}&gotonode={agent.mesh_node_id}&viewmode=13&hide=31"
control = f"{core.mesh_site}/?{token_param}gotonode={agent.mesh_node_id}&viewmode=11&hide=31"
terminal = f"{core.mesh_site}/?{token_param}gotonode={agent.mesh_node_id}&viewmode=12&hide=31"
file = f"{core.mesh_site}/?{token_param}gotonode={agent.mesh_node_id}&viewmode=13&hide=31"
AuditLog.audit_mesh_session(
username=request.user.username,

View File

@ -0,0 +1,18 @@
# Generated by Django 4.0.3 on 2022-04-12 18:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0032_alter_coresettings_email_alert_recipients_and_more'),
]
operations = [
migrations.AddField(
model_name='coresettings',
name='mesh_disable_auto_login',
field=models.BooleanField(default=False),
),
]

View File

@ -66,6 +66,7 @@ class CoreSettings(BaseAuditModel):
mesh_device_group = models.CharField(
max_length=255, null=True, blank=True, default="TacticalRMM"
)
mesh_disable_auto_login = models.BooleanField(default=False)
agent_auto_update = models.BooleanField(default=True)
workstation_policy = models.ForeignKey(
"automation.Policy",

View File

@ -347,6 +347,11 @@
<div class="col-2"></div>
<q-input dense outlined v-model="settings.mesh_device_group" class="col-6" />
</q-card-section>
<q-card-section class="row">
<div class="col-4">Disable Auto Login for Remote Control and Remote background:</div>
<div class="col-2"></div>
<q-checkbox dense v-model="settings.mesh_disable_auto_login" class="col-6" />
</q-card-section>
</q-tab-panel>
<q-tab-panel name="customfields">
<CustomFields />