linuxserver / docker-nginx

GNU General Public License v3.0
148 stars 46 forks source link

precreate nginx log files, fix permissions #97

Closed aptalca closed 2 weeks ago

aptalca commented 1 year ago

We need to precreate the nginx log files and fix their permissions on first run. Otherwise nginx creates them as root owned.

fixes https://github.com/linuxserver/docker-baseimage-alpine-nginx/issues/149

LinuxServer-CI commented 1 year ago
I am a bot, here are the test results for this PR: https://ci-tests.linuxserver.io/lspipepr/nginx/1.24.0-r7-pkg-4e37044e-dev-5efb8ec06677b433bacc995bc71ac53015d7a684-pr-97/index.html https://ci-tests.linuxserver.io/lspipepr/nginx/1.24.0-r7-pkg-4e37044e-dev-5efb8ec06677b433bacc995bc71ac53015d7a684-pr-97/shellcheck-result.xml Tag Passed
amd64-1.24.0-r7-pkg-4e37044e-dev-5efb8ec06677b433bacc995bc71ac53015d7a684-pr-97
arm64v8-1.24.0-r7-pkg-4e37044e-dev-5efb8ec06677b433bacc995bc71ac53015d7a684-pr-97
nemchik commented 1 year ago

I think we want this in the nginx base, not here.

aptalca commented 1 year ago

Sure, the precreation can move to the base, but we would still need the chown as the base no longer does that

nemchik commented 1 year ago

Sure, the precreation can move to the base, but we would still need the chown as the base no longer does that

if we're precreating using s6-setuidgid as abc i thought we didn't need the chown?

aptalca commented 1 year ago

We need it for other files in general. The base used to do a recursive chown so the nginx image never had to. But the recursive chown was removed from the base a few months ago so now we need it here.

The precreation requirement is separate because without it the log files are created after init completes and chown runs so they remain root owned until the next container start

aptalca commented 1 year ago

In other words, this PR attempts to fix two separate issues, but one of those fixes (precreation) can be moved to the base. The other will stay here.

LinuxServer-CI commented 11 months ago

This pull request has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

aptalca commented 2 weeks ago

looks like this was implemented in the base