diff --git a/README.md b/README.md index bc6dfdd2f..05467881f 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,6 @@ JumpServer 采纳分布式架构,支持多机房跨区域部署,支持横向 ### 在线体验 - 环境地址: -- 用户名:test -- 密码:test01 | :warning: 注意 | | :--------------------------- | @@ -70,7 +68,7 @@ JumpServer 采纳分布式架构,支持多机房跨区域部署,支持横向 #### 微信交流群 -微信群二维码 +微信群二维码 ### 贡献 如果有你好的想法创意,或者帮助我们修复了 Bug, 欢迎提交 Pull Request diff --git a/apps/applications/const.py b/apps/applications/const.py index ee150da31..dde571fbc 100644 --- a/apps/applications/const.py +++ b/apps/applications/const.py @@ -20,6 +20,7 @@ class AppType(TextChoices): oracle = 'oracle', 'Oracle' pgsql = 'postgresql', 'PostgreSQL' mariadb = 'mariadb', 'MariaDB' + sqlserver = 'sqlserver', 'SQLServer' # remote-app category chrome = 'chrome', 'Chrome' @@ -33,7 +34,7 @@ class AppType(TextChoices): @classmethod def category_types_mapper(cls): 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.cloud: [cls.k8s] } diff --git a/apps/applications/migrations/0013_auto_20211105_1605.py b/apps/applications/migrations/0013_auto_20211105_1605.py new file mode 100644 index 000000000..5da963fdc --- /dev/null +++ b/apps/applications/migrations/0013_auto_20211105_1605.py @@ -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'), + ), + ] diff --git a/apps/applications/serializers/attrs/application_type/__init__.py b/apps/applications/serializers/attrs/application_type/__init__.py index aaa597136..8881dedc0 100644 --- a/apps/applications/serializers/attrs/application_type/__init__.py +++ b/apps/applications/serializers/attrs/application_type/__init__.py @@ -3,6 +3,7 @@ from .mysql import * from .mariadb import * from .oracle import * from .pgsql import * +from .sqlserver import * from .chrome import * from .mysql_workbench import * diff --git a/apps/applications/serializers/attrs/application_type/sqlserver.py b/apps/applications/serializers/attrs/application_type/sqlserver.py new file mode 100644 index 000000000..af8246bd0 --- /dev/null +++ b/apps/applications/serializers/attrs/application_type/sqlserver.py @@ -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) + diff --git a/apps/applications/serializers/attrs/attrs.py b/apps/applications/serializers/attrs/attrs.py index 09b7f48b1..4bd3f81eb 100644 --- a/apps/applications/serializers/attrs/attrs.py +++ b/apps/applications/serializers/attrs/attrs.py @@ -28,6 +28,7 @@ type_serializer_classes_mapping = { const.AppType.mariadb.value: application_type.MariaDBSerializer, const.AppType.oracle.value: application_type.OracleSerializer, const.AppType.pgsql.value: application_type.PostgreSerializer, + const.AppType.sqlserver.value: application_type.SQLServerSerializer, # remote-app const.AppType.chrome.value: application_type.ChromeSerializer, const.AppType.mysql_workbench.value: application_type.MySQLWorkbenchSerializer, diff --git a/apps/assets/migrations/0079_auto_20211105_1605.py b/apps/assets/migrations/0079_auto_20211105_1605.py new file mode 100644 index 000000000..915a659df --- /dev/null +++ b/apps/assets/migrations/0079_auto_20211105_1605.py @@ -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'), + ), + ] diff --git a/apps/assets/models/user.py b/apps/assets/models/user.py index 5f1a8df76..337ccdf2f 100644 --- a/apps/assets/models/user.py +++ b/apps/assets/models/user.py @@ -32,6 +32,7 @@ class ProtocolMixin: oracle = 'oracle', 'Oracle' mariadb = 'mariadb', 'MariaDB' postgresql = 'postgresql', 'PostgreSQL' + sqlserver = 'sqlserver', 'SQLServer' k8s = 'k8s', 'K8S' SUPPORT_PUSH_PROTOCOLS = [Protocol.ssh, Protocol.rdp] @@ -43,7 +44,7 @@ class ProtocolMixin: Protocol.rdp ] 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 = [ Protocol.k8s diff --git a/apps/perms/migrations/0021_auto_20211105_1605.py b/apps/perms/migrations/0021_auto_20211105_1605.py new file mode 100644 index 000000000..f1d3c0043 --- /dev/null +++ b/apps/perms/migrations/0021_auto_20211105_1605.py @@ -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'), + ), + ] diff --git a/apps/terminal/migrations/0041_auto_20211105_1605.py b/apps/terminal/migrations/0041_auto_20211105_1605.py new file mode 100644 index 000000000..ef271abc6 --- /dev/null +++ b/apps/terminal/migrations/0041_auto_20211105_1605.py @@ -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), + ), + ] diff --git a/apps/terminal/models/session.py b/apps/terminal/models/session.py index 3084a3395..f591de916 100644 --- a/apps/terminal/models/session.py +++ b/apps/terminal/models/session.py @@ -31,6 +31,7 @@ class Session(OrgModelMixin): MYSQL = 'mysql', 'mysql' ORACLE = 'oracle', 'oracle' MARIADB = 'mariadb', 'mariadb' + SQLSERVER = 'sqlserver', 'sqlserver' POSTGRESQL = 'postgresql', 'postgresql' K8S = 'k8s', 'kubernetes' @@ -122,7 +123,7 @@ class Session(OrgModelMixin): @property def db_protocols(self): _PROTOCOL = self.PROTOCOL - return [_PROTOCOL.MYSQL, _PROTOCOL.MARIADB, _PROTOCOL.ORACLE, _PROTOCOL.POSTGRESQL] + return [_PROTOCOL.MYSQL, _PROTOCOL.MARIADB, _PROTOCOL.ORACLE, _PROTOCOL.POSTGRESQL, _PROTOCOL.SQLSERVER] @property def can_terminate(self):