From ec393c1440158905ab8facf701a4196fd9a27b08 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 20 Apr 2021 11:27:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(task):=20=E4=BF=AE=E5=A4=8D=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E8=BF=87=E6=9C=9F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/tasks/push_system_user.py | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/assets/tasks/push_system_user.py b/apps/assets/tasks/push_system_user.py index b56cfcdd8..f640e03a1 100644 --- a/apps/assets/tasks/push_system_user.py +++ b/apps/assets/tasks/push_system_user.py @@ -56,6 +56,7 @@ def get_push_unixlike_system_user_tasks(system_user, username=None): 'shell': system_user.shell or Empty, 'state': 'present', 'home': system_user.home or Empty, + 'expires': -1, 'groups': groups or Empty, 'comment': comment } From 4563743f00e125459ca59292d0515918b859e68e Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 20 Apr 2021 16:17:18 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?rdp=E6=96=87=E4=BB=B6=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/authentication/api/connection_token.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/authentication/api/connection_token.py b/apps/authentication/api/connection_token.py index ae9e4a2de..5da2f587a 100644 --- a/apps/authentication/api/connection_token.py +++ b/apps/authentication/api/connection_token.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- # +import urllib.parse + from django.conf import settings from django.core.cache import cache from django.shortcuts import get_object_or_404 @@ -148,7 +150,8 @@ class UserConnectionTokenViewSet(RootOrgViewMixin, SerializerMixin2, GenericView data += f'{k}:{v}\n' response = HttpResponse(data, content_type='text/plain') filename = "{}-{}-jumpserver.rdp".format(user.username, asset.hostname) - response['Content-Disposition'] = 'attachment; filename={}'.format(filename) + filename = urllib.parse.quote(filename) + response['Content-Disposition'] = 'attachment; filename*=UTF-8\'\'%s' % filename return response @staticmethod