From 1f4eb767c1c3b0c4e02fca5499cecd6453820ced Mon Sep 17 00:00:00 2001 From: Jonathan Green Date: Thu, 19 Sep 2024 10:28:12 -0300 Subject: [PATCH] Fix uwsgi log file permissions --- docker/Dockerfile | 5 ++++- docker/services/logrotate/logrotate.d/celery.conf | 2 +- docker/services/logrotate/logrotate.d/simplified.conf | 4 +--- docker/services/uwsgi/uwsgi.d/40_log.ini | 1 - 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 75320a21c7..f27446e50f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -74,7 +74,10 @@ COPY docker/services/nginx /etc/nginx/ # Setup uwsgi COPY docker/services/uwsgi /etc/ RUN mkdir -p /var/log/uwsgi && \ - chown -RHh simplified:simplified /var/log/uwsgi && \ + chown root:adm /var/log/uwsgi && \ + touch /var/log/uwsgi/uwsgi.log && \ + chown simplified:adm /var/log/uwsgi/uwsgi.log && \ + chmod 644 /var/log/uwsgi/uwsgi.log && \ mkdir /var/run/uwsgi && \ chown simplified:simplified /var/run/uwsgi diff --git a/docker/services/logrotate/logrotate.d/celery.conf b/docker/services/logrotate/logrotate.d/celery.conf index e7b502e943..abc2745e25 100644 --- a/docker/services/logrotate/logrotate.d/celery.conf +++ b/docker/services/logrotate/logrotate.d/celery.conf @@ -2,7 +2,7 @@ missingok daily create 0660 simplified adm - rotate 30 + rotate 13 compress delaycompress notifempty diff --git a/docker/services/logrotate/logrotate.d/simplified.conf b/docker/services/logrotate/logrotate.d/simplified.conf index 0e343ceb13..9f67e1119f 100644 --- a/docker/services/logrotate/logrotate.d/simplified.conf +++ b/docker/services/logrotate/logrotate.d/simplified.conf @@ -1,7 +1,6 @@ /var/log/simplified/*.log { missingok daily - create 0700 root root rotate 13 copytruncate compress @@ -13,8 +12,7 @@ /var/log/uwsgi/*.log { missingok daily - create 0660 simplified adm - rotate 30 + rotate 13 copytruncate compress delaycompress diff --git a/docker/services/uwsgi/uwsgi.d/40_log.ini b/docker/services/uwsgi/uwsgi.d/40_log.ini index 61f1999d0c..f2a1b9cc1b 100644 --- a/docker/services/uwsgi/uwsgi.d/40_log.ini +++ b/docker/services/uwsgi/uwsgi.d/40_log.ini @@ -1,5 +1,4 @@ [uwsgi] log-format = [uwsgi] %(var.HTTP_X_FORWARDED_FOR) (%(addr)) - - [%(ltime)] "%(method) %(uri) %(proto)" %(status) %(size) "%(referer)" "%(uagent)" host_hdr=%(host) req_time_elapsed=%(msecs) process=%(pid) worker=%(wid) -logfile-chmod = 644 logger = stdio: logger = file:/var/log/uwsgi/uwsgi.log