From 6b565e628f4c40e0050a2704c3dd56b4eaf9d184 Mon Sep 17 00:00:00 2001 From: FibreTTP <120446961+FibreTTP@users.noreply.github.com> Date: Wed, 27 Sep 2023 14:25:04 +1000 Subject: [PATCH 1/3] Change perms on logrotated logs to npm user --- docker/rootfs/etc/logrotate.d/nginx-proxy-manager | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/rootfs/etc/logrotate.d/nginx-proxy-manager b/docker/rootfs/etc/logrotate.d/nginx-proxy-manager index 20c23ac6..0882d61e 100644 --- a/docker/rootfs/etc/logrotate.d/nginx-proxy-manager +++ b/docker/rootfs/etc/logrotate.d/nginx-proxy-manager @@ -1,5 +1,5 @@ /data/logs/*_access.log /data/logs/*/access.log { - create 0644 root root + create 0644 npm npm weekly rotate 4 missingok @@ -12,7 +12,7 @@ } /data/logs/*_error.log /data/logs/*/error.log { - create 0644 root root + create 0644 npm npm weekly rotate 10 missingok From 4867db078c9a7b606d42e0fe455e00561088bc71 Mon Sep 17 00:00:00 2001 From: FibreTTP <120446961+FibreTTP@users.noreply.github.com> Date: Wed, 27 Sep 2023 14:58:19 +1000 Subject: [PATCH 2/3] Remove explicit user and group - add su directive for default user (npm). --- docker/rootfs/etc/logrotate.d/nginx-proxy-manager | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/rootfs/etc/logrotate.d/nginx-proxy-manager b/docker/rootfs/etc/logrotate.d/nginx-proxy-manager index 0882d61e..275b0aa6 100644 --- a/docker/rootfs/etc/logrotate.d/nginx-proxy-manager +++ b/docker/rootfs/etc/logrotate.d/nginx-proxy-manager @@ -1,5 +1,6 @@ /data/logs/*_access.log /data/logs/*/access.log { - create 0644 npm npm + su npm npm + create 0644 weekly rotate 4 missingok @@ -12,7 +13,8 @@ } /data/logs/*_error.log /data/logs/*/error.log { - create 0644 npm npm + su npm npm + create 0644 weekly rotate 10 missingok From f426e6456935694b7a08ac139459ae136e4cc846 Mon Sep 17 00:00:00 2001 From: FibreTTP <120446961+FibreTTP@users.noreply.github.com> Date: Wed, 27 Sep 2023 16:12:33 +1000 Subject: [PATCH 3/3] Add warning comment about changing the default user name and group name --- docker/rootfs/bin/common.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker/rootfs/bin/common.sh b/docker/rootfs/bin/common.sh index 913dd3e1..13cf06ac 100644 --- a/docker/rootfs/bin/common.sh +++ b/docker/rootfs/bin/common.sh @@ -12,6 +12,10 @@ export CYAN BLUE YELLOW RED RESET PUID=${PUID:-0} PGID=${PGID:-0} +# If changing the username and group name below, +# ensure all references to this user is also changed. +# See docker/rootfs/etc/logrotate.d/nginx-proxy-manager +# and docker/rootfs/etc/nginx/nginx.conf NPMUSER=npm NPMGROUP=npm NPMHOME=/tmp/npmuserhome