From 456f26b9d59243d8741d53e42efaeaf12eb4df49 Mon Sep 17 00:00:00 2001 From: szaimen Date: Wed, 20 Apr 2022 17:00:51 +0200 Subject: [PATCH] run caddy as different user Signed-off-by: szaimen --- Containers/mastercontainer/Dockerfile | 3 ++- Containers/mastercontainer/start.sh | 2 +- Containers/mastercontainer/supervisord.conf | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Containers/mastercontainer/Dockerfile b/Containers/mastercontainer/Dockerfile index 7fad6da3..6a665e9c 100644 --- a/Containers/mastercontainer/Dockerfile +++ b/Containers/mastercontainer/Dockerfile @@ -92,7 +92,8 @@ COPY supervisord.conf / RUN chmod +x /usr/bin/start.sh; \ chmod +x /cron.sh; \ chmod +x /session-deduplicator.sh; \ - chmod +x /backup-time-file-watcher.sh + chmod +x /backup-time-file-watcher.sh; \ + chmod a+r /Caddyfile USER root diff --git a/Containers/mastercontainer/start.sh b/Containers/mastercontainer/start.sh index 265b7209..62355403 100755 --- a/Containers/mastercontainer/start.sh +++ b/Containers/mastercontainer/start.sh @@ -127,7 +127,7 @@ chmod 770 -R /mnt/docker-aio-config chmod 777 /mnt/docker-aio-config chown www-data:www-data -R /mnt/docker-aio-config/data/ chown www-data:www-data -R /mnt/docker-aio-config/session/ -chown root:root -R /mnt/docker-aio-config/caddy/ +chown www-data:www-data -R /mnt/docker-aio-config/caddy/ chown root:root -R /mnt/docker-aio-config/certs/ # Adjust certs diff --git a/Containers/mastercontainer/supervisord.conf b/Containers/mastercontainer/supervisord.conf index 9c3604c0..ad24f412 100644 --- a/Containers/mastercontainer/supervisord.conf +++ b/Containers/mastercontainer/supervisord.conf @@ -20,7 +20,7 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -command=/usr/bin/caddy run -config /Caddyfile +command=sudo -u www-data /usr/bin/caddy run -config /Caddyfile [program:cron] stdout_logfile=/dev/stdout