fix(entrypoint): ensure books directory exists and is writable by the target user (#119)
This commit is contained in:
@@ -30,8 +30,8 @@ if ! getent passwd "$USER_ID" >/dev/null 2>&1; then
|
|||||||
adduser -u "$USER_ID" -G "$(getent group "$GROUP_ID" | cut -d: -f1)" -S -D "$APP_USER"
|
adduser -u "$USER_ID" -G "$(getent group "$GROUP_ID" | cut -d: -f1)" -S -D "$APP_USER"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Ensure data and bookdrop directories exist and are writable by the target user
|
# Ensure data, bookdrop, and books directories exist and are writable by the target user
|
||||||
mkdir -p /app/data /bookdrop
|
mkdir -p /app/data /bookdrop /books
|
||||||
chown "$USER_ID:$GROUP_ID" /app/data /bookdrop 2>/dev/null || true
|
chown "$USER_ID:$GROUP_ID" /app/data /bookdrop /books 2>/dev/null || true
|
||||||
|
|
||||||
exec su-exec "$USER_ID:$GROUP_ID" "$@"
|
exec su-exec "$USER_ID:$GROUP_ID" "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user