mirror of https://github.com/jumpserver/jumpserver
commit
a82ed3e924
18
Dockerfile
18
Dockerfile
|
@ -29,24 +29,22 @@ ARG TOOLS=" \
|
||||||
redis-tools \
|
redis-tools \
|
||||||
telnet \
|
telnet \
|
||||||
vim \
|
vim \
|
||||||
unzip \
|
unzip \
|
||||||
wget"
|
wget"
|
||||||
|
|
||||||
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list \
|
RUN sed -i 's@http://.*.debian.org@http://mirrors.ustc.edu.cn@g' /etc/apt/sources.list \
|
||||||
&& sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list \
|
&& apt-get update \
|
||||||
&& apt update && sleep 1 && apt update \
|
&& apt-get -y install --no-install-recommends ${BUILD_DEPENDENCIES} \
|
||||||
&& apt -y install ${BUILD_DEPENDENCIES} \
|
&& apt-get -y install --no-install-recommends ${DEPENDENCIES} \
|
||||||
&& apt -y install ${DEPENDENCIES} \
|
&& apt-get -y install --no-install-recommends ${TOOLS} \
|
||||||
&& apt -y install ${TOOLS} \
|
|
||||||
&& localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8 \
|
&& localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8 \
|
||||||
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||||
&& mkdir -p /root/.ssh/ \
|
&& mkdir -p /root/.ssh/ \
|
||||||
&& echo "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile /dev/null" > /root/.ssh/config \
|
&& echo "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile /dev/null" > /root/.ssh/config \
|
||||||
&& sed -i "s@# alias l@alias l@g" ~/.bashrc \
|
&& sed -i "s@# alias l@alias l@g" ~/.bashrc \
|
||||||
&& echo "set mouse-=a" > ~/.vimrc \
|
&& echo "set mouse-=a" > ~/.vimrc \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& echo "no" | dpkg-reconfigure dash \
|
||||||
&& mv /bin/sh /bin/sh.bak \
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
&& ln -s /bin/bash /bin/sh
|
|
||||||
|
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ARG ORACLE_LIB_MAJOR=19
|
ARG ORACLE_LIB_MAJOR=19
|
||||||
|
|
|
@ -147,6 +147,9 @@ def _clear_users_from_org(org, users):
|
||||||
@receiver(post_save, sender=User)
|
@receiver(post_save, sender=User)
|
||||||
@on_transaction_commit
|
@on_transaction_commit
|
||||||
def on_user_created_set_default_org(sender, instance, created, **kwargs):
|
def on_user_created_set_default_org(sender, instance, created, **kwargs):
|
||||||
|
if not instance.id:
|
||||||
|
# 用户已被手动删除,instance.orgs 时会使用 id 进行查找报错,所以判断不存在id时不做处理
|
||||||
|
return
|
||||||
if not created:
|
if not created:
|
||||||
return
|
return
|
||||||
if instance.orgs.count() > 0:
|
if instance.orgs.count() > 0:
|
||||||
|
|
Loading…
Reference in New Issue