From 04284adc87e834561da97ab25be0a09c36afe1a4 Mon Sep 17 00:00:00 2001 From: maninhill <41712985+maninhill@users.noreply.github.com> Date: Wed, 3 Jul 2024 22:35:41 +0800 Subject: [PATCH 001/137] chore: Update README.md --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 192958a4c..5b7e9ebb4 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ [![][github-release-shield]][github-release-link] [![][github-stars-shield]][github-stars-link] -**English** · [简体中文](./README.zh-CN.md) · [Documents][docs-link] · [Report Bug][github-issues-link] · [Request Feature][github-issues-link] +**English** · [简体中文](./README.zh-CN.md)
@@ -18,7 +18,7 @@ JumpServer is an open-source Privileged Access Management (PAM) tool that provides DevOps and IT teams with on-demand and secure access to SSH, RDP, Kubernetes, Database and Remote App endpoints through a web browser. -![JumpServer Overview](https://github.com/jumpserver/jumpserver/assets/41712985/eb9e6f39-3911-4d4a-bca9-aa50cc3b761d) +![JumpServer Overview](https://github.com/jumpserver/jumpserver/assets/41712985/4f981076-ce03-41db-a64e-e79d633c8831) ## Screenshots @@ -68,8 +68,6 @@ JumpServer consists of multiple key components, which collectively form the func | [Panda](https://github.com/jumpserver/Panda) | Panda | JumpServer Remote Application Connector (Linux) | | [Magnus](https://github.com/jumpserver/magnus) | Magnus | JumpServer Database Proxy Connector | - - ## Contributing Welcome to submit PR to contribute. Please refer to [CONTRIBUTING.md][contributing-link] for guidelines. From e25a96d35984fd84126a4bc07fc5db08183fb5e2 Mon Sep 17 00:00:00 2001 From: maninhill <41712985+maninhill@users.noreply.github.com> Date: Wed, 3 Jul 2024 22:55:22 +0800 Subject: [PATCH 002/137] chore: Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5b7e9ebb4..eee76503d 100644 --- a/README.md +++ b/README.md @@ -63,10 +63,10 @@ JumpServer consists of multiple key components, which collectively form the func | [KoKo](https://github.com/jumpserver/koko) | Koko release | JumpServer Character Protocol Connector | | [Lion](https://github.com/jumpserver/lion) | Lion release | JumpServer Graphical Protocol Connector | | [Chen](https://github.com/jumpserver/chen) | Chen release | JumpServer Web DB | -| [Razor](https://github.com/jumpserver/razor) | Chen | JumpServer RDP Proxy Connector | -| [Tinker](https://github.com/jumpserver/tinker) | Tinker | JumpServer Remote Application Connector (Windows) | -| [Panda](https://github.com/jumpserver/Panda) | Panda | JumpServer Remote Application Connector (Linux) | -| [Magnus](https://github.com/jumpserver/magnus) | Magnus | JumpServer Database Proxy Connector | +| [Razor](https://github.com/jumpserver/razor) | Chen | JumpServer EE RDP Proxy Connector | +| [Tinker](https://github.com/jumpserver/tinker) | Tinker | JumpServer EE Remote Application Connector (Windows) | +| [Panda](https://github.com/jumpserver/Panda) | Panda | JumpServer EE Remote Application Connector (Linux) | +| [Magnus](https://github.com/jumpserver/magnus) | Magnus | JumpServer EE Database Proxy Connector | ## Contributing From c95ad5a31cc92f1789c8849129e015bec83270d1 Mon Sep 17 00:00:00 2001 From: maninhill <41712985+maninhill@users.noreply.github.com> Date: Thu, 4 Jul 2024 08:54:19 +0800 Subject: [PATCH 003/137] chore: Update README.md --- README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index eee76503d..b51b5cde2 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,16 @@ JumpServer is an open-source Privileged Access Management (PAM) tool that provid ![JumpServer Overview](https://github.com/jumpserver/jumpserver/assets/41712985/4f981076-ce03-41db-a64e-e79d633c8831) +## Quick Start + +Prepare a clean Linux Server ( 64 bit, >= 4c8g ) + +``` +curl -sSL https://github.com/jumpserver/jumpserver/releases/latest/download/quick_start.sh | bash +``` + +Access JumpServer in your browser at `http://your-ip/`, `admin`/`ChangeMe` + ## Screenshots @@ -43,15 +53,6 @@ JumpServer is an open-source Privileged Access Management (PAM) tool that provid
-## Quick Start -Prepare a clean Linux Server ( 64bit, >= 4c8g ) - -``` -curl -sSL https://github.com/jumpserver/jumpserver/releases/latest/download/quick_start.sh | bash -``` - -Access JumpServer in your browser at `http://your-ip/`, `admin`/`admin` - ## Components JumpServer consists of multiple key components, which collectively form the functional framework of JumpServer, providing users with comprehensive capabilities for operations management and security control. From 0f79006b596c2a89cd4ab9407ba7a07afe5406b6 Mon Sep 17 00:00:00 2001 From: Bryan Date: Thu, 4 Jul 2024 09:44:48 +0800 Subject: [PATCH 004/137] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b51b5cde2..f05095adf 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ JumpServer is an open-source Privileged Access Management (PAM) tool that provides DevOps and IT teams with on-demand and secure access to SSH, RDP, Kubernetes, Database and Remote App endpoints through a web browser. -![JumpServer Overview](https://github.com/jumpserver/jumpserver/assets/41712985/4f981076-ce03-41db-a64e-e79d633c8831) +![JumpServer Overview](https://github.com/jumpserver/jumpserver/assets/32935519/1c13155d-2e8d-43ea-b49e-75a17adc421a) ## Quick Start From 1a68c4b44a3dcf2ca474cc21600b6a0d0adcc46a Mon Sep 17 00:00:00 2001 From: Bryan Date: Thu, 4 Jul 2024 09:45:45 +0800 Subject: [PATCH 005/137] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f05095adf..38543b147 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ JumpServer is an open-source Privileged Access Management (PAM) tool that provides DevOps and IT teams with on-demand and secure access to SSH, RDP, Kubernetes, Database and Remote App endpoints through a web browser. -![JumpServer Overview](https://github.com/jumpserver/jumpserver/assets/32935519/1c13155d-2e8d-43ea-b49e-75a17adc421a) +![JumpServer Overview](https://github.com/jumpserver/jumpserver/assets/32935519/35a371cb-8590-40ed-88ec-f351f8cf9045) ## Quick Start From 3731123369aa894144f5501beede4b01072d8631 Mon Sep 17 00:00:00 2001 From: Bryan Date: Thu, 4 Jul 2024 09:47:28 +0800 Subject: [PATCH 006/137] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 38543b147..d3512c8ae 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ ## What is JumpServer? -JumpServer is an open-source Privileged Access Management (PAM) tool that provides DevOps and IT teams with on-demand and secure access to SSH, RDP, Kubernetes, Database and Remote App endpoints through a web browser. +JumpServer is an open-source Privileged Access Management (PAM) tool that provides DevOps and IT teams with on-demand and secure access to SSH, RDP, Kubernetes, Database and RemoteApp endpoints through a web browser. ![JumpServer Overview](https://github.com/jumpserver/jumpserver/assets/32935519/35a371cb-8590-40ed-88ec-f351f8cf9045) From 823d9af91dec049e2284d0bc3b3c20b2272e5435 Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 4 Jul 2024 10:01:53 +0800 Subject: [PATCH 007/137] perf: upgrade to v4, more international and more standardized. --- .dockerignore | 1 + .isort.cfg | 1 + config_example.yml | 6 ++---- entrypoint.sh | 2 +- jms | 2 +- requirements/issues.txt | 2 ++ run_server.py | 10 ---------- ui/README.md | 2 +- 8 files changed, 9 insertions(+), 17 deletions(-) delete mode 100644 run_server.py diff --git a/.dockerignore b/.dockerignore index 0ddcc29ae..9537605a4 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,3 +8,4 @@ celerybeat.pid .vagrant/ apps/xpack/.git .history/ +.idea \ No newline at end of file diff --git a/.isort.cfg b/.isort.cfg index e59d309dc..bdefbe705 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,3 +1,4 @@ [settings] line_length=120 known_first_party=common,users,assets,perms,authentication,jumpserver,notification,ops,orgs,rbac,settings,terminal,tickets + diff --git a/config_example.yml b/config_example.yml index 472514cd6..93024c0a5 100644 --- a/config_example.yml +++ b/config_example.yml @@ -75,7 +75,7 @@ REDIS_PORT: 6379 # OTP settings # OTP/MFA 配置 # OTP_VALID_WINDOW: 0 -# OTP_ISSUER_NAME: Jumpserver +# OTP_ISSUER_NAME: JumpServer # 启用定时任务 # PERIOD_TASK_ENABLED: True @@ -87,7 +87,7 @@ REDIS_PORT: 6379 # 浏览器关闭页面后,会话过期 # SESSION_EXPIRE_AT_BROWSER_CLOSE: False -# 每次api请求,session续期 +# 每次 api 请求,session 续期 # SESSION_SAVE_EVERY_REQUEST: True # 仅允许用户从来源处登录 @@ -96,6 +96,4 @@ REDIS_PORT: 6379 # 仅允许已存在的用户登录,不允许第三方认证后,自动创建用户 # ONLY_ALLOW_EXIST_USER_AUTH: False -# 开启 Vault 账号存储 -# VAULT_ENABLED: False diff --git a/entrypoint.sh b/entrypoint.sh index 2e4c5887b..2b0a87307 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -9,4 +9,4 @@ case "$1" in ;; esac -exec "$@" \ No newline at end of file +exec "$@" diff --git a/jms b/jms index 943e19e11..77d002e2c 100755 --- a/jms +++ b/jms @@ -174,7 +174,7 @@ def start_services(): if __name__ == '__main__': parser = argparse.ArgumentParser( description=""" - Jumpserver service control tools; + JumpServer service control tools; Example: \r\n diff --git a/requirements/issues.txt b/requirements/issues.txt index 768d95e1e..4862f9e91 100644 --- a/requirements/issues.txt +++ b/requirements/issues.txt @@ -13,3 +13,5 @@ $ xcode-select --install # libxmlsec 报错 wget 'https://raw.githubusercontent.com/Homebrew/homebrew-core/7f35e6ede954326a10949891af2dba47bbe1fc17/Formula/libxmlsec1.rb' brew install ./libxmlsec1.rb + +# libxmlsec1 \ No newline at end of file diff --git a/run_server.py b/run_server.py deleted file mode 100644 index b7cce251b..000000000 --- a/run_server.py +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python3 -# coding: utf-8 - -import sys -import subprocess - - -if __name__ == '__main__': - subprocess.call('python3 jms start all', shell=True, stdin=sys.stdin, stdout=sys.stdout) - diff --git a/ui/README.md b/ui/README.md index 57302d82b..2870c05ea 100644 --- a/ui/README.md +++ b/ui/README.md @@ -1,4 +1,4 @@ -| 项目 | 描述 | +| Repo | Description | |--------------------------------------------|----------------------------| | [Lina](https://github.com/jumpserver/lina) | JumpServer Web UI 项目 | | [Luna](https://github.com/jumpserver/luna) | JumpServer Web Terminal 项目 | From 50d196eda41ea72be4ca33abd4b915c54aa770b9 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Thu, 4 Jul 2024 16:03:51 +0800 Subject: [PATCH 008/137] perf: Job api add filter options (#13610) Co-authored-by: feng <1304903146@qq.com> --- apps/ops/api/job.py | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/ops/api/job.py b/apps/ops/api/job.py index f67c886c4..f31df2b13 100644 --- a/apps/ops/api/job.py +++ b/apps/ops/api/job.py @@ -63,6 +63,7 @@ def merge_nodes_and_assets(nodes, assets, user): class JobViewSet(OrgBulkModelViewSet): serializer_class = JobSerializer + filterset_fields = ('name', 'type') search_fields = ('name', 'comment') model = Job From d07c47650703ad89a503f538dad0fe59503cea26 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Thu, 4 Jul 2024 18:14:34 +0800 Subject: [PATCH 009/137] perf: Translate (#13612) Co-authored-by: feng <1304903146@qq.com> --- apps/i18n/core/en/LC_MESSAGES/django.po | 29 ++++++++------- apps/i18n/core/ja/LC_MESSAGES/django.po | 35 +++++++++--------- apps/i18n/core/zh/LC_MESSAGES/django.po | 39 ++++++++++---------- apps/i18n/core/zh_Hant/LC_MESSAGES/django.po | 37 +++++++++---------- apps/i18n/lina/en.json | 1 - apps/i18n/lina/ja.json | 1 - apps/i18n/lina/zh.json | 4 +- apps/i18n/lina/zh_hant.json | 1 - apps/terminal/serializers/terminal.py | 2 +- 9 files changed, 74 insertions(+), 75 deletions(-) diff --git a/apps/i18n/core/en/LC_MESSAGES/django.po b/apps/i18n/core/en/LC_MESSAGES/django.po index 3a3572acb..bc6f8b543 100644 --- a/apps/i18n/core/en/LC_MESSAGES/django.po +++ b/apps/i18n/core/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-03 16:39+0800\n" +"POT-Creation-Date: 2024-07-04 18:09+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1232,7 +1232,8 @@ msgstr "" #: authentication/templates/authentication/_access_key_modal.html:32 #: perms/models/asset_permission.py:82 #: terminal/models/component/endpoint.py:120 -#: terminal/models/session/sharing.py:29 tickets/const.py:36 +#: terminal/models/session/sharing.py:29 terminal/serializers/terminal.py:44 +#: tickets/const.py:36 msgid "Active" msgstr "Active" @@ -4195,34 +4196,34 @@ msgstr "" msgid "Task {} args or kwargs error" msgstr "" -#: ops/api/job.py:81 +#: ops/api/job.py:82 #, python-brace-format msgid "" "Asset ({asset}) must have at least one of the following protocols added: " "SSH, SFTP, or WinRM" msgstr "" -#: ops/api/job.py:82 +#: ops/api/job.py:83 #, python-brace-format msgid "Asset ({asset}) authorization is missing SSH, SFTP, or WinRM protocol" msgstr "" -#: ops/api/job.py:83 +#: ops/api/job.py:84 #, python-brace-format msgid "Asset ({asset}) authorization lacks upload permissions" msgstr "" -#: ops/api/job.py:168 +#: ops/api/job.py:169 msgid "Duplicate file exists" msgstr "" -#: ops/api/job.py:173 +#: ops/api/job.py:174 #, python-brace-format msgid "" "File size exceeds maximum limit. Please select a file smaller than {limit}MB" msgstr "" -#: ops/api/job.py:237 +#: ops/api/job.py:238 msgid "" "The task is being created and cannot be interrupted. Please try again later." msgstr "" @@ -4231,27 +4232,27 @@ msgstr "" msgid "Currently playbook is being used in a job" msgstr "" -#: ops/api/playbook.py:96 +#: ops/api/playbook.py:97 msgid "Unsupported file content" msgstr "" -#: ops/api/playbook.py:98 ops/api/playbook.py:144 ops/api/playbook.py:192 +#: ops/api/playbook.py:99 ops/api/playbook.py:145 ops/api/playbook.py:193 msgid "Invalid file path" msgstr "" -#: ops/api/playbook.py:170 +#: ops/api/playbook.py:171 msgid "This file can not be rename" msgstr "" -#: ops/api/playbook.py:189 +#: ops/api/playbook.py:190 msgid "File already exists" msgstr "" -#: ops/api/playbook.py:207 +#: ops/api/playbook.py:208 msgid "File key is required" msgstr "" -#: ops/api/playbook.py:210 +#: ops/api/playbook.py:211 msgid "This file can not be delete" msgstr "" diff --git a/apps/i18n/core/ja/LC_MESSAGES/django.po b/apps/i18n/core/ja/LC_MESSAGES/django.po index ba24685d0..1a3b6127d 100644 --- a/apps/i18n/core/ja/LC_MESSAGES/django.po +++ b/apps/i18n/core/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: 2024-07-03 16:39+0800\n" +"POT-Creation-Date: 2024-07-04 18:09+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1249,7 +1249,8 @@ msgstr "レビュー担当者" #: authentication/templates/authentication/_access_key_modal.html:32 #: perms/models/asset_permission.py:82 #: terminal/models/component/endpoint.py:120 -#: terminal/models/session/sharing.py:29 tickets/const.py:36 +#: terminal/models/session/sharing.py:29 terminal/serializers/terminal.py:44 +#: tickets/const.py:36 msgid "Active" msgstr "アクティブ" @@ -2737,7 +2738,7 @@ msgstr "理由表示" #: audits/serializers.py:70 audits/serializers.py:184 msgid "Auth backend display" -msgstr "認証バックエンド" +msgstr "検証方法" #: audits/serializers.py:134 #, python-format @@ -4292,7 +4293,7 @@ msgstr "タスクは存在しません" msgid "Task {} args or kwargs error" msgstr "タスク実行パラメータエラー" -#: ops/api/job.py:81 +#: ops/api/job.py:82 #, python-brace-format msgid "" "Asset ({asset}) must have at least one of the following protocols added: " @@ -4301,22 +4302,22 @@ msgstr "" "資産({asset})には、少なくともSSH、SFTP、WinRMのいずれか一つのプロトコルを追加" "する必要があります" -#: ops/api/job.py:82 +#: ops/api/job.py:83 #, python-brace-format msgid "Asset ({asset}) authorization is missing SSH, SFTP, or WinRM protocol" msgstr "" "資産({asset})の認証にはSSH、SFTP、またはWinRMプロトコルが不足しています" -#: ops/api/job.py:83 +#: ops/api/job.py:84 #, python-brace-format msgid "Asset ({asset}) authorization lacks upload permissions" msgstr "資産({asset})の認証にはアップロード権限が不足しています" -#: ops/api/job.py:168 +#: ops/api/job.py:169 msgid "Duplicate file exists" msgstr "重複したファイルが存在する" -#: ops/api/job.py:173 +#: ops/api/job.py:174 #, python-brace-format msgid "" "File size exceeds maximum limit. Please select a file smaller than {limit}MB" @@ -4324,7 +4325,7 @@ msgstr "" "ファイルサイズが最大制限を超えています。{limit}MB より小さいファイルを選択し" "てください。" -#: ops/api/job.py:237 +#: ops/api/job.py:238 msgid "" "The task is being created and cannot be interrupted. Please try again later." msgstr "タスクを作成中で、中断できません。後でもう一度お試しください。" @@ -4333,27 +4334,27 @@ msgstr "タスクを作成中で、中断できません。後でもう一度お msgid "Currently playbook is being used in a job" msgstr "現在プレイブックは1つのジョブで使用されています" -#: ops/api/playbook.py:96 +#: ops/api/playbook.py:97 msgid "Unsupported file content" msgstr "サポートされていないファイルの内容" -#: ops/api/playbook.py:98 ops/api/playbook.py:144 ops/api/playbook.py:192 +#: ops/api/playbook.py:99 ops/api/playbook.py:145 ops/api/playbook.py:193 msgid "Invalid file path" msgstr "無効なファイルパス" -#: ops/api/playbook.py:170 +#: ops/api/playbook.py:171 msgid "This file can not be rename" msgstr "ファイル名を変更することはできません" -#: ops/api/playbook.py:189 +#: ops/api/playbook.py:190 msgid "File already exists" msgstr "ファイルは既に存在します。" -#: ops/api/playbook.py:207 +#: ops/api/playbook.py:208 msgid "File key is required" msgstr "ファイルキーこのフィールドは必須です" -#: ops/api/playbook.py:210 +#: ops/api/playbook.py:211 msgid "This file can not be delete" msgstr "このファイルを削除できません" @@ -4395,7 +4396,7 @@ msgstr "VCS" #: ops/const.py:38 ops/models/adhoc.py:44 settings/serializers/feature.py:135 msgid "Adhoc" -msgstr "コマンド#コマンド#" +msgstr "コマンド" #: ops/const.py:39 ops/models/job.py:149 ops/models/playbook.py:88 msgid "Playbook" @@ -5450,7 +5451,7 @@ msgstr "DN のバインド" #: settings/serializers/auth/ldap.py:47 msgid "Binding Distinguished Name" -msgstr "専有名のバインド" +msgstr "バインドディレクトリ管理者" #: settings/serializers/auth/ldap.py:51 msgid "Binding password" diff --git a/apps/i18n/core/zh/LC_MESSAGES/django.po b/apps/i18n/core/zh/LC_MESSAGES/django.po index 2b69fe5a5..7d9fc1b7f 100644 --- a/apps/i18n/core/zh/LC_MESSAGES/django.po +++ b/apps/i18n/core/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: 2024-07-03 16:39+0800\n" +"POT-Creation-Date: 2024-07-04 18:09+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -145,7 +145,7 @@ msgstr "Access key" #: accounts/const/account.py:9 authentication/backends/passkey/models.py:16 #: authentication/models/sso_token.py:14 settings/serializers/feature.py:52 msgid "Token" -msgstr "Token" +msgstr "令牌" #: accounts/const/account.py:10 msgid "API key" @@ -1243,7 +1243,8 @@ msgstr "审批人" #: authentication/templates/authentication/_access_key_modal.html:32 #: perms/models/asset_permission.py:82 #: terminal/models/component/endpoint.py:120 -#: terminal/models/session/sharing.py:29 tickets/const.py:36 +#: terminal/models/session/sharing.py:29 terminal/serializers/terminal.py:44 +#: tickets/const.py:36 msgid "Active" msgstr "激活中" @@ -2715,7 +2716,7 @@ msgstr "原因描述" #: audits/serializers.py:70 audits/serializers.py:184 msgid "Auth backend display" -msgstr "没有匹配到认证后端" +msgstr "认证方式" #: audits/serializers.py:134 #, python-format @@ -4236,34 +4237,34 @@ msgstr "任务 {} 不存在" msgid "Task {} args or kwargs error" msgstr "任务 {} 执行参数错误" -#: ops/api/job.py:81 +#: ops/api/job.py:82 #, python-brace-format msgid "" "Asset ({asset}) must have at least one of the following protocols added: " "SSH, SFTP, or WinRM" msgstr "资产({asset})至少要添加ssh,sftp,winrm其中一种协议" -#: ops/api/job.py:82 +#: ops/api/job.py:83 #, python-brace-format msgid "Asset ({asset}) authorization is missing SSH, SFTP, or WinRM protocol" msgstr "资产({asset})授权缺少ssh,sftp或winrm协议" -#: ops/api/job.py:83 +#: ops/api/job.py:84 #, python-brace-format msgid "Asset ({asset}) authorization lacks upload permissions" msgstr "资产({asset})授权缺少上传权限" -#: ops/api/job.py:168 +#: ops/api/job.py:169 msgid "Duplicate file exists" msgstr "存在同名文件" -#: ops/api/job.py:173 +#: ops/api/job.py:174 #, python-brace-format msgid "" "File size exceeds maximum limit. Please select a file smaller than {limit}MB" msgstr "文件大小超过最大限制。请选择小于 {limit}MB 的文件。" -#: ops/api/job.py:237 +#: ops/api/job.py:238 msgid "" "The task is being created and cannot be interrupted. Please try again later." msgstr "正在创建任务,无法中断,请稍后重试。" @@ -4272,27 +4273,27 @@ msgstr "正在创建任务,无法中断,请稍后重试。" msgid "Currently playbook is being used in a job" msgstr "当前 playbook 正在作业中使用" -#: ops/api/playbook.py:96 +#: ops/api/playbook.py:97 msgid "Unsupported file content" msgstr "不支持的文件内容" -#: ops/api/playbook.py:98 ops/api/playbook.py:144 ops/api/playbook.py:192 +#: ops/api/playbook.py:99 ops/api/playbook.py:145 ops/api/playbook.py:193 msgid "Invalid file path" msgstr "无效的文件路径" -#: ops/api/playbook.py:170 +#: ops/api/playbook.py:171 msgid "This file can not be rename" msgstr "该文件不能重命名" -#: ops/api/playbook.py:189 +#: ops/api/playbook.py:190 msgid "File already exists" msgstr "文件已存在" -#: ops/api/playbook.py:207 +#: ops/api/playbook.py:208 msgid "File key is required" msgstr "文件密钥该字段是必填项。" -#: ops/api/playbook.py:210 +#: ops/api/playbook.py:211 msgid "This file can not be delete" msgstr "无法删除此文件" @@ -5382,15 +5383,15 @@ msgstr "绑定 DN" #: settings/serializers/auth/ldap.py:47 msgid "Binding Distinguished Name" -msgstr "绑定专有名称" +msgstr "绑定目录管理员" #: settings/serializers/auth/ldap.py:51 msgid "Binding password" -msgstr "原来密码" +msgstr "绑定密码" #: settings/serializers/auth/ldap.py:54 msgid "Search OU" -msgstr "系统架构" +msgstr "用户 OU" #: settings/serializers/auth/ldap.py:56 msgid "" diff --git a/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po b/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po index ec419a190..9a139525a 100644 --- a/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po +++ b/apps/i18n/core/zh_Hant/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: 2024-07-03 16:39+0800\n" +"POT-Creation-Date: 2024-07-04 18:09+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -768,10 +768,8 @@ msgid "Secret from login" msgstr "與用戶登錄時相同" #: accounts/models/virtual.py:18 -#, fuzzy -#| msgid "Email account" msgid "Virtual account" -msgstr "信箱帳號" +msgstr "虚拟账号" #: accounts/models/virtual.py:28 msgid "Same with user" @@ -1247,7 +1245,8 @@ msgstr "審批人" #: authentication/templates/authentication/_access_key_modal.html:32 #: perms/models/asset_permission.py:82 #: terminal/models/component/endpoint.py:120 -#: terminal/models/session/sharing.py:29 tickets/const.py:36 +#: terminal/models/session/sharing.py:29 terminal/serializers/terminal.py:44 +#: tickets/const.py:36 msgid "Active" msgstr "啟用中" @@ -2719,7 +2718,7 @@ msgstr "原因描述" #: audits/serializers.py:70 audits/serializers.py:184 msgid "Auth backend display" -msgstr "没有匹配到认证后端" +msgstr "认证代币描述" #: audits/serializers.py:134 #, python-format @@ -4239,34 +4238,34 @@ msgstr "任務 {} 不存在" msgid "Task {} args or kwargs error" msgstr "任務 {} 執行參數錯誤" -#: ops/api/job.py:81 +#: ops/api/job.py:82 #, python-brace-format msgid "" "Asset ({asset}) must have at least one of the following protocols added: " "SSH, SFTP, or WinRM" msgstr "资产({asset})至少要添加ssh,sftp,winrm其中一种协议" -#: ops/api/job.py:82 +#: ops/api/job.py:83 #, python-brace-format msgid "Asset ({asset}) authorization is missing SSH, SFTP, or WinRM protocol" msgstr "资产({asset})授权缺少ssh,sftp或winrm协议" -#: ops/api/job.py:83 +#: ops/api/job.py:84 #, python-brace-format msgid "Asset ({asset}) authorization lacks upload permissions" msgstr "资产({asset})授权缺少上传权限" -#: ops/api/job.py:168 +#: ops/api/job.py:169 msgid "Duplicate file exists" msgstr "存在同名文件" -#: ops/api/job.py:173 +#: ops/api/job.py:174 #, python-brace-format msgid "" "File size exceeds maximum limit. Please select a file smaller than {limit}MB" msgstr "檔案大小超過最大限制。請選擇小於 {limit}MB 的文件。" -#: ops/api/job.py:237 +#: ops/api/job.py:238 msgid "" "The task is being created and cannot be interrupted. Please try again later." msgstr "正在創建任務,無法中斷,請稍後重試。" @@ -4275,27 +4274,27 @@ msgstr "正在創建任務,無法中斷,請稍後重試。" msgid "Currently playbook is being used in a job" msgstr "當前 playbook 正在作業中使用" -#: ops/api/playbook.py:96 +#: ops/api/playbook.py:97 msgid "Unsupported file content" msgstr "不支持的文件內容" -#: ops/api/playbook.py:98 ops/api/playbook.py:144 ops/api/playbook.py:192 +#: ops/api/playbook.py:99 ops/api/playbook.py:145 ops/api/playbook.py:193 msgid "Invalid file path" msgstr "無效的文件路徑" -#: ops/api/playbook.py:170 +#: ops/api/playbook.py:171 msgid "This file can not be rename" msgstr "該文件不能重命名" -#: ops/api/playbook.py:189 +#: ops/api/playbook.py:190 msgid "File already exists" msgstr "文件已存在" -#: ops/api/playbook.py:207 +#: ops/api/playbook.py:208 msgid "File key is required" msgstr "文件金鑰該欄位是必填項。" -#: ops/api/playbook.py:210 +#: ops/api/playbook.py:211 msgid "This file can not be delete" msgstr "無法刪除此文件" @@ -5389,7 +5388,7 @@ msgstr "綁定 DN" #: settings/serializers/auth/ldap.py:47 msgid "Binding Distinguished Name" -msgstr "綁定專有名稱" +msgstr "綁定的 DN" #: settings/serializers/auth/ldap.py:51 msgid "Binding password" diff --git a/apps/i18n/lina/en.json b/apps/i18n/lina/en.json index 043fd06b0..ecdbfaceb 100644 --- a/apps/i18n/lina/en.json +++ b/apps/i18n/lina/en.json @@ -1101,7 +1101,6 @@ "Setting": "Setting", "SettingInEndpointHelpText": "Configure service address and port in system settings / component settings / server endpoints", "Settings": "System settings", - "Settings...": "Settings...", "Show": "Display", "ShowAssetAllChildrenNode": "Show all sub-nodes assets", "ShowAssetOnlyCurrentNode": "Only show current node assets", diff --git a/apps/i18n/lina/ja.json b/apps/i18n/lina/ja.json index 6f79704bd..9d69be384 100644 --- a/apps/i18n/lina/ja.json +++ b/apps/i18n/lina/ja.json @@ -1135,7 +1135,6 @@ "Setting": "設定", "SettingInEndpointHelpText": "システム設定/コンポーネント設定/サーバーエンドポイントでサービスのアドレスとポートを設定してください", "Settings": "システム設定", - "Settings...": "設定...", "Show": "表示", "ShowAssetAllChildrenNode": "すべての子ノードの資産を表示", "ShowAssetOnlyCurrentNode": "現在のノードアセットのみを表示", diff --git a/apps/i18n/lina/zh.json b/apps/i18n/lina/zh.json index 6c773cc7d..69d30500d 100644 --- a/apps/i18n/lina/zh.json +++ b/apps/i18n/lina/zh.json @@ -1103,7 +1103,6 @@ "Setting": "设置", "SettingInEndpointHelpText": "在 系统设置 / 组件设置 / 服务端点 中配置服务地址和端口", "Settings": "系统设置", - "Settings...": "设置...", "Show": "显示", "ShowAssetAllChildrenNode": "显示所有子节点资产", "ShowAssetOnlyCurrentNode": "仅显示当前节点资产", @@ -1385,5 +1384,6 @@ "ZoneList": "网域列表", "ZoneUpdate": "更新网域", "forceEnableMFAHelpText": "如果强制启用,用户无法自行禁用", - "removeWarningMsg": "你确定要移除" + "removeWarningMsg": "你确定要移除", + "VaultHCPMountPoint": "Vault 服务器的挂载点,默认为 jumpserver" } \ No newline at end of file diff --git a/apps/i18n/lina/zh_hant.json b/apps/i18n/lina/zh_hant.json index 3f88abb1b..44d892609 100644 --- a/apps/i18n/lina/zh_hant.json +++ b/apps/i18n/lina/zh_hant.json @@ -1459,7 +1459,6 @@ "Setting": "設置", "SettingInEndpointHelpText": "在 系統設置 / 組件設置 / 服務端點 中配置服務地址和埠", "Settings": "系統設置", - "Settings...": " Settings...", "Show": "顯示", "ShowAssetAllChildrenNode": "顯示所有子節點資產", "ShowAssetOnlyCurrentNode": "僅顯示當前節點資產", diff --git a/apps/terminal/serializers/terminal.py b/apps/terminal/serializers/terminal.py index e47fcf93e..a80e2ad84 100644 --- a/apps/terminal/serializers/terminal.py +++ b/apps/terminal/serializers/terminal.py @@ -41,7 +41,7 @@ class TerminalSmallSerializer(serializers.ModelSerializer): class TerminalSerializer(BulkModelSerializer): session_online = serializers.ReadOnlyField(source='get_online_session_count', label=_('Online sessions')) is_alive = serializers.BooleanField(read_only=True, label=_('Is alive')) - is_active = serializers.BooleanField(read_only=True, label='Is active') + is_active = serializers.BooleanField(read_only=True, label=_('Active')) load = LabeledChoiceField( read_only=True, choices=const.ComponentLoad.choices, label=_('Load status') From 78bd3f581a880e1ae3af09ae3488e34fcaa6c65a Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Fri, 5 Jul 2024 16:36:55 +0800 Subject: [PATCH 010/137] perf: Translate --- .../serializers/connection_token.py | 1 + apps/i18n/core/en/LC_MESSAGES/django.po | 22 ++++++++++++------- apps/i18n/core/ja/LC_MESSAGES/django.po | 22 ++++++++++++------- apps/i18n/core/zh/LC_MESSAGES/django.po | 22 ++++++++++++------- apps/i18n/core/zh_Hant/LC_MESSAGES/django.po | 22 ++++++++++++------- apps/i18n/lina/en.json | 5 ++++- apps/i18n/lina/zh.json | 5 ++++- apps/ops/api/job.py | 5 ++++- apps/ops/models/job.py | 2 ++ apps/ops/serializers/job.py | 8 +++++++ 10 files changed, 79 insertions(+), 35 deletions(-) diff --git a/apps/authentication/serializers/connection_token.py b/apps/authentication/serializers/connection_token.py index 4579e73ee..5781b020d 100644 --- a/apps/authentication/serializers/connection_token.py +++ b/apps/authentication/serializers/connection_token.py @@ -40,6 +40,7 @@ class ConnectionTokenSerializer(CommonModelSerializer): 'from_ticket': {'read_only': True}, 'value': {'read_only': True}, 'is_expired': {'read_only': True, 'label': _('Is expired')}, + 'org_name': {'label': _("Org name")}, } def get_request_user(self): diff --git a/apps/i18n/core/en/LC_MESSAGES/django.po b/apps/i18n/core/en/LC_MESSAGES/django.po index bc6f8b543..5088f557c 100644 --- a/apps/i18n/core/en/LC_MESSAGES/django.po +++ b/apps/i18n/core/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-04 18:09+0800\n" +"POT-Creation-Date: 2024-07-05 16:34+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3357,6 +3357,11 @@ msgstr "" msgid "Is expired" msgstr "Expired" +#: authentication/serializers/connection_token.py:43 +#: orgs/mixins/serializers.py:26 rbac/serializers/rolebinding.py:27 +msgid "Org name" +msgstr "Organization" + #: authentication/serializers/password_mfa.py:29 #: users/templates/users/forgot_password.html:153 msgid "The {} cannot be empty" @@ -4473,7 +4478,8 @@ msgstr "" msgid "Run as policy" msgstr "" -#: ops/models/job.py:222 terminal/notifications.py:174 +#: ops/models/job.py:222 ops/serializers/job.py:92 +#: terminal/notifications.py:174 msgid "Job" msgstr "" @@ -4485,7 +4491,7 @@ msgstr "" msgid "Material Type" msgstr "" -#: ops/models/job.py:545 +#: ops/models/job.py:547 msgid "Job Execution" msgstr "" @@ -4549,7 +4555,11 @@ msgstr "" msgid "Is finished" msgstr "Finished" -#: ops/serializers/job.py:90 +#: ops/serializers/job.py:89 +msgid "Task id" +msgstr "" + +#: ops/serializers/job.py:98 msgid "You do not have permission for the current job." msgstr "" @@ -4652,10 +4662,6 @@ msgstr "請選擇一個組織後再保存" msgid "Organization" msgstr "" -#: orgs/mixins/serializers.py:26 rbac/serializers/rolebinding.py:27 -msgid "Org name" -msgstr "Organization" - #: orgs/models.py:14 msgid "GLOBAL" msgstr "" diff --git a/apps/i18n/core/ja/LC_MESSAGES/django.po b/apps/i18n/core/ja/LC_MESSAGES/django.po index 1a3b6127d..82b7e759a 100644 --- a/apps/i18n/core/ja/LC_MESSAGES/django.po +++ b/apps/i18n/core/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: 2024-07-04 18:09+0800\n" +"POT-Creation-Date: 2024-07-05 16:34+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3423,6 +3423,11 @@ msgstr "アクション" msgid "Is expired" msgstr "期限切れです" +#: authentication/serializers/connection_token.py:43 +#: orgs/mixins/serializers.py:26 rbac/serializers/rolebinding.py:27 +msgid "Org name" +msgstr "組織名" + #: authentication/serializers/password_mfa.py:29 #: users/templates/users/forgot_password.html:153 msgid "The {} cannot be empty" @@ -4575,7 +4580,8 @@ msgstr "ユーザーとして実行" msgid "Run as policy" msgstr "ユーザー ポリシー" -#: ops/models/job.py:222 terminal/notifications.py:174 +#: ops/models/job.py:222 ops/serializers/job.py:92 +#: terminal/notifications.py:174 msgid "Job" msgstr "ジョブ#ジョブ#" @@ -4587,7 +4593,7 @@ msgstr "Material" msgid "Material Type" msgstr "Material を選択してオプションを設定します。" -#: ops/models/job.py:545 +#: ops/models/job.py:547 msgid "Job Execution" msgstr "ジョブ実行" @@ -4651,7 +4657,11 @@ msgstr "タスクの種類" msgid "Is finished" msgstr "終了しました" -#: ops/serializers/job.py:90 +#: ops/serializers/job.py:89 +msgid "Task id" +msgstr "タスク ID" + +#: ops/serializers/job.py:98 msgid "You do not have permission for the current job." msgstr "あなたは現在のジョブの権限を持っていません。" @@ -4755,10 +4765,6 @@ msgstr "組織を選択してから保存してください" msgid "Organization" msgstr "組織" -#: orgs/mixins/serializers.py:26 rbac/serializers/rolebinding.py:27 -msgid "Org name" -msgstr "組織名" - #: orgs/models.py:14 msgid "GLOBAL" msgstr "グローバル組織" diff --git a/apps/i18n/core/zh/LC_MESSAGES/django.po b/apps/i18n/core/zh/LC_MESSAGES/django.po index 7d9fc1b7f..5ebee2fe7 100644 --- a/apps/i18n/core/zh/LC_MESSAGES/django.po +++ b/apps/i18n/core/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: 2024-07-04 18:09+0800\n" +"POT-Creation-Date: 2024-07-05 16:34+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -3386,6 +3386,11 @@ msgstr "动作" msgid "Is expired" msgstr "已过期" +#: authentication/serializers/connection_token.py:43 +#: orgs/mixins/serializers.py:26 rbac/serializers/rolebinding.py:27 +msgid "Org name" +msgstr "组织名称" + #: authentication/serializers/password_mfa.py:29 #: users/templates/users/forgot_password.html:153 msgid "The {} cannot be empty" @@ -4514,7 +4519,8 @@ msgstr "运行用户" msgid "Run as policy" msgstr "用户策略" -#: ops/models/job.py:222 terminal/notifications.py:174 +#: ops/models/job.py:222 ops/serializers/job.py:92 +#: terminal/notifications.py:174 msgid "Job" msgstr "作业" @@ -4526,7 +4532,7 @@ msgstr "Material" msgid "Material Type" msgstr "Material 类型" -#: ops/models/job.py:545 +#: ops/models/job.py:547 msgid "Job Execution" msgstr "作业执行" @@ -4590,7 +4596,11 @@ msgstr "任务类型" msgid "Is finished" msgstr "是否完成" -#: ops/serializers/job.py:90 +#: ops/serializers/job.py:89 +msgid "Task id" +msgstr "任务 ID" + +#: ops/serializers/job.py:98 msgid "You do not have permission for the current job." msgstr "你没有当前作业的权限。" @@ -4693,10 +4703,6 @@ msgstr "请选择一个组织后再保存" msgid "Organization" msgstr "组织" -#: orgs/mixins/serializers.py:26 rbac/serializers/rolebinding.py:27 -msgid "Org name" -msgstr "组织名称" - #: orgs/models.py:14 msgid "GLOBAL" msgstr "全局组织" diff --git a/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po b/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po index 9a139525a..2c428330b 100644 --- a/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po +++ b/apps/i18n/core/zh_Hant/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: 2024-07-04 18:09+0800\n" +"POT-Creation-Date: 2024-07-05 16:34+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -3388,6 +3388,11 @@ msgstr "動作" msgid "Is expired" msgstr "已過期" +#: authentication/serializers/connection_token.py:43 +#: orgs/mixins/serializers.py:26 rbac/serializers/rolebinding.py:27 +msgid "Org name" +msgstr "組織名稱" + #: authentication/serializers/password_mfa.py:29 #: users/templates/users/forgot_password.html:153 msgid "The {} cannot be empty" @@ -4517,7 +4522,8 @@ msgstr "執行使用者" msgid "Run as policy" msgstr "使用者策略" -#: ops/models/job.py:222 terminal/notifications.py:174 +#: ops/models/job.py:222 ops/serializers/job.py:92 +#: terminal/notifications.py:174 msgid "Job" msgstr "作業" @@ -4529,7 +4535,7 @@ msgstr "Material" msgid "Material Type" msgstr "Material 類型" -#: ops/models/job.py:545 +#: ops/models/job.py:547 msgid "Job Execution" msgstr "作業執行" @@ -4593,7 +4599,11 @@ msgstr "任務類型" msgid "Is finished" msgstr "是否完成" -#: ops/serializers/job.py:90 +#: ops/serializers/job.py:89 +msgid "Task id" +msgstr "任務 ID" + +#: ops/serializers/job.py:98 msgid "You do not have permission for the current job." msgstr "你沒有當前作業的權限。" @@ -4696,10 +4706,6 @@ msgstr "請選擇一個組織後再保存" msgid "Organization" msgstr "組織" -#: orgs/mixins/serializers.py:26 rbac/serializers/rolebinding.py:27 -msgid "Org name" -msgstr "組織名稱" - #: orgs/models.py:14 msgid "GLOBAL" msgstr "全局組織" diff --git a/apps/i18n/lina/en.json b/apps/i18n/lina/en.json index ecdbfaceb..ba6f34c29 100644 --- a/apps/i18n/lina/en.json +++ b/apps/i18n/lina/en.json @@ -1383,5 +1383,8 @@ "ZoneList": "Zones", "ZoneUpdate": "Update the zone", "forceEnableMFAHelpText": "If force enable, user can not disable by themselves", - "removeWarningMsg": "Are you sure you want to remove" + "removeWarningMsg": "Are you sure you want to remove", + "RetrySelected": "Retry selected", + "ApproveSelected": "Approve selected", + "Running": "Running" } \ No newline at end of file diff --git a/apps/i18n/lina/zh.json b/apps/i18n/lina/zh.json index 69d30500d..9bf631a30 100644 --- a/apps/i18n/lina/zh.json +++ b/apps/i18n/lina/zh.json @@ -1385,5 +1385,8 @@ "ZoneUpdate": "更新网域", "forceEnableMFAHelpText": "如果强制启用,用户无法自行禁用", "removeWarningMsg": "你确定要移除", - "VaultHCPMountPoint": "Vault 服务器的挂载点,默认为 jumpserver" + "VaultHCPMountPoint": "Vault 服务器的挂载点,默认为 jumpserver", + "RetrySelected": "重试所选", + "ApproveSelected": "审批所选", + "Running": "运行中" } \ No newline at end of file diff --git a/apps/ops/api/job.py b/apps/ops/api/job.py index f31df2b13..55365861b 100644 --- a/apps/ops/api/job.py +++ b/apps/ops/api/job.py @@ -271,7 +271,10 @@ class JobExecutionTaskDetail(APIView): execution = get_object_or_404(JobExecution, pk=task_id, creator=request.user) return Response(data={ - 'status': execution.status, + 'status': { + 'value': execution.status, + 'label': execution.get_status_display() + }, 'is_finished': execution.is_finished, 'is_success': execution.is_success, 'time_cost': execution.time_cost, diff --git a/apps/ops/models/job.py b/apps/ops/models/job.py index f8aedd209..689989b9a 100644 --- a/apps/ops/models/job.py +++ b/apps/ops/models/job.py @@ -247,6 +247,8 @@ class JobExecution(JMSOrgBaseModel): verbose_name=_("Material Type")) # clean up zombie execution + def get_status_display(self): + return dict(JobStatus.choices).get(self.status, self.status) @classmethod def clean_unexpected_execution(cls): diff --git a/apps/ops/serializers/job.py b/apps/ops/serializers/job.py index b66ab4202..431b062d0 100644 --- a/apps/ops/serializers/job.py +++ b/apps/ops/serializers/job.py @@ -84,6 +84,14 @@ class JobExecutionSerializer(BulkOrgResourceModelSerializer): fields = read_only_fields + [ "job", "parameters", "creator" ] + extra_kwargs = { + "task_id": { + "label": _("Task id"), + }, + "job": { + "label": _("Job"), + } + } def validate_job(self, job_obj): if job_obj.creator != self.context['request'].user: From 57d689bee66d09ce9225a20fc8a35c9d7e2cd791 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Fri, 5 Jul 2024 18:09:39 +0800 Subject: [PATCH 011/137] perf: Translate (#13620) Co-authored-by: feng <1304903146@qq.com> --- .../automations/change_secret/manager.py | 3 ++ apps/assets/serializers/automations/base.py | 9 +++++ apps/i18n/core/en/LC_MESSAGES/django.po | 31 +++++++++-------- apps/i18n/core/ja/LC_MESSAGES/django.po | 31 +++++++++-------- apps/i18n/core/zh/LC_MESSAGES/django.po | 33 ++++++++++--------- apps/i18n/core/zh_Hant/LC_MESSAGES/django.po | 31 +++++++++-------- apps/i18n/lina/ja.json | 2 +- apps/i18n/lina/zh.json | 2 +- apps/i18n/lina/zh_hant.json | 2 +- apps/rbac/serializers/role.py | 2 +- 10 files changed, 85 insertions(+), 61 deletions(-) diff --git a/apps/accounts/automations/change_secret/manager.py b/apps/accounts/automations/change_secret/manager.py index 2a4432182..b5a978b79 100644 --- a/apps/accounts/automations/change_secret/manager.py +++ b/apps/accounts/automations/change_secret/manager.py @@ -226,6 +226,9 @@ class ChangeSecretManager(AccountBasePlaybookManager): def run(self, *args, **kwargs): if self.secret_type and not self.check_secret(): + self.execution.status = 'success' + self.execution.date_finished = timezone.now() + self.execution.save() return super().run(*args, **kwargs) recorders = list(self.name_recorder_mapper.values()) diff --git a/apps/assets/serializers/automations/base.py b/apps/assets/serializers/automations/base.py index 4622c0674..522049d17 100644 --- a/apps/assets/serializers/automations/base.py +++ b/apps/assets/serializers/automations/base.py @@ -36,6 +36,7 @@ class BaseAutomationSerializer(PeriodTaskSerializerMixin, BulkOrgResourceModelSe class AutomationExecutionSerializer(serializers.ModelSerializer): snapshot = serializers.SerializerMethodField(label=_('Automation snapshot')) + status = serializers.SerializerMethodField(label=_("Status")) trigger = LabeledChoiceField(choices=Trigger.choices, read_only=True, label=_("Trigger mode")) class Meta: @@ -45,6 +46,14 @@ class AutomationExecutionSerializer(serializers.ModelSerializer): ] fields = ['id', 'automation'] + read_only_fields + @staticmethod + def get_status(obj): + if obj.status == 'success': + return _("Success") + elif obj.status == 'pending': + return _("Pending") + return obj.status + @staticmethod def get_snapshot(obj): from assets.const import AutomationTypes as AssetTypes diff --git a/apps/i18n/core/en/LC_MESSAGES/django.po b/apps/i18n/core/en/LC_MESSAGES/django.po index 5088f557c..446e26286 100644 --- a/apps/i18n/core/en/LC_MESSAGES/django.po +++ b/apps/i18n/core/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-05 16:34+0800\n" +"POT-Creation-Date: 2024-07-05 18:00+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -64,7 +64,8 @@ msgstr "" #: accounts/automations/backup_account/handlers.py:219 #: accounts/const/automation.py:110 -#: accounts/serializers/automations/change_secret.py:166 audits/const.py:64 +#: accounts/serializers/automations/change_secret.py:166 +#: assets/serializers/automations/base.py:52 audits/const.py:64 #: audits/models.py:64 audits/signal_handlers/activity_log.py:33 #: common/const/choices.py:18 ops/const.py:74 ops/serializers/celery.py:48 #: terminal/const.py:78 terminal/models/session/sharing.py:121 @@ -303,8 +304,9 @@ msgstr "" msgid "SFTP" msgstr "" -#: accounts/const/automation.py:111 common/const/choices.py:16 -#: terminal/const.py:77 tickets/const.py:29 tickets/const.py:38 +#: accounts/const/automation.py:111 assets/serializers/automations/base.py:54 +#: common/const/choices.py:16 terminal/const.py:77 tickets/const.py:29 +#: tickets/const.py:38 msgid "Pending" msgstr "" @@ -482,7 +484,7 @@ msgstr "" #: accounts/serializers/account/backup.py:48 #: accounts/serializers/automations/base.py:56 #: assets/models/automations/base.py:122 -#: assets/serializers/automations/base.py:39 +#: assets/serializers/automations/base.py:40 msgid "Trigger mode" msgstr "" @@ -575,7 +577,8 @@ msgid "Date finished" msgstr "" #: accounts/models/automations/change_secret.py:44 -#: assets/models/automations/base.py:113 audits/models.py:208 +#: assets/models/automations/base.py:113 +#: assets/serializers/automations/base.py:39 audits/models.py:208 #: audits/serializers.py:54 ops/models/base.py:49 ops/models/job.py:234 #: terminal/models/applet/applet.py:320 terminal/models/applet/host.py:140 #: terminal/models/component/status.py:30 @@ -707,9 +710,9 @@ msgstr "" #: ops/models/celery.py:80 ops/models/job.py:142 ops/models/playbook.py:28 #: ops/serializers/job.py:18 orgs/models.py:82 #: perms/models/asset_permission.py:61 rbac/models/role.py:29 -#: settings/models.py:34 settings/models.py:183 settings/serializers/msg.py:86 -#: settings/serializers/terminal.py:9 terminal/models/applet/applet.py:33 -#: terminal/models/component/endpoint.py:12 +#: rbac/serializers/role.py:28 settings/models.py:34 settings/models.py:183 +#: settings/serializers/msg.py:86 settings/serializers/terminal.py:9 +#: terminal/models/applet/applet.py:33 terminal/models/component/endpoint.py:12 #: terminal/models/component/endpoint.py:109 #: terminal/models/component/storage.py:26 terminal/models/component/task.py:13 #: terminal/models/component/terminal.py:85 @@ -4966,11 +4969,6 @@ msgstr "" msgid "Perms" msgstr "" -#: rbac/serializers/role.py:28 terminal/models/applet/applet.py:34 -#: terminal/models/virtualapp/virtualapp.py:20 -msgid "Display name" -msgstr "" - #: rbac/serializers/rolebinding.py:60 msgid "Has bound this role" msgstr "" @@ -6853,6 +6851,11 @@ msgstr "" msgid "Enterprise" msgstr "" +#: terminal/models/applet/applet.py:34 +#: terminal/models/virtualapp/virtualapp.py:20 +msgid "Display name" +msgstr "" + #: terminal/models/applet/applet.py:36 #: terminal/models/virtualapp/virtualapp.py:22 msgid "Author" diff --git a/apps/i18n/core/ja/LC_MESSAGES/django.po b/apps/i18n/core/ja/LC_MESSAGES/django.po index 82b7e759a..c4f404ba9 100644 --- a/apps/i18n/core/ja/LC_MESSAGES/django.po +++ b/apps/i18n/core/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: 2024-07-05 16:34+0800\n" +"POT-Creation-Date: 2024-07-05 18:00+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -64,7 +64,8 @@ msgstr "仕上げ" #: accounts/automations/backup_account/handlers.py:219 #: accounts/const/automation.py:110 -#: accounts/serializers/automations/change_secret.py:166 audits/const.py:64 +#: accounts/serializers/automations/change_secret.py:166 +#: assets/serializers/automations/base.py:52 audits/const.py:64 #: audits/models.py:64 audits/signal_handlers/activity_log.py:33 #: common/const/choices.py:18 ops/const.py:74 ops/serializers/celery.py:48 #: terminal/const.py:78 terminal/models/session/sharing.py:121 @@ -303,8 +304,9 @@ msgstr "メール" msgid "SFTP" msgstr "SFTP" -#: accounts/const/automation.py:111 common/const/choices.py:16 -#: terminal/const.py:77 tickets/const.py:29 tickets/const.py:38 +#: accounts/const/automation.py:111 assets/serializers/automations/base.py:54 +#: common/const/choices.py:16 terminal/const.py:77 tickets/const.py:29 +#: tickets/const.py:38 msgid "Pending" msgstr "未定" @@ -482,7 +484,7 @@ msgstr "アカウントのバックアップスナップショット" #: accounts/serializers/account/backup.py:48 #: accounts/serializers/automations/base.py:56 #: assets/models/automations/base.py:122 -#: assets/serializers/automations/base.py:39 +#: assets/serializers/automations/base.py:40 msgid "Trigger mode" msgstr "トリガーモード" @@ -575,7 +577,8 @@ msgid "Date finished" msgstr "終了日" #: accounts/models/automations/change_secret.py:44 -#: assets/models/automations/base.py:113 audits/models.py:208 +#: assets/models/automations/base.py:113 +#: assets/serializers/automations/base.py:39 audits/models.py:208 #: audits/serializers.py:54 ops/models/base.py:49 ops/models/job.py:234 #: terminal/models/applet/applet.py:320 terminal/models/applet/host.py:140 #: terminal/models/component/status.py:30 @@ -707,9 +710,9 @@ msgstr "パスワードルール" #: ops/models/celery.py:80 ops/models/job.py:142 ops/models/playbook.py:28 #: ops/serializers/job.py:18 orgs/models.py:82 #: perms/models/asset_permission.py:61 rbac/models/role.py:29 -#: settings/models.py:34 settings/models.py:183 settings/serializers/msg.py:86 -#: settings/serializers/terminal.py:9 terminal/models/applet/applet.py:33 -#: terminal/models/component/endpoint.py:12 +#: rbac/serializers/role.py:28 settings/models.py:34 settings/models.py:183 +#: settings/serializers/msg.py:86 settings/serializers/terminal.py:9 +#: terminal/models/applet/applet.py:33 terminal/models/component/endpoint.py:12 #: terminal/models/component/endpoint.py:109 #: terminal/models/component/storage.py:26 terminal/models/component/task.py:13 #: terminal/models/component/terminal.py:85 @@ -5073,11 +5076,6 @@ msgstr "システムロールバインディング" msgid "Perms" msgstr "パーマ" -#: rbac/serializers/role.py:28 terminal/models/applet/applet.py:34 -#: terminal/models/virtualapp/virtualapp.py:20 -msgid "Display name" -msgstr "表示名" - #: rbac/serializers/rolebinding.py:60 msgid "Has bound this role" msgstr "この役割をバインドしました" @@ -7097,6 +7095,11 @@ msgstr "コミュニティ版" msgid "Enterprise" msgstr "エンタープライズ版" +#: terminal/models/applet/applet.py:34 +#: terminal/models/virtualapp/virtualapp.py:20 +msgid "Display name" +msgstr "表示名" + #: terminal/models/applet/applet.py:36 #: terminal/models/virtualapp/virtualapp.py:22 msgid "Author" diff --git a/apps/i18n/core/zh/LC_MESSAGES/django.po b/apps/i18n/core/zh/LC_MESSAGES/django.po index 5ebee2fe7..f6119f249 100644 --- a/apps/i18n/core/zh/LC_MESSAGES/django.po +++ b/apps/i18n/core/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: 2024-07-05 16:34+0800\n" +"POT-Creation-Date: 2024-07-05 18:00+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -63,7 +63,8 @@ msgstr "完成" #: accounts/automations/backup_account/handlers.py:219 #: accounts/const/automation.py:110 -#: accounts/serializers/automations/change_secret.py:166 audits/const.py:64 +#: accounts/serializers/automations/change_secret.py:166 +#: assets/serializers/automations/base.py:52 audits/const.py:64 #: audits/models.py:64 audits/signal_handlers/activity_log.py:33 #: common/const/choices.py:18 ops/const.py:74 ops/serializers/celery.py:48 #: terminal/const.py:78 terminal/models/session/sharing.py:121 @@ -302,8 +303,9 @@ msgstr "邮箱" msgid "SFTP" msgstr "SFTP" -#: accounts/const/automation.py:111 common/const/choices.py:16 -#: terminal/const.py:77 tickets/const.py:29 tickets/const.py:38 +#: accounts/const/automation.py:111 assets/serializers/automations/base.py:54 +#: common/const/choices.py:16 terminal/const.py:77 tickets/const.py:29 +#: tickets/const.py:38 msgid "Pending" msgstr "待定的" @@ -481,7 +483,7 @@ msgstr "账号备份快照" #: accounts/serializers/account/backup.py:48 #: accounts/serializers/automations/base.py:56 #: assets/models/automations/base.py:122 -#: assets/serializers/automations/base.py:39 +#: assets/serializers/automations/base.py:40 msgid "Trigger mode" msgstr "触发模式" @@ -574,7 +576,8 @@ msgid "Date finished" msgstr "结束日期" #: accounts/models/automations/change_secret.py:44 -#: assets/models/automations/base.py:113 audits/models.py:208 +#: assets/models/automations/base.py:113 +#: assets/serializers/automations/base.py:39 audits/models.py:208 #: audits/serializers.py:54 ops/models/base.py:49 ops/models/job.py:234 #: terminal/models/applet/applet.py:320 terminal/models/applet/host.py:140 #: terminal/models/component/status.py:30 @@ -706,9 +709,9 @@ msgstr "密码规则" #: ops/models/celery.py:80 ops/models/job.py:142 ops/models/playbook.py:28 #: ops/serializers/job.py:18 orgs/models.py:82 #: perms/models/asset_permission.py:61 rbac/models/role.py:29 -#: settings/models.py:34 settings/models.py:183 settings/serializers/msg.py:86 -#: settings/serializers/terminal.py:9 terminal/models/applet/applet.py:33 -#: terminal/models/component/endpoint.py:12 +#: rbac/serializers/role.py:28 settings/models.py:34 settings/models.py:183 +#: settings/serializers/msg.py:86 settings/serializers/terminal.py:9 +#: terminal/models/applet/applet.py:33 terminal/models/component/endpoint.py:12 #: terminal/models/component/endpoint.py:109 #: terminal/models/component/storage.py:26 terminal/models/component/task.py:13 #: terminal/models/component/terminal.py:85 @@ -5010,11 +5013,6 @@ msgstr "系统角色绑定" msgid "Perms" msgstr "权限" -#: rbac/serializers/role.py:28 terminal/models/applet/applet.py:34 -#: terminal/models/virtualapp/virtualapp.py:20 -msgid "Display name" -msgstr "显示名称" - #: rbac/serializers/rolebinding.py:60 msgid "Has bound this role" msgstr "已经绑定" @@ -6967,6 +6965,11 @@ msgstr "社区版" msgid "Enterprise" msgstr "企业版" +#: terminal/models/applet/applet.py:34 +#: terminal/models/virtualapp/virtualapp.py:20 +msgid "Display name" +msgstr "显示名称" + #: terminal/models/applet/applet.py:36 #: terminal/models/virtualapp/virtualapp.py:22 msgid "Author" @@ -8560,7 +8563,7 @@ msgstr "组织管理员" #: users/serializers/user.py:140 msgid "Can public key authentication" -msgstr "可以公钥认证吗" +msgstr "可以使用公钥认证" #: users/serializers/user.py:242 msgid "Full name" diff --git a/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po b/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po index 2c428330b..101fa8bb4 100644 --- a/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po +++ b/apps/i18n/core/zh_Hant/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: 2024-07-05 16:34+0800\n" +"POT-Creation-Date: 2024-07-05 18:00+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -65,7 +65,8 @@ msgstr "完成" #: accounts/automations/backup_account/handlers.py:219 #: accounts/const/automation.py:110 -#: accounts/serializers/automations/change_secret.py:166 audits/const.py:64 +#: accounts/serializers/automations/change_secret.py:166 +#: assets/serializers/automations/base.py:52 audits/const.py:64 #: audits/models.py:64 audits/signal_handlers/activity_log.py:33 #: common/const/choices.py:18 ops/const.py:74 ops/serializers/celery.py:48 #: terminal/const.py:78 terminal/models/session/sharing.py:121 @@ -304,8 +305,9 @@ msgstr "信箱" msgid "SFTP" msgstr "SFTP" -#: accounts/const/automation.py:111 common/const/choices.py:16 -#: terminal/const.py:77 tickets/const.py:29 tickets/const.py:38 +#: accounts/const/automation.py:111 assets/serializers/automations/base.py:54 +#: common/const/choices.py:16 terminal/const.py:77 tickets/const.py:29 +#: tickets/const.py:38 msgid "Pending" msgstr "待定的" @@ -483,7 +485,7 @@ msgstr "帳號備份快照" #: accounts/serializers/account/backup.py:48 #: accounts/serializers/automations/base.py:56 #: assets/models/automations/base.py:122 -#: assets/serializers/automations/base.py:39 +#: assets/serializers/automations/base.py:40 msgid "Trigger mode" msgstr "觸發模式" @@ -576,7 +578,8 @@ msgid "Date finished" msgstr "結束日期" #: accounts/models/automations/change_secret.py:44 -#: assets/models/automations/base.py:113 audits/models.py:208 +#: assets/models/automations/base.py:113 +#: assets/serializers/automations/base.py:39 audits/models.py:208 #: audits/serializers.py:54 ops/models/base.py:49 ops/models/job.py:234 #: terminal/models/applet/applet.py:320 terminal/models/applet/host.py:140 #: terminal/models/component/status.py:30 @@ -708,9 +711,9 @@ msgstr "密碼規則" #: ops/models/celery.py:80 ops/models/job.py:142 ops/models/playbook.py:28 #: ops/serializers/job.py:18 orgs/models.py:82 #: perms/models/asset_permission.py:61 rbac/models/role.py:29 -#: settings/models.py:34 settings/models.py:183 settings/serializers/msg.py:86 -#: settings/serializers/terminal.py:9 terminal/models/applet/applet.py:33 -#: terminal/models/component/endpoint.py:12 +#: rbac/serializers/role.py:28 settings/models.py:34 settings/models.py:183 +#: settings/serializers/msg.py:86 settings/serializers/terminal.py:9 +#: terminal/models/applet/applet.py:33 terminal/models/component/endpoint.py:12 #: terminal/models/component/endpoint.py:109 #: terminal/models/component/storage.py:26 terminal/models/component/task.py:13 #: terminal/models/component/terminal.py:85 @@ -5015,11 +5018,6 @@ msgstr "系統角色綁定" msgid "Perms" msgstr "權限" -#: rbac/serializers/role.py:28 terminal/models/applet/applet.py:34 -#: terminal/models/virtualapp/virtualapp.py:20 -msgid "Display name" -msgstr "顯示名稱" - #: rbac/serializers/rolebinding.py:60 msgid "Has bound this role" msgstr "已經綁定" @@ -6973,6 +6971,11 @@ msgstr "社區版" msgid "Enterprise" msgstr "企業版" +#: terminal/models/applet/applet.py:34 +#: terminal/models/virtualapp/virtualapp.py:20 +msgid "Display name" +msgstr "顯示名稱" + #: terminal/models/applet/applet.py:36 #: terminal/models/virtualapp/virtualapp.py:22 msgid "Author" diff --git a/apps/i18n/lina/ja.json b/apps/i18n/lina/ja.json index 9d69be384..1e5492287 100644 --- a/apps/i18n/lina/ja.json +++ b/apps/i18n/lina/ja.json @@ -699,7 +699,7 @@ "LoginAssetToday": "本日のアクティブな資産数", "LoginAssets": "アクティブな資産", "LoginConfirm": "ログインレビュー", - "LoginConfirmUser": "確認方法", + "LoginConfirmUser": "ログインレビュー担当者", "LoginCount": "ログイン回数", "LoginDate": "ログイン日", "LoginFailed": "ログイン失敗", diff --git a/apps/i18n/lina/zh.json b/apps/i18n/lina/zh.json index 9bf631a30..a02b7042a 100644 --- a/apps/i18n/lina/zh.json +++ b/apps/i18n/lina/zh.json @@ -676,7 +676,7 @@ "LoginAssetToday": "今日活跃资产数", "LoginAssets": "活跃资产", "LoginConfirm": "登录复核", - "LoginConfirmUser": "确认方式", + "LoginConfirmUser": "登录复核 受理人", "LoginCount": "登录次数", "LoginDate": "登录日期", "LoginFailed": "登录失败", diff --git a/apps/i18n/lina/zh_hant.json b/apps/i18n/lina/zh_hant.json index 44d892609..c7628feb9 100644 --- a/apps/i18n/lina/zh_hant.json +++ b/apps/i18n/lina/zh_hant.json @@ -903,7 +903,7 @@ "LoginCity": "登入城市", "LoginConfig": "登入配置", "LoginConfirm": "登入覆核", - "LoginConfirmUser": "確認方式", + "LoginConfirmUser": "登錄複核 受理人", "LoginCount": "登入次數", "LoginDate": "登入日期", "LoginFailed": "登入失敗", diff --git a/apps/rbac/serializers/role.py b/apps/rbac/serializers/role.py index 84c597396..4a16db9db 100644 --- a/apps/rbac/serializers/role.py +++ b/apps/rbac/serializers/role.py @@ -25,7 +25,7 @@ class RoleSerializer(serializers.ModelSerializer): extra_kwargs = { 'permissions': {'write_only': True}, 'users_amount': {'label': _('Users amount')}, - 'display_name': {'label': _('Display name')} + 'display_name': {'label': _('Name')} } From 5836583490abb751f1280ddcd97fa98d0315f74e Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Mon, 8 Jul 2024 11:42:24 +0800 Subject: [PATCH 012/137] fix: The account gather results do not have the last login time (#13625) Co-authored-by: feng <1304903146@qq.com> --- apps/accounts/automations/gather_accounts/filter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/accounts/automations/gather_accounts/filter.py b/apps/accounts/automations/gather_accounts/filter.py index f3b111d36..1cca4d980 100644 --- a/apps/accounts/automations/gather_accounts/filter.py +++ b/apps/accounts/automations/gather_accounts/filter.py @@ -31,7 +31,7 @@ class GatherAccountsFilter: def posix_filter(info): username_pattern = re.compile(r'^(\S+)') ip_pattern = re.compile(r'(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})') - login_time_pattern = re.compile(r'\w{3} \d{2} \d{2}:\d{2}:\d{2} \d{4}') + login_time_pattern = re.compile(r'\w{3} \w{3}\s+\d{1,2} \d{2}:\d{2}:\d{2} \d{4}') result = {} for line in info: usernames = username_pattern.findall(line) @@ -46,7 +46,8 @@ class GatherAccountsFilter: result[username].update({'address': ip_addr}) login_times = login_time_pattern.findall(line) if login_times: - date = timezone.datetime.strptime(f'{login_times[0]} +0800', '%b %d %H:%M:%S %Y %z') + datetime_str = login_times[0].split(' ', 1)[1] + " +0800" + date = timezone.datetime.strptime(datetime_str, '%b %d %H:%M:%S %Y %z') result[username].update({'date': date}) return result From d0a94090789be85516e16be1cae73c8b5a1e8887 Mon Sep 17 00:00:00 2001 From: Bryan Date: Mon, 8 Jul 2024 14:49:56 +0800 Subject: [PATCH 013/137] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d3512c8ae..2ee5d81a9 100644 --- a/README.md +++ b/README.md @@ -90,8 +90,8 @@ https://www.gnu.org/licenses/gpl-3.0.html Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an " AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -[docs-link]: https://en-docs.jumpserver.org/ -[discord-link]: https://discord.com/invite/jcM5tKWJ +[docs-link]: https://jumpserver.com/docs +[discord-link]: https://discord.com/invite/W6vYXmAQG2 [contributing-link]: https://github.com/jumpserver/jumpserver/blob/dev/CONTRIBUTING.md From 9654add528fa1bab2c384838bd1eb261a8066096 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Mon, 8 Jul 2024 15:43:56 +0800 Subject: [PATCH 014/137] perf: Translate (#13633) Co-authored-by: feng <1304903146@qq.com> --- apps/i18n/core/en/LC_MESSAGES/django.po | 6 ++--- apps/i18n/core/ja/LC_MESSAGES/django.po | 27 ++++++++++---------- apps/i18n/core/zh/LC_MESSAGES/django.po | 23 ++++++++--------- apps/i18n/core/zh_Hant/LC_MESSAGES/django.po | 24 ++++++++--------- apps/i18n/lina/en.json | 2 +- apps/i18n/lina/ja.json | 2 +- apps/i18n/lina/zh.json | 2 +- apps/i18n/lina/zh_hant.json | 2 +- apps/settings/serializers/auth/base.py | 2 +- apps/settings/serializers/feature.py | 2 +- 10 files changed, 45 insertions(+), 47 deletions(-) diff --git a/apps/i18n/core/en/LC_MESSAGES/django.po b/apps/i18n/core/en/LC_MESSAGES/django.po index 446e26286..93428c9b4 100644 --- a/apps/i18n/core/en/LC_MESSAGES/django.po +++ b/apps/i18n/core/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-05 18:00+0800\n" +"POT-Creation-Date: 2024-07-08 15:32+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -5245,7 +5245,7 @@ msgid "" msgstr "" #: settings/serializers/auth/base.py:35 -msgid "Forgot Password" +msgid "Forgot Password URL" msgstr "" #: settings/serializers/auth/base.py:36 @@ -5834,7 +5834,7 @@ msgid "Chat AI" msgstr "" #: settings/serializers/feature.py:80 -msgid "Base URL" +msgid "GPT Base URL" msgstr "" #: settings/serializers/feature.py:81 diff --git a/apps/i18n/core/ja/LC_MESSAGES/django.po b/apps/i18n/core/ja/LC_MESSAGES/django.po index c4f404ba9..ae7846d85 100644 --- a/apps/i18n/core/ja/LC_MESSAGES/django.po +++ b/apps/i18n/core/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: 2024-07-05 18:00+0800\n" +"POT-Creation-Date: 2024-07-08 15:32+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1086,13 +1086,14 @@ msgstr "SSHキー戦略" #: accounts/serializers/automations/change_secret.py:57 msgid "Please enter your account username" -msgstr "MFAコードを入力してください" +msgstr "アカウントのユーザー名を入力してください" #: accounts/serializers/automations/change_secret.py:62 msgid "" "Secret parameter settings, currently only effective for assets of the host " "type." -msgstr "暗号化パラメータの設定は現在、ホストタイプのリソースにのみ有効です。" +msgstr "" +"パラメータ設定は現在、AIX LINUX UNIX タイプの資産に対してのみ有効です。" #: accounts/serializers/automations/change_secret.py:84 msgid "* Please enter the correct password length" @@ -5357,8 +5358,8 @@ msgstr "" "スでユーザーを作成します" #: settings/serializers/auth/base.py:35 -msgid "Forgot Password" -msgstr "パスワードを忘れた" +msgid "Forgot Password URL" +msgstr "パスワードを忘れた場合のリンク" #: settings/serializers/auth/base.py:36 msgid "The URL for Forgotten Password on the user login page" @@ -5631,7 +5632,7 @@ msgstr "レルム名" #: settings/serializers/auth/oidc.py:70 msgid "OpenID Connect" -msgstr "接続" +msgstr "OpenID 接続する" #: settings/serializers/auth/oidc.py:73 msgid "Provider endpoint" @@ -5759,7 +5760,7 @@ msgstr "認証コード長" #: settings/serializers/auth/sms.py:26 msgid "Length of the sent verification code" -msgstr "確認コードを送信" +msgstr "送信された認証コードの長さ" #: settings/serializers/auth/sms.py:31 settings/serializers/auth/sms.py:54 #: settings/serializers/auth/sms.py:62 settings/serializers/auth/sms.py:71 @@ -5985,8 +5986,8 @@ msgid "Chat AI" msgstr "チャットAI" #: settings/serializers/feature.py:80 -msgid "Base URL" -msgstr "ベースサイトのアドレス" +msgid "GPT Base URL" +msgstr "GPTアドレス" #: settings/serializers/feature.py:81 msgid "The base URL of the GPT service. For example: https://api.openai.com/v1" @@ -6079,15 +6080,15 @@ msgstr "" #: settings/serializers/msg.py:33 msgid "The user to be used for email server authentication" -msgstr "これは、SSO認証中にメールが返されない場合にデフォルトで使用されます。" +msgstr "" +"メールサーバーにログインするためのユーザー名。通常、これはあなたのメールアド" +"レスです" #: settings/serializers/msg.py:37 msgid "" "Password to use for the email server. It is used in conjunction with `User` " "when authenticating to the email server" -msgstr "" -"メールサーバーに対するパスワード。メールサーバーに対する認証時に、これがユー" -"ザーとともに使用されます" +msgstr "メールサーバーにログインするためのパスワード" #: settings/serializers/msg.py:40 msgid "Sender" diff --git a/apps/i18n/core/zh/LC_MESSAGES/django.po b/apps/i18n/core/zh/LC_MESSAGES/django.po index f6119f249..8d73aabcb 100644 --- a/apps/i18n/core/zh/LC_MESSAGES/django.po +++ b/apps/i18n/core/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: 2024-07-05 18:00+0800\n" +"POT-Creation-Date: 2024-07-08 15:32+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -1083,13 +1083,13 @@ msgstr "SSH 密钥更改方式" #: accounts/serializers/automations/change_secret.py:57 msgid "Please enter your account username" -msgstr "请输入 MFA 验证码" +msgstr "请输入您的账户用户名" #: accounts/serializers/automations/change_secret.py:62 msgid "" "Secret parameter settings, currently only effective for assets of the host " "type." -msgstr "秘文参数设置,目前只对宿主类型的资产有效。" +msgstr "参数设置,目前只对 AIX LINUX UNIX 类型的资产有效。" #: accounts/serializers/automations/change_secret.py:84 msgid "* Please enter the correct password length" @@ -5291,8 +5291,8 @@ msgstr "" "以此邮箱后缀创建用户" #: settings/serializers/auth/base.py:35 -msgid "Forgot Password" -msgstr "忘记密码" +msgid "Forgot Password URL" +msgstr "忘记密码链接" #: settings/serializers/auth/base.py:36 msgid "The URL for Forgotten Password on the user login page" @@ -5560,7 +5560,7 @@ msgstr "域" #: settings/serializers/auth/oidc.py:70 msgid "OpenID Connect" -msgstr "连接" +msgstr "OpenID 连接" #: settings/serializers/auth/oidc.py:73 msgid "Provider endpoint" @@ -5685,7 +5685,7 @@ msgstr "验证码长度" #: settings/serializers/auth/sms.py:26 msgid "Length of the sent verification code" -msgstr "发送验证码" +msgstr "发送验证码的长度" #: settings/serializers/auth/sms.py:31 settings/serializers/auth/sms.py:54 #: settings/serializers/auth/sms.py:62 settings/serializers/auth/sms.py:71 @@ -5902,8 +5902,8 @@ msgid "Chat AI" msgstr "聊天 AI" #: settings/serializers/feature.py:80 -msgid "Base URL" -msgstr "JumpServer 地址" +msgid "GPT Base URL" +msgstr "GPT 地址" #: settings/serializers/feature.py:81 msgid "The base URL of the GPT service. For example: https://api.openai.com/v1" @@ -5992,14 +5992,13 @@ msgstr "" #: settings/serializers/msg.py:33 msgid "The user to be used for email server authentication" -msgstr "SSO认证时,如果没有返回邮件地址,将使用该后缀" +msgstr "登录到邮件服务器的用户名。这通常是你的邮件地址" #: settings/serializers/msg.py:37 msgid "" "Password to use for the email server. It is used in conjunction with `User` " "when authenticating to the email server" -msgstr "" -"用于电子邮件服务器的密码。在向电子邮件服务器进行身份验证时,它与用户一起使用" +msgstr "登录到邮件服务器的密码" #: settings/serializers/msg.py:40 msgid "Sender" diff --git a/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po b/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po index 101fa8bb4..7e11dd50c 100644 --- a/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po +++ b/apps/i18n/core/zh_Hant/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: 2024-07-05 18:00+0800\n" +"POT-Creation-Date: 2024-07-08 15:32+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -1085,13 +1085,13 @@ msgstr "SSH 金鑰更改方式" #: accounts/serializers/automations/change_secret.py:57 msgid "Please enter your account username" -msgstr "請輸入 MFA 驗證碼" +msgstr "請輸入您的帳戶使用者名稱" #: accounts/serializers/automations/change_secret.py:62 msgid "" "Secret parameter settings, currently only effective for assets of the host " "type." -msgstr "密文參數設定, 目前只對宿主型的資產有效。" +msgstr "參數設置,目前只對 AIX LINUX UNIX 類型的資產有效。" #: accounts/serializers/automations/change_secret.py:84 msgid "* Please enter the correct password length" @@ -5296,8 +5296,8 @@ msgstr "" "統將自動以此電子信箱後綴建立使用者" #: settings/serializers/auth/base.py:35 -msgid "Forgot Password" -msgstr "忘記密碼" +msgid "Forgot Password URL" +msgstr "忘記密碼連結" #: settings/serializers/auth/base.py:36 msgid "The URL for Forgotten Password on the user login page" @@ -5565,7 +5565,7 @@ msgstr "域" #: settings/serializers/auth/oidc.py:70 msgid "OpenID Connect" -msgstr "Connect" +msgstr "OpenID 連接" #: settings/serializers/auth/oidc.py:73 msgid "Provider endpoint" @@ -5690,7 +5690,7 @@ msgstr "驗證碼長度" #: settings/serializers/auth/sms.py:26 msgid "Length of the sent verification code" -msgstr "發送驗證碼" +msgstr "發送的驗證碼長度" #: settings/serializers/auth/sms.py:31 settings/serializers/auth/sms.py:54 #: settings/serializers/auth/sms.py:62 settings/serializers/auth/sms.py:71 @@ -5907,8 +5907,8 @@ msgid "Chat AI" msgstr "聊天 AI" #: settings/serializers/feature.py:80 -msgid "Base URL" -msgstr "JumpServer 地址" +msgid "GPT Base URL" +msgstr "GPT 地址" #: settings/serializers/feature.py:81 msgid "The base URL of the GPT service. For example: https://api.openai.com/v1" @@ -5997,15 +5997,13 @@ msgstr "" #: settings/serializers/msg.py:33 msgid "The user to be used for email server authentication" -msgstr "SSO認證時,如果沒有返回郵件地址,將使用該後綴" +msgstr "登入郵件伺服器的使用者名稱。這通常是你的郵件地址" #: settings/serializers/msg.py:37 msgid "" "Password to use for the email server. It is used in conjunction with `User` " "when authenticating to the email server" -msgstr "" -"用於電子郵件伺服器的密碼。在向電子郵件伺服器進行身份驗證時,它與使用者一起使" -"用" +msgstr "登入郵件伺服器的密碼" #: settings/serializers/msg.py:40 msgid "Sender" diff --git a/apps/i18n/lina/en.json b/apps/i18n/lina/en.json index ba6f34c29..1675cda22 100644 --- a/apps/i18n/lina/en.json +++ b/apps/i18n/lina/en.json @@ -924,7 +924,7 @@ "RecentSession": "Recent sessions", "RecentlyUsed": "Recently", "Recipient": "Recipient", - "RecipientHelpText": "If both recipient a and b are set, the account's key will be split into two parts", + "RecipientHelpText": "If both recipients A and B are set, the account's ciphertext will be split into two parts; if only one recipient is set, the key will not be split.", "RecipientServer": "Receiving server", "Reconnect": "Reconnect", "Refresh": "Refresh", diff --git a/apps/i18n/lina/ja.json b/apps/i18n/lina/ja.json index 1e5492287..03e7e9a44 100644 --- a/apps/i18n/lina/ja.json +++ b/apps/i18n/lina/ja.json @@ -957,7 +957,7 @@ "RecentSession": "最近の会話", "RecentlyUsed": "最近使用", "Recipient": "受取人", - "RecipientHelpText": "A B受信者が設定されている場合、アカウントの鍵は前後二つに分割されます", + "RecipientHelpText": "受信者 A と B が同時に設定されている場合、アカウントの暗号文は 2 つの部分に分割されます。受信者が 1 つだけ設定されている場合、キーは分割されません。", "RecipientServer": "受信サーバー", "Reconnect": "再接続", "Refresh": "更新", diff --git a/apps/i18n/lina/zh.json b/apps/i18n/lina/zh.json index a02b7042a..bdd9b60a4 100644 --- a/apps/i18n/lina/zh.json +++ b/apps/i18n/lina/zh.json @@ -926,7 +926,7 @@ "RecentSession": "最近会话", "RecentlyUsed": "最近使用", "Recipient": "接收人", - "RecipientHelpText": "若收件人 A B 都设置,账号的密钥将被拆分成前后两部分", + "RecipientHelpText": "如果同时设置了收件人A和B,账号的密文将被拆分为两部分;如果只设置了一个收件人,密钥则不会被拆分。", "RecipientServer": "接收服务器", "Reconnect": "重新连接", "Refresh": "刷新", diff --git a/apps/i18n/lina/zh_hant.json b/apps/i18n/lina/zh_hant.json index c7628feb9..9bd1ecec3 100644 --- a/apps/i18n/lina/zh_hant.json +++ b/apps/i18n/lina/zh_hant.json @@ -1239,7 +1239,7 @@ "RecentSession": "最近會話", "RecentlyUsed": "最近使用", "Recipient": "接收人", - "RecipientHelpText": "若收件人 A B 都設置,帳號的金鑰將被拆分成前後兩部分。如用戶未設置加密密碼 - 請前往個人資訊 -> 偏好設置中設置加密密碼", + "RecipientHelpText": "如果同時設定了收件人A和B,帳號的密文將被拆分為兩部分;如果只設定了一個收件人,密鑰則不會被拆分。", "RecipientServer": "接收伺服器", "Reconnect": "重新連接", "Refresh": "刷新", diff --git a/apps/settings/serializers/auth/base.py b/apps/settings/serializers/auth/base.py index a9292acfc..4b7409f08 100644 --- a/apps/settings/serializers/auth/base.py +++ b/apps/settings/serializers/auth/base.py @@ -32,7 +32,7 @@ class AuthSettingSerializer(serializers.Serializer): ) FORGOT_PASSWORD_URL = serializers.CharField( required=False, allow_blank=True, max_length=1024, - label=_("Forgot Password"), + label=_("Forgot Password URL"), help_text=_("The URL for Forgotten Password on the user login page") ) LOGIN_REDIRECT_MSG_ENABLED = serializers.BooleanField( diff --git a/apps/settings/serializers/feature.py b/apps/settings/serializers/feature.py index d88a42af6..a28d5d183 100644 --- a/apps/settings/serializers/feature.py +++ b/apps/settings/serializers/feature.py @@ -77,7 +77,7 @@ class ChatAISettingSerializer(serializers.Serializer): required=False, label=_('Chat AI') ) GPT_BASE_URL = serializers.CharField( - allow_blank=True, required=False, label=_('Base URL'), + allow_blank=True, required=False, label=_('GPT Base URL'), help_text=_('The base URL of the GPT service. For example: https://api.openai.com/v1') ) GPT_API_KEY = EncryptedField( From a509afe24b08900930f02e050d974be850ca92d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Tue, 9 Jul 2024 09:32:34 +0800 Subject: [PATCH 015/137] fix: FromAsCasing keywords --- Dockerfile | 4 ++-- Dockerfile-ee | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3bedb6867..06ae03a72 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:bullseye-slim as stage-1 +FROM debian:bullseye-slim AS stage-1 ARG TARGETARCH ARG DEPENDENCIES=" \ @@ -45,7 +45,7 @@ RUN echo > /opt/jumpserver/config.yml \ sed -i "s@VERSION = .*@VERSION = '${VERSION}'@g" apps/jumpserver/const.py; \ fi -FROM python:3.11-slim-bullseye as stage-2 +FROM python:3.11-slim-bullseye AS stage-2 ARG TARGETARCH ARG BUILD_DEPENDENCIES=" \ diff --git a/Dockerfile-ee b/Dockerfile-ee index ff29dd4d2..a11bdbd33 100644 --- a/Dockerfile-ee +++ b/Dockerfile-ee @@ -1,7 +1,7 @@ ARG VERSION -FROM registry.fit2cloud.com/jumpserver/xpack:${VERSION} as build-xpack -FROM python:3.11-slim-bullseye as build-core +FROM registry.fit2cloud.com/jumpserver/xpack:${VERSION} AS build-xpack +FROM python:3.11-slim-bullseye AS build-core ARG BUILD_DEPENDENCIES=" \ g++" From b8c223d525172b369ef5284606d9224be8a1a872 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 9 Jul 2024 10:49:41 +0800 Subject: [PATCH 016/137] perf: can set xpack disable force --- apps/i18n/koko/en.json | 3 ++- apps/i18n/koko/zh.json | 3 ++- apps/jumpserver/settings/_xpack.py | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/i18n/koko/en.json b/apps/i18n/koko/en.json index c5d9cabd1..136efdb4b 100644 --- a/apps/i18n/koko/en.json +++ b/apps/i18n/koko/en.json @@ -25,6 +25,7 @@ "PauseSession": "Pause Session", "ReadOnly": "Read-Only", "Remove": "Remove", + "Confirm": "Confirm", "RemoveShareUser": "You have been removed from the shared session.", "RemoveShareUserConfirm": "Are you sure to remove the user from the shared session?", "ResumeSession": "Resume Session", @@ -49,4 +50,4 @@ "VerifyCode": "Verify Code", "WaitFileTransfer": "Wait file transfer to finish", "Writable": "Writable" -} \ No newline at end of file +} diff --git a/apps/i18n/koko/zh.json b/apps/i18n/koko/zh.json index 1db0ca567..072b524ad 100644 --- a/apps/i18n/koko/zh.json +++ b/apps/i18n/koko/zh.json @@ -6,6 +6,7 @@ "CopyShareURLSuccess": "复制分享地址成功", "CreateLink": "创建分享链接", "CreateSuccess": "创建成功", + "Confirm": "确认", "Download": "下载", "DownloadSuccess": "下载成功", "EndFileTransfer": "文件传输结束", @@ -49,4 +50,4 @@ "VerifyCode": "验证码", "WaitFileTransfer": "等待文件传输结束", "Writable": "读写" -} \ No newline at end of file +} diff --git a/apps/jumpserver/settings/_xpack.py b/apps/jumpserver/settings/_xpack.py index 6e43c7501..497e2c45d 100644 --- a/apps/jumpserver/settings/_xpack.py +++ b/apps/jumpserver/settings/_xpack.py @@ -11,7 +11,10 @@ current_year = datetime.datetime.now().year corporation = f'FIT2CLOUD 飞致云 © 2014-{current_year}' XPACK_DIR = os.path.join(const.BASE_DIR, 'xpack') -XPACK_ENABLED = os.path.isdir(XPACK_DIR) +XPACK_DISABLED = os.environ.get('XPACK_ENABLED') in ['0', 'false', 'False', 'no', 'No'] +XPACK_ENABLED = False +if not XPACK_DISABLED: + XPACK_ENABLED = os.path.isdir(XPACK_DIR) XPACK_TEMPLATES_DIR = [] XPACK_CONTEXT_PROCESSOR = [] XPACK_LICENSE_IS_VALID = False From 443e492fd4a3bf7483ed4f8c381210d066341b83 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Tue, 9 Jul 2024 10:59:56 +0800 Subject: [PATCH 017/137] perf: Asset type cloud add community version (#13640) Co-authored-by: feng <1304903146@qq.com> --- apps/assets/const/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/assets/const/types.py b/apps/assets/const/types.py index b03f22d12..edbb68d00 100644 --- a/apps/assets/const/types.py +++ b/apps/assets/const/types.py @@ -171,10 +171,10 @@ class AllTypes(ChoicesMixin): (Category.DEVICE, DeviceTypes), (Category.DATABASE, DatabaseTypes), (Category.WEB, WebTypes), + (Category.CLOUD, CloudTypes), ] if settings.XPACK_ENABLED: types.extend([ - (Category.CLOUD, CloudTypes), (Category.CUSTOM, CustomTypes), ]) return types From c56ab9bc1ea07d0e4b10fcbda7f85894c00d2631 Mon Sep 17 00:00:00 2001 From: maninhill <41712985+maninhill@users.noreply.github.com> Date: Mon, 8 Jul 2024 11:06:41 +0800 Subject: [PATCH 018/137] chore: Update README.zh-CN.md --- README.zh-CN.md | 48 ++++++++++++++++++++++-------------------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index d9e8ff444..e76610a3e 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -12,13 +12,13 @@

- 9 年时间,倾情投入,用心做好一款开源堡垒机。 + 10 年时间,倾情投入,用心做好一款开源堡垒机。

------------------------------ -JumpServer 是广受欢迎的开源堡垒机,是符合 4A 规范的专业运维安全审计系统。 +## JumpServer 是什么? -JumpServer 堡垒机帮助企业以更安全的方式管控和登录各种类型的资产,包括: +JumpServer 是广受欢迎的开源堡垒机,是符合 4A 规范的专业运维安全审计系统。JumpServer 堡垒机帮助企业以更安全的方式管控和登录各种类型的资产,包括: - **SSH**: Linux / Unix / 网络设备 等; - **Windows**: Web 方式连接 / 原生 RDP 连接; @@ -38,6 +38,13 @@ JumpServer 堡垒机帮助企业以更安全的方式管控和登录各种类型 - **多租户**: 一套系统,多个子公司或部门同时使用; - **云端存储**: 审计录像云端存储,永不丢失; +## 快速开始 + +- [快速入门](https://docs.jumpserver.org/zh/v3/quick_start/) +- [产品文档](https://docs.jumpserver.org) +- [在线学习](https://edu.fit2cloud.com/page/2635362) +- [知识库](https://kb.fit2cloud.com/categories/jumpserver) + ## UI 展示 ![UI展示](https://docs.jumpserver.org/zh/v3/img/dashboard.png) @@ -52,13 +59,6 @@ JumpServer 堡垒机帮助企业以更安全的方式管控和登录各种类型 | 请勿修改体验环境用户的密码! | | 请勿在环境中添加业务生产环境地址、用户名密码等敏感信息! | -## 快速开始 - -- [快速入门](https://docs.jumpserver.org/zh/v3/quick_start/) -- [产品文档](https://docs.jumpserver.org) -- [在线学习](https://edu.fit2cloud.com/page/2635362) -- [知识库](https://kb.fit2cloud.com/categories/jumpserver) - ## 案例研究 - [腾讯音乐娱乐集团:基于JumpServer的安全运维审计解决方案](https://blog.fit2cloud.com/?p=a04cdf0d-6704-4d18-9b40-9180baecd0e2) @@ -81,28 +81,24 @@ JumpServer 堡垒机帮助企业以更安全的方式管控和登录各种类型 您也可以到我们的 [社区论坛](https://bbs.fit2cloud.com/c/js/5) 当中进行交流沟通。 -### 参与贡献 +## 参与贡献 欢迎提交 PR 参与贡献。 参考 [CONTRIBUTING.md](https://github.com/jumpserver/jumpserver/blob/dev/CONTRIBUTING.md) ## 组件项目 -| 项目 | 状态 | 描述 | -|--------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------| -| [Lina](https://github.com/jumpserver/lina) |
Lina release | JumpServer Web UI 项目 | -| [Luna](https://github.com/jumpserver/luna) | Luna release | JumpServer Web Terminal 项目 | -| [KoKo](https://github.com/jumpserver/koko) | Koko release | JumpServer 字符协议 Connector 项目 | -| [Lion](https://github.com/jumpserver/lion-release) | Lion release | JumpServer 图形协议 Connector 项目,依赖 [Apache Guacamole](https://guacamole.apache.org/) | -| [Razor](https://github.com/jumpserver/razor) | Chen | JumpServer RDP 代理 Connector 项目 | -| [Tinker](https://github.com/jumpserver/tinker) | Tinker | JumpServer 远程应用 Connector 项目 (Windows) | -| [Panda](https://github.com/jumpserver/Panda) | Panda | JumpServer 远程应用 Connector 项目 (Linux) | -| [Magnus](https://github.com/jumpserver/magnus-release) | Magnus release | JumpServer 数据库代理 Connector 项目 | -| [Chen](https://github.com/jumpserver/chen-release) | Chen release | JumpServer Web DB 项目,替代原来的 OmniDB | -| [Kael](https://github.com/jumpserver/kael) | Kael release | JumpServer 连接 GPT 资产的组件项目 | -| [Wisp](https://github.com/jumpserver/wisp) | Magnus release | JumpServer 各系统终端组件和 Core API 通信的组件项目 | -| [Clients](https://github.com/jumpserver/clients) | Clients release | JumpServer 客户端 项目 | -| [Installer](https://github.com/jumpserver/installer) | Installer release | JumpServer 安装包 项目 | +| Project | Status | Description | +|--------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------| +| [Lina](https://github.com/jumpserver/lina) | Lina release | JumpServer Web UI | +| [Luna](https://github.com/jumpserver/luna) | Luna release | JumpServer Web Terminal | +| [KoKo](https://github.com/jumpserver/koko) | Koko release | JumpServer Character Protocol Connector | +| [Lion](https://github.com/jumpserver/lion) | Lion release | JumpServer Graphical Protocol Connector | +| [Chen](https://github.com/jumpserver/chen) | Chen release | JumpServer Web DB | +| [Razor](https://github.com/jumpserver/razor) | Chen | JumpServer EE RDP Proxy Connector | +| [Tinker](https://github.com/jumpserver/tinker) | Tinker | JumpServer EE Remote Application Connector (Windows) | +| [Panda](https://github.com/jumpserver/Panda) | Panda | JumpServer EE Remote Application Connector (Linux) | +| [Magnus](https://github.com/jumpserver/magnus) | Magnus | JumpServer EE Database Proxy Connector | ## 安全说明 JumpServer是一款安全产品,请参考 [基本安全建议](https://docs.jumpserver.org/zh/master/install/install_security/) From 75fa96b29c2fee209382fa236b30eee72cb2c809 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 9 Jul 2024 11:22:04 +0800 Subject: [PATCH 019/137] perf: remove notification migrations --- apps/i18n/core/zh/LC_MESSAGES/django.po | 2 +- .../migrations/0002_auto_20210909_1946.py | 15 ++++++++++++ .../migrations/0003_initial_admin_msg.py | 24 ------------------- 3 files changed, 16 insertions(+), 25 deletions(-) delete mode 100644 apps/notifications/migrations/0003_initial_admin_msg.py diff --git a/apps/i18n/core/zh/LC_MESSAGES/django.po b/apps/i18n/core/zh/LC_MESSAGES/django.po index 8d73aabcb..7d7615ef9 100644 --- a/apps/i18n/core/zh/LC_MESSAGES/django.po +++ b/apps/i18n/core/zh/LC_MESSAGES/django.po @@ -1551,7 +1551,7 @@ msgstr "未知" #: assets/const/automation.py:7 msgid "OK" -msgstr "" +msgstr "成功" #: assets/const/automation.py:12 msgid "Ping" diff --git a/apps/notifications/migrations/0002_auto_20210909_1946.py b/apps/notifications/migrations/0002_auto_20210909_1946.py index 6145b3471..04fc6f14a 100644 --- a/apps/notifications/migrations/0002_auto_20210909_1946.py +++ b/apps/notifications/migrations/0002_auto_20210909_1946.py @@ -6,6 +6,20 @@ from django.db import migrations, models import django.db.models.deletion +def init_user_msg_subscription(apps, schema_editor): + User = apps.get_model('users', 'User') + UserMsgSubscription = apps.get_model('notifications', 'UserMsgSubscription') + + receive_backends = ['site_msg', 'email'] + user = User.objects.filter(username='admin').first() + if not user: + return + UserMsgSubscription.objects.update_or_create( + defaults={'receive_backends': receive_backends}, user=user + ) + + + class Migration(migrations.Migration): initial = True @@ -57,4 +71,5 @@ class Migration(migrations.Migration): name='users', field=models.ManyToManyField(related_name='recv_site_messages', through='notifications.SiteMessage', to=settings.AUTH_USER_MODEL), ), + migrations.RunPython(init_user_msg_subscription) ] diff --git a/apps/notifications/migrations/0003_initial_admin_msg.py b/apps/notifications/migrations/0003_initial_admin_msg.py deleted file mode 100644 index 5a5a55e16..000000000 --- a/apps/notifications/migrations/0003_initial_admin_msg.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 4.1.13 on 2024-05-21 11:04 - -from django.db import migrations - - -def init_user_msg_subscription(apps, schema_editor): - User = apps.get_model('users', 'User') - UserMsgSubscription = apps.get_model('notifications', 'UserMsgSubscription') - - receive_backends = ['site_msg', 'email'] - user = User.objects.get(username='admin') - UserMsgSubscription.objects.update_or_create( - defaults={'receive_backends': receive_backends}, user=user - ) - - -class Migration(migrations.Migration): - dependencies = [ - ('notifications', '0002_auto_20210909_1946'), - ] - - operations = [ - migrations.RunPython(init_user_msg_subscription), - ] From 2f7391efc381eec42409de224bf36a6c6062649e Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Tue, 9 Jul 2024 11:34:51 +0800 Subject: [PATCH 020/137] perf: modify migrations --- apps/accounts/migrations/0001_initial.py | 73 +++++++++++++++++------- apps/rbac/migrations/0001_initial.py | 21 +++++-- 2 files changed, 68 insertions(+), 26 deletions(-) diff --git a/apps/accounts/migrations/0001_initial.py b/apps/accounts/migrations/0001_initial.py index c1bf3bd13..dbecc94d0 100644 --- a/apps/accounts/migrations/0001_initial.py +++ b/apps/accounts/migrations/0001_initial.py @@ -10,7 +10,6 @@ import common.db.fields class Migration(migrations.Migration): - initial = True dependencies = [ @@ -26,13 +25,19 @@ class Migration(migrations.Migration): ('date_updated', models.DateTimeField(auto_now=True, verbose_name='Date updated')), ('comment', models.TextField(blank=True, default='', verbose_name='Comment')), ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)), - ('org_id', models.CharField(blank=True, db_index=True, default='', max_length=36, verbose_name='Organization')), - ('connectivity', models.CharField(choices=[('-', 'Unknown'), ('ok', 'OK'), ('err', 'Error')], default='-', max_length=16, verbose_name='Connectivity')), + ('org_id', + models.CharField(blank=True, db_index=True, default='', max_length=36, verbose_name='Organization')), + ('connectivity', + models.CharField(choices=[('-', 'Unknown'), ('ok', 'OK'), ('err', 'Error')], default='-', + max_length=16, verbose_name='Connectivity')), ('date_verified', models.DateTimeField(null=True, verbose_name='Date verified')), ('_secret', common.db.fields.EncryptTextField(blank=True, null=True, verbose_name='Secret')), ('name', models.CharField(max_length=128, verbose_name='Name')), ('username', models.CharField(blank=True, db_index=True, max_length=128, verbose_name='Username')), - ('secret_type', models.CharField(choices=[('password', 'Password'), ('ssh_key', 'SSH key'), ('access_key', 'Access key'), ('token', 'Token'), ('api_key', 'API key')], default='password', max_length=16, verbose_name='Secret type')), + ('secret_type', models.CharField( + choices=[('password', 'Password'), ('ssh_key', 'SSH key'), ('access_key', 'Access key'), + ('token', 'Token'), ('api_key', 'API key')], default='password', max_length=16, + verbose_name='Secret type')), ('privileged', models.BooleanField(default=False, verbose_name='Privileged')), ('is_active', models.BooleanField(default=True, verbose_name='Is active')), ('version', models.IntegerField(default=0, verbose_name='Version')), @@ -41,7 +46,11 @@ class Migration(migrations.Migration): ], options={ 'verbose_name': 'Account', - 'permissions': [('view_accountsecret', 'Can view asset account secret'), ('view_historyaccount', 'Can view asset history account'), ('view_historyaccountsecret', 'Can view asset history account secret'), ('verify_account', 'Can verify account'), ('push_account', 'Can push account'), ('remove_account', 'Can remove account')], + 'permissions': [('view_accountsecret', 'Can view asset account secret'), + ('view_historyaccount', 'Can view asset history account'), + ('view_historyaccountsecret', 'Can view asset history account secret'), + ('verify_account', 'Can verify account'), ('push_account', 'Can push account'), + ('remove_account', 'Can remove account')], }, ), migrations.CreateModel( @@ -53,16 +62,21 @@ class Migration(migrations.Migration): ('date_updated', models.DateTimeField(auto_now=True, verbose_name='Date updated')), ('comment', models.TextField(blank=True, default='', verbose_name='Comment')), ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)), - ('org_id', models.CharField(blank=True, db_index=True, default='', max_length=36, verbose_name='Organization')), + ('org_id', + models.CharField(blank=True, db_index=True, default='', max_length=36, verbose_name='Organization')), ('name', models.CharField(max_length=128, verbose_name='Name')), ('is_periodic', models.BooleanField(default=False, verbose_name='Periodic run')), ('interval', models.IntegerField(blank=True, default=24, null=True, verbose_name='Interval')), ('crontab', models.CharField(blank=True, max_length=128, null=True, verbose_name='Crontab')), ('types', models.JSONField(default=list)), - ('backup_type', models.CharField(choices=[('email', 'Email'), ('object_storage', 'SFTP')], default='email', max_length=128, verbose_name='Backup type')), + ('backup_type', + models.CharField(choices=[('email', 'Email'), ('object_storage', 'SFTP')], default='email', + max_length=128, verbose_name='Backup type')), ('is_password_divided_by_email', models.BooleanField(default=True, verbose_name='Password divided')), - ('is_password_divided_by_obj_storage', models.BooleanField(default=True, verbose_name='Password divided')), - ('zip_encrypt_password', common.db.fields.EncryptCharField(blank=True, max_length=4096, null=True, verbose_name='Zip encrypt password')), + ('is_password_divided_by_obj_storage', + models.BooleanField(default=True, verbose_name='Password divided')), + ('zip_encrypt_password', common.db.fields.EncryptCharField(blank=True, max_length=4096, null=True, + verbose_name='Zip encrypt password')), ], options={ 'verbose_name': 'Account backup plan', @@ -72,12 +86,16 @@ class Migration(migrations.Migration): migrations.CreateModel( name='AccountBackupExecution', fields=[ - ('org_id', models.CharField(blank=True, db_index=True, default='', max_length=36, verbose_name='Organization')), + ('org_id', + models.CharField(blank=True, db_index=True, default='', max_length=36, verbose_name='Organization')), ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)), ('date_start', models.DateTimeField(auto_now_add=True, verbose_name='Date start')), ('timedelta', models.FloatField(default=0.0, null=True, verbose_name='Time')), - ('snapshot', models.JSONField(blank=True, default=dict, encoder=common.db.encoder.ModelJSONFieldEncoder, null=True, verbose_name='Account backup snapshot')), - ('trigger', models.CharField(choices=[('manual', 'Manual trigger'), ('timing', 'Timing trigger')], default='manual', max_length=128, verbose_name='Trigger mode')), + ('snapshot', + models.JSONField(blank=True, default=dict, encoder=common.db.encoder.ModelJSONFieldEncoder, null=True, + verbose_name='Account backup snapshot')), + ('trigger', models.CharField(choices=[('manual', 'Manual trigger'), ('timing', 'Timing trigger')], + default='manual', max_length=128, verbose_name='Trigger mode')), ('reason', models.CharField(blank=True, max_length=1024, null=True, verbose_name='Reason')), ('is_success', models.BooleanField(default=False, verbose_name='Is success')), ], @@ -95,13 +113,19 @@ class Migration(migrations.Migration): ('date_updated', models.DateTimeField(auto_now=True, verbose_name='Date updated')), ('comment', models.TextField(blank=True, default='', verbose_name='Comment')), ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)), - ('org_id', models.CharField(blank=True, db_index=True, default='', max_length=36, verbose_name='Organization')), + ('org_id', + models.CharField(blank=True, db_index=True, default='', max_length=36, verbose_name='Organization')), ('_secret', common.db.fields.EncryptTextField(blank=True, null=True, verbose_name='Secret')), - ('secret_strategy', models.CharField(choices=[('specific', 'Specific secret'), ('random', 'Random generate')], default='specific', max_length=16, verbose_name='Secret strategy')), + ('secret_strategy', + models.CharField(choices=[('specific', 'Specific secret'), ('random', 'Random generate')], + default='specific', max_length=16, verbose_name='Secret strategy')), ('password_rules', models.JSONField(default=dict, verbose_name='Password rules')), ('name', models.CharField(max_length=128, verbose_name='Name')), ('username', models.CharField(blank=True, db_index=True, max_length=128, verbose_name='Username')), - ('secret_type', models.CharField(choices=[('password', 'Password'), ('ssh_key', 'SSH key'), ('access_key', 'Access key'), ('token', 'Token'), ('api_key', 'API key')], default='password', max_length=16, verbose_name='Secret type')), + ('secret_type', models.CharField( + choices=[('password', 'Password'), ('ssh_key', 'SSH key'), ('access_key', 'Access key'), + ('token', 'Token'), ('api_key', 'API key')], default='password', max_length=16, + verbose_name='Secret type')), ('privileged', models.BooleanField(default=False, verbose_name='Privileged')), ('is_active', models.BooleanField(default=True, verbose_name='Is active')), ('auto_push', models.BooleanField(default=False, verbose_name='Auto push')), @@ -142,7 +166,8 @@ class Migration(migrations.Migration): ('date_updated', models.DateTimeField(auto_now=True, verbose_name='Date updated')), ('comment', models.TextField(blank=True, default='', verbose_name='Comment')), ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)), - ('org_id', models.CharField(blank=True, db_index=True, default='', max_length=36, verbose_name='Organization')), + ('org_id', + models.CharField(blank=True, db_index=True, default='', max_length=36, verbose_name='Organization')), ('present', models.BooleanField(default=True, verbose_name='Present')), ('date_last_login', models.DateTimeField(null=True, verbose_name='Date login')), ('username', models.CharField(blank=True, db_index=True, max_length=32, verbose_name='Username')), @@ -158,12 +183,16 @@ class Migration(migrations.Migration): fields=[ ('id', models.UUIDField(db_index=True, default=uuid.uuid4)), ('_secret', common.db.fields.EncryptTextField(blank=True, null=True, verbose_name='Secret')), - ('secret_type', models.CharField(choices=[('password', 'Password'), ('ssh_key', 'SSH key'), ('access_key', 'Access key'), ('token', 'Token'), ('api_key', 'API key')], default='password', max_length=16, verbose_name='Secret type')), + ('secret_type', models.CharField( + choices=[('password', 'Password'), ('ssh_key', 'SSH key'), ('access_key', 'Access key'), + ('token', 'Token'), ('api_key', 'API key')], default='password', max_length=16, + verbose_name='Secret type')), ('version', models.IntegerField(default=0, verbose_name='Version')), ('history_id', models.AutoField(primary_key=True, serialize=False)), ('history_date', models.DateTimeField(db_index=True)), ('history_change_reason', models.CharField(max_length=100, null=True)), - ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), + ('history_type', + models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), ], options={ 'verbose_name': 'historical Account', @@ -181,9 +210,13 @@ class Migration(migrations.Migration): ('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)), - ('org_id', models.CharField(blank=True, db_index=True, default='', max_length=36, verbose_name='Organization')), - ('alias', models.CharField(choices=[('@INPUT', 'Manual input'), ('@USER', 'Dynamic user'), ('@ANON', 'Anonymous account'), ('@SPEC', 'Specified account')], max_length=128, verbose_name='Alias')), + ('org_id', + models.CharField(blank=True, db_index=True, default='', max_length=36, verbose_name='Organization')), + ('alias', models.CharField( + choices=[('@INPUT', 'Manual input'), ('@USER', 'Dynamic user'), ('@ANON', 'Anonymous account'), + ('@SPEC', 'Specified account')], max_length=128, verbose_name='Alias')), ('secret_from_login', models.BooleanField(default=None, null=True, verbose_name='Secret from login')), ], + options={'verbose_name': 'Virtual account'}, ), ] diff --git a/apps/rbac/migrations/0001_initial.py b/apps/rbac/migrations/0001_initial.py index 9e56fda5f..d6724868b 100644 --- a/apps/rbac/migrations/0001_initial.py +++ b/apps/rbac/migrations/0001_initial.py @@ -8,7 +8,6 @@ import uuid class Migration(migrations.Migration): - initial = True dependencies = [ @@ -25,7 +24,11 @@ class Migration(migrations.Migration): ], options={ 'verbose_name': 'Menu permission', - 'permissions': [('view_console', 'Can view console view'), ('view_audit', 'Can view audit view'), ('view_workbench', 'Can view workbench view'), ('view_webterminal', 'Can view web terminal'), ('view_filemanager', 'Can view file manager'), ('view_systemtools', 'Can view System Tools')], + 'permissions': [('view_console', 'Can view console view'), ('view_audit', 'Can view audit view'), + ('view_workbench', 'Can view workbench view'), + ('view_webterminal', 'Can view web terminal'), + ('view_filemanager', 'Can view file manager'), + ('view_systemtools', 'Can view System Tools')], 'default_permissions': [], }, ), @@ -38,7 +41,8 @@ class Migration(migrations.Migration): ('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, verbose_name='Name')), - ('scope', models.CharField(choices=[('system', 'System'), ('org', 'Organization')], default='system', max_length=128, verbose_name='Scope')), + ('scope', models.CharField(choices=[('system', 'System'), ('org', 'Organization')], default='system', + max_length=128, verbose_name='Scope')), ('builtin', models.BooleanField(default=False, verbose_name='Builtin')), ('comment', models.TextField(blank=True, default='', max_length=128, verbose_name='Comment')), ], @@ -54,6 +58,7 @@ class Migration(migrations.Migration): 'proxy': True, 'indexes': [], 'constraints': [], + 'verbose_name': 'ContentType' }, bases=('contenttypes.contenttype',), managers=[ @@ -84,9 +89,13 @@ class Migration(migrations.Migration): ('date_updated', models.DateTimeField(auto_now=True, verbose_name='Date updated')), ('comment', models.TextField(blank=True, default='', verbose_name='Comment')), ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)), - ('scope', models.CharField(choices=[('system', 'System'), ('org', 'Organization')], default='system', max_length=128, verbose_name='Scope')), - ('org', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='role_bindings', to='orgs.organization', verbose_name='Organization')), - ('role', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='role_bindings', to='rbac.role', verbose_name='Role')), + ('scope', models.CharField(choices=[('system', 'System'), ('org', 'Organization')], default='system', + max_length=128, verbose_name='Scope')), + ('org', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, + related_name='role_bindings', to='orgs.organization', + verbose_name='Organization')), + ('role', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='role_bindings', + to='rbac.role', verbose_name='Role')), ], options={ 'verbose_name': 'Role binding', From d14d8869acedc2231dbafb63073b3bc512b8f615 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 5 Jul 2024 17:33:01 +0800 Subject: [PATCH 021/137] perf: add connection options for mongodb --- apps/assets/const/protocol.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/assets/const/protocol.py b/apps/assets/const/protocol.py index 474570bab..4d5c2f097 100644 --- a/apps/assets/const/protocol.py +++ b/apps/assets/const/protocol.py @@ -208,6 +208,12 @@ class Protocol(ChoicesMixin, models.TextChoices): 'default': 'admin', 'label': _('Auth source'), 'help_text': _('The database to authenticate against') + }, + 'connection_options': { + 'type': 'str', + 'default': '', + 'label': _('Connection options'), + 'help_text': _('The connection specific options eg. retryWrites=false&retryReads=false') } } }, From ba8d3be9a6e4af1fcd9d18b3b08d5b6098d00da4 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Tue, 9 Jul 2024 14:52:00 +0800 Subject: [PATCH 022/137] fix: Operatelog plaintext storage AKSK (#13506) * fix: Operatelog plaintext storage AKSK * perf: Encrypt some field when saving operatelog * fix: Operatelog plaintext storage AKSK --------- Co-authored-by: jiangweidong <1053570670@qq.com> --- apps/audits/handler.py | 20 +++++++++++++++----- apps/audits/utils.py | 8 ++++++-- apps/common/db/fields.py | 5 ----- apps/common/local.py | 16 ++++++---------- apps/common/serializers/fields.py | 3 --- 5 files changed, 27 insertions(+), 25 deletions(-) diff --git a/apps/audits/handler.py b/apps/audits/handler.py index debe0a068..770ac9661 100644 --- a/apps/audits/handler.py +++ b/apps/audits/handler.py @@ -5,7 +5,7 @@ from django.core.cache import cache from django.db import transaction from django.utils.translation import gettext_lazy as _ -from common.local import encrypted_field_set +from common.local import similar_encrypted_pattern, exclude_encrypted_fields from common.utils import get_request_ip, get_logger from common.utils.encode import Singleton from common.utils.timezone import as_current_tz @@ -109,19 +109,29 @@ class OperatorLogHandler(metaclass=Singleton): return ','.join(value) return json.dumps(value) + @staticmethod + def __similar_check(key): + if not key or key in exclude_encrypted_fields: + return False + + return bool(similar_encrypted_pattern.search(key)) + def __data_processing(self, dict_item, loop=True): encrypt_value = '******' - for key, value in dict_item.items(): + new_data = {} + for label, item in dict_item.items(): + value = item.get('value', '') + field_name = item.get('name', '') if isinstance(value, bool): value = _('Yes') if value else _('No') elif isinstance(value, (list, tuple)): value = self.serialized_value(value) elif isinstance(value, dict) and loop: self.__data_processing(value, loop=False) - if key in encrypted_field_set: + if self.__similar_check(field_name): value = encrypt_value - dict_item[key] = value - return dict_item + new_data[label] = value + return new_data def data_processing(self, before, after): if before: diff --git a/apps/audits/utils.py b/apps/audits/utils.py index 1b1e4b8e6..3618978a2 100644 --- a/apps/audits/utils.py +++ b/apps/audits/utils.py @@ -82,7 +82,9 @@ def _get_instance_field_value( elif isinstance(f, GenericForeignKey): continue try: - data.setdefault(str(f.verbose_name), value) + data.setdefault( + str(f.verbose_name), {'name': getattr(f, 'column', ''), 'value': value} + ) except Exception as e: print(f.__dict__) raise e @@ -106,7 +108,9 @@ def model_to_dict_for_operate_log( return try: field_key = getattr(f, 'verbose_name', None) or f.related_model._meta.verbose_name - data.setdefault(str(field_key), value) + data.setdefault( + str(field_key), {'name': getattr(f, 'column', ''), 'value': value} + ) except: pass diff --git a/apps/common/db/fields.py b/apps/common/db/fields.py index f5b1e4b83..0bbe08f18 100644 --- a/apps/common/db/fields.py +++ b/apps/common/db/fields.py @@ -14,7 +14,6 @@ from django.db.models import Q, Manager, QuerySet from django.utils.translation import gettext_lazy as _ from rest_framework.utils.encoders import JSONEncoder -from common.local import add_encrypted_field_set from common.utils import contains_ip from .utils import Encryptor from .validators import PortRangeValidator @@ -168,7 +167,6 @@ class EncryptTextField(EncryptMixin, models.TextField): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - add_encrypted_field_set(self.verbose_name) class EncryptCharField(EncryptMixin, models.CharField): @@ -184,7 +182,6 @@ class EncryptCharField(EncryptMixin, models.CharField): def __init__(self, *args, **kwargs): self.change_max_length(kwargs) super().__init__(*args, **kwargs) - add_encrypted_field_set(self.verbose_name) def deconstruct(self): name, path, args, kwargs = super().deconstruct() @@ -198,13 +195,11 @@ class EncryptCharField(EncryptMixin, models.CharField): class EncryptJsonDictTextField(EncryptMixin, JsonDictTextField): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - add_encrypted_field_set(self.verbose_name) class EncryptJsonDictCharField(EncryptMixin, JsonDictCharField): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - add_encrypted_field_set(self.verbose_name) class PortField(models.IntegerField): diff --git a/apps/common/local.py b/apps/common/local.py index f5fd01f19..1dc16ad12 100644 --- a/apps/common/local.py +++ b/apps/common/local.py @@ -1,18 +1,14 @@ -from werkzeug.local import Local +import re -from django.utils import translation +from werkzeug.local import Local thread_local = Local() -encrypted_field_set = {'password', 'secret'} +exclude_encrypted_fields = ('secret_type', 'secret_strategy', 'password_rules') +similar_encrypted_pattern = re.compile( + 'password|secret|token|passphrase|private|key|cert', re.IGNORECASE +) def _find(attr): return getattr(thread_local, attr, None) - - -def add_encrypted_field_set(label): - return - if label: - with translation.override('en'): - encrypted_field_set.add(str(label)) diff --git a/apps/common/serializers/fields.py b/apps/common/serializers/fields.py index e53faeb9d..dfe9191df 100644 --- a/apps/common/serializers/fields.py +++ b/apps/common/serializers/fields.py @@ -8,7 +8,6 @@ from rest_framework import serializers from rest_framework.fields import ChoiceField, empty from common.db.fields import TreeChoices, JSONManyToManyField as ModelJSONManyToManyField -from common.local import add_encrypted_field_set from common.utils import decrypt_password __all__ = [ @@ -47,9 +46,7 @@ class EncryptedField(serializers.CharField): if write_only is None: write_only = True kwargs["write_only"] = write_only - encrypted_key = kwargs.pop('encrypted_key', None) super().__init__(**kwargs) - add_encrypted_field_set(encrypted_key or self.label) def to_internal_value(self, value): value = super().to_internal_value(value) From afe7f03c1622e32f2a4e98612e2bea6f9bdee7c7 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Tue, 9 Jul 2024 15:02:37 +0800 Subject: [PATCH 023/137] perf: login style change (#13539) * perf: login style change * perf: login style change * perf: login style change --------- Co-authored-by: zhaojisen <1301338853@qq.com> --- .../templates/authentication/login.html | 63 ++++++++++++++---- apps/static/img/logo_text_green.png | Bin 3703 -> 0 bytes apps/templates/_foot_js.html | 7 ++ 3 files changed, 58 insertions(+), 12 deletions(-) delete mode 100644 apps/static/img/logo_text_green.png diff --git a/apps/authentication/templates/authentication/login.html b/apps/authentication/templates/authentication/login.html index fac9974ce..47bc3fb8b 100644 --- a/apps/authentication/templates/authentication/login.html +++ b/apps/authentication/templates/authentication/login.html @@ -69,16 +69,21 @@ } .login-content { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); height: 500px; width: 1000px; - margin-right: auto; - margin-left: auto; - margin-top: calc((100vh - 470px) / 3); } + body { + position: relative; + width: 100vw; + height: 100vh; background-color: #f3f3f3; - height: calc(100vh - (100vh - 470px) / 3); + {#height: calc(100vh - (100vh - 470px) / 3);#} } .captcha { @@ -99,6 +104,27 @@ border-right: 1px solid #EFF0F1; } + .left-form-box .form-panel { + position: relative; + top: 50%; + transform: translateY(-50%); + } + + .left-form-box .form-panel { + position: relative; + top: 50%; + transform: translateY(-50%); + } + + .left-form-box .form-panel .form-mobile { + padding: 15px 60px; + text-align: left + } + + .left-form-box .form-panel .form-mobile h2 { + display: inline + } + .red-fonts { color: red; } @@ -112,11 +138,11 @@ } .jms-title { - padding: 22px 10px 10px; + {#padding: 22px 10px 10px;#} } .more-login-items { - margin-top: 10px; + margin-top: 15px; } .more-login-item { @@ -153,6 +179,9 @@ } .jms-title { + display: flex; + justify-content: center; + align-items: center; font-size: 21px; font-weight: 400; color: #151515; @@ -252,7 +281,7 @@ .mobile-logo { display: block; - padding: 0 30px; + padding: 0 45px; text-align: left; } @@ -260,6 +289,15 @@ height: revert; width: revert; } + + .left-form-box .form-panel { + transform: translateY(-65%); + } + + .left-form-box .form-panel .form-mobile h2 { + padding: 0; + margin: 0; + } } @@ -279,14 +317,15 @@
-