From 5ac9dc0758f7d802d9c014c4fca6af17202df2b8 Mon Sep 17 00:00:00 2001 From: Jamie Curnow Date: Wed, 22 Mar 2023 13:00:26 +1000 Subject: [PATCH] Attempt to set HOME for npmuser backend --- docker/rootfs/etc/s6-overlay/s6-rc.d/backend/run | 4 ++-- docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/10-npmuser.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/rootfs/etc/s6-overlay/s6-rc.d/backend/run b/docker/rootfs/etc/s6-overlay/s6-rc.d/backend/run index 31b59fb0..b8287643 100755 --- a/docker/rootfs/etc/s6-overlay/s6-rc.d/backend/run +++ b/docker/rootfs/etc/s6-overlay/s6-rc.d/backend/run @@ -11,12 +11,12 @@ if [ "$DEVELOPMENT" == "true" ]; then cd /app || exit 1 # If yarn install fails: add --verbose --network-concurrency 1 s6-setuidgid npmuser yarn install - exec s6-setuidgid npmuser node --max_old_space_size=250 --abort_on_uncaught_exception node_modules/nodemon/bin/nodemon.js + exec s6-setuidgid npmuser bash -c 'export HOME=/tmp/npmuserhome;node --max_old_space_size=250 --abort_on_uncaught_exception node_modules/nodemon/bin/nodemon.js' else cd /app || exit 1 while : do - s6-setuidgid npmuser node --abort_on_uncaught_exception --max_old_space_size=250 index.js + s6-setuidgid npmuser bash -c 'export HOME=/tmp/npmuserhome;node --abort_on_uncaught_exception --max_old_space_size=250 index.js' sleep 1 done fi diff --git a/docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/10-npmuser.sh b/docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/10-npmuser.sh index 86b9fc26..df9b68d9 100755 --- a/docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/10-npmuser.sh +++ b/docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/10-npmuser.sh @@ -10,7 +10,7 @@ PGID=${PGID:-911} log_info 'Creating npmuser ...' groupmod -g 1000 users || exit 1 -useradd -u "${PUID}" -U -d /data -s /bin/false npmuser || exit 1 +useradd -u "${PUID}" -U -d /tmp/npmuserhome -s /bin/false npmuser || exit 1 usermod -G users npmuser || exit 1 groupmod -o -g "$PGID" npmuser || exit 1 # Home for npmuser