From fd54cbc7772dfae66fdf7315a6cca07c2bbef4a4 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 15 Nov 2022 19:23:44 +0800 Subject: [PATCH 1/3] fix: action choices --- apps/perms/const.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/perms/const.py b/apps/perms/const.py index 3c8f9ee21..9a7fdb3aa 100644 --- a/apps/perms/const.py +++ b/apps/perms/const.py @@ -10,11 +10,11 @@ __all__ = ["SpecialAccount", "ActionChoices"] class ActionChoices(BitChoices): - connect = bit(1), _("Connect") - upload = bit(2), _("Upload") - download = bit(3), _("Download") - copy = bit(4), _("Copy") - paste = bit(5), _("Paste") + connect = bit(0), _("Connect") + upload = bit(1), _("Upload") + download = bit(2), _("Download") + copy = bit(3), _("Copy") + paste = bit(4), _("Paste") @classmethod def is_tree(cls): @@ -23,6 +23,7 @@ class ActionChoices(BitChoices): @classmethod def branches(cls): return ( + cls.connect, (_("Transfer"), [cls.upload, cls.download]), (_("Clipboard"), [cls.copy, cls.paste]), ) From e220b8174d1255e435256c48d711aed08e719452 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, 15 Nov 2022 22:18:15 +0800 Subject: [PATCH 2/3] =?UTF-8?q?perf:=20=E9=85=8D=E7=BD=AE=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index b228185bc..6d5affc2f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,18 +61,15 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core \ && echo "zh_CN.UTF-8" | dpkg-reconfigure locales \ && rm -rf /var/lib/apt/lists/* -ARG ORACLE_LIB_MAJOR=19 -ARG ORACLE_LIB_MINOR=10 -ENV ORACLE_FILE="instantclient-basiclite-linux.${TARGETARCH:-amd64}-${ORACLE_LIB_MAJOR}.${ORACLE_LIB_MINOR}.0.0.0dbru.zip" +ARG DOWNLOAD_URL=https://download.jumpserver.org RUN mkdir -p /opt/oracle/ \ && cd /opt/oracle/ \ - && wget https://download.jumpserver.org/files/oracle/${ORACLE_FILE} \ - && unzip instantclient-basiclite-linux.${TARGETARCH-amd64}-19.10.0.0.0dbru.zip \ - && mv instantclient_${ORACLE_LIB_MAJOR}_${ORACLE_LIB_MINOR} instantclient \ - && echo "/opt/oracle/instantclient" > /etc/ld.so.conf.d/oracle-instantclient.conf \ + && wget ${DOWNLOAD_URL}/public/instantclient-basiclite-linux.${TARGETARCH}-19.10.0.0.0.zip \ + && unzip instantclient-basiclite-linux.${TARGETARCH}-19.10.0.0.0.zip \ + && sh -c "echo /opt/oracle/instantclient_19_10 > /etc/ld.so.conf.d/oracle-instantclient.conf" \ && ldconfig \ - && rm -f ${ORACLE_FILE} + && rm -f instantclient-basiclite-linux.${TARGETARCH}-19.10.0.0.0.zip WORKDIR /tmp/build COPY ./requirements ./requirements From e8fb6d538001122d4eb243cd2beda0f1ee884029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Wed, 16 Nov 2022 08:58:16 +0800 Subject: [PATCH 3/3] =?UTF-8?q?perf:=20=E9=85=8D=E7=BD=AE=20apt=20?= =?UTF-8?q?=E9=95=9C=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6d5affc2f..2f65985b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,8 +45,10 @@ ARG TOOLS=" \ unzip \ wget" +ARG APT_MIRROR=http://mirrors.ustc.edu.cn + RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core \ - sed -i 's@http://.*.debian.org@http://mirrors.ustc.edu.cn@g' /etc/apt/sources.list \ + sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list \ && rm -f /etc/apt/apt.conf.d/docker-clean \ && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ && apt-get update \