Merge branch 'master' into dev

pull/7289/head
ibuler 3 years ago
commit 0762f87ba5

@ -40,8 +40,6 @@ JumpServer 采纳分布式架构,支持多机房跨区域部署,支持横向
### 在线体验 ### 在线体验
- 环境地址:<https://demo.jumpserver.org/> - 环境地址:<https://demo.jumpserver.org/>
- 用户名test
- 密码test01
| :warning: 注意 | | :warning: 注意 |
| :--------------------------- | | :--------------------------- |
@ -70,7 +68,7 @@ JumpServer 采纳分布式架构,支持多机房跨区域部署,支持横向
#### 微信交流群 #### 微信交流群
<img src="https://download.jumpserver.org/images/weixin-group.jpeg" alt="微信群二维码" width="200"/> <img src="https://download.jumpserver.org/images/wecom-group.jpeg" alt="微信群二维码" width="200"/>
### 贡献 ### 贡献
如果有你好的想法创意,或者帮助我们修复了 Bug, 欢迎提交 Pull Request 如果有你好的想法创意,或者帮助我们修复了 Bug, 欢迎提交 Pull Request

@ -20,6 +20,7 @@ class AppType(TextChoices):
oracle = 'oracle', 'Oracle' oracle = 'oracle', 'Oracle'
pgsql = 'postgresql', 'PostgreSQL' pgsql = 'postgresql', 'PostgreSQL'
mariadb = 'mariadb', 'MariaDB' mariadb = 'mariadb', 'MariaDB'
sqlserver = 'sqlserver', 'SQLServer'
# remote-app category # remote-app category
chrome = 'chrome', 'Chrome' chrome = 'chrome', 'Chrome'
@ -33,7 +34,7 @@ class AppType(TextChoices):
@classmethod @classmethod
def category_types_mapper(cls): def category_types_mapper(cls):
return { return {
AppCategory.db: [cls.mysql, cls.oracle, cls.pgsql, cls.mariadb], AppCategory.db: [cls.mysql, cls.oracle, cls.pgsql, cls.mariadb, cls.sqlserver],
AppCategory.remote_app: [cls.chrome, cls.mysql_workbench, cls.vmware_client, cls.custom], AppCategory.remote_app: [cls.chrome, cls.mysql_workbench, cls.vmware_client, cls.custom],
AppCategory.cloud: [cls.k8s] AppCategory.cloud: [cls.k8s]
} }

@ -0,0 +1,18 @@
# Generated by Django 3.1.12 on 2021-11-05 08:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('applications', '0012_auto_20211014_2209'),
]
operations = [
migrations.AlterField(
model_name='application',
name='type',
field=models.CharField(choices=[('mysql', 'MySQL'), ('oracle', 'Oracle'), ('postgresql', 'PostgreSQL'), ('mariadb', 'MariaDB'), ('sqlserver', 'SQLServer'), ('chrome', 'Chrome'), ('mysql_workbench', 'MySQL Workbench'), ('vmware_client', 'vSphere Client'), ('custom', 'Custom'), ('k8s', 'Kubernetes')], max_length=16, verbose_name='Type'),
),
]

@ -3,6 +3,7 @@ from .mysql import *
from .mariadb import * from .mariadb import *
from .oracle import * from .oracle import *
from .pgsql import * from .pgsql import *
from .sqlserver import *
from .chrome import * from .chrome import *
from .mysql_workbench import * from .mysql_workbench import *

@ -0,0 +1,12 @@
from rest_framework import serializers
from django.utils.translation import ugettext_lazy as _
from ..application_category import DBSerializer
__all__ = ['SQLServerSerializer']
class SQLServerSerializer(DBSerializer):
port = serializers.IntegerField(default=1433, label=_('Port'), allow_null=True)

@ -28,6 +28,7 @@ type_serializer_classes_mapping = {
const.AppType.mariadb.value: application_type.MariaDBSerializer, const.AppType.mariadb.value: application_type.MariaDBSerializer,
const.AppType.oracle.value: application_type.OracleSerializer, const.AppType.oracle.value: application_type.OracleSerializer,
const.AppType.pgsql.value: application_type.PostgreSerializer, const.AppType.pgsql.value: application_type.PostgreSerializer,
const.AppType.sqlserver.value: application_type.SQLServerSerializer,
# remote-app # remote-app
const.AppType.chrome.value: application_type.ChromeSerializer, const.AppType.chrome.value: application_type.ChromeSerializer,
const.AppType.mysql_workbench.value: application_type.MySQLWorkbenchSerializer, const.AppType.mysql_workbench.value: application_type.MySQLWorkbenchSerializer,

@ -0,0 +1,18 @@
# Generated by Django 3.1.12 on 2021-11-05 08:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('assets', '0078_auto_20211014_2209'),
]
operations = [
migrations.AlterField(
model_name='systemuser',
name='protocol',
field=models.CharField(choices=[('ssh', 'SSH'), ('rdp', 'RDP'), ('telnet', 'Telnet'), ('vnc', 'VNC'), ('mysql', 'MySQL'), ('oracle', 'Oracle'), ('mariadb', 'MariaDB'), ('postgresql', 'PostgreSQL'), ('sqlserver', 'SQLServer'), ('k8s', 'K8S')], default='ssh', max_length=16, verbose_name='Protocol'),
),
]

@ -32,6 +32,7 @@ class ProtocolMixin:
oracle = 'oracle', 'Oracle' oracle = 'oracle', 'Oracle'
mariadb = 'mariadb', 'MariaDB' mariadb = 'mariadb', 'MariaDB'
postgresql = 'postgresql', 'PostgreSQL' postgresql = 'postgresql', 'PostgreSQL'
sqlserver = 'sqlserver', 'SQLServer'
k8s = 'k8s', 'K8S' k8s = 'k8s', 'K8S'
SUPPORT_PUSH_PROTOCOLS = [Protocol.ssh, Protocol.rdp] SUPPORT_PUSH_PROTOCOLS = [Protocol.ssh, Protocol.rdp]
@ -43,7 +44,7 @@ class ProtocolMixin:
Protocol.rdp Protocol.rdp
] ]
APPLICATION_CATEGORY_DB_PROTOCOLS = [ APPLICATION_CATEGORY_DB_PROTOCOLS = [
Protocol.mysql, Protocol.oracle, Protocol.mariadb, Protocol.postgresql Protocol.mysql, Protocol.oracle, Protocol.mariadb, Protocol.postgresql, Protocol.sqlserver
] ]
APPLICATION_CATEGORY_CLOUD_PROTOCOLS = [ APPLICATION_CATEGORY_CLOUD_PROTOCOLS = [
Protocol.k8s Protocol.k8s

@ -0,0 +1,18 @@
# Generated by Django 3.1.12 on 2021-11-05 08:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('perms', '0020_auto_20210910_1103'),
]
operations = [
migrations.AlterField(
model_name='applicationpermission',
name='type',
field=models.CharField(choices=[('mysql', 'MySQL'), ('oracle', 'Oracle'), ('postgresql', 'PostgreSQL'), ('mariadb', 'MariaDB'), ('sqlserver', 'SQLServer'), ('chrome', 'Chrome'), ('mysql_workbench', 'MySQL Workbench'), ('vmware_client', 'vSphere Client'), ('custom', 'Custom'), ('k8s', 'Kubernetes')], max_length=16, verbose_name='Type'),
),
]

@ -0,0 +1,18 @@
# Generated by Django 3.1.12 on 2021-11-05 08:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('terminal', '0040_sessionjoinrecord_sessionsharing'),
]
operations = [
migrations.AlterField(
model_name='session',
name='protocol',
field=models.CharField(choices=[('ssh', 'ssh'), ('rdp', 'rdp'), ('vnc', 'vnc'), ('telnet', 'telnet'), ('mysql', 'mysql'), ('oracle', 'oracle'), ('mariadb', 'mariadb'), ('sqlserver', 'sqlserver'), ('postgresql', 'postgresql'), ('k8s', 'kubernetes')], db_index=True, default='ssh', max_length=16),
),
]

@ -31,6 +31,7 @@ class Session(OrgModelMixin):
MYSQL = 'mysql', 'mysql' MYSQL = 'mysql', 'mysql'
ORACLE = 'oracle', 'oracle' ORACLE = 'oracle', 'oracle'
MARIADB = 'mariadb', 'mariadb' MARIADB = 'mariadb', 'mariadb'
SQLSERVER = 'sqlserver', 'sqlserver'
POSTGRESQL = 'postgresql', 'postgresql' POSTGRESQL = 'postgresql', 'postgresql'
K8S = 'k8s', 'kubernetes' K8S = 'k8s', 'kubernetes'
@ -122,7 +123,7 @@ class Session(OrgModelMixin):
@property @property
def db_protocols(self): def db_protocols(self):
_PROTOCOL = self.PROTOCOL _PROTOCOL = self.PROTOCOL
return [_PROTOCOL.MYSQL, _PROTOCOL.MARIADB, _PROTOCOL.ORACLE, _PROTOCOL.POSTGRESQL] return [_PROTOCOL.MYSQL, _PROTOCOL.MARIADB, _PROTOCOL.ORACLE, _PROTOCOL.POSTGRESQL, _PROTOCOL.SQLSERVER]
@property @property
def can_terminate(self): def can_terminate(self):

Loading…
Cancel
Save