build: sandbox权限限制,/opt/maxkb/app 目录下的文件只能读取自己的 /opt/maxkb/app/sandbox

This commit is contained in:
CaptainB 2024-09-26 15:20:12 +08:00 committed by 刘瑞斌
parent fb38f94d61
commit 52e883c65c

View File

@ -61,6 +61,8 @@ RUN chmod 755 /opt/maxkb/app/installer/run-maxkb.sh && \
cp -f /opt/maxkb/app/installer/run-maxkb.sh /usr/bin/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 && \
useradd --no-create-home --home /opt/maxkb/app/sandbox --shell /bin/bash sandbox && \
chown sandbox:sandbox /opt/maxkb/app/sandbox