refactor(ci): add permissions check at docker's entrypoint (#1128)

Co-authored-by: MadDogOwner <xiaoran@xrgzs.top>
This commit is contained in:
我怎么就不是一只猫呢?
2025-08-22 19:35:48 +08:00
committed by GitHub
parent 6499374d1c
commit 01914a06ef

View File

@ -5,9 +5,23 @@ umask ${UMASK}
if [ "$1" = "version" ]; then
./openlist version
else
# Check file of /opt/openlist/data permissions for current user
# 检查当前用户是否有当前目录的写和执行权限
if [ -d ./data ]; then
if ! [ -w ./data ] || ! [ -x ./data ]; then
cat <<EOF
Error: Current user does not have write and/or execute permissions for the ./data directory: $(pwd)/data
Please visit https://doc.oplist.org/guide/installation/docker#for-version-after-v4-1-0 for more information.
错误:当前用户没有 ./data 目录($(pwd)/data的写和/或执行权限。
请访问 https://doc.oplist.org/guide/installation/docker#v4-1-0-%E4%BB%A5%E5%90%8E%E7%89%88%E6%9C%AC 获取更多信息。
Exiting...
EOF
exit 1
fi
fi
# Define the target directory path for aria2 service
ARIA2_DIR="/opt/service/start/aria2"
if [ "$RUN_ARIA2" = "true" ]; then
# If aria2 should run and target directory doesn't exist, copy it
if [ ! -d "$ARIA2_DIR" ]; then