From 8fbe585470bc4a45568cf9d96576a7a73f054154 Mon Sep 17 00:00:00 2001 From: ian351c Date: Wed, 5 Jun 2024 12:36:38 -0400 Subject: [PATCH] Chown is ok for files on base image... --- .../rootfs/etc/s6-overlay/s6-rc.d/prepare/50-ipv6.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/50-ipv6.sh b/docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/50-ipv6.sh index cb78a13c..da088425 100755 --- a/docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/50-ipv6.sh +++ b/docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/50-ipv6.sh @@ -32,13 +32,17 @@ process_folder () { echo "$(sed -E "$SED_REGEX" "$FILE")" > $FILE done - if [ "$SKIP_FILE_OWNERSHIP" == "true" ] || [ "$SKIP_FILE_OWNERSHIP" == "on" ] || [ "$SKIP_FILE_OWNERSHIP" == "1" ] || [ "$SKIP_FILE_OWNERSHIP" == "yes" ]; then - log_info 'Skipping ownership, use only with caution ...' - else + # ensure the files are still owned by the npm user chown -R "$PUID:$PGID" "$1" fi } +# process files on base image process_folder /etc/nginx/conf.d -process_folder /data/nginx +# conditionally process files that are probably in a volume or bind +if [ "$SKIP_FILE_OWNERSHIP" == "true" ] || [ "$SKIP_FILE_OWNERSHIP" == "on" ] || [ "$SKIP_FILE_OWNERSHIP" == "1" ] || [ "$SKIP_FILE_OWNERSHIP" == "yes" ]; then + log_info 'Skipping ownership, use only with caution ...' +else + process_folder /data/nginx +fi