From 758af6f48ec2ca942c209a069efdf36ebaa34afd Mon Sep 17 00:00:00 2001 From: LoveIsGrief Date: Tue, 14 Jan 2020 17:14:41 +0100 Subject: [PATCH] docker: Make sure APP_HOME is editable by the user Otherwise MuWire won't be able to write into the home #32 - Docker image --- docker/rootfs/etc/cont-init.d/00-app-user-map.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker/rootfs/etc/cont-init.d/00-app-user-map.sh b/docker/rootfs/etc/cont-init.d/00-app-user-map.sh index e11cc0ab..5132ed58 100755 --- a/docker/rootfs/etc/cont-init.d/00-app-user-map.sh +++ b/docker/rootfs/etc/cont-init.d/00-app-user-map.sh @@ -17,4 +17,10 @@ chmod 640 /etc/shadow echo "$APP_USER:x:$USER_ID:$GROUP_ID::${APP_HOME:-/dev/null}:/sbin/nologin" >> /etc/passwd echo "$APP_USER:x:$GROUP_ID:" >> /etc/group +# Make sure APP_HOME is editable by the user +if [[ -n "$APP_HOME" ]] ; then + chown -R "$APP_USER" "$APP_HOME" + chmod -R u+rw "$APP_HOME" +fi + # vim:ft=sh:ts=4:sw=4:et:sts=4