Compare commits

...

7 Commits
dev ... v3.9.1

Author SHA1 Message Date
fit2bot
2b0292ffa0 feat: Update v3.9.1 2023-11-17 15:50:20 +08:00
ibuler
a92023840a fix: 修复自动禁用非活跃用户任务 2023-11-17 15:41:12 +08:00
Aaron3S
2d1bf866fa fix: 删除debug信息 2023-11-17 11:34:58 +08:00
吴小白
c606c3eb21 perf: 优化 Dockerfile 2023-11-17 10:38:41 +08:00
老广
dabbb45f6e Merge pull request #12144 from jumpserver/dev
v3.9.0
2023-11-16 18:23:05 +08:00
Bryan
ce24c1c3fd Merge pull request #11914 from jumpserver/dev
v3.8.0
2023-10-19 03:37:39 -05:00
Bryan
3c54c82ce9 Merge pull request #11636 from jumpserver/dev
v3.7.0
2023-09-21 17:02:48 +08:00
5 changed files with 12 additions and 12 deletions

View File

@@ -44,8 +44,8 @@ ARG TOOLS=" \
wget"
ARG APT_MIRROR=http://mirrors.ustc.edu.cn
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core \
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=core \
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core-apt \
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=core-apt \
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 \
@@ -63,9 +63,9 @@ RUN --mount=type=cache,target=/root/.cache \
--mount=type=bind,source=pyproject.toml,target=/opt/jumpserver/pyproject.toml \
set -ex \
&& python3 -m venv /opt/py3 \
&& . /opt/py3/bin/activate \
&& pip install poetry -i ${PIP_MIRROR} \
&& poetry config virtualenvs.create false \
&& . /opt/py3/bin/activate \
&& poetry install
FROM python:3.11-slim-bullseye
@@ -75,8 +75,8 @@ ENV LANG=zh_CN.UTF-8 \
ARG DEPENDENCIES=" \
libjpeg-dev \
libxmlsec1-openssl \
libx11-dev"
libx11-dev \
libxmlsec1-openssl"
ARG TOOLS=" \
ca-certificates \
@@ -94,8 +94,8 @@ ARG TOOLS=" \
wget"
ARG APT_MIRROR=http://mirrors.ustc.edu.cn
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core \
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=core \
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core-apt \
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=core-apt \
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 \
@@ -118,7 +118,6 @@ ARG VERSION
ENV VERSION=$VERSION
VOLUME /opt/jumpserver/data
VOLUME /opt/jumpserver/logs
EXPOSE 8080

1
GITSHA Normal file
View File

@@ -0,0 +1 @@
a92023840a13ac81abf21d0291cba2aaee23943b

View File

@@ -8,7 +8,7 @@ __all__ = ['BASE_DIR', 'PROJECT_DIR', 'VERSION', 'CONFIG']
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_DIR = os.path.dirname(BASE_DIR)
VERSION = '2.0.0'
VERSION = 'v3.9.1'
CONFIG = ConfigManager.load_user_config()

View File

@@ -320,7 +320,6 @@ class JobExecution(JMSOrgBaseModel):
"login_password={{login_password}} " \
"login_port={{login_port}} " \
"%s={{login_db}}" % login_db_token
print(login_args)
shell = "{} {}=\"{}\" ".format(login_args, query_token, self.current_job.args)
return module, shell

View File

@@ -88,8 +88,8 @@ def check_unused_users():
uncommon_users_ttl = settings.SECURITY_UNCOMMON_USERS_TTL
seconds_to_subtract = uncommon_users_ttl * 24 * 60 * 60
t = timezone.now() - timedelta(seconds=seconds_to_subtract)
last_login_q = Q(last_login__lte=t) | Q(last_login__isnull=True)
api_key_q = Q(date_api_key_last_used__lte=t) | Q(date_api_key_last_used__isnull=True)
last_login_q = Q(last_login__lte=t) | (Q(last_login__isnull=True) & Q(date_joined__lte=t))
api_key_q = Q(date_api_key_last_used__lte=t) | (Q(date_api_key_last_used__isnull=True) & Q(date_joined__lte=t))
users = User.objects \
.filter(date_joined__lt=t) \
@@ -99,6 +99,7 @@ def check_unused_users():
if not users:
return
print("Some users are not used for a long time, and they will be disabled.")
resource_ids = []
for user in users: