mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-01 15:37:19 +00:00
feat: 添加组件类型 razor 并替换 XRDP_ENABLED
This commit is contained in:
@@ -324,8 +324,7 @@ class Config(dict):
|
||||
# 保留(Luna还在用)
|
||||
'TERMINAL_MAGNUS_ENABLED': True,
|
||||
'TERMINAL_KOKO_SSH_ENABLED': True,
|
||||
# 保留(Luna还在用)
|
||||
'XRDP_ENABLED': True,
|
||||
'TERMINAL_RAZOR_ENABLED': True,
|
||||
|
||||
# 安全配置
|
||||
'SECURITY_MFA_AUTH': 0, # 0 不开启 1 全局开启 2 管理员开启
|
||||
|
@@ -139,7 +139,7 @@ LOGIN_REDIRECT_MSG_ENABLED = CONFIG.LOGIN_REDIRECT_MSG_ENABLED
|
||||
|
||||
CLOUD_SYNC_TASK_EXECUTION_KEEP_DAYS = CONFIG.CLOUD_SYNC_TASK_EXECUTION_KEEP_DAYS
|
||||
|
||||
XRDP_ENABLED = CONFIG.XRDP_ENABLED
|
||||
TERMINAL_RAZOR_ENABLED = CONFIG.TERMINAL_RAZOR_ENABLED
|
||||
TERMINAL_MAGNUS_ENABLED = CONFIG.TERMINAL_MAGNUS_ENABLED
|
||||
TERMINAL_KOKO_SSH_ENABLED = CONFIG.TERMINAL_KOKO_SSH_ENABLED
|
||||
|
||||
|
23
apps/settings/migrations/0006_remove_setting_enabled.py
Normal file
23
apps/settings/migrations/0006_remove_setting_enabled.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# Generated by Django 3.1.14 on 2022-06-06 09:45
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def migrate_terminal_razor_enabled(apps, schema_editor):
|
||||
setting_model = apps.get_model("settings", "Setting")
|
||||
s = setting_model.objects.filter(name='XRDP_ENABLED').first()
|
||||
if not s:
|
||||
return
|
||||
s.name = 'TERMINAL_RAZOR_ENABLED'
|
||||
s.save()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('settings', '0005_auto_20220310_0616'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(migrate_terminal_razor_enabled),
|
||||
]
|
@@ -35,7 +35,7 @@ class PrivateSettingSerializer(PublicSettingSerializer):
|
||||
AUTH_FEISHU = serializers.BooleanField()
|
||||
AUTH_TEMP_TOKEN = serializers.BooleanField()
|
||||
|
||||
XRDP_ENABLED = serializers.BooleanField()
|
||||
TERMINAL_RAZOR_ENABLED = serializers.BooleanField()
|
||||
TERMINAL_MAGNUS_ENABLED = serializers.BooleanField()
|
||||
TERMINAL_KOKO_SSH_ENABLED = serializers.BooleanField()
|
||||
|
||||
|
@@ -34,5 +34,5 @@ class TerminalSettingSerializer(serializers.Serializer):
|
||||
"if you cannot log in to the device through Telnet, set this parameter")
|
||||
)
|
||||
TERMINAL_MAGNUS_ENABLED = serializers.BooleanField(label=_("Enable database proxy"))
|
||||
XRDP_ENABLED = serializers.BooleanField(label=_("Enable XRDP"))
|
||||
TERMINAL_RAZOR_ENABLED = serializers.BooleanField(label=_("Enable Razor"))
|
||||
TERMINAL_KOKO_SSH_ENABLED = serializers.BooleanField(label=_("Enable SSH Client"))
|
||||
|
@@ -49,6 +49,7 @@ class TerminalTypeChoices(TextChoices):
|
||||
core = 'core', 'Core'
|
||||
celery = 'celery', 'Celery'
|
||||
magnus = 'magnus', 'Magnus'
|
||||
razor = 'razor', 'Razor'
|
||||
|
||||
@classmethod
|
||||
def types(cls):
|
||||
|
@@ -21,7 +21,7 @@ def migrate_endpoints(apps, schema_editor):
|
||||
}
|
||||
Endpoint.objects.create(**default_data)
|
||||
|
||||
if not settings.XRDP_ENABLED:
|
||||
if not settings.TERMINAL_RAZOR_ENABLED:
|
||||
return
|
||||
# migrate xrdp
|
||||
xrdp_addr = settings.TERMINAL_RDP_ADDR
|
||||
@@ -41,7 +41,7 @@ def migrate_endpoints(apps, schema_editor):
|
||||
else:
|
||||
rdp_port = 3389
|
||||
xrdp_data = {
|
||||
'name': 'XRDP',
|
||||
'name': 'Razor',
|
||||
'host': host,
|
||||
'https_port': 0,
|
||||
'http_port': 0,
|
||||
@@ -56,7 +56,7 @@ def migrate_endpoints(apps, schema_editor):
|
||||
|
||||
EndpointRule = apps.get_model("terminal", "EndpointRule")
|
||||
xrdp_rule_data = {
|
||||
'name': 'XRDP',
|
||||
'name': 'Razor',
|
||||
'ip_group': ['*'],
|
||||
'priority': 20,
|
||||
'endpoint': xrdp_endpoint,
|
||||
|
18
apps/terminal/migrations/0050_auto_20220606_1745.py
Normal file
18
apps/terminal/migrations/0050_auto_20220606_1745.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.1.14 on 2022-06-06 09:45
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('terminal', '0049_endpoint_redis_port'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='terminal',
|
||||
name='type',
|
||||
field=models.CharField(choices=[('koko', 'KoKo'), ('guacamole', 'Guacamole'), ('omnidb', 'OmniDB'), ('xrdp', 'Xrdp'), ('lion', 'Lion'), ('core', 'Core'), ('celery', 'Celery'), ('magnus', 'Magnus'), ('razor', 'Razor')], default='koko', max_length=64, verbose_name='type'),
|
||||
),
|
||||
]
|
Reference in New Issue
Block a user