mirror of https://github.com/jumpserver/jumpserver
feat: 支持 Dameng 数据库
parent
dfd133cf5a
commit
48b037ac26
|
@ -8,6 +8,7 @@ class DatabaseTypes(BaseType):
|
||||||
ORACLE = 'oracle', 'Oracle'
|
ORACLE = 'oracle', 'Oracle'
|
||||||
SQLSERVER = 'sqlserver', 'SQLServer'
|
SQLSERVER = 'sqlserver', 'SQLServer'
|
||||||
DB2 = 'db2', 'DB2'
|
DB2 = 'db2', 'DB2'
|
||||||
|
DAMENG = 'dameng', 'Dameng'
|
||||||
CLICKHOUSE = 'clickhouse', 'ClickHouse'
|
CLICKHOUSE = 'clickhouse', 'ClickHouse'
|
||||||
MONGODB = 'mongodb', 'MongoDB'
|
MONGODB = 'mongodb', 'MongoDB'
|
||||||
REDIS = 'redis', 'Redis'
|
REDIS = 'redis', 'Redis'
|
||||||
|
@ -55,6 +56,15 @@ class DatabaseTypes(BaseType):
|
||||||
'change_secret_enabled': False,
|
'change_secret_enabled': False,
|
||||||
'push_account_enabled': False,
|
'push_account_enabled': False,
|
||||||
},
|
},
|
||||||
|
cls.DAMENG: {
|
||||||
|
'ansible_enabled': False,
|
||||||
|
'ping_enabled': False,
|
||||||
|
'gather_facts_enabled': False,
|
||||||
|
'gather_accounts_enabled': False,
|
||||||
|
'verify_account_enabled': False,
|
||||||
|
'change_secret_enabled': False,
|
||||||
|
'push_account_enabled': False,
|
||||||
|
},
|
||||||
cls.CLICKHOUSE: {
|
cls.CLICKHOUSE: {
|
||||||
'ansible_enabled': False,
|
'ansible_enabled': False,
|
||||||
'ping_enabled': False,
|
'ping_enabled': False,
|
||||||
|
@ -84,6 +94,7 @@ class DatabaseTypes(BaseType):
|
||||||
cls.ORACLE: [{'name': 'Oracle'}],
|
cls.ORACLE: [{'name': 'Oracle'}],
|
||||||
cls.SQLSERVER: [{'name': 'SQLServer'}],
|
cls.SQLSERVER: [{'name': 'SQLServer'}],
|
||||||
cls.DB2: [{'name': 'DB2'}],
|
cls.DB2: [{'name': 'DB2'}],
|
||||||
|
cls.DAMENG: [{'name': 'Dameng'}],
|
||||||
cls.CLICKHOUSE: [{'name': 'ClickHouse'}],
|
cls.CLICKHOUSE: [{'name': 'ClickHouse'}],
|
||||||
cls.MONGODB: [{'name': 'MongoDB'}],
|
cls.MONGODB: [{'name': 'MongoDB'}],
|
||||||
cls.REDIS: [
|
cls.REDIS: [
|
||||||
|
|
|
@ -23,6 +23,7 @@ class Protocol(ChoicesMixin, models.TextChoices):
|
||||||
postgresql = 'postgresql', 'PostgreSQL'
|
postgresql = 'postgresql', 'PostgreSQL'
|
||||||
sqlserver = 'sqlserver', 'SQLServer'
|
sqlserver = 'sqlserver', 'SQLServer'
|
||||||
db2 = 'db2', 'DB2'
|
db2 = 'db2', 'DB2'
|
||||||
|
dameng = 'dameng', 'Dameng'
|
||||||
clickhouse = 'clickhouse', 'ClickHouse'
|
clickhouse = 'clickhouse', 'ClickHouse'
|
||||||
redis = 'redis', 'Redis'
|
redis = 'redis', 'Redis'
|
||||||
mongodb = 'mongodb', 'MongoDB'
|
mongodb = 'mongodb', 'MongoDB'
|
||||||
|
@ -185,6 +186,12 @@ class Protocol(ChoicesMixin, models.TextChoices):
|
||||||
'secret_types': ['password'],
|
'secret_types': ['password'],
|
||||||
'xpack': True,
|
'xpack': True,
|
||||||
},
|
},
|
||||||
|
cls.dameng: {
|
||||||
|
'port': 5236,
|
||||||
|
'required': True,
|
||||||
|
'secret_types': ['password'],
|
||||||
|
'xpack': True,
|
||||||
|
},
|
||||||
cls.clickhouse: {
|
cls.clickhouse: {
|
||||||
'port': 9000,
|
'port': 9000,
|
||||||
'required': True,
|
'required': True,
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
# Generated by Django 4.1.10 on 2023-10-07 06:37
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
def add_dameng_platform(apps, schema_editor):
|
||||||
|
platform_cls = apps.get_model('assets', 'Platform')
|
||||||
|
automation_cls = apps.get_model('assets', 'PlatformAutomation')
|
||||||
|
platform, _ = platform_cls.objects.update_or_create(
|
||||||
|
name='Dameng', defaults={
|
||||||
|
'name': 'Dameng', 'category': 'database',
|
||||||
|
'internal': True, 'type': 'dameng',
|
||||||
|
'domain_enabled': True, 'su_enabled': False,
|
||||||
|
'su_method': None, 'comment': 'Dameng', 'created_by': 'System',
|
||||||
|
'updated_by': 'System', 'custom_fields': []
|
||||||
|
}
|
||||||
|
)
|
||||||
|
platform.protocols.update_or_create(name='dameng', defaults={
|
||||||
|
'name': 'dameng', 'port': 5236, 'primary': True, 'setting': {}
|
||||||
|
})
|
||||||
|
automation_cls.objects.update_or_create(platform=platform, defaults={'ansible_enabled': False})
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
dependencies = [
|
||||||
|
('assets', '0127_automation_remove_account'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RunPython(add_dameng_platform)
|
||||||
|
]
|
|
@ -166,7 +166,8 @@ class ConnectMethodUtil:
|
||||||
'support': [
|
'support': [
|
||||||
Protocol.mysql, Protocol.postgresql,
|
Protocol.mysql, Protocol.postgresql,
|
||||||
Protocol.oracle, Protocol.sqlserver,
|
Protocol.oracle, Protocol.sqlserver,
|
||||||
Protocol.mariadb, Protocol.db2
|
Protocol.mariadb, Protocol.db2,
|
||||||
|
Protocol.dameng
|
||||||
],
|
],
|
||||||
'match': 'm2m'
|
'match': 'm2m'
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue