build: sandbox权限限制禁止向/tmp写入

This commit is contained in:
CaptainB 2024-09-26 16:17:19 +08:00 committed by 刘瑞斌
parent 677ce46b49
commit 2653c75f21

View File

@ -62,7 +62,7 @@ RUN chmod 755 /opt/maxkb/app/installer/run-maxkb.sh && \
cp -f /opt/maxkb/app/installer/init.sql /docker-entrypoint-initdb.d && \
mkdir -p /opt/maxkb/app/sandbox/python-packages && \
find /opt/maxkb/app -mindepth 1 -not -name 'sandbox' -exec chmod 700 {} + && \
chmod 500 /opt/maxkb/app/sandbox && \
chmod 755 /tmp && \
useradd --no-create-home --home /opt/maxkb/app/sandbox --shell /bin/bash sandbox && \
chown sandbox:sandbox /opt/maxkb/app/sandbox