From f481463c64553490e0f1d43e55f35ef94b7a30f6 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Tue, 12 Apr 2022 17:45:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0Endpoint=20(#8041)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add Endpoint EndpointRule EndpointProtocol model * feat: add Endpoint EndpointRule EndpointProtocol API * feat: modify protocols field * feat: 修改序列类 * feat: 获取connect-url连接地址 * feat: 获取connect-url连接地址 * feat: 优化后台获取smart-endpoint逻辑 * feat: 优化后台获取smart-endpoint逻辑 * feat: 删除配置KOKO、XRDP、MAGNUS * feat: 删除配置KOKO、XRDP、MAGNUS * feat: 修改翻译 * feat: 修改smart endpoint * feat: 修改翻译 * feat: smart API 添加token解析 * feat: 删除 smart serializer * feat: 修改迁移逻辑 * feat: 解决冲突 * feat: 修改匹配 endpoint Co-authored-by: Jiangjie.Bai --- apps/applications/models/application.py | 20 + apps/assets/models/asset.py | 3 + apps/authentication/api/connection_token.py | 30 +- apps/common/fields/model.py | 14 +- apps/jumpserver/conf.py | 14 +- apps/jumpserver/settings/custom.py | 11 - apps/locale/ja/LC_MESSAGES/django.mo | 4 +- apps/locale/ja/LC_MESSAGES/django.po | 628 +++++------------ apps/locale/zh/LC_MESSAGES/django.mo | 4 +- apps/locale/zh/LC_MESSAGES/django.po | 634 +++++------------- apps/settings/api/public.py | 7 - apps/settings/serializers/terminal.py | 30 +- apps/terminal/api/__init__.py | 1 + apps/terminal/api/endpoint.py | 78 +++ .../migrations/0048_endpoint_endpointrule.py | 86 +++ apps/terminal/models/__init__.py | 1 + apps/terminal/models/endpoint.py | 94 +++ apps/terminal/models/session.py | 9 + apps/terminal/serializers/__init__.py | 1 + apps/terminal/serializers/endpoint.py | 51 ++ apps/terminal/urls/api_urls.py | 2 + 21 files changed, 695 insertions(+), 1027 deletions(-) create mode 100644 apps/terminal/api/endpoint.py create mode 100644 apps/terminal/migrations/0048_endpoint_endpointrule.py create mode 100644 apps/terminal/models/endpoint.py create mode 100644 apps/terminal/serializers/endpoint.py diff --git a/apps/applications/models/application.py b/apps/applications/models/application.py index aa2d56f70..15e7dae14 100644 --- a/apps/applications/models/application.py +++ b/apps/applications/models/application.py @@ -247,6 +247,14 @@ class Application(CommonModelMixin, OrgModelMixin, ApplicationTreeNodeMixin): def category_remote_app(self): return self.category == const.AppCategory.remote_app.value + @property + def category_cloud(self): + return self.category == const.AppCategory.cloud.value + + @property + def category_db(self): + return self.category == const.AppCategory.db.value + def get_rdp_remote_app_setting(self): from applications.serializers.attrs import get_serializer_class_by_application_type if not self.category_remote_app: @@ -279,6 +287,18 @@ class Application(CommonModelMixin, OrgModelMixin, ApplicationTreeNodeMixin): if raise_exception: raise ValueError("Remote App not has asset attr") + def get_target_ip(self): + if self.category_remote_app: + asset = self.get_remote_app_asset() + target_ip = asset.ip + elif self.category_cloud: + target_ip = self.attrs.get('cluster') + elif self.category_db: + target_ip = self.attrs.get('host') + else: + target_ip = '' + return target_ip + class ApplicationUser(SystemUser): class Meta: diff --git a/apps/assets/models/asset.py b/apps/assets/models/asset.py index 84ddee404..c80c65ce6 100644 --- a/apps/assets/models/asset.py +++ b/apps/assets/models/asset.py @@ -235,6 +235,9 @@ class Asset(AbsConnectivity, AbsHardwareInfo, ProtocolsMixin, NodesRelationMixin def __str__(self): return '{0.hostname}({0.ip})'.format(self) + def get_target_ip(self): + return self.ip + def set_admin_user_relation(self): from .authbook import AuthBook if not self.admin_user: diff --git a/apps/authentication/api/connection_token.py b/apps/authentication/api/connection_token.py index f8c64e417..3e905076c 100644 --- a/apps/authentication/api/connection_token.py +++ b/apps/authentication/api/connection_token.py @@ -31,12 +31,13 @@ from perms.models.base import Action from perms.utils.application.permission import get_application_actions from perms.utils.asset.permission import get_asset_actions from common.const.http import PATCH +from terminal.models import EndpointRule from ..serializers import ( ConnectionTokenSerializer, ConnectionTokenSecretSerializer, ) logger = get_logger(__name__) -__all__ = ['UserConnectionTokenViewSet'] +__all__ = ['UserConnectionTokenViewSet', 'TokenCacheMixin'] class ClientProtocolMixin: @@ -51,6 +52,17 @@ class ClientProtocolMixin: request: Request get_serializer: Callable create_token: Callable + get_serializer_context: Callable + + def get_smart_endpoint(self, protocol, asset=None, application=None): + if asset: + target_ip = asset.get_target_ip() + elif application: + target_ip = application.get_target_ip() + else: + target_ip = '' + endpoint = EndpointRule.match_endpoint(target_ip, protocol, self.request) + return endpoint def get_request_resource(self, serializer): asset = serializer.validated_data.get('asset') @@ -122,10 +134,10 @@ class ClientProtocolMixin: options['screen mode id:i'] = '2' if full_screen else '1' # RDP Server 地址 - address = settings.TERMINAL_RDP_ADDR - if not address or address == 'localhost:3389': - address = self.request.get_host().split(':')[0] + ':3389' - options['full address:s'] = address + endpoint = self.get_smart_endpoint( + protocol='rdp', asset=asset, application=application + ) + options['full address:s'] = f'{endpoint.host}:{endpoint.rdp_port}' # 用户名 options['username:s'] = '{}|{}'.format(user.username, token) if system_user.ad_domain: @@ -169,9 +181,12 @@ class ClientProtocolMixin: else: name = '*' + endpoint = self.get_smart_endpoint( + protocol='ssh', asset=asset, application=application + ) content = { - 'ip': settings.TERMINAL_KOKO_HOST, - 'port': str(settings.TERMINAL_KOKO_SSH_PORT), + 'ip': endpoint.host, + 'port': endpoint.ssh_port, 'username': f'JMS-{token}', 'password': secret } @@ -345,6 +360,7 @@ class SecretDetailMixin: class TokenCacheMixin: + """ endpoint smart view 用到此类来解析token中的资产、应用 """ CACHE_KEY_PREFIX = 'CONNECTION_TOKEN_{}' def get_token_cache_key(self, token): diff --git a/apps/common/fields/model.py b/apps/common/fields/model.py index 4a4f3525d..a3ac13e82 100644 --- a/apps/common/fields/model.py +++ b/apps/common/fields/model.py @@ -4,7 +4,7 @@ import json from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import force_text - +from django.core.validators import MinValueValidator, MaxValueValidator from ..utils import signer, crypto @@ -13,7 +13,7 @@ __all__ = [ 'JsonCharField', 'JsonTextField', 'JsonListCharField', 'JsonListTextField', 'JsonDictCharField', 'JsonDictTextField', 'EncryptCharField', 'EncryptTextField', 'EncryptMixin', 'EncryptJsonDictTextField', - 'EncryptJsonDictCharField', + 'EncryptJsonDictCharField', 'PortField' ] @@ -180,3 +180,13 @@ class EncryptJsonDictTextField(EncryptMixin, JsonDictTextField): class EncryptJsonDictCharField(EncryptMixin, JsonDictCharField): pass + +class PortField(models.IntegerField): + def __init__(self, *args, **kwargs): + kwargs.update({ + 'blank': False, + 'null': False, + 'validators': [MinValueValidator(0), MaxValueValidator(65535)] + }) + super().__init__(*args, **kwargs) + diff --git a/apps/jumpserver/conf.py b/apps/jumpserver/conf.py index 8e34d6f91..f72ed899f 100644 --- a/apps/jumpserver/conf.py +++ b/apps/jumpserver/conf.py @@ -310,16 +310,12 @@ class Config(dict): 'TERMINAL_HOST_KEY': '', 'TERMINAL_TELNET_REGEX': '', 'TERMINAL_COMMAND_STORAGE': {}, - 'TERMINAL_RDP_ADDR': lambda: urlparse(settings.SITE_URL).hostname + ':3389', - 'XRDP_ENABLED': True, - 'TERMINAL_KOKO_HOST': lambda: urlparse(settings.SITE_URL).hostname, - 'TERMINAL_KOKO_SSH_PORT': 2222, - + # 未来废弃(当下迁移会用) + 'TERMINAL_RDP_ADDR': '', + # 保留(Luna还在用) 'TERMINAL_MAGNUS_ENABLED': True, - 'TERMINAL_MAGNUS_HOST': lambda: urlparse(settings.SITE_URL).hostname, - 'TERMINAL_MAGNUS_MYSQL_PORT': 33060, - 'TERMINAL_MAGNUS_MARIADB_PORT': 33061, - 'TERMINAL_MAGNUS_POSTGRE_PORT': 54320, + # 保留(Luna还在用) + 'XRDP_ENABLED': True, # 安全配置 'SECURITY_MFA_AUTH': 0, # 0 不开启 1 全局开启 2 管理员开启 diff --git a/apps/jumpserver/settings/custom.py b/apps/jumpserver/settings/custom.py index 2aa05afe5..794180fd2 100644 --- a/apps/jumpserver/settings/custom.py +++ b/apps/jumpserver/settings/custom.py @@ -140,9 +140,6 @@ CLOUD_SYNC_TASK_EXECUTION_KEEP_DAYS = CONFIG.CLOUD_SYNC_TASK_EXECUTION_KEEP_DAYS XRDP_ENABLED = CONFIG.XRDP_ENABLED -TERMINAL_KOKO_HOST = CONFIG.TERMINAL_KOKO_HOST -TERMINAL_KOKO_SSH_PORT = CONFIG.TERMINAL_KOKO_SSH_PORT - # SMS enabled SMS_ENABLED = CONFIG.SMS_ENABLED SMS_BACKEND = CONFIG.SMS_BACKEND @@ -170,11 +167,3 @@ ANNOUNCEMENT = CONFIG.ANNOUNCEMENT # help HELP_DOCUMENT_URL = CONFIG.HELP_DOCUMENT_URL HELP_SUPPORT_URL = CONFIG.HELP_SUPPORT_URL - -# Magnus -MAGNUS_ENABLED = CONFIG.MAGNUS_ENABLED -TERMINAL_MAGNUS_HOST = CONFIG.TERMINAL_MAGNUS_HOST -TERMINAL_MAGNUS_ENABLED = CONFIG.TERMINAL_MAGNUS_ENABLED -TERMINAL_MAGNUS_MYSQL_PORT = CONFIG.TERMINAL_MAGNUS_MYSQL_PORT -TERMINAL_MAGNUS_MARIADB_PORT = CONFIG.TERMINAL_MAGNUS_MARIADB_PORT -TERMINAL_MAGNUS_POSTGRE_PORT = CONFIG.TERMINAL_MAGNUS_POSTGRE_PORT diff --git a/apps/locale/ja/LC_MESSAGES/django.mo b/apps/locale/ja/LC_MESSAGES/django.mo index 080e2ab5e..73226f058 100644 --- a/apps/locale/ja/LC_MESSAGES/django.mo +++ b/apps/locale/ja/LC_MESSAGES/django.mo @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:097c6d06ed8dcf2e1807560b6eb52d98cba31f25fe8d67ce4315668c150ca6b8 -size 129989 +oid sha256:70685e92cbf84f4178224a44fd84eb884a0acfb9749200541ea6655a9a397a72 +size 125019 diff --git a/apps/locale/ja/LC_MESSAGES/django.po b/apps/locale/ja/LC_MESSAGES/django.po index 757d1e463..c80ef4904 100644 --- a/apps/locale/ja/LC_MESSAGES/django.po +++ b/apps/locale/ja/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-02 10:01+0800\n" +"POT-Creation-Date: 2022-04-12 17:03+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -29,31 +29,27 @@ msgstr "Acls" #: assets/models/group.py:20 assets/models/label.py:18 ops/mixin.py:24 #: orgs/models.py:65 perms/models/base.py:83 rbac/models/role.py:29 #: settings/models.py:29 settings/serializers/sms.py:6 +#: terminal/models/endpoint.py:10 terminal/models/endpoint.py:53 #: terminal/models/storage.py:23 terminal/models/task.py:16 #: terminal/models/terminal.py:100 users/forms/profile.py:32 #: users/models/group.py:15 users/models/user.py:661 -#: users/templates/users/_select_user_modal.html:13 -#: users/templates/users/user_asset_permission.html:37 -#: users/templates/users/user_asset_permission.html:154 -#: users/templates/users/user_database_app_permission.html:36 #: xpack/plugins/cloud/models.py:28 msgid "Name" msgstr "名前" #: acls/models/base.py:27 assets/models/cmd_filter.py:84 -#: assets/models/user.py:247 +#: assets/models/user.py:247 terminal/models/endpoint.py:56 msgid "Priority" msgstr "優先順位" #: acls/models/base.py:28 assets/models/cmd_filter.py:84 -#: assets/models/user.py:247 +#: assets/models/user.py:247 terminal/models/endpoint.py:57 msgid "1-100, the lower the value will be match first" msgstr "1-100、低い値は最初に一致します" #: acls/models/base.py:31 authentication/models.py:17 #: authentication/templates/authentication/_access_key_modal.html:32 #: perms/models/base.py:88 terminal/models/sharing.py:26 -#: users/templates/users/_select_user_modal.html:18 msgid "Active" msgstr "アクティブ" @@ -65,6 +61,7 @@ msgstr "アクティブ" #: assets/models/domain.py:64 assets/models/group.py:23 #: assets/models/label.py:23 ops/models/adhoc.py:38 orgs/models.py:68 #: perms/models/base.py:93 rbac/models/role.py:37 settings/models.py:34 +#: terminal/models/endpoint.py:20 terminal/models/endpoint.py:63 #: terminal/models/storage.py:26 terminal/models/terminal.py:114 #: tickets/models/comment.py:24 tickets/models/ticket.py:154 #: users/models/group.py:16 users/models/user.py:698 @@ -91,16 +88,12 @@ msgstr "ログイン確認" #: assets/models/cmd_filter.py:30 assets/models/label.py:15 audits/models.py:37 #: audits/models.py:60 audits/models.py:85 audits/serializers.py:100 #: authentication/models.py:50 orgs/models.py:214 perms/models/base.py:84 -#: rbac/builtin.py:101 rbac/models/rolebinding.py:40 templates/index.html:78 +#: rbac/builtin.py:106 rbac/models/rolebinding.py:40 #: terminal/backends/command/models.py:19 -#: terminal/backends/command/serializers.py:12 terminal/models/session.py:42 +#: terminal/backends/command/serializers.py:12 terminal/models/session.py:44 #: terminal/notifications.py:91 terminal/notifications.py:139 #: tickets/models/comment.py:17 users/const.py:14 users/models/user.py:886 #: users/models/user.py:917 users/serializers/group.py:19 -#: users/templates/users/user_asset_permission.html:38 -#: users/templates/users/user_asset_permission.html:64 -#: users/templates/users/user_database_app_permission.html:37 -#: users/templates/users/user_database_app_permission.html:58 msgid "User" msgstr "ユーザー" @@ -112,10 +105,6 @@ msgstr "ルール" #: acls/serializers/login_acl.py:17 acls/serializers/login_asset_acl.py:75 #: assets/models/cmd_filter.py:89 audits/models.py:61 audits/serializers.py:51 #: authentication/templates/authentication/_access_key_modal.html:34 -#: users/templates/users/_granted_assets.html:29 -#: users/templates/users/user_asset_permission.html:44 -#: users/templates/users/user_asset_permission.html:79 -#: users/templates/users/user_database_app_permission.html:42 msgid "Action" msgstr "アクション" @@ -136,16 +125,13 @@ msgstr "システムユーザー" #: acls/models/login_asset_acl.py:22 #: applications/serializers/attrs/application_category/remote_app.py:36 -#: assets/models/asset.py:383 assets/models/authbook.py:19 +#: assets/models/asset.py:386 assets/models/authbook.py:19 #: assets/models/backup.py:31 assets/models/cmd_filter.py:38 #: assets/models/gathered_user.py:14 assets/serializers/label.py:30 #: assets/serializers/system_user.py:264 audits/models.py:39 -#: perms/models/asset_permission.py:23 templates/index.html:82 -#: terminal/backends/command/models.py:20 -#: terminal/backends/command/serializers.py:13 terminal/models/session.py:44 +#: perms/models/asset_permission.py:23 terminal/backends/command/models.py:20 +#: terminal/backends/command/serializers.py:13 terminal/models/session.py:46 #: terminal/notifications.py:90 -#: users/templates/users/user_asset_permission.html:40 -#: users/templates/users/user_asset_permission.html:70 #: xpack/plugins/change_auth_plan/models/asset.py:199 #: xpack/plugins/change_auth_plan/serializers/asset.py:180 #: xpack/plugins/cloud/models.py:223 @@ -172,7 +158,6 @@ msgstr "コンマ区切り文字列の形式。* はすべて一致すること #: authentication/templates/authentication/_msg_oauth_bind.html:9 #: ops/models/adhoc.py:159 users/forms/profile.py:31 users/models/user.py:659 #: users/templates/users/_msg_user_created.html:12 -#: users/templates/users/_select_user_modal.html:14 #: xpack/plugins/change_auth_plan/models/asset.py:34 #: xpack/plugins/change_auth_plan/models/asset.py:195 #: xpack/plugins/cloud/serializers/account_attrs.py:22 @@ -196,17 +181,13 @@ msgstr "" #: authentication/templates/authentication/_msg_oauth_bind.html:12 #: authentication/templates/authentication/_msg_rest_password_success.html:8 #: authentication/templates/authentication/_msg_rest_public_key_success.html:8 -#: settings/serializers/terminal.py:8 -#: users/templates/users/_granted_assets.html:26 -#: users/templates/users/user_asset_permission.html:156 +#: settings/serializers/terminal.py:8 terminal/serializers/endpoint.py:37 msgid "IP" msgstr "IP" #: acls/serializers/login_asset_acl.py:35 assets/models/asset.py:211 #: assets/serializers/account.py:14 assets/serializers/gathered_user.py:23 #: settings/serializers/terminal.py:7 -#: users/templates/users/_granted_assets.html:25 -#: users/templates/users/user_asset_permission.html:157 msgid "Hostname" msgstr "ホスト名" @@ -220,7 +201,7 @@ msgstr "" #: acls/serializers/login_asset_acl.py:55 assets/models/asset.py:213 #: assets/models/domain.py:62 assets/models/user.py:248 -#: terminal/serializers/session.py:30 terminal/serializers/storage.py:69 +#: terminal/serializers/session.py:30 terminal/serializers/storage.py:67 msgid "Protocol" msgstr "プロトコル" @@ -285,13 +266,7 @@ msgstr "アプリケーション" #: assets/models/cmd_filter.py:42 assets/models/user.py:338 audits/models.py:40 #: perms/models/application_permission.py:33 #: perms/models/asset_permission.py:25 terminal/backends/command/models.py:21 -#: terminal/backends/command/serializers.py:35 terminal/models/session.py:46 -#: users/templates/users/_granted_assets.html:27 -#: users/templates/users/user_asset_permission.html:42 -#: users/templates/users/user_asset_permission.html:76 -#: users/templates/users/user_asset_permission.html:159 -#: users/templates/users/user_database_app_permission.html:40 -#: users/templates/users/user_database_app_permission.html:67 +#: terminal/backends/command/serializers.py:35 terminal/models/session.py:48 #: xpack/plugins/change_auth_plan/models/app.py:36 #: xpack/plugins/change_auth_plan/models/app.py:147 #: xpack/plugins/change_auth_plan/serializers/app.py:65 @@ -343,7 +318,7 @@ msgid "Domain" msgstr "ドメイン" #: applications/models/application.py:228 xpack/plugins/cloud/models.py:33 -#: xpack/plugins/cloud/serializers/account.py:59 +#: xpack/plugins/cloud/serializers/account.py:58 msgid "Attrs" msgstr "ツールバーの" @@ -351,7 +326,7 @@ msgstr "ツールバーの" msgid "Can match application" msgstr "アプリケーションを一致させることができます" -#: applications/models/application.py:286 +#: applications/models/application.py:306 msgid "Application user" msgstr "アプリケーションユーザー" @@ -409,6 +384,7 @@ msgstr "クラスター" #: applications/serializers/attrs/application_category/db.py:11 #: ops/models/adhoc.py:157 settings/serializers/auth/radius.py:14 +#: terminal/models/endpoint.py:11 #: xpack/plugins/cloud/serializers/account_attrs.py:68 msgid "Host" msgstr "ホスト" @@ -639,27 +615,27 @@ msgstr "ラベル" msgid "Created by" msgstr "によって作成された" -#: assets/models/asset.py:386 +#: assets/models/asset.py:389 msgid "Can refresh asset hardware info" msgstr "資産ハードウェア情報を更新できます" -#: assets/models/asset.py:387 +#: assets/models/asset.py:390 msgid "Can test asset connectivity" msgstr "資産接続をテストできます" -#: assets/models/asset.py:388 +#: assets/models/asset.py:391 msgid "Can push system user to asset" msgstr "システムユーザーを資産にプッシュできます" -#: assets/models/asset.py:389 +#: assets/models/asset.py:392 msgid "Can match asset" msgstr "アセットを一致させることができます" -#: assets/models/asset.py:390 +#: assets/models/asset.py:393 msgid "Add asset to node" msgstr "ノードにアセットを追加する" -#: assets/models/asset.py:391 +#: assets/models/asset.py:394 msgid "Move asset to node" msgstr "アセットをノードに移動する" @@ -706,7 +682,7 @@ msgid "Timing trigger" msgstr "タイミングトリガー" #: assets/models/backup.py:105 audits/models.py:44 ops/models/command.py:31 -#: perms/models/base.py:89 terminal/models/session.py:56 +#: perms/models/base.py:89 terminal/models/session.py:58 #: tickets/serializers/ticket/meta/ticket_type/apply_application.py:55 #: tickets/serializers/ticket/meta/ticket_type/apply_asset.py:57 #: xpack/plugins/change_auth_plan/models/base.py:112 @@ -767,7 +743,7 @@ msgstr "OK" #: assets/models/base.py:32 audits/models.py:116 #: xpack/plugins/change_auth_plan/serializers/app.py:88 #: xpack/plugins/change_auth_plan/serializers/asset.py:198 -#: xpack/plugins/cloud/const.py:31 +#: xpack/plugins/cloud/const.py:30 msgid "Failed" msgstr "失敗しました" @@ -782,9 +758,8 @@ msgstr "確認済みの日付" #: assets/models/base.py:177 audits/signal_handlers.py:68 #: authentication/forms.py:22 #: authentication/templates/authentication/login.html:181 -#: settings/serializers/auth/ldap.py:44 users/forms/profile.py:21 +#: settings/serializers/auth/ldap.py:43 users/forms/profile.py:21 #: users/templates/users/_msg_user_created.html:13 -#: users/templates/users/user_password_update.html:43 #: users/templates/users/user_password_verify.html:18 #: xpack/plugins/change_auth_plan/models/base.py:42 #: xpack/plugins/change_auth_plan/models/base.py:121 @@ -849,11 +824,6 @@ msgstr "デフォルトクラスター" #: assets/models/cmd_filter.py:34 perms/models/base.py:86 #: users/models/group.py:31 users/models/user.py:667 -#: users/templates/users/_select_user_modal.html:16 -#: users/templates/users/user_asset_permission.html:39 -#: users/templates/users/user_asset_permission.html:67 -#: users/templates/users/user_database_app_permission.html:38 -#: users/templates/users/user_database_app_permission.html:61 msgid "User group" msgstr "ユーザーグループ" @@ -866,7 +836,7 @@ msgid "Regex" msgstr "正規情報" #: assets/models/cmd_filter.py:68 ops/models/command.py:26 -#: terminal/backends/command/serializers.py:14 terminal/models/session.py:53 +#: terminal/backends/command/serializers.py:14 terminal/models/session.py:55 #: terminal/templates/terminal/_msg_command_alert.html:12 #: terminal/templates/terminal/_msg_command_execute_alert.html:10 msgid "Command" @@ -966,7 +936,7 @@ msgstr "ラベル" msgid "New node" msgstr "新しいノード" -#: assets/models/node.py:474 users/templates/users/_granted_assets.html:130 +#: assets/models/node.py:474 msgid "empty" msgstr "空" @@ -983,9 +953,6 @@ msgid "Parent key" msgstr "親キー" #: assets/models/node.py:559 assets/serializers/system_user.py:263 -#: users/templates/users/user_asset_permission.html:41 -#: users/templates/users/user_asset_permission.html:73 -#: users/templates/users/user_asset_permission.html:158 #: xpack/plugins/cloud/models.py:96 xpack/plugins/cloud/serializers/task.py:69 msgid "Node" msgstr "ノード" @@ -1140,7 +1107,7 @@ msgid "Actions" msgstr "アクション" #: assets/serializers/backup.py:31 ops/mixin.py:106 ops/mixin.py:147 -#: settings/serializers/auth/ldap.py:59 +#: settings/serializers/auth/ldap.py:62 #: xpack/plugins/change_auth_plan/serializers/base.py:42 msgid "Periodic perform" msgstr "定期的なパフォーマンス" @@ -1388,8 +1355,7 @@ msgstr "監査" #: audits/models.py:27 audits/models.py:57 #: authentication/templates/authentication/_access_key_modal.html:65 -#: rbac/tree.py:166 users/templates/users/user_asset_permission.html:128 -#: users/templates/users/user_database_app_permission.html:111 +#: rbac/tree.py:166 msgid "Delete" msgstr "削除" @@ -1418,7 +1384,7 @@ msgid "Symlink" msgstr "Symlink" #: audits/models.py:38 audits/models.py:64 audits/models.py:87 -#: terminal/models/session.py:49 terminal/models/sharing.py:82 +#: terminal/models/session.py:51 terminal/models/sharing.py:82 msgid "Remote addr" msgstr "リモートaddr" @@ -1448,8 +1414,6 @@ msgstr "作成" #: audits/models.py:56 rbac/tree.py:165 templates/_csv_import_export.html:18 #: templates/_csv_update_modal.html:6 -#: users/templates/users/user_asset_permission.html:127 -#: users/templates/users/user_database_app_permission.html:110 msgid "Update" msgstr "更新" @@ -1558,7 +1522,7 @@ msgstr "ホスト表示" msgid "Result" msgstr "結果" -#: audits/serializers.py:98 terminal/serializers/storage.py:161 +#: audits/serializers.py:98 terminal/serializers/storage.py:156 msgid "Hosts" msgstr "ホスト" @@ -1669,7 +1633,6 @@ msgid "{AssetPermission} REMOVE {UserGroup}" msgstr "{AssetPermission} 削除 {UserGroup}" #: audits/signal_handlers.py:131 perms/models/asset_permission.py:29 -#: users/templates/users/_user_detail_nav_header.html:31 msgid "Asset permission" msgstr "資産権限" @@ -1767,7 +1730,7 @@ msgstr "{ApplicationPermission} 追加 {SystemUser}" msgid "{ApplicationPermission} REMOVE {SystemUser}" msgstr "{ApplicationPermission} 削除 {SystemUser}" -#: authentication/api/connection_token.py:313 +#: authentication/api/connection_token.py:328 msgid "Invalid token" msgstr "無効なトークン" @@ -2065,7 +2028,7 @@ msgstr "MFAタイプ ({}) が有効になっていない" msgid "Please change your password" msgstr "パスワードを変更してください" -#: authentication/models.py:33 terminal/serializers/storage.py:30 +#: authentication/models.py:33 terminal/serializers/storage.py:28 msgid "Access key" msgstr "アクセスキー" @@ -2129,7 +2092,6 @@ msgid "Date" msgstr "日付" #: authentication/templates/authentication/_access_key_modal.html:48 -#: users/templates/users/_granted_assets.html:75 msgid "Show" msgstr "表示" @@ -2189,7 +2151,7 @@ msgstr "コードエラー" #: authentication/templates/authentication/_msg_reset_password.html:3 #: authentication/templates/authentication/_msg_rest_password_success.html:2 #: authentication/templates/authentication/_msg_rest_public_key_success.html:2 -#: jumpserver/conf.py:295 ops/tasks.py:145 ops/tasks.py:148 +#: jumpserver/conf.py:296 ops/tasks.py:145 ops/tasks.py:148 #: perms/templates/perms/_msg_item_permissions_expire.html:3 #: perms/templates/perms/_msg_permed_items_expire.html:3 #: users/templates/users/_msg_account_expire_reminder.html:4 @@ -2650,11 +2612,11 @@ msgstr "特殊文字を含むべきではない" msgid "The mobile phone number format is incorrect" msgstr "携帯電話番号の形式が正しくありません" -#: jumpserver/conf.py:294 +#: jumpserver/conf.py:295 msgid "Create account successfully" msgstr "アカウントを正常に作成" -#: jumpserver/conf.py:296 +#: jumpserver/conf.py:297 msgid "Your account has been created successfully" msgstr "アカウントが正常に作成されました" @@ -2720,12 +2682,12 @@ msgid "App ops" msgstr "アプリ操作" #: ops/mixin.py:29 ops/mixin.py:92 ops/mixin.py:162 -#: settings/serializers/auth/ldap.py:66 +#: settings/serializers/auth/ldap.py:69 msgid "Cycle perform" msgstr "サイクル実行" #: ops/mixin.py:33 ops/mixin.py:90 ops/mixin.py:109 ops/mixin.py:150 -#: settings/serializers/auth/ldap.py:63 +#: settings/serializers/auth/ldap.py:66 msgid "Regularly perform" msgstr "定期的に実行する" @@ -2912,7 +2874,8 @@ msgstr "アプリ組織" #: orgs/mixins/models.py:46 orgs/mixins/serializers.py:25 orgs/models.py:80 #: orgs/models.py:211 rbac/const.py:7 rbac/models/rolebinding.py:47 -#: rbac/serializers/rolebinding.py:40 tickets/serializers/ticket/ticket.py:77 +#: rbac/serializers/rolebinding.py:40 settings/serializers/auth/ldap.py:59 +#: tickets/serializers/ticket/ticket.py:77 msgid "Organization" msgstr "組織" @@ -2925,7 +2888,7 @@ msgid "Can view root org" msgstr "グローバル組織を表示できます" #: orgs/models.py:216 rbac/models/role.py:46 rbac/models/rolebinding.py:43 -#: users/models/user.py:671 users/templates/users/_select_user_modal.html:15 +#: users/models/user.py:671 msgid "Role" msgstr "ロール" @@ -3151,27 +3114,27 @@ msgstr "{} 少なくとも1つのシステムロール" msgid "RBAC" msgstr "RBAC" -#: rbac/builtin.py:92 +#: rbac/builtin.py:97 msgid "SystemAdmin" msgstr "システム管理者" -#: rbac/builtin.py:95 +#: rbac/builtin.py:100 msgid "SystemAuditor" msgstr "システム監査人" -#: rbac/builtin.py:98 +#: rbac/builtin.py:103 msgid "SystemComponent" msgstr "システムコンポーネント" -#: rbac/builtin.py:104 +#: rbac/builtin.py:109 msgid "OrgAdmin" msgstr "組織管理者" -#: rbac/builtin.py:107 +#: rbac/builtin.py:112 msgid "OrgAuditor" msgstr "監査員を組織する" -#: rbac/builtin.py:110 +#: rbac/builtin.py:115 msgid "OrgUser" msgstr "組織ユーザー" @@ -3376,11 +3339,11 @@ msgstr "同期が実行中です。しばらくお待ちください。" msgid "Synchronization error: {}" msgstr "同期エラー: {}" -#: settings/api/ldap.py:211 +#: settings/api/ldap.py:213 msgid "Get ldap users is None" msgstr "Ldapユーザーを取得するにはNone" -#: settings/api/ldap.py:220 +#: settings/api/ldap.py:222 msgid "Imported {} users successfully (Organization: {})" msgstr "{} 人のユーザーを正常にインポートしました (組織: {})" @@ -3508,15 +3471,15 @@ msgstr "ピン認証の有効化" msgid "Enable FeiShu Auth" msgstr "飛本認証の有効化" -#: settings/serializers/auth/ldap.py:39 +#: settings/serializers/auth/ldap.py:38 msgid "LDAP server" msgstr "LDAPサーバー" -#: settings/serializers/auth/ldap.py:40 +#: settings/serializers/auth/ldap.py:39 msgid "eg: ldap://localhost:389" msgstr "例: ldap://localhost:389" -#: settings/serializers/auth/ldap.py:42 +#: settings/serializers/auth/ldap.py:41 msgid "Bind DN" msgstr "DN のバインド" @@ -3549,15 +3512,15 @@ msgstr "" "ユーザー属性マッピングは、LDAPのユーザー属性をjumpserverユーザーにマッピング" "する方法、username, name,emailはjumpserverのユーザーが必要とする属性です" -#: settings/serializers/auth/ldap.py:70 +#: settings/serializers/auth/ldap.py:73 msgid "Connect timeout" msgstr "接続タイムアウト" -#: settings/serializers/auth/ldap.py:72 +#: settings/serializers/auth/ldap.py:75 msgid "Search paged size" msgstr "ページサイズを検索" -#: settings/serializers/auth/ldap.py:74 +#: settings/serializers/auth/ldap.py:77 msgid "Enable LDAP auth" msgstr "LDAP認証の有効化" @@ -4256,61 +4219,13 @@ msgstr "" "ログイン成功メッセージはデバイスによって異なります。Telnet経由でデバイスにロ" "グインできない場合は、このパラメーターを設定します。" -#: settings/serializers/terminal.py:37 -msgid "RDP address" -msgstr "RDPアドレス" - -#: settings/serializers/terminal.py:38 -msgid "RDP visit address, eg: dev.jumpserver.org:3389" -msgstr "RDP訪問先住所、例: dev.jumpserver.org:3389" - -#: settings/serializers/terminal.py:40 -msgid "Enable XRDP" -msgstr "XRDPの有効化" - -#: settings/serializers/terminal.py:43 -msgid "Koko host" -msgstr "KOKO ホストアドレス" - -#: settings/serializers/terminal.py:46 -msgid "Koko ssh port" -msgstr "Koko ssh ポート" - -#: settings/serializers/terminal.py:49 +#: settings/serializers/terminal.py:36 msgid "Enable database proxy" msgstr "属性マップの有効化" -#: settings/serializers/terminal.py:51 -msgid "Database proxy host" -msgstr "データベースエージェントホスト" - -#: settings/serializers/terminal.py:52 -msgid "Database proxy host, eg: dev.jumpserver.org" -msgstr "RDP訪問先住所、例: dev.jumpserver.org:3389" - -#: settings/serializers/terminal.py:55 -msgid "MySQL port" -msgstr "MySQLポート" - -#: settings/serializers/terminal.py:56 -msgid "MySQL protocol listen port" -msgstr "MySQLプロトコルリッスンポート" - -#: settings/serializers/terminal.py:59 -msgid "MariaDB port" -msgstr "MariaDBポート" - -#: settings/serializers/terminal.py:60 -msgid "MariaDB protocol listen port" -msgstr "MariaDBプロトコルリッスンポート" - -#: settings/serializers/terminal.py:63 -msgid "PostgreSQL port" -msgstr "PostgreSQLポート" - -#: settings/serializers/terminal.py:64 -msgid "PostgreSQL protocol listen port" -msgstr "PostgreSQLプロトコルリッスンポート" +#: settings/serializers/terminal.py:37 +msgid "Enable XRDP" +msgstr "XRDPの有効化" #: settings/utils/ldap.py:417 msgid "ldap:// or ldaps:// protocol is used." @@ -4413,10 +4328,6 @@ msgstr "認証に失敗しました (不明): {}" msgid "Authentication success: {}" msgstr "認証成功: {}" -#: templates/_base_list.html:37 -msgid "Search" -msgstr "検索" - #: templates/_csv_import_export.html:8 msgid "Export" msgstr "エクスポート" @@ -4466,7 +4377,6 @@ msgid "Commercial support" msgstr "商用サポート" #: templates/_header_bar.html:76 users/forms/profile.py:43 -#: users/templates/users/user_password_update.html:39 msgid "Profile" msgstr "プロフィール" @@ -4572,175 +4482,14 @@ msgstr "待つ:" msgid "The verification code has been sent" msgstr "確認コードが送信されました" -#: templates/_pagination.html:59 -msgid "" -"Displays the results of items _START_ to _END_; A total of _TOTAL_ entries" -msgstr "アイテムの結果を表示します _START_ to _END_; 合計 _TOTAL_ エントリ" - #: templates/_without_nav_base.html:26 msgid "Home page" msgstr "ホームページ" -#: templates/delete_confirm.html:6 -msgid "Confirm delete" -msgstr "削除の確認" - -#: templates/delete_confirm.html:11 -msgid "Are you sure delete" -msgstr "削除してもよろしいですか" - #: templates/flash_message_standalone.html:25 msgid "Cancel" msgstr "キャンセル" -#: templates/index.html:11 -msgid "Total users" -msgstr "合計ユーザー数" - -#: templates/index.html:23 -msgid "Total assets" -msgstr "総資産" - -#: templates/index.html:36 -msgid "Online users" -msgstr "オンラインユーザー" - -#: templates/index.html:49 -msgid "Online sessions" -msgstr "オンラインセッション" - -#: templates/index.html:61 -msgid "In the past week, a total of " -msgstr "過去1週間、共有 " - -#: templates/index.html:61 -msgid " users have logged in " -msgstr " ビットユーザーログイン." - -#: templates/index.html:61 -msgid " times asset." -msgstr " 次资产." - -#: templates/index.html:69 -msgid "Active user asset ratio" -msgstr "アクティブなユーザー資産比率" - -#: templates/index.html:72 -msgid "" -"The following graphs describe the percentage of active users per month and " -"assets per user host per month, respectively." -msgstr "" -"次のグラフは、1か月あたりのアクティブユーザーの割合と、1か月あたりのユーザー" -"ホストあたりの資産の割合をそれぞれ示しています。" - -#: templates/index.html:97 templates/index.html:112 -msgid "Top 10 assets in a week" -msgstr "1週間でトップ10の資産" - -#: templates/index.html:113 -msgid "Login frequency and last login record." -msgstr "ログイン頻度と最後のログイン記録。" - -#: templates/index.html:122 -msgid "Last 10 login" -msgstr "最後の10ログイン" - -#: templates/index.html:128 -msgid "Login record" -msgstr "ログイン記録" - -#: templates/index.html:129 -msgid "Last 10 login records." -msgstr "最後の10件のログイン記録。" - -#: templates/index.html:143 templates/index.html:158 -msgid "Top 10 users in a week" -msgstr "1週間でトップ10のユーザー" - -#: templates/index.html:159 -msgid "User login frequency and last login record." -msgstr "ユーザーログイン頻度と最後のログインレコード。" - -#: templates/index.html:184 -msgid "Monthly data overview" -msgstr "毎月のデータ概要" - -#: templates/index.html:185 -msgid "History summary in one month" -msgstr "1ヶ月で履歴概要" - -#: templates/index.html:193 templates/index.html:217 -msgid "Login count" -msgstr "ログイン数" - -#: templates/index.html:193 templates/index.html:224 -msgid "Active users" -msgstr "アクティブユーザー" - -#: templates/index.html:193 templates/index.html:231 -msgid "Active assets" -msgstr "アクティブな資産" - -#: templates/index.html:262 templates/index.html:313 -msgid "Monthly active users" -msgstr "毎月のアクティブユーザー数" - -#: templates/index.html:262 templates/index.html:314 -msgid "Disable user" -msgstr "ユーザーを無効にする" - -#: templates/index.html:262 templates/index.html:315 -msgid "Month not logged in user" -msgstr "ユーザーにログインしていない月" - -#: templates/index.html:288 templates/index.html:368 -msgid "Access to the source" -msgstr "ソースへのアクセス" - -#: templates/index.html:342 -msgid "Month is logged into the asset" -msgstr "月が資産にログインされます" - -#: templates/index.html:342 templates/index.html:393 -msgid "Disable host" -msgstr "ホストの無効化" - -#: templates/index.html:342 templates/index.html:394 -msgid "Month not logged on host" -msgstr "月がホストにログオンしていない" - -#: templates/index.html:392 -msgid "Month is logged into the host" -msgstr "月がホストにログインされます" - -#: templates/index.html:466 -msgid " times/week" -msgstr " 時間/週" - -#: templates/index.html:491 templates/index.html:527 -msgid " times" -msgstr " 回数" - -#: templates/index.html:494 templates/index.html:530 -msgid "The time last logged in" -msgstr "最後にログインした時刻" - -#: templates/index.html:495 templates/index.html:531 -msgid "At" -msgstr "于" - -#: templates/index.html:510 templates/index.html:545 templates/index.html:580 -msgid "(No)" -msgstr "(しばらく)" - -#: templates/index.html:561 -msgid "Before" -msgstr "前" - -#: templates/index.html:562 -msgid "Login in " -msgstr "ログイン" - #: templates/resource_download.html:18 templates/resource_download.html:24 #: templates/resource_download.html:25 templates/resource_download.html:30 msgid "Client" @@ -4786,19 +4535,23 @@ msgstr "" msgid "Filters" msgstr "フィルター" -#: terminal/api/session.py:211 +#: terminal/api/endpoint.py:65 +msgid "Not found protocol query params" +msgstr "" + +#: terminal/api/session.py:210 msgid "Session does not exist: {}" msgstr "セッションが存在しません: {}" -#: terminal/api/session.py:214 +#: terminal/api/session.py:213 msgid "Session is finished or the protocol not supported" msgstr "セッションが終了したか、プロトコルがサポートされていません" -#: terminal/api/session.py:219 +#: terminal/api/session.py:218 msgid "User does not exist: {}" msgstr "ユーザーが存在しない: {}" -#: terminal/api/session.py:227 +#: terminal/api/session.py:226 msgid "User does not have permission" msgstr "ユーザーに権限がありません" @@ -4842,7 +4595,7 @@ msgstr "オンラインセッションを持つ" msgid "Terminals" msgstr "ターミナル管理" -#: terminal/backends/command/es.py:27 +#: terminal/backends/command/es.py:26 msgid "Invalid elasticsearch config" msgstr "無効なElasticsearch構成" @@ -4899,7 +4652,6 @@ msgid "High" msgstr "高い" #: terminal/const.py:35 users/templates/users/reset_password.html:50 -#: users/templates/users/user_password_update.html:104 msgid "Normal" msgstr "正常" @@ -4919,6 +4671,49 @@ msgstr "ストレージが無効です" msgid "Command record" msgstr "コマンドレコード" +#: terminal/models/endpoint.py:13 +msgid "HTTPS Port" +msgstr "HTTPS ポート" + +#: terminal/models/endpoint.py:14 terminal/models/terminal.py:107 +msgid "HTTP Port" +msgstr "HTTP ポート" + +#: terminal/models/endpoint.py:15 terminal/models/terminal.py:106 +msgid "SSH Port" +msgstr "SSH ポート" + +#: terminal/models/endpoint.py:16 +msgid "RDP Port" +msgstr "RDP ポート" + +#: terminal/models/endpoint.py:17 +msgid "MySQL Port" +msgstr "MySQL ポート" + +#: terminal/models/endpoint.py:18 +msgid "MariaDB Port" +msgstr "MariaDB ポート" + +#: terminal/models/endpoint.py:19 +msgid "PostgreSQL Port" +msgstr "PostgreSQL ポート" + +#: terminal/models/endpoint.py:25 terminal/models/endpoint.py:61 +#: terminal/serializers/endpoint.py:40 terminal/serializers/storage.py:37 +#: terminal/serializers/storage.py:49 terminal/serializers/storage.py:79 +#: terminal/serializers/storage.py:89 terminal/serializers/storage.py:97 +msgid "Endpoint" +msgstr "エンドポイント" + +#: terminal/models/endpoint.py:54 +msgid "IP group" +msgstr "IP グループ" + +#: terminal/models/endpoint.py:66 +msgid "Endpoint rule" +msgstr "エンドポイントルール" + #: terminal/models/replay.py:12 msgid "Session replay" msgstr "セッション再生" @@ -4931,35 +4726,35 @@ msgstr "セッションのリプレイをアップロードできます" msgid "Can download session replay" msgstr "セッション再生をダウンロードできます" -#: terminal/models/session.py:48 terminal/models/sharing.py:87 +#: terminal/models/session.py:50 terminal/models/sharing.py:87 msgid "Login from" msgstr "ログイン元" -#: terminal/models/session.py:52 +#: terminal/models/session.py:54 msgid "Replay" msgstr "リプレイ" -#: terminal/models/session.py:57 +#: terminal/models/session.py:59 msgid "Date end" msgstr "終了日" -#: terminal/models/session.py:242 +#: terminal/models/session.py:251 msgid "Session record" msgstr "セッション記録" -#: terminal/models/session.py:244 +#: terminal/models/session.py:253 msgid "Can monitor session" msgstr "セッションを監視できます" -#: terminal/models/session.py:245 +#: terminal/models/session.py:254 msgid "Can share session" msgstr "セッションを共有できます" -#: terminal/models/session.py:246 +#: terminal/models/session.py:255 msgid "Can terminate session" msgstr "セッションを終了できます" -#: terminal/models/session.py:247 +#: terminal/models/session.py:256 msgid "Can validate session action perm" msgstr "セッションアクションのパーマを検証できます" @@ -5068,14 +4863,6 @@ msgstr "クワーグ" msgid "type" msgstr "タイプ" -#: terminal/models/terminal.py:106 -msgid "SSH Port" -msgstr "SSHポート" - -#: terminal/models/terminal.py:107 -msgid "HTTP Port" -msgstr "HTTPポート" - #: terminal/models/terminal.py:183 terminal/serializers/session.py:38 msgid "Terminal" msgstr "ターミナル" @@ -5132,65 +4919,59 @@ msgstr "終了できます" msgid "Command amount" msgstr "コマンド量" -#: terminal/serializers/storage.py:21 +#: terminal/serializers/storage.py:19 msgid "Endpoint invalid: remove path `{}`" msgstr "エンドポイントが無効: パス '{}' を削除" -#: terminal/serializers/storage.py:27 +#: terminal/serializers/storage.py:25 msgid "Bucket" msgstr "バケット" -#: terminal/serializers/storage.py:34 users/models/user.py:695 +#: terminal/serializers/storage.py:32 users/models/user.py:695 msgid "Secret key" msgstr "秘密キー" -#: terminal/serializers/storage.py:39 terminal/serializers/storage.py:51 -#: terminal/serializers/storage.py:81 terminal/serializers/storage.py:91 -#: terminal/serializers/storage.py:99 -msgid "Endpoint" -msgstr "エンドポイント" - -#: terminal/serializers/storage.py:66 xpack/plugins/cloud/models.py:220 +#: terminal/serializers/storage.py:64 xpack/plugins/cloud/models.py:220 msgid "Region" msgstr "リージョン" -#: terminal/serializers/storage.py:110 +#: terminal/serializers/storage.py:108 msgid "Container name" msgstr "コンテナー名" -#: terminal/serializers/storage.py:112 +#: terminal/serializers/storage.py:110 msgid "Account name" msgstr "アカウント名" -#: terminal/serializers/storage.py:113 +#: terminal/serializers/storage.py:111 msgid "Account key" msgstr "アカウントキー" -#: terminal/serializers/storage.py:116 +#: terminal/serializers/storage.py:114 msgid "Endpoint suffix" msgstr "エンドポイントサフィックス" -#: terminal/serializers/storage.py:138 +#: terminal/serializers/storage.py:134 msgid "The address format is incorrect" msgstr "アドレス形式が正しくありません" -#: terminal/serializers/storage.py:145 +#: terminal/serializers/storage.py:141 msgid "Host invalid" msgstr "ホスト無効" -#: terminal/serializers/storage.py:148 +#: terminal/serializers/storage.py:144 msgid "Port invalid" msgstr "ポートが無効" -#: terminal/serializers/storage.py:164 +#: terminal/serializers/storage.py:159 msgid "Index" msgstr "インデックス" -#: terminal/serializers/storage.py:166 +#: terminal/serializers/storage.py:161 msgid "Doc type" msgstr "Docタイプ" -#: terminal/serializers/storage.py:168 +#: terminal/serializers/storage.py:163 msgid "Ignore Certificate Verification" msgstr "証明書の検証を無視する" @@ -5748,7 +5529,6 @@ msgid "Not a valid ssh public key" msgstr "有効なssh公開鍵ではありません" #: users/forms/profile.py:160 users/models/user.py:692 -#: users/templates/users/user_password_update.html:48 msgid "Public key" msgstr "公開キー" @@ -5957,10 +5737,6 @@ msgstr "セキュリティのために、複数のユーザーのみをリスト msgid "name not unique" msgstr "名前が一意ではない" -#: users/templates/users/_granted_assets.html:7 -msgid "Loading" -msgstr "読み込み中" - #: users/templates/users/_msg_account_expire_reminder.html:7 msgid "Your account will expire in" msgstr "アカウントの有効期限は" @@ -6015,69 +5791,11 @@ msgstr "あなたのssh公開鍵はサイト管理者によってリセットさ msgid "click here to set your password" msgstr "ここをクリックしてパスワードを設定してください" -#: users/templates/users/_select_user_modal.html:5 -msgid "Please Select User" -msgstr "ユーザーを選択してください" - -#: users/templates/users/_select_user_modal.html:17 -msgid "Asset num" -msgstr "資産num" - -#: users/templates/users/_user_detail_nav_header.html:11 -msgid "User detail" -msgstr "ユーザーの詳細" - -#: users/templates/users/_user_detail_nav_header.html:15 -msgid "User permissions" -msgstr "ユーザー権限" - -#: users/templates/users/_user_detail_nav_header.html:23 -msgid "Asset granted" -msgstr "付与された資産" - -#: users/templates/users/_user_detail_nav_header.html:40 -msgid "RemoteApp granted" -msgstr "承認されたリモートアプリケーション" - -#: users/templates/users/_user_detail_nav_header.html:47 -msgid "RemoteApp permission" -msgstr "リモートアプリケーションのライセンス" - -#: users/templates/users/_user_detail_nav_header.html:54 -msgid "DatabaseApp granted" -msgstr "認可されたデータベース・アプリケーション" - -#: users/templates/users/_user_detail_nav_header.html:61 -msgid "DatabaseApp permission" -msgstr "数据库应用授权" - -#: users/templates/users/_user_update_pk_modal.html:4 -msgid "Update User SSH Public Key" -msgstr "SSHキーの更新" - -#: users/templates/users/first_login.html:6 -#: users/templates/users/first_login_done.html:19 -msgid "First Login" -msgstr "最初のログイン" - -#: users/templates/users/first_login_done.html:31 -msgid "Welcome to use jumpserver, visit " -msgstr "JumpServer砦機へようこそ" - -#: users/templates/users/first_login_done.html:32 -msgid "Use guide" -msgstr "ガイド人" - -#: users/templates/users/first_login_done.html:32 -msgid " for more information" -msgstr "より多くの情報のため" - #: users/templates/users/forgot_password.html:23 msgid "Input your email, that will send a mail to your" msgstr "あなたのメールを入力し、それはあなたにメールを送信します" #: users/templates/users/forgot_password.html:32 -#: users/templates/users/user_password_update.html:75 msgid "Submit" msgstr "送信" @@ -6094,12 +5812,10 @@ msgid "MFA setting" msgstr "MFAの設定" #: users/templates/users/reset_password.html:23 -#: users/templates/users/user_password_update.html:64 msgid "Your password must satisfy" msgstr "パスワードを満たす必要があります" #: users/templates/users/reset_password.html:24 -#: users/templates/users/user_password_update.html:65 msgid "Password strength" msgstr "パスワードの強さ" @@ -6108,54 +5824,25 @@ msgid "Setting" msgstr "設定" #: users/templates/users/reset_password.html:48 -#: users/templates/users/user_password_update.html:102 msgid "Very weak" msgstr "非常に弱い" #: users/templates/users/reset_password.html:49 -#: users/templates/users/user_password_update.html:103 msgid "Weak" msgstr "弱い" #: users/templates/users/reset_password.html:51 -#: users/templates/users/user_password_update.html:105 msgid "Medium" msgstr "中" #: users/templates/users/reset_password.html:52 -#: users/templates/users/user_password_update.html:106 msgid "Strong" msgstr "強い" #: users/templates/users/reset_password.html:53 -#: users/templates/users/user_password_update.html:107 msgid "Very strong" msgstr "非常に強い" -#: users/templates/users/user_asset_permission.html:43 -#: users/templates/users/user_asset_permission.html:155 -#: users/templates/users/user_database_app_permission.html:41 -#: xpack/plugins/cloud/models.py:34 -msgid "Validity" -msgstr "有効性" - -#: users/templates/users/user_asset_permission.html:160 -msgid "Inherit" -msgstr "継承" - -#: users/templates/users/user_asset_permission.html:161 -msgid "Include" -msgstr "含める" - -#: users/templates/users/user_asset_permission.html:162 -msgid "Exclude" -msgstr "除外" - -#: users/templates/users/user_database_app_permission.html:39 -#: users/templates/users/user_database_app_permission.html:64 -msgid "DatabaseApp" -msgstr "データベースの適用" - #: users/templates/users/user_otp_check_password.html:6 msgid "Enable OTP" msgstr "OTPの有効化" @@ -6205,10 +5892,6 @@ msgstr "" "インストール後、次のステップをクリックしてバインディングページに入ります (イ" "ンストールされている場合は、次のステップに直接進みます)。" -#: users/templates/users/user_password_update.html:74 -msgid "Reset" -msgstr "リセット" - #: users/templates/users/user_password_verify.html:8 #: users/templates/users/user_password_verify.html:9 msgid "Verify password" @@ -6520,62 +6203,58 @@ msgid "Baidu Cloud" msgstr "百度雲" #: xpack/plugins/cloud/const.py:15 -msgid "JD Cloud" -msgstr "京東雲" - -#: xpack/plugins/cloud/const.py:16 msgid "Tencent Cloud" msgstr "テンセント雲" -#: xpack/plugins/cloud/const.py:17 +#: xpack/plugins/cloud/const.py:16 msgid "VMware" msgstr "VMware" -#: xpack/plugins/cloud/const.py:18 xpack/plugins/cloud/providers/nutanix.py:13 +#: xpack/plugins/cloud/const.py:17 xpack/plugins/cloud/providers/nutanix.py:13 msgid "Nutanix" msgstr "Nutanix" -#: xpack/plugins/cloud/const.py:19 +#: xpack/plugins/cloud/const.py:18 msgid "Huawei Private Cloud" msgstr "華為私有雲" -#: xpack/plugins/cloud/const.py:20 +#: xpack/plugins/cloud/const.py:19 msgid "Qingyun Private Cloud" msgstr "青雲私有雲" -#: xpack/plugins/cloud/const.py:21 +#: xpack/plugins/cloud/const.py:20 msgid "OpenStack" msgstr "OpenStack" -#: xpack/plugins/cloud/const.py:22 +#: xpack/plugins/cloud/const.py:21 msgid "Google Cloud Platform" msgstr "谷歌雲" -#: xpack/plugins/cloud/const.py:26 +#: xpack/plugins/cloud/const.py:25 msgid "Instance name" msgstr "インスタンス名" -#: xpack/plugins/cloud/const.py:27 +#: xpack/plugins/cloud/const.py:26 msgid "Instance name and Partial IP" msgstr "インスタンス名と部分IP" -#: xpack/plugins/cloud/const.py:32 +#: xpack/plugins/cloud/const.py:31 msgid "Succeed" msgstr "成功" -#: xpack/plugins/cloud/const.py:36 +#: xpack/plugins/cloud/const.py:35 msgid "Unsync" msgstr "同期していません" -#: xpack/plugins/cloud/const.py:37 +#: xpack/plugins/cloud/const.py:36 msgid "New Sync" msgstr "新しい同期" -#: xpack/plugins/cloud/const.py:38 +#: xpack/plugins/cloud/const.py:37 msgid "Synced" msgstr "同期済み" -#: xpack/plugins/cloud/const.py:39 +#: xpack/plugins/cloud/const.py:38 msgid "Released" msgstr "リリース済み" @@ -6587,6 +6266,10 @@ msgstr "クラウドセンター" msgid "Provider" msgstr "プロバイダー" +#: xpack/plugins/cloud/models.py:34 +msgid "Validity" +msgstr "有効性" + #: xpack/plugins/cloud/models.py:39 msgid "Cloud account" msgstr "クラウドアカウント" @@ -6748,13 +6431,11 @@ msgid "South America (São Paulo)" msgstr "南米 (サンパウロ)" #: xpack/plugins/cloud/providers/baiducloud.py:54 -#: xpack/plugins/cloud/providers/jdcloud.py:127 msgid "CN North-Beijing" msgstr "華北-北京" #: xpack/plugins/cloud/providers/baiducloud.py:55 #: xpack/plugins/cloud/providers/huaweicloud.py:40 -#: xpack/plugins/cloud/providers/jdcloud.py:130 msgid "CN South-Guangzhou" msgstr "華南-広州" @@ -6776,7 +6457,6 @@ msgid "CN North-Baoding" msgstr "華北-保定" #: xpack/plugins/cloud/providers/baiducloud.py:60 -#: xpack/plugins/cloud/providers/jdcloud.py:129 msgid "CN East-Shanghai" msgstr "華東-上海" @@ -6841,15 +6521,11 @@ msgstr "華北-ウランチャブ一" msgid "CN South-Guangzhou-InvitationOnly" msgstr "華南-広州-友好ユーザー環境" -#: xpack/plugins/cloud/providers/jdcloud.py:128 -msgid "CN East-Suqian" -msgstr "華東-宿遷" - -#: xpack/plugins/cloud/serializers/account.py:60 +#: xpack/plugins/cloud/serializers/account.py:59 msgid "Validity display" msgstr "有効表示" -#: xpack/plugins/cloud/serializers/account.py:61 +#: xpack/plugins/cloud/serializers/account.py:60 msgid "Provider display" msgstr "プロバイダ表示" diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index 88f701b6b..5b9f31b64 100644 --- a/apps/locale/zh/LC_MESSAGES/django.mo +++ b/apps/locale/zh/LC_MESSAGES/django.mo @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3d6a0d40534209f3ffab0b0ecfab7ec82f137156fc8e7b19ce1711036d14aeca -size 107709 +oid sha256:9c13775875a335e3c8dbc7f666af622c5aa12050100b15e616c210e8e3043e38 +size 103490 diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index fb29c7d9c..b15b2c545 100644 --- a/apps/locale/zh/LC_MESSAGES/django.po +++ b/apps/locale/zh/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: JumpServer 0.3.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-02 10:01+0800\n" +"POT-Creation-Date: 2022-04-12 17:03+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -28,31 +28,27 @@ msgstr "访问控制" #: assets/models/group.py:20 assets/models/label.py:18 ops/mixin.py:24 #: orgs/models.py:65 perms/models/base.py:83 rbac/models/role.py:29 #: settings/models.py:29 settings/serializers/sms.py:6 +#: terminal/models/endpoint.py:10 terminal/models/endpoint.py:53 #: terminal/models/storage.py:23 terminal/models/task.py:16 #: terminal/models/terminal.py:100 users/forms/profile.py:32 #: users/models/group.py:15 users/models/user.py:661 -#: users/templates/users/_select_user_modal.html:13 -#: users/templates/users/user_asset_permission.html:37 -#: users/templates/users/user_asset_permission.html:154 -#: users/templates/users/user_database_app_permission.html:36 #: xpack/plugins/cloud/models.py:28 msgid "Name" msgstr "名称" #: acls/models/base.py:27 assets/models/cmd_filter.py:84 -#: assets/models/user.py:247 +#: assets/models/user.py:247 terminal/models/endpoint.py:56 msgid "Priority" msgstr "优先级" #: acls/models/base.py:28 assets/models/cmd_filter.py:84 -#: assets/models/user.py:247 +#: assets/models/user.py:247 terminal/models/endpoint.py:57 msgid "1-100, the lower the value will be match first" msgstr "优先级可选范围为 1-100 (数值越小越优先)" #: acls/models/base.py:31 authentication/models.py:17 #: authentication/templates/authentication/_access_key_modal.html:32 #: perms/models/base.py:88 terminal/models/sharing.py:26 -#: users/templates/users/_select_user_modal.html:18 msgid "Active" msgstr "激活中" @@ -64,6 +60,7 @@ msgstr "激活中" #: assets/models/domain.py:64 assets/models/group.py:23 #: assets/models/label.py:23 ops/models/adhoc.py:38 orgs/models.py:68 #: perms/models/base.py:93 rbac/models/role.py:37 settings/models.py:34 +#: terminal/models/endpoint.py:20 terminal/models/endpoint.py:63 #: terminal/models/storage.py:26 terminal/models/terminal.py:114 #: tickets/models/comment.py:24 tickets/models/ticket.py:154 #: users/models/group.py:16 users/models/user.py:698 @@ -90,16 +87,12 @@ msgstr "登录复核" #: assets/models/cmd_filter.py:30 assets/models/label.py:15 audits/models.py:37 #: audits/models.py:60 audits/models.py:85 audits/serializers.py:100 #: authentication/models.py:50 orgs/models.py:214 perms/models/base.py:84 -#: rbac/builtin.py:101 rbac/models/rolebinding.py:40 templates/index.html:78 +#: rbac/builtin.py:106 rbac/models/rolebinding.py:40 #: terminal/backends/command/models.py:19 -#: terminal/backends/command/serializers.py:12 terminal/models/session.py:42 +#: terminal/backends/command/serializers.py:12 terminal/models/session.py:44 #: terminal/notifications.py:91 terminal/notifications.py:139 #: tickets/models/comment.py:17 users/const.py:14 users/models/user.py:886 #: users/models/user.py:917 users/serializers/group.py:19 -#: users/templates/users/user_asset_permission.html:38 -#: users/templates/users/user_asset_permission.html:64 -#: users/templates/users/user_database_app_permission.html:37 -#: users/templates/users/user_database_app_permission.html:58 msgid "User" msgstr "用户" @@ -111,10 +104,6 @@ msgstr "规则" #: acls/serializers/login_acl.py:17 acls/serializers/login_asset_acl.py:75 #: assets/models/cmd_filter.py:89 audits/models.py:61 audits/serializers.py:51 #: authentication/templates/authentication/_access_key_modal.html:34 -#: users/templates/users/_granted_assets.html:29 -#: users/templates/users/user_asset_permission.html:44 -#: users/templates/users/user_asset_permission.html:79 -#: users/templates/users/user_database_app_permission.html:42 msgid "Action" msgstr "动作" @@ -135,16 +124,13 @@ msgstr "系统用户" #: acls/models/login_asset_acl.py:22 #: applications/serializers/attrs/application_category/remote_app.py:36 -#: assets/models/asset.py:383 assets/models/authbook.py:19 +#: assets/models/asset.py:386 assets/models/authbook.py:19 #: assets/models/backup.py:31 assets/models/cmd_filter.py:38 #: assets/models/gathered_user.py:14 assets/serializers/label.py:30 #: assets/serializers/system_user.py:264 audits/models.py:39 -#: perms/models/asset_permission.py:23 templates/index.html:82 -#: terminal/backends/command/models.py:20 -#: terminal/backends/command/serializers.py:13 terminal/models/session.py:44 +#: perms/models/asset_permission.py:23 terminal/backends/command/models.py:20 +#: terminal/backends/command/serializers.py:13 terminal/models/session.py:46 #: terminal/notifications.py:90 -#: users/templates/users/user_asset_permission.html:40 -#: users/templates/users/user_asset_permission.html:70 #: xpack/plugins/change_auth_plan/models/asset.py:199 #: xpack/plugins/change_auth_plan/serializers/asset.py:180 #: xpack/plugins/cloud/models.py:223 @@ -171,7 +157,6 @@ msgstr "格式为逗号分隔的字符串, * 表示匹配所有. " #: authentication/templates/authentication/_msg_oauth_bind.html:9 #: ops/models/adhoc.py:159 users/forms/profile.py:31 users/models/user.py:659 #: users/templates/users/_msg_user_created.html:12 -#: users/templates/users/_select_user_modal.html:14 #: xpack/plugins/change_auth_plan/models/asset.py:34 #: xpack/plugins/change_auth_plan/models/asset.py:195 #: xpack/plugins/cloud/serializers/account_attrs.py:22 @@ -194,17 +179,13 @@ msgstr "" #: authentication/templates/authentication/_msg_oauth_bind.html:12 #: authentication/templates/authentication/_msg_rest_password_success.html:8 #: authentication/templates/authentication/_msg_rest_public_key_success.html:8 -#: settings/serializers/terminal.py:8 -#: users/templates/users/_granted_assets.html:26 -#: users/templates/users/user_asset_permission.html:156 +#: settings/serializers/terminal.py:8 terminal/serializers/endpoint.py:37 msgid "IP" msgstr "IP" #: acls/serializers/login_asset_acl.py:35 assets/models/asset.py:211 #: assets/serializers/account.py:14 assets/serializers/gathered_user.py:23 #: settings/serializers/terminal.py:7 -#: users/templates/users/_granted_assets.html:25 -#: users/templates/users/user_asset_permission.html:157 msgid "Hostname" msgstr "主机名" @@ -216,7 +197,7 @@ msgstr "格式为逗号分隔的字符串, * 表示匹配所有. 可选的协议 #: acls/serializers/login_asset_acl.py:55 assets/models/asset.py:213 #: assets/models/domain.py:62 assets/models/user.py:248 -#: terminal/serializers/session.py:30 terminal/serializers/storage.py:69 +#: terminal/serializers/session.py:30 terminal/serializers/storage.py:67 msgid "Protocol" msgstr "协议" @@ -280,13 +261,7 @@ msgstr "应用程序" #: assets/models/cmd_filter.py:42 assets/models/user.py:338 audits/models.py:40 #: perms/models/application_permission.py:33 #: perms/models/asset_permission.py:25 terminal/backends/command/models.py:21 -#: terminal/backends/command/serializers.py:35 terminal/models/session.py:46 -#: users/templates/users/_granted_assets.html:27 -#: users/templates/users/user_asset_permission.html:42 -#: users/templates/users/user_asset_permission.html:76 -#: users/templates/users/user_asset_permission.html:159 -#: users/templates/users/user_database_app_permission.html:40 -#: users/templates/users/user_database_app_permission.html:67 +#: terminal/backends/command/serializers.py:35 terminal/models/session.py:48 #: xpack/plugins/change_auth_plan/models/app.py:36 #: xpack/plugins/change_auth_plan/models/app.py:147 #: xpack/plugins/change_auth_plan/serializers/app.py:65 @@ -338,7 +313,7 @@ msgid "Domain" msgstr "网域" #: applications/models/application.py:228 xpack/plugins/cloud/models.py:33 -#: xpack/plugins/cloud/serializers/account.py:59 +#: xpack/plugins/cloud/serializers/account.py:58 msgid "Attrs" msgstr "属性" @@ -346,7 +321,7 @@ msgstr "属性" msgid "Can match application" msgstr "匹配应用" -#: applications/models/application.py:286 +#: applications/models/application.py:306 msgid "Application user" msgstr "应用用户" @@ -404,6 +379,7 @@ msgstr "集群" #: applications/serializers/attrs/application_category/db.py:11 #: ops/models/adhoc.py:157 settings/serializers/auth/radius.py:14 +#: terminal/models/endpoint.py:11 #: xpack/plugins/cloud/serializers/account_attrs.py:68 msgid "Host" msgstr "主机" @@ -634,27 +610,27 @@ msgstr "标签管理" msgid "Created by" msgstr "创建者" -#: assets/models/asset.py:386 +#: assets/models/asset.py:389 msgid "Can refresh asset hardware info" msgstr "可以更新资产硬件信息" -#: assets/models/asset.py:387 +#: assets/models/asset.py:390 msgid "Can test asset connectivity" msgstr "可以测试资产连接性" -#: assets/models/asset.py:388 +#: assets/models/asset.py:391 msgid "Can push system user to asset" msgstr "可以推送系统用户到资产" -#: assets/models/asset.py:389 +#: assets/models/asset.py:392 msgid "Can match asset" msgstr "可以匹配资产" -#: assets/models/asset.py:390 +#: assets/models/asset.py:393 msgid "Add asset to node" msgstr "添加资产到节点" -#: assets/models/asset.py:391 +#: assets/models/asset.py:394 msgid "Move asset to node" msgstr "移动资产到节点" @@ -701,7 +677,7 @@ msgid "Timing trigger" msgstr "定时触发" #: assets/models/backup.py:105 audits/models.py:44 ops/models/command.py:31 -#: perms/models/base.py:89 terminal/models/session.py:56 +#: perms/models/base.py:89 terminal/models/session.py:58 #: tickets/serializers/ticket/meta/ticket_type/apply_application.py:55 #: tickets/serializers/ticket/meta/ticket_type/apply_asset.py:57 #: xpack/plugins/change_auth_plan/models/base.py:112 @@ -762,7 +738,7 @@ msgstr "成功" #: assets/models/base.py:32 audits/models.py:116 #: xpack/plugins/change_auth_plan/serializers/app.py:88 #: xpack/plugins/change_auth_plan/serializers/asset.py:198 -#: xpack/plugins/cloud/const.py:31 +#: xpack/plugins/cloud/const.py:30 msgid "Failed" msgstr "失败" @@ -777,9 +753,8 @@ msgstr "校验日期" #: assets/models/base.py:177 audits/signal_handlers.py:68 #: authentication/forms.py:22 #: authentication/templates/authentication/login.html:181 -#: settings/serializers/auth/ldap.py:44 users/forms/profile.py:21 +#: settings/serializers/auth/ldap.py:43 users/forms/profile.py:21 #: users/templates/users/_msg_user_created.html:13 -#: users/templates/users/user_password_update.html:43 #: users/templates/users/user_password_verify.html:18 #: xpack/plugins/change_auth_plan/models/base.py:42 #: xpack/plugins/change_auth_plan/models/base.py:121 @@ -844,11 +819,6 @@ msgstr "默认Cluster" #: assets/models/cmd_filter.py:34 perms/models/base.py:86 #: users/models/group.py:31 users/models/user.py:667 -#: users/templates/users/_select_user_modal.html:16 -#: users/templates/users/user_asset_permission.html:39 -#: users/templates/users/user_asset_permission.html:67 -#: users/templates/users/user_database_app_permission.html:38 -#: users/templates/users/user_database_app_permission.html:61 msgid "User group" msgstr "用户组" @@ -861,7 +831,7 @@ msgid "Regex" msgstr "正则表达式" #: assets/models/cmd_filter.py:68 ops/models/command.py:26 -#: terminal/backends/command/serializers.py:14 terminal/models/session.py:53 +#: terminal/backends/command/serializers.py:14 terminal/models/session.py:55 #: terminal/templates/terminal/_msg_command_alert.html:12 #: terminal/templates/terminal/_msg_command_execute_alert.html:10 msgid "Command" @@ -961,7 +931,7 @@ msgstr "标签" msgid "New node" msgstr "新节点" -#: assets/models/node.py:474 users/templates/users/_granted_assets.html:130 +#: assets/models/node.py:474 msgid "empty" msgstr "空" @@ -978,9 +948,6 @@ msgid "Parent key" msgstr "ssh私钥" #: assets/models/node.py:559 assets/serializers/system_user.py:263 -#: users/templates/users/user_asset_permission.html:41 -#: users/templates/users/user_asset_permission.html:73 -#: users/templates/users/user_asset_permission.html:158 #: xpack/plugins/cloud/models.py:96 xpack/plugins/cloud/serializers/task.py:69 msgid "Node" msgstr "节点" @@ -1132,7 +1099,7 @@ msgid "Actions" msgstr "动作" #: assets/serializers/backup.py:31 ops/mixin.py:106 ops/mixin.py:147 -#: settings/serializers/auth/ldap.py:59 +#: settings/serializers/auth/ldap.py:62 #: xpack/plugins/change_auth_plan/serializers/base.py:42 msgid "Periodic perform" msgstr "定时执行" @@ -1376,8 +1343,7 @@ msgstr "日志审计" #: audits/models.py:27 audits/models.py:57 #: authentication/templates/authentication/_access_key_modal.html:65 -#: rbac/tree.py:166 users/templates/users/user_asset_permission.html:128 -#: users/templates/users/user_database_app_permission.html:111 +#: rbac/tree.py:166 msgid "Delete" msgstr "删除" @@ -1406,7 +1372,7 @@ msgid "Symlink" msgstr "建立软链接" #: audits/models.py:38 audits/models.py:64 audits/models.py:87 -#: terminal/models/session.py:49 terminal/models/sharing.py:82 +#: terminal/models/session.py:51 terminal/models/sharing.py:82 msgid "Remote addr" msgstr "远端地址" @@ -1436,8 +1402,6 @@ msgstr "创建" #: audits/models.py:56 rbac/tree.py:165 templates/_csv_import_export.html:18 #: templates/_csv_update_modal.html:6 -#: users/templates/users/user_asset_permission.html:127 -#: users/templates/users/user_database_app_permission.html:110 msgid "Update" msgstr "更新" @@ -1546,7 +1510,7 @@ msgstr "主机名称" msgid "Result" msgstr "结果" -#: audits/serializers.py:98 terminal/serializers/storage.py:161 +#: audits/serializers.py:98 terminal/serializers/storage.py:156 msgid "Hosts" msgstr "主机" @@ -1657,7 +1621,6 @@ msgid "{AssetPermission} REMOVE {UserGroup}" msgstr "{AssetPermission} 移除 {UserGroup}" #: audits/signal_handlers.py:131 perms/models/asset_permission.py:29 -#: users/templates/users/_user_detail_nav_header.html:31 msgid "Asset permission" msgstr "资产授权" @@ -1755,7 +1718,7 @@ msgstr "{ApplicationPermission} 添加 {SystemUser}" msgid "{ApplicationPermission} REMOVE {SystemUser}" msgstr "{ApplicationPermission} 移除 {SystemUser}" -#: authentication/api/connection_token.py:313 +#: authentication/api/connection_token.py:328 msgid "Invalid token" msgstr "无效的令牌" @@ -2044,7 +2007,7 @@ msgstr "该 MFA ({}) 方式没有启用" msgid "Please change your password" msgstr "请修改密码" -#: authentication/models.py:33 terminal/serializers/storage.py:30 +#: authentication/models.py:33 terminal/serializers/storage.py:28 msgid "Access key" msgstr "API key" @@ -2108,7 +2071,6 @@ msgid "Date" msgstr "日期" #: authentication/templates/authentication/_access_key_modal.html:48 -#: users/templates/users/_granted_assets.html:75 msgid "Show" msgstr "显示" @@ -2168,7 +2130,7 @@ msgstr "代码错误" #: authentication/templates/authentication/_msg_reset_password.html:3 #: authentication/templates/authentication/_msg_rest_password_success.html:2 #: authentication/templates/authentication/_msg_rest_public_key_success.html:2 -#: jumpserver/conf.py:295 ops/tasks.py:145 ops/tasks.py:148 +#: jumpserver/conf.py:296 ops/tasks.py:145 ops/tasks.py:148 #: perms/templates/perms/_msg_item_permissions_expire.html:3 #: perms/templates/perms/_msg_permed_items_expire.html:3 #: users/templates/users/_msg_account_expire_reminder.html:4 @@ -2620,11 +2582,11 @@ msgstr "不能包含特殊字符" msgid "The mobile phone number format is incorrect" msgstr "手机号格式不正确" -#: jumpserver/conf.py:294 +#: jumpserver/conf.py:295 msgid "Create account successfully" msgstr "创建账号成功" -#: jumpserver/conf.py:296 +#: jumpserver/conf.py:297 msgid "Your account has been created successfully" msgstr "你的账号已创建成功" @@ -2685,12 +2647,12 @@ msgid "App ops" msgstr "作业中心" #: ops/mixin.py:29 ops/mixin.py:92 ops/mixin.py:162 -#: settings/serializers/auth/ldap.py:66 +#: settings/serializers/auth/ldap.py:69 msgid "Cycle perform" msgstr "周期执行" #: ops/mixin.py:33 ops/mixin.py:90 ops/mixin.py:109 ops/mixin.py:150 -#: settings/serializers/auth/ldap.py:63 +#: settings/serializers/auth/ldap.py:66 msgid "Regularly perform" msgstr "定期执行" @@ -2877,7 +2839,8 @@ msgstr "组织管理" #: orgs/mixins/models.py:46 orgs/mixins/serializers.py:25 orgs/models.py:80 #: orgs/models.py:211 rbac/const.py:7 rbac/models/rolebinding.py:47 -#: rbac/serializers/rolebinding.py:40 tickets/serializers/ticket/ticket.py:77 +#: rbac/serializers/rolebinding.py:40 settings/serializers/auth/ldap.py:59 +#: tickets/serializers/ticket/ticket.py:77 msgid "Organization" msgstr "组织" @@ -2890,7 +2853,7 @@ msgid "Can view root org" msgstr "可以查看全局组织" #: orgs/models.py:216 rbac/models/role.py:46 rbac/models/rolebinding.py:43 -#: users/models/user.py:671 users/templates/users/_select_user_modal.html:15 +#: users/models/user.py:671 msgid "Role" msgstr "角色" @@ -3114,27 +3077,27 @@ msgstr "{} 至少有一个系统角色" msgid "RBAC" msgstr "RBAC" -#: rbac/builtin.py:92 +#: rbac/builtin.py:97 msgid "SystemAdmin" msgstr "系统管理员" -#: rbac/builtin.py:95 +#: rbac/builtin.py:100 msgid "SystemAuditor" msgstr "系统审计员" -#: rbac/builtin.py:98 +#: rbac/builtin.py:103 msgid "SystemComponent" msgstr "系统组件" -#: rbac/builtin.py:104 +#: rbac/builtin.py:109 msgid "OrgAdmin" msgstr "组织管理员" -#: rbac/builtin.py:107 +#: rbac/builtin.py:112 msgid "OrgAuditor" msgstr "组织审计员" -#: rbac/builtin.py:110 +#: rbac/builtin.py:115 msgid "OrgUser" msgstr "组织用户" @@ -3338,11 +3301,11 @@ msgstr "同步正在运行,请稍等" msgid "Synchronization error: {}" msgstr "同步错误: {}" -#: settings/api/ldap.py:211 +#: settings/api/ldap.py:213 msgid "Get ldap users is None" msgstr "获取 LDAP 用户为 None" -#: settings/api/ldap.py:220 +#: settings/api/ldap.py:222 msgid "Imported {} users successfully (Organization: {})" msgstr "成功导入 {} 个用户 ( 组织: {} )" @@ -3470,15 +3433,15 @@ msgstr "启用钉钉认证" msgid "Enable FeiShu Auth" msgstr "启用飞书认证" -#: settings/serializers/auth/ldap.py:39 +#: settings/serializers/auth/ldap.py:38 msgid "LDAP server" msgstr "LDAP 地址" -#: settings/serializers/auth/ldap.py:40 +#: settings/serializers/auth/ldap.py:39 msgid "eg: ldap://localhost:389" msgstr "如: ldap://localhost:389" -#: settings/serializers/auth/ldap.py:42 +#: settings/serializers/auth/ldap.py:41 msgid "Bind DN" msgstr "绑定 DN" @@ -3511,15 +3474,15 @@ msgstr "" "用户属性映射代表怎样将LDAP中用户属性映射到jumpserver用户上,username, name," "email 是jumpserver的用户需要属性" -#: settings/serializers/auth/ldap.py:70 +#: settings/serializers/auth/ldap.py:73 msgid "Connect timeout" msgstr "连接超时时间" -#: settings/serializers/auth/ldap.py:72 +#: settings/serializers/auth/ldap.py:75 msgid "Search paged size" msgstr "搜索分页数量" -#: settings/serializers/auth/ldap.py:74 +#: settings/serializers/auth/ldap.py:77 msgid "Enable LDAP auth" msgstr "启用 LDAP 认证" @@ -4194,61 +4157,13 @@ msgid "" "device through Telnet, set this parameter" msgstr "不同设备登录成功提示不一样,所以如果 telnet 不能正常登录,可以这里设置" -#: settings/serializers/terminal.py:37 -msgid "RDP address" -msgstr "RDP 地址" - -#: settings/serializers/terminal.py:38 -msgid "RDP visit address, eg: dev.jumpserver.org:3389" -msgstr "RDP 访问地址, 如: dev.jumpserver.org:3389" - -#: settings/serializers/terminal.py:40 -msgid "Enable XRDP" -msgstr "启用 XRDP 服务" - -#: settings/serializers/terminal.py:43 -msgid "Koko host" -msgstr "KOKO 主机地址" - -#: settings/serializers/terminal.py:46 -msgid "Koko ssh port" -msgstr "KOKO ssh 端口" - -#: settings/serializers/terminal.py:49 +#: settings/serializers/terminal.py:36 msgid "Enable database proxy" msgstr "启用数据库组件" -#: settings/serializers/terminal.py:51 -msgid "Database proxy host" -msgstr "数据库主机地址" - -#: settings/serializers/terminal.py:52 -msgid "Database proxy host, eg: dev.jumpserver.org" -msgstr "数据库组件地址, 如: dev.jumpserver.org (没有端口, 不同协议端口不同)" - -#: settings/serializers/terminal.py:55 -msgid "MySQL port" -msgstr "MySQL 协议端口" - -#: settings/serializers/terminal.py:56 -msgid "MySQL protocol listen port" -msgstr "MySQL 协议监听端口" - -#: settings/serializers/terminal.py:59 -msgid "MariaDB port" -msgstr "MariaDB 端口" - -#: settings/serializers/terminal.py:60 -msgid "MariaDB protocol listen port" -msgstr "MariaDB 协议监听的端口" - -#: settings/serializers/terminal.py:63 -msgid "PostgreSQL port" -msgstr "PostgreSQL 端口" - -#: settings/serializers/terminal.py:64 -msgid "PostgreSQL protocol listen port" -msgstr "PostgreSQL 协议监听端口" +#: settings/serializers/terminal.py:37 +msgid "Enable XRDP" +msgstr "启用 XRDP 服务" #: settings/utils/ldap.py:417 msgid "ldap:// or ldaps:// protocol is used." @@ -4351,10 +4266,6 @@ msgstr "认证失败: (未知): {}" msgid "Authentication success: {}" msgstr "认证成功: {}" -#: templates/_base_list.html:37 -msgid "Search" -msgstr "搜索" - #: templates/_csv_import_export.html:8 msgid "Export" msgstr "导出" @@ -4400,7 +4311,6 @@ msgid "Commercial support" msgstr "商业支持" #: templates/_header_bar.html:76 users/forms/profile.py:43 -#: users/templates/users/user_password_update.html:39 msgid "Profile" msgstr "个人信息" @@ -4505,173 +4415,14 @@ msgstr "等待:" msgid "The verification code has been sent" msgstr "验证码已发送" -#: templates/_pagination.html:59 -msgid "" -"Displays the results of items _START_ to _END_; A total of _TOTAL_ entries" -msgstr "显示第 _START_ 至 _END_ 项结果; 总共 _TOTAL_ 项" - #: templates/_without_nav_base.html:26 msgid "Home page" msgstr "首页" -#: templates/delete_confirm.html:6 -msgid "Confirm delete" -msgstr "确认删除" - -#: templates/delete_confirm.html:11 -msgid "Are you sure delete" -msgstr "您确定删除吗?" - #: templates/flash_message_standalone.html:25 msgid "Cancel" msgstr "取消" -#: templates/index.html:11 -msgid "Total users" -msgstr "用户总数" - -#: templates/index.html:23 -msgid "Total assets" -msgstr "资产总数" - -#: templates/index.html:36 -msgid "Online users" -msgstr "在线用户" - -#: templates/index.html:49 -msgid "Online sessions" -msgstr "在线会话" - -#: templates/index.html:61 -msgid "In the past week, a total of " -msgstr "过去一周, 共有 " - -#: templates/index.html:61 -msgid " users have logged in " -msgstr " 位用户登录 " - -#: templates/index.html:61 -msgid " times asset." -msgstr " 次资产." - -#: templates/index.html:69 -msgid "Active user asset ratio" -msgstr "活跃用户资产占比" - -#: templates/index.html:72 -msgid "" -"The following graphs describe the percentage of active users per month and " -"assets per user host per month, respectively." -msgstr "以下图形分别描述一个月活跃用户和资产占所有用户主机的百分比" - -#: templates/index.html:97 templates/index.html:112 -msgid "Top 10 assets in a week" -msgstr "一周Top10资产" - -#: templates/index.html:113 -msgid "Login frequency and last login record." -msgstr "登录次数及最近一次登录记录." - -#: templates/index.html:122 -msgid "Last 10 login" -msgstr "最近十次登录" - -#: templates/index.html:128 -msgid "Login record" -msgstr "登录记录" - -#: templates/index.html:129 -msgid "Last 10 login records." -msgstr "最近十次登录记录." - -#: templates/index.html:143 templates/index.html:158 -msgid "Top 10 users in a week" -msgstr "一周Top10用户" - -#: templates/index.html:159 -msgid "User login frequency and last login record." -msgstr "用户登录次数及最近一次登录记录" - -#: templates/index.html:184 -msgid "Monthly data overview" -msgstr "月数据总览" - -#: templates/index.html:185 -msgid "History summary in one month" -msgstr "一个月内历史汇总" - -#: templates/index.html:193 templates/index.html:217 -msgid "Login count" -msgstr "登录次数" - -#: templates/index.html:193 templates/index.html:224 -msgid "Active users" -msgstr "活跃用户" - -#: templates/index.html:193 templates/index.html:231 -msgid "Active assets" -msgstr "活跃资产" - -#: templates/index.html:262 templates/index.html:313 -msgid "Monthly active users" -msgstr "月活跃用户" - -#: templates/index.html:262 templates/index.html:314 -msgid "Disable user" -msgstr "禁用用户" - -#: templates/index.html:262 templates/index.html:315 -msgid "Month not logged in user" -msgstr "月未登录用户" - -#: templates/index.html:288 templates/index.html:368 -msgid "Access to the source" -msgstr "访问来源" - -#: templates/index.html:342 -msgid "Month is logged into the asset" -msgstr "月被登录资产" - -#: templates/index.html:342 templates/index.html:393 -msgid "Disable host" -msgstr "禁用主机" - -#: templates/index.html:342 templates/index.html:394 -msgid "Month not logged on host" -msgstr "月未登录主机" - -#: templates/index.html:392 -msgid "Month is logged into the host" -msgstr "月被登录主机" - -#: templates/index.html:466 -msgid " times/week" -msgstr " 次/周" - -#: templates/index.html:491 templates/index.html:527 -msgid " times" -msgstr " 次" - -#: templates/index.html:494 templates/index.html:530 -msgid "The time last logged in" -msgstr "最近一次登录日期" - -#: templates/index.html:495 templates/index.html:531 -msgid "At" -msgstr "于" - -#: templates/index.html:510 templates/index.html:545 templates/index.html:580 -msgid "(No)" -msgstr "(暂无)" - -#: templates/index.html:561 -msgid "Before" -msgstr "前" - -#: templates/index.html:562 -msgid "Login in " -msgstr "登录了" - #: templates/resource_download.html:18 templates/resource_download.html:24 #: templates/resource_download.html:25 templates/resource_download.html:30 msgid "Client" @@ -4713,19 +4464,23 @@ msgstr "Jmservisor 是在 windows 远程应用发布服务器中用来拉起远 msgid "Filters" msgstr "过滤" -#: terminal/api/session.py:211 +#: terminal/api/endpoint.py:65 +msgid "Not found protocol query params" +msgstr "" + +#: terminal/api/session.py:210 msgid "Session does not exist: {}" msgstr "会话不存在: {}" -#: terminal/api/session.py:214 +#: terminal/api/session.py:213 msgid "Session is finished or the protocol not supported" msgstr "会话已经完成或协议不支持" -#: terminal/api/session.py:219 +#: terminal/api/session.py:218 msgid "User does not exist: {}" msgstr "用户不存在: {}" -#: terminal/api/session.py:227 +#: terminal/api/session.py:226 msgid "User does not have permission" msgstr "用户没有权限" @@ -4769,7 +4524,7 @@ msgstr "有在线会话" msgid "Terminals" msgstr "终端管理" -#: terminal/backends/command/es.py:27 +#: terminal/backends/command/es.py:26 msgid "Invalid elasticsearch config" msgstr "无效的 Elasticsearch 配置" @@ -4826,7 +4581,6 @@ msgid "High" msgstr "较高" #: terminal/const.py:35 users/templates/users/reset_password.html:50 -#: users/templates/users/user_password_update.html:104 msgid "Normal" msgstr "正常" @@ -4846,6 +4600,49 @@ msgstr "存储无效" msgid "Command record" msgstr "命令记录" +#: terminal/models/endpoint.py:13 +msgid "HTTPS Port" +msgstr "HTTPS 端口" + +#: terminal/models/endpoint.py:14 terminal/models/terminal.py:107 +msgid "HTTP Port" +msgstr "HTTP 端口" + +#: terminal/models/endpoint.py:15 terminal/models/terminal.py:106 +msgid "SSH Port" +msgstr "SSH 端口" + +#: terminal/models/endpoint.py:16 +msgid "RDP Port" +msgstr "RDP 端口" + +#: terminal/models/endpoint.py:17 +msgid "MySQL Port" +msgstr "MySQL 端口" + +#: terminal/models/endpoint.py:18 +msgid "MariaDB Port" +msgstr "MariaDB 端口" + +#: terminal/models/endpoint.py:19 +msgid "PostgreSQL Port" +msgstr "PostgreSQL 端口" + +#: terminal/models/endpoint.py:25 terminal/models/endpoint.py:61 +#: terminal/serializers/endpoint.py:40 terminal/serializers/storage.py:37 +#: terminal/serializers/storage.py:49 terminal/serializers/storage.py:79 +#: terminal/serializers/storage.py:89 terminal/serializers/storage.py:97 +msgid "Endpoint" +msgstr "端点" + +#: terminal/models/endpoint.py:54 +msgid "IP group" +msgstr "IP 组" + +#: terminal/models/endpoint.py:66 +msgid "Endpoint rule" +msgstr "端点规则" + #: terminal/models/replay.py:12 msgid "Session replay" msgstr "会话录像" @@ -4858,35 +4655,35 @@ msgstr "可以上传会话录像" msgid "Can download session replay" msgstr "可以下载会话录像" -#: terminal/models/session.py:48 terminal/models/sharing.py:87 +#: terminal/models/session.py:50 terminal/models/sharing.py:87 msgid "Login from" msgstr "登录来源" -#: terminal/models/session.py:52 +#: terminal/models/session.py:54 msgid "Replay" msgstr "回放" -#: terminal/models/session.py:57 +#: terminal/models/session.py:59 msgid "Date end" msgstr "结束日期" -#: terminal/models/session.py:242 +#: terminal/models/session.py:251 msgid "Session record" msgstr "会话记录" -#: terminal/models/session.py:244 +#: terminal/models/session.py:253 msgid "Can monitor session" msgstr "可以监控会话" -#: terminal/models/session.py:245 +#: terminal/models/session.py:254 msgid "Can share session" msgstr "可以分享会话" -#: terminal/models/session.py:246 +#: terminal/models/session.py:255 msgid "Can terminate session" msgstr "可以终断会话" -#: terminal/models/session.py:247 +#: terminal/models/session.py:256 msgid "Can validate session action perm" msgstr "可以验证会话动作权限" @@ -4995,14 +4792,6 @@ msgstr "其它参数" msgid "type" msgstr "类型" -#: terminal/models/terminal.py:106 -msgid "SSH Port" -msgstr "SSH端口" - -#: terminal/models/terminal.py:107 -msgid "HTTP Port" -msgstr "HTTP端口" - #: terminal/models/terminal.py:183 terminal/serializers/session.py:38 msgid "Terminal" msgstr "终端" @@ -5059,65 +4848,59 @@ msgstr "是否可中断" msgid "Command amount" msgstr "命令数量" -#: terminal/serializers/storage.py:21 +#: terminal/serializers/storage.py:19 msgid "Endpoint invalid: remove path `{}`" msgstr "端点无效: 移除路径 `{}`" -#: terminal/serializers/storage.py:27 +#: terminal/serializers/storage.py:25 msgid "Bucket" msgstr "桶名称" -#: terminal/serializers/storage.py:34 users/models/user.py:695 +#: terminal/serializers/storage.py:32 users/models/user.py:695 msgid "Secret key" msgstr "密钥" -#: terminal/serializers/storage.py:39 terminal/serializers/storage.py:51 -#: terminal/serializers/storage.py:81 terminal/serializers/storage.py:91 -#: terminal/serializers/storage.py:99 -msgid "Endpoint" -msgstr "端点" - -#: terminal/serializers/storage.py:66 xpack/plugins/cloud/models.py:220 +#: terminal/serializers/storage.py:64 xpack/plugins/cloud/models.py:220 msgid "Region" msgstr "地域" -#: terminal/serializers/storage.py:110 +#: terminal/serializers/storage.py:108 msgid "Container name" msgstr "容器名称" -#: terminal/serializers/storage.py:112 +#: terminal/serializers/storage.py:110 msgid "Account name" msgstr "账号名称" -#: terminal/serializers/storage.py:113 +#: terminal/serializers/storage.py:111 msgid "Account key" msgstr "账号密钥" -#: terminal/serializers/storage.py:116 +#: terminal/serializers/storage.py:114 msgid "Endpoint suffix" msgstr "端点后缀" -#: terminal/serializers/storage.py:138 +#: terminal/serializers/storage.py:134 msgid "The address format is incorrect" msgstr "地址格式不正确" -#: terminal/serializers/storage.py:145 +#: terminal/serializers/storage.py:141 msgid "Host invalid" msgstr "主机无效" -#: terminal/serializers/storage.py:148 +#: terminal/serializers/storage.py:144 msgid "Port invalid" msgstr "端口无效" -#: terminal/serializers/storage.py:164 +#: terminal/serializers/storage.py:159 msgid "Index" msgstr "索引" -#: terminal/serializers/storage.py:166 +#: terminal/serializers/storage.py:161 msgid "Doc type" msgstr "文档类型" -#: terminal/serializers/storage.py:168 +#: terminal/serializers/storage.py:163 msgid "Ignore Certificate Verification" msgstr "忽略证书认证" @@ -5671,7 +5454,6 @@ msgid "Not a valid ssh public key" msgstr "SSH密钥不合法" #: users/forms/profile.py:160 users/models/user.py:692 -#: users/templates/users/user_password_update.html:48 msgid "Public key" msgstr "SSH公钥" @@ -5880,10 +5662,6 @@ msgstr "为了安全,仅列出几个用户" msgid "name not unique" msgstr "名称重复" -#: users/templates/users/_granted_assets.html:7 -msgid "Loading" -msgstr "加载中" - #: users/templates/users/_msg_account_expire_reminder.html:7 msgid "Your account will expire in" msgstr "您的账号即将过期" @@ -5936,69 +5714,11 @@ msgstr "你的 SSH 密钥已经被管理员重置" msgid "click here to set your password" msgstr "点击这里设置密码" -#: users/templates/users/_select_user_modal.html:5 -msgid "Please Select User" -msgstr "选择用户" - -#: users/templates/users/_select_user_modal.html:17 -msgid "Asset num" -msgstr "资产数量" - -#: users/templates/users/_user_detail_nav_header.html:11 -msgid "User detail" -msgstr "用户详情" - -#: users/templates/users/_user_detail_nav_header.html:15 -msgid "User permissions" -msgstr "用户授权" - -#: users/templates/users/_user_detail_nav_header.html:23 -msgid "Asset granted" -msgstr "授权的资产" - -#: users/templates/users/_user_detail_nav_header.html:40 -msgid "RemoteApp granted" -msgstr "授权的远程应用" - -#: users/templates/users/_user_detail_nav_header.html:47 -msgid "RemoteApp permission" -msgstr "远程应用授权" - -#: users/templates/users/_user_detail_nav_header.html:54 -msgid "DatabaseApp granted" -msgstr "授权的数据库应用" - -#: users/templates/users/_user_detail_nav_header.html:61 -msgid "DatabaseApp permission" -msgstr "数据库应用授权" - -#: users/templates/users/_user_update_pk_modal.html:4 -msgid "Update User SSH Public Key" -msgstr "更新SSH密钥" - -#: users/templates/users/first_login.html:6 -#: users/templates/users/first_login_done.html:19 -msgid "First Login" -msgstr "首次登录" - -#: users/templates/users/first_login_done.html:31 -msgid "Welcome to use jumpserver, visit " -msgstr "欢迎使用 JumpServer 堡垒机" - -#: users/templates/users/first_login_done.html:32 -msgid "Use guide" -msgstr "向导" - -#: users/templates/users/first_login_done.html:32 -msgid " for more information" -msgstr "获取更多信息" - #: users/templates/users/forgot_password.html:23 msgid "Input your email, that will send a mail to your" msgstr "输入您的邮箱, 将会发一封重置邮件到您的邮箱中" #: users/templates/users/forgot_password.html:32 -#: users/templates/users/user_password_update.html:75 msgid "Submit" msgstr "提交" @@ -6015,12 +5735,10 @@ msgid "MFA setting" msgstr "设置 MFA 多因子认证" #: users/templates/users/reset_password.html:23 -#: users/templates/users/user_password_update.html:64 msgid "Your password must satisfy" msgstr "您的密码必须满足:" #: users/templates/users/reset_password.html:24 -#: users/templates/users/user_password_update.html:65 msgid "Password strength" msgstr "密码强度:" @@ -6029,54 +5747,25 @@ msgid "Setting" msgstr "设置" #: users/templates/users/reset_password.html:48 -#: users/templates/users/user_password_update.html:102 msgid "Very weak" msgstr "很弱" #: users/templates/users/reset_password.html:49 -#: users/templates/users/user_password_update.html:103 msgid "Weak" msgstr "弱" #: users/templates/users/reset_password.html:51 -#: users/templates/users/user_password_update.html:105 msgid "Medium" msgstr "一般" #: users/templates/users/reset_password.html:52 -#: users/templates/users/user_password_update.html:106 msgid "Strong" msgstr "强" #: users/templates/users/reset_password.html:53 -#: users/templates/users/user_password_update.html:107 msgid "Very strong" msgstr "很强" -#: users/templates/users/user_asset_permission.html:43 -#: users/templates/users/user_asset_permission.html:155 -#: users/templates/users/user_database_app_permission.html:41 -#: xpack/plugins/cloud/models.py:34 -msgid "Validity" -msgstr "有效" - -#: users/templates/users/user_asset_permission.html:160 -msgid "Inherit" -msgstr "继承" - -#: users/templates/users/user_asset_permission.html:161 -msgid "Include" -msgstr "包含" - -#: users/templates/users/user_asset_permission.html:162 -msgid "Exclude" -msgstr "不包含" - -#: users/templates/users/user_database_app_permission.html:39 -#: users/templates/users/user_database_app_permission.html:64 -msgid "DatabaseApp" -msgstr "数据库应用" - #: users/templates/users/user_otp_check_password.html:6 msgid "Enable OTP" msgstr "启用 MFA(OTP)" @@ -6120,10 +5809,6 @@ msgid "" "installed, go to the next step directly)." msgstr "安装完成后点击下一步进入绑定页面(如已安装,直接进入下一步)" -#: users/templates/users/user_password_update.html:74 -msgid "Reset" -msgstr "重置" - #: users/templates/users/user_password_verify.html:8 #: users/templates/users/user_password_verify.html:9 msgid "Verify password" @@ -6430,62 +6115,58 @@ msgid "Baidu Cloud" msgstr "百度云" #: xpack/plugins/cloud/const.py:15 -msgid "JD Cloud" -msgstr "京东云" - -#: xpack/plugins/cloud/const.py:16 msgid "Tencent Cloud" msgstr "腾讯云" -#: xpack/plugins/cloud/const.py:17 +#: xpack/plugins/cloud/const.py:16 msgid "VMware" msgstr "VMware" -#: xpack/plugins/cloud/const.py:18 xpack/plugins/cloud/providers/nutanix.py:13 +#: xpack/plugins/cloud/const.py:17 xpack/plugins/cloud/providers/nutanix.py:13 msgid "Nutanix" msgstr "Nutanix" -#: xpack/plugins/cloud/const.py:19 +#: xpack/plugins/cloud/const.py:18 msgid "Huawei Private Cloud" msgstr "华为私有云" -#: xpack/plugins/cloud/const.py:20 +#: xpack/plugins/cloud/const.py:19 msgid "Qingyun Private Cloud" msgstr "青云私有云" -#: xpack/plugins/cloud/const.py:21 +#: xpack/plugins/cloud/const.py:20 msgid "OpenStack" msgstr "OpenStack" -#: xpack/plugins/cloud/const.py:22 +#: xpack/plugins/cloud/const.py:21 msgid "Google Cloud Platform" msgstr "谷歌云" -#: xpack/plugins/cloud/const.py:26 +#: xpack/plugins/cloud/const.py:25 msgid "Instance name" msgstr "实例名称" -#: xpack/plugins/cloud/const.py:27 +#: xpack/plugins/cloud/const.py:26 msgid "Instance name and Partial IP" msgstr "实例名称和部分IP" -#: xpack/plugins/cloud/const.py:32 +#: xpack/plugins/cloud/const.py:31 msgid "Succeed" msgstr "成功" -#: xpack/plugins/cloud/const.py:36 +#: xpack/plugins/cloud/const.py:35 msgid "Unsync" msgstr "未同步" -#: xpack/plugins/cloud/const.py:37 +#: xpack/plugins/cloud/const.py:36 msgid "New Sync" msgstr "新同步" -#: xpack/plugins/cloud/const.py:38 +#: xpack/plugins/cloud/const.py:37 msgid "Synced" msgstr "已同步" -#: xpack/plugins/cloud/const.py:39 +#: xpack/plugins/cloud/const.py:38 msgid "Released" msgstr "已释放" @@ -6497,6 +6178,10 @@ msgstr "云管中心" msgid "Provider" msgstr "云服务商" +#: xpack/plugins/cloud/models.py:34 +msgid "Validity" +msgstr "有效" + #: xpack/plugins/cloud/models.py:39 msgid "Cloud account" msgstr "云账号" @@ -6658,13 +6343,11 @@ msgid "South America (São Paulo)" msgstr "南美洲(圣保罗)" #: xpack/plugins/cloud/providers/baiducloud.py:54 -#: xpack/plugins/cloud/providers/jdcloud.py:127 msgid "CN North-Beijing" msgstr "华北-北京" #: xpack/plugins/cloud/providers/baiducloud.py:55 #: xpack/plugins/cloud/providers/huaweicloud.py:40 -#: xpack/plugins/cloud/providers/jdcloud.py:130 msgid "CN South-Guangzhou" msgstr "华南-广州" @@ -6686,7 +6369,6 @@ msgid "CN North-Baoding" msgstr "华北-保定" #: xpack/plugins/cloud/providers/baiducloud.py:60 -#: xpack/plugins/cloud/providers/jdcloud.py:129 msgid "CN East-Shanghai" msgstr "华东-上海" @@ -6751,15 +6433,11 @@ msgstr "华北-乌兰察布一" msgid "CN South-Guangzhou-InvitationOnly" msgstr "华南-广州-友好用户环境" -#: xpack/plugins/cloud/providers/jdcloud.py:128 -msgid "CN East-Suqian" -msgstr "华东-宿迁" - -#: xpack/plugins/cloud/serializers/account.py:60 +#: xpack/plugins/cloud/serializers/account.py:59 msgid "Validity display" msgstr "有效性显示" -#: xpack/plugins/cloud/serializers/account.py:61 +#: xpack/plugins/cloud/serializers/account.py:60 msgid "Provider display" msgstr "服务商显示" @@ -6921,11 +6599,3 @@ msgstr "旗舰版" #: xpack/plugins/license/models.py:77 msgid "Community edition" msgstr "社区版" - -#~ msgid "Database proxy MySQL protocol listen port" -#~ msgstr "MySQL 协议监听的端口" - -#, fuzzy -#~| msgid "Database proxy PostgreSQL port" -#~ msgid "Database proxy PostgreSQL listen port" -#~ msgstr "数据库组件 PostgreSQL 协议监听的端口" diff --git a/apps/settings/api/public.py b/apps/settings/api/public.py index 43acffaf0..a6dc3b43c 100644 --- a/apps/settings/api/public.py +++ b/apps/settings/api/public.py @@ -64,13 +64,6 @@ class PublicSettingApi(generics.RetrieveAPIView): "AUTH_FEISHU": settings.AUTH_FEISHU, # Terminal "XRDP_ENABLED": settings.XRDP_ENABLED, - "TERMINAL_KOKO_HOST": settings.TERMINAL_KOKO_HOST, - "TERMINAL_KOKO_SSH_PORT": settings.TERMINAL_KOKO_SSH_PORT, - "TERMINAL_MAGNUS_ENABLED": settings.TERMINAL_MAGNUS_ENABLED, - "TERMINAL_MAGNUS_HOST": settings.TERMINAL_MAGNUS_HOST, - "TERMINAL_MAGNUS_MYSQL_PORT": settings.TERMINAL_MAGNUS_MYSQL_PORT, - "TERMINAL_MAGNUS_MARIADB_PORT": settings.TERMINAL_MAGNUS_MARIADB_PORT, - "TERMINAL_MAGNUS_POSTGRE_PORT": settings.TERMINAL_MAGNUS_POSTGRE_PORT, # Announcement "ANNOUNCEMENT_ENABLED": settings.ANNOUNCEMENT_ENABLED, "ANNOUNCEMENT": settings.ANNOUNCEMENT, diff --git a/apps/settings/serializers/terminal.py b/apps/settings/serializers/terminal.py index c6073aa28..bf4b8d7a0 100644 --- a/apps/settings/serializers/terminal.py +++ b/apps/settings/serializers/terminal.py @@ -33,33 +33,5 @@ class TerminalSettingSerializer(serializers.Serializer): help_text=_("The login success message varies with devices. " "if you cannot log in to the device through Telnet, set this parameter") ) - TERMINAL_RDP_ADDR = serializers.CharField( - required=False, label=_("RDP address"), max_length=1024, allow_blank=True, - help_text=_('RDP visit address, eg: dev.jumpserver.org:3389') - ) - XRDP_ENABLED = serializers.BooleanField(label=_("Enable XRDP")) - - TERMINAL_KOKO_HOST = serializers.CharField( - required=False, label=_("Koko host"), max_length=1024 - ) - TERMINAL_KOKO_SSH_PORT = serializers.CharField( - required=False, label=_("Koko ssh port"), max_length=1024 - ) - TERMINAL_MAGNUS_ENABLED = serializers.BooleanField(label=_("Enable database proxy")) - TERMINAL_MAGNUS_HOST = serializers.CharField( - required=False, label=_("Database proxy host"), max_length=1024, allow_blank=True, - help_text=_('Database proxy host, eg: dev.jumpserver.org') - ) - TERMINAL_MAGNUS_MYSQL_PORT = serializers.IntegerField( - required=False, label=_("MySQL port"), default=33060, - help_text=_('MySQL protocol listen port') - ) - TERMINAL_MAGNUS_MARIADB_PORT = serializers.IntegerField( - required=False, label=_("MariaDB port"), default=33061, - help_text=_('MariaDB protocol listen port') - ) - TERMINAL_MAGNUS_POSTGRE_PORT = serializers.IntegerField( - required=False, label=_("PostgreSQL port"), default=54320, - help_text=_('PostgreSQL protocol listen port') - ) + XRDP_ENABLED = serializers.BooleanField(label=_("Enable XRDP")) diff --git a/apps/terminal/api/__init__.py b/apps/terminal/api/__init__.py index fec6da11e..16021a5ed 100644 --- a/apps/terminal/api/__init__.py +++ b/apps/terminal/api/__init__.py @@ -7,3 +7,4 @@ from .task import * from .storage import * from .status import * from .sharing import * +from .endpoint import * diff --git a/apps/terminal/api/endpoint.py b/apps/terminal/api/endpoint.py new file mode 100644 index 000000000..14efb738f --- /dev/null +++ b/apps/terminal/api/endpoint.py @@ -0,0 +1,78 @@ +from rest_framework.decorators import action +from rest_framework.response import Response +from rest_framework import status +from common.drf.api import JMSBulkModelViewSet +from common.utils import get_object_or_none +from django.shortcuts import get_object_or_404 +from assets.models import Asset +from orgs.utils import tmp_to_root_org +from applications.models import Application +from terminal.models import Session +from ..models import Endpoint, EndpointRule +from .. import serializers + + +__all__ = ['EndpointViewSet', 'EndpointRuleViewSet'] + + +class EndpointViewSet(JMSBulkModelViewSet): + filterset_fields = ('name', 'host') + search_fields = filterset_fields + serializer_class = serializers.EndpointSerializer + queryset = Endpoint.objects.all() + rbac_perms = { + 'smart': 'terminal.view_endpoint' + } + + @staticmethod + def get_target_ip(request): + # 用来方便测试 + target_ip = request.GET.get('target_ip') + if target_ip: + return target_ip + + asset_id = request.GET.get('asset_id') + app_id = request.GET.get('app_id') + session_id = request.GET.get('session_id') + token = request.GET.get('token') + if token: + from authentication.api.connection_token import TokenCacheMixin as TokenUtil + value = TokenUtil().get_token_from_cache(token) + if value: + if value.get('type') == 'asset': + asset_id = value.get('asset') + else: + app_id = value.get('application') + if asset_id: + pk, model = asset_id, Asset + elif app_id: + pk, model = app_id, Application + elif session_id: + pk, model = session_id, Session + else: + return '' + + with tmp_to_root_org(): + instance = get_object_or_404(model, pk=pk) + target_ip = instance.get_target_ip() + return target_ip + + @action(methods=['get'], detail=False, url_path='smart') + def smart(self, request, *args, **kwargs): + protocol = request.GET.get('protocol') + if not protocol: + return Response( + data={'error': _('Not found protocol query params')}, + status=status.HTTP_404_NOT_FOUND + ) + target_ip = self.get_target_ip(request) + endpoint = EndpointRule.match_endpoint(target_ip, protocol, request) + serializer = self.get_serializer(endpoint) + return Response(serializer.data) + + +class EndpointRuleViewSet(JMSBulkModelViewSet): + filterset_fields = ('name',) + search_fields = filterset_fields + serializer_class = serializers.EndpointRuleSerializer + queryset = EndpointRule.objects.all() diff --git a/apps/terminal/migrations/0048_endpoint_endpointrule.py b/apps/terminal/migrations/0048_endpoint_endpointrule.py new file mode 100644 index 000000000..9e75823e2 --- /dev/null +++ b/apps/terminal/migrations/0048_endpoint_endpointrule.py @@ -0,0 +1,86 @@ +# Generated by Django 3.1.14 on 2022-04-12 07:39 + +import common.fields.model +import django.core.validators +from django.db import migrations, models +import django.db.models.deletion +import uuid +from django.conf import settings + + +def migrate_endpoints(apps, schema_editor): + endpoint_data = { + 'id': '00000000-0000-0000-0000-000000000001', + 'name': 'Default', + 'host': '', + 'https_port': 0, + 'http_port': 0, + 'created_by': 'System' + } + + if settings.XRDP_ENABLED: + xrdp_addr = settings.TERMINAL_RDP_ADDR + if ':' in xrdp_addr: + hostname, port = xrdp_addr.strip().split(':') + else: + hostname, port = xrdp_addr, 3389 + endpoint_data.update({ + 'host': '' if hostname.strip() in ['localhost', '127.0.0.1'] else hostname.strip(), + 'rdp_port': int(port) + }) + Endpoint = apps.get_model("terminal", "Endpoint") + Endpoint.objects.create(**endpoint_data) + + +class Migration(migrations.Migration): + + dependencies = [ + ('terminal', '0047_auto_20220302_1951'), + ] + + operations = [ + migrations.CreateModel( + name='Endpoint', + fields=[ + ('created_by', models.CharField(blank=True, max_length=32, null=True, verbose_name='Created by')), + ('updated_by', models.CharField(blank=True, max_length=32, null=True, verbose_name='Updated by')), + ('date_created', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Date created')), + ('date_updated', models.DateTimeField(auto_now=True, verbose_name='Date updated')), + ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)), + ('name', models.CharField(max_length=128, unique=True, blank=True, verbose_name='Name')), + ('host', models.CharField(max_length=256, verbose_name='Host')), + ('https_port', common.fields.model.PortField(default=443, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(65535)], verbose_name='HTTPS Port')), + ('http_port', common.fields.model.PortField(default=80, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(65535)], verbose_name='HTTP Port')), + ('ssh_port', common.fields.model.PortField(default=2222, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(65535)], verbose_name='SSH Port')), + ('rdp_port', common.fields.model.PortField(default=3389, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(65535)], verbose_name='RDP Port')), + ('mysql_port', common.fields.model.PortField(default=33060, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(65535)], verbose_name='MySQL Port')), + ('mariadb_port', common.fields.model.PortField(default=33061, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(65535)], verbose_name='MariaDB Port')), + ('postgresql_port', common.fields.model.PortField(default=54320, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(65535)], verbose_name='PostgreSQL Port')), + ('comment', models.TextField(blank=True, default='', verbose_name='Comment')), + ], + options={ + 'verbose_name': 'Endpoint', + 'ordering': ('name',), + }, + ), + migrations.CreateModel( + name='EndpointRule', + fields=[ + ('created_by', models.CharField(blank=True, max_length=32, null=True, verbose_name='Created by')), + ('updated_by', models.CharField(blank=True, max_length=32, null=True, verbose_name='Updated by')), + ('date_created', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Date created')), + ('date_updated', models.DateTimeField(auto_now=True, verbose_name='Date updated')), + ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)), + ('name', models.CharField(max_length=128, unique=True, verbose_name='Name')), + ('ip_group', models.JSONField(default=list, verbose_name='IP group')), + ('priority', models.IntegerField(help_text='1-100, the lower the value will be match first', unique=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100)], verbose_name='Priority')), + ('comment', models.TextField(blank=True, default='', verbose_name='Comment')), + ('endpoint', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='rules', to='terminal.endpoint', verbose_name='Endpoint')), + ], + options={ + 'verbose_name': 'Endpoint rule', + 'ordering': ('priority', 'name'), + }, + ), + migrations.RunPython(migrate_endpoints), + ] diff --git a/apps/terminal/models/__init__.py b/apps/terminal/models/__init__.py index e69928b3a..be079721d 100644 --- a/apps/terminal/models/__init__.py +++ b/apps/terminal/models/__init__.py @@ -6,3 +6,4 @@ from .task import * from .terminal import * from .sharing import * from .replay import * +from .endpoint import * diff --git a/apps/terminal/models/endpoint.py b/apps/terminal/models/endpoint.py new file mode 100644 index 000000000..39f275f9a --- /dev/null +++ b/apps/terminal/models/endpoint.py @@ -0,0 +1,94 @@ +from django.db import models +from django.utils.translation import ugettext_lazy as _ +from django.core.validators import MinValueValidator, MaxValueValidator +from common.db.models import JMSModel +from common.fields.model import PortField +from common.utils.ip import contains_ip + + +class Endpoint(JMSModel): + name = models.CharField(max_length=128, verbose_name=_('Name'), unique=True) + host = models.CharField(max_length=256, blank=True, verbose_name=_('Host')) + # disabled value=0 + https_port = PortField(default=443, verbose_name=_('HTTPS Port')) + http_port = PortField(default=80, verbose_name=_('HTTP Port')) + ssh_port = PortField(default=2222, verbose_name=_('SSH Port')) + rdp_port = PortField(default=3389, verbose_name=_('RDP Port')) + mysql_port = PortField(default=33060, verbose_name=_('MySQL Port')) + mariadb_port = PortField(default=33061, verbose_name=_('MariaDB Port')) + postgresql_port = PortField(default=54320, verbose_name=_('PostgreSQL Port')) + comment = models.TextField(default='', blank=True, verbose_name=_('Comment')) + + default_id = '00000000-0000-0000-0000-000000000001' + + class Meta: + verbose_name = _('Endpoint') + ordering = ('name',) + + def __str__(self): + return self.name + + def get_port(self, protocol): + return getattr(self, f'{protocol}_port', 0) + + def delete(self, using=None, keep_parents=False): + if self.id == self.default_id: + return + return super().delete(using, keep_parents) + + @classmethod + def get_or_create_default(cls, request=None): + data = { + 'id': cls.default_id, + 'name': 'Default', + 'host': '', + 'https_port': 0, + 'http_port': 0, + } + endpoint, created = cls.objects.get_or_create(id=cls.default_id, defaults=data) + if not endpoint.host and request: + endpoint.host = request.get_host().split(':')[0] + return endpoint + + +class EndpointRule(JMSModel): + name = models.CharField(max_length=128, verbose_name=_('Name'), unique=True) + ip_group = models.JSONField(default=list, verbose_name=_('IP group')) + priority = models.IntegerField( + verbose_name=_("Priority"), validators=[MinValueValidator(1), MaxValueValidator(100)], + unique=True, help_text=_("1-100, the lower the value will be match first"), + ) + endpoint = models.ForeignKey( + 'terminal.Endpoint', null=True, blank=True, related_name='rules', + on_delete=models.SET_NULL, verbose_name=_("Endpoint"), + ) + comment = models.TextField(default='', blank=True, verbose_name=_('Comment')) + + class Meta: + verbose_name = _('Endpoint rule') + ordering = ('priority', 'name') + + def __str__(self): + return f'{self.name}({self.priority})' + + @classmethod + def match(cls, target_ip, protocol): + for endpoint_rule in cls.objects.all().prefetch_related('endpoint'): + if not contains_ip(target_ip, endpoint_rule.ip_group): + continue + if not endpoint_rule.endpoint: + continue + if not endpoint_rule.endpoint.host: + continue + if endpoint_rule.endpoint.get_port(protocol) == 0: + continue + return endpoint_rule + + @classmethod + def match_endpoint(cls, target_ip, protocol, request=None): + endpoint_rule = cls.match(target_ip, protocol) + if endpoint_rule: + endpoint = endpoint_rule.endpoint + else: + endpoint = Endpoint.get_or_create_default(request) + return endpoint diff --git a/apps/terminal/models/session.py b/apps/terminal/models/session.py index 09f1c9e91..565c54335 100644 --- a/apps/terminal/models/session.py +++ b/apps/terminal/models/session.py @@ -11,9 +11,11 @@ from django.core.files.storage import default_storage from django.core.cache import cache from assets.models import Asset +from applications.models import Application from users.models import User from orgs.mixins.models import OrgModelMixin from django.db.models import TextChoices +from common.utils import get_object_or_none from ..backends import get_multi_command_storage @@ -194,6 +196,13 @@ class Session(OrgModelMixin): def login_from_display(self): return self.get_login_from_display() + def get_target_ip(self): + instance = get_object_or_none(Asset, pk=self.asset_id) + if not instance: + instance = get_object_or_none(Application, pk=self.asset_id) + target_ip = instance.get_target_ip() if instance else '' + return target_ip + @classmethod def generate_fake(cls, count=100, is_finished=True): import random diff --git a/apps/terminal/serializers/__init__.py b/apps/terminal/serializers/__init__.py index 4e868cabc..e1312ebae 100644 --- a/apps/terminal/serializers/__init__.py +++ b/apps/terminal/serializers/__init__.py @@ -4,3 +4,4 @@ from .terminal import * from .session import * from .storage import * from .sharing import * +from .endpoint import * diff --git a/apps/terminal/serializers/endpoint.py b/apps/terminal/serializers/endpoint.py new file mode 100644 index 000000000..822c6b5c2 --- /dev/null +++ b/apps/terminal/serializers/endpoint.py @@ -0,0 +1,51 @@ +from rest_framework import serializers +from django.utils.translation import ugettext_lazy as _ +from common.drf.serializers import BulkModelSerializer +from acls.serializers.rules import ip_group_help_text, ip_group_child_validator +from ..models import Endpoint, EndpointRule + +__all__ = ['EndpointSerializer', 'EndpointRuleSerializer'] + + +class EndpointSerializer(BulkModelSerializer): + + class Meta: + model = Endpoint + fields_mini = ['id', 'name'] + fields_small = [ + 'host', + 'https_port', 'http_port', 'ssh_port', + 'rdp_port', 'mysql_port', 'mariadb_port', + 'postgresql_port', + ] + fields = fields_mini + fields_small + [ + 'comment', 'date_created', 'date_updated', 'created_by' + ] + extra_kwargs = { + 'https_port': {'default': 443}, + 'http_port': {'default': 80}, + 'ssh_port': {'default': 2222}, + 'rdp_port': {'default': 3389}, + 'mysql_port': {'default': 33060}, + 'mariadb_port': {'default': 33061}, + 'postgresql_port': {'default': 54320}, + } + + +class EndpointRuleSerializer(BulkModelSerializer): + ip_group = serializers.ListField( + default=['*'], label=_('IP'), help_text=ip_group_help_text, + child=serializers.CharField(max_length=1024, validators=[ip_group_child_validator]) + ) + endpoint_display = serializers.ReadOnlyField(source='endpoint.name', label=_('Endpoint')) + + class Meta: + model = EndpointRule + fields_mini = ['id', 'name'] + fields_small = fields_mini + ['ip_group', 'priority'] + fields_fk = ['endpoint', 'endpoint_display'] + fields = fields_mini + fields_small + fields_fk + [ + 'comment', 'date_created', 'date_updated', 'created_by' + ] + extra_kwargs = { + } diff --git a/apps/terminal/urls/api_urls.py b/apps/terminal/urls/api_urls.py index 9366332e2..c392f9c07 100644 --- a/apps/terminal/urls/api_urls.py +++ b/apps/terminal/urls/api_urls.py @@ -22,6 +22,8 @@ router.register(r'replay-storages', api.ReplayStorageViewSet, 'replay-storage') router.register(r'command-storages', api.CommandStorageViewSet, 'command-storage') router.register(r'session-sharings', api.SessionSharingViewSet, 'session-sharing') router.register(r'session-join-records', api.SessionJoinRecordsViewSet, 'session-sharing-record') +router.register(r'endpoints', api.EndpointViewSet, 'endpoint') +router.register(r'endpoint-rules', api.EndpointRuleViewSet, 'endpoint-rule') urlpatterns = [ path('my-sessions/', api.MySessionAPIView.as_view(), name='my-session'),