Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logs for nginx under /config/log/nginx #713

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ services:
tubesync:
image: ghcr.io/meeb/tubesync:latest
container_name: tubesync
restart: unless-stopped
restart: on-failure:3
ports:
- 4848:4848
volumes:
Expand Down
4 changes: 2 additions & 2 deletions config/root/etc/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ http {

# Logging
log_format host '$remote_addr - $remote_user [$time_local] "[$host] $request" $status $bytes_sent "$http_referer" "$http_user_agent" "$gzip_ratio"';
access_log /dev/stdout;
error_log stderr;
access_log /config/log/nginx/access.log.gz combined gzip=9 flush=1m;
error_log /config/log/nginx/error.log info;

# GZIP
gzip on;
Expand Down
15 changes: 15 additions & 0 deletions config/root/etc/s6-overlay/s6-rc.d/tubesync-init/run
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ then
chmod -R 0755 /downloads
fi

# Prepare for nginx logging into /config/log/nginx
mkdir -p /config/log
rm -rf /config/log/nginx.9
for n in $(seq 8 -1 0)
do
test '!' -d "/config/log/nginx.${n}" ||
mv "/config/log/nginx.${n}" "/config/log/nginx.$((1 + n))"
done ; unset -v n ;
rm -rf /config/log/nginx.0
test '!' -d /config/log/nginx ||
mv /config/log/nginx /config/log/nginx.0
rm -rf /config/log/nginx
cp -a /var/log/nginx /config/log/
cp -p /config/log/nginx/access.log /config/log/nginx/access.log.gz

# Run migrations
exec s6-setuidgid app \
/usr/bin/python3 /app/manage.py migrate