mirror of https://github.com/jumpserver/jumpserver
feat: 添加组件类型 razor 并替换 XRDP_ENABLED
parent
dade0cadda
commit
2366f02d10
|
@ -324,8 +324,7 @@ class Config(dict):
|
||||||
# 保留(Luna还在用)
|
# 保留(Luna还在用)
|
||||||
'TERMINAL_MAGNUS_ENABLED': True,
|
'TERMINAL_MAGNUS_ENABLED': True,
|
||||||
'TERMINAL_KOKO_SSH_ENABLED': True,
|
'TERMINAL_KOKO_SSH_ENABLED': True,
|
||||||
# 保留(Luna还在用)
|
'TERMINAL_RAZOR_ENABLED': True,
|
||||||
'XRDP_ENABLED': True,
|
|
||||||
|
|
||||||
# 安全配置
|
# 安全配置
|
||||||
'SECURITY_MFA_AUTH': 0, # 0 不开启 1 全局开启 2 管理员开启
|
'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
|
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_MAGNUS_ENABLED = CONFIG.TERMINAL_MAGNUS_ENABLED
|
||||||
TERMINAL_KOKO_SSH_ENABLED = CONFIG.TERMINAL_KOKO_SSH_ENABLED
|
TERMINAL_KOKO_SSH_ENABLED = CONFIG.TERMINAL_KOKO_SSH_ENABLED
|
||||||
|
|
||||||
|
|
|
@ -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_FEISHU = serializers.BooleanField()
|
||||||
AUTH_TEMP_TOKEN = serializers.BooleanField()
|
AUTH_TEMP_TOKEN = serializers.BooleanField()
|
||||||
|
|
||||||
XRDP_ENABLED = serializers.BooleanField()
|
TERMINAL_RAZOR_ENABLED = serializers.BooleanField()
|
||||||
TERMINAL_MAGNUS_ENABLED = serializers.BooleanField()
|
TERMINAL_MAGNUS_ENABLED = serializers.BooleanField()
|
||||||
TERMINAL_KOKO_SSH_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")
|
"if you cannot log in to the device through Telnet, set this parameter")
|
||||||
)
|
)
|
||||||
TERMINAL_MAGNUS_ENABLED = serializers.BooleanField(label=_("Enable database proxy"))
|
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"))
|
TERMINAL_KOKO_SSH_ENABLED = serializers.BooleanField(label=_("Enable SSH Client"))
|
||||||
|
|
|
@ -49,6 +49,7 @@ class TerminalTypeChoices(TextChoices):
|
||||||
core = 'core', 'Core'
|
core = 'core', 'Core'
|
||||||
celery = 'celery', 'Celery'
|
celery = 'celery', 'Celery'
|
||||||
magnus = 'magnus', 'Magnus'
|
magnus = 'magnus', 'Magnus'
|
||||||
|
razor = 'razor', 'Razor'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def types(cls):
|
def types(cls):
|
||||||
|
|
|
@ -21,7 +21,7 @@ def migrate_endpoints(apps, schema_editor):
|
||||||
}
|
}
|
||||||
Endpoint.objects.create(**default_data)
|
Endpoint.objects.create(**default_data)
|
||||||
|
|
||||||
if not settings.XRDP_ENABLED:
|
if not settings.TERMINAL_RAZOR_ENABLED:
|
||||||
return
|
return
|
||||||
# migrate xrdp
|
# migrate xrdp
|
||||||
xrdp_addr = settings.TERMINAL_RDP_ADDR
|
xrdp_addr = settings.TERMINAL_RDP_ADDR
|
||||||
|
@ -41,7 +41,7 @@ def migrate_endpoints(apps, schema_editor):
|
||||||
else:
|
else:
|
||||||
rdp_port = 3389
|
rdp_port = 3389
|
||||||
xrdp_data = {
|
xrdp_data = {
|
||||||
'name': 'XRDP',
|
'name': 'Razor',
|
||||||
'host': host,
|
'host': host,
|
||||||
'https_port': 0,
|
'https_port': 0,
|
||||||
'http_port': 0,
|
'http_port': 0,
|
||||||
|
@ -56,7 +56,7 @@ def migrate_endpoints(apps, schema_editor):
|
||||||
|
|
||||||
EndpointRule = apps.get_model("terminal", "EndpointRule")
|
EndpointRule = apps.get_model("terminal", "EndpointRule")
|
||||||
xrdp_rule_data = {
|
xrdp_rule_data = {
|
||||||
'name': 'XRDP',
|
'name': 'Razor',
|
||||||
'ip_group': ['*'],
|
'ip_group': ['*'],
|
||||||
'priority': 20,
|
'priority': 20,
|
||||||
'endpoint': xrdp_endpoint,
|
'endpoint': xrdp_endpoint,
|
||||||
|
|
|
@ -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'),
|
||||||
|
),
|
||||||
|
]
|
Loading…
Reference in New Issue