From 4991922878182408fa5798544dc4f9dee799dd65 Mon Sep 17 00:00:00 2001 From: bunkerity Date: Wed, 23 Jun 2021 14:06:39 +0200 Subject: [PATCH] linux - fix daemon directive and rights on /etc/nginx --- confs/global/nginx.conf | 2 +- entrypoint/entrypoint.sh | 2 +- helpers/install.sh | 12 +++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/confs/global/nginx.conf b/confs/global/nginx.conf index 09a0c3c01..cf3df3b3e 100644 --- a/confs/global/nginx.conf +++ b/confs/global/nginx.conf @@ -11,7 +11,7 @@ load_module /usr/lib/nginx/modules/ngx_http_brotli_filter_module.so; load_module /usr/lib/nginx/modules/ngx_http_brotli_static_module.so; # run in foreground -daemon off; +# daemon off; # PID file pid /tmp/nginx.pid; diff --git a/entrypoint/entrypoint.sh b/entrypoint/entrypoint.sh index 3921cf0e7..d8d059d31 100644 --- a/entrypoint/entrypoint.sh +++ b/entrypoint/entrypoint.sh @@ -84,7 +84,7 @@ fi # run nginx echo "[*] Running nginx ..." -nginx & +nginx -g 'daemon off;' & pid="$!" # autotest diff --git a/helpers/install.sh b/helpers/install.sh index 1a165467d..b19d337c5 100644 --- a/helpers/install.sh +++ b/helpers/install.sh @@ -196,22 +196,24 @@ if [ ! -d "/opt/bunkerized-nginx/plugins" ] ; then fi # Set permissions for /opt/bunkerized-nginx -echo "[*] Set permissions for /opt/bunkerized-nginx files and folders" +echo "[*] Set permissions on files and folders" do_and_check_cmd chown -R root:nginx /opt/bunkerized-nginx -do_and_check_cmd find /opt -type f -exec chmod 0740 {} \; -do_and_check_cmd find /opt -type d -exec chmod 0750 {} \; +do_and_check_cmd find /opt/bunkerized-nginx -type f -exec chmod 0740 {} \; +do_and_check_cmd find /opt/bunkerized-nginx -type d -exec chmod 0750 {} \; do_and_check_cmd chmod 770 /opt/bunkerized-nginx/cache do_and_check_cmd chmod 770 /opt/bunkerized-nginx/acme-challenge do_and_check_cmd chmod 750 /opt/bunkerized-nginx/scripts/* do_and_check_cmd chmod 750 /opt/bunkerized-nginx/entrypoint/* do_and_check_cmd chmod 750 /opt/bunkerized-nginx/gen/main.py - # Set permissions for /usr/local/bin/bunkerized-nginx do_and_check_cmd chown root:root /usr/local/bin/bunkerized-nginx do_and_check_cmd chmod 750 /usr/local/bin/bunkerized-nginx - # Set permissions for /opt do_and_check_cmd chmod u+rx /opt +# Set permissions for /etc/nginx +do_and_check_cmd chown -R nginx:nginx /etc/nginx +do_and_check_cmd find /etc/nginx -type f -exec chmod 0774 {} \; +do_and_check_cmd find /etc/nginx -type d -exec chmod 0775 {} \; # Install cron echo "[*] Add jobs to crontab"