Skip to content

Commit

Permalink
Fix uwsgi log file permissions (PP-1667) (#2077)
Browse files Browse the repository at this point in the history
Updates our docker build to make sure that:

    /var/log/uwsgi
        owned by root:adm
    /var/log/uwsgi/uwsgi.log
        owned by simplified:adm
        has 644 permissions, so cloudwatchd can read and upload the files
  • Loading branch information
jonathangreen authored Sep 19, 2024
1 parent 40db1c6 commit 1500983
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
5 changes: 4 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docker/services/logrotate/logrotate.d/celery.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
missingok
daily
create 0660 simplified adm
rotate 30
rotate 13
compress
delaycompress
notifempty
Expand Down
4 changes: 1 addition & 3 deletions docker/services/logrotate/logrotate.d/simplified.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/var/log/simplified/*.log {
missingok
daily
create 0700 root root
rotate 13
copytruncate
compress
Expand All @@ -13,8 +12,7 @@
/var/log/uwsgi/*.log {
missingok
daily
create 0660 simplified adm
rotate 30
rotate 13
copytruncate
compress
delaycompress
Expand Down
1 change: 0 additions & 1 deletion docker/services/uwsgi/uwsgi.d/40_log.ini
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1500983

Please sign in to comment.