From b31aa14bc4b75c80b101321aca15cec087fe081b Mon Sep 17 00:00:00 2001 From: Zoey Date: Sun, 14 Jan 2024 14:11:49 +0100 Subject: [PATCH] fix logrotate --- README.md | 4 ++-- rootfs/usr/local/bin/launch.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 292b3787..e09041df 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ so that the barrier for entry here is low. - Supports HTTP/3 (QUIC) protocol. - Supports CrowdSec IPS. Please see [here](https://github.com/ZoeyVid/NPMplus#crowdsec) to enable it. -- goaccess included, see compose.yaml (nginx config from [here](https://github.com/xavier-hernandez/goaccess-for-nginxproxymanager/blob/main/resources/nginx/nginx.conf)) +- goaccess included, see compose.yaml to enable, runs by default on https://:91 (nginx config from [here](https://github.com/xavier-hernandez/goaccess-for-nginxproxymanager/blob/main/resources/nginx/nginx.conf)) - Supports ModSecurity, with coreruleset as an option. You can configure ModSecurity/coreruleset by editing the files in the `/opt/npm/etc/modsecurity` folder. - If the core ruleset blocks valid requests, please check the `/opt/npm/etc/modsecurity/crs-setup.conf` file. - Try to whitelist the Content-Type you are sending (for example, `application/activity+json` for Mastodon and `application/dns-message` for DoH). @@ -108,7 +108,7 @@ so that the barrier for entry here is low. 3. run `docker exec crowdsec cscli bouncers add npmplus -o raw` and save the output 4. open `/opt/npm/etc/crowdsec/crowdsec.conf` 5. set `ENABLED` to `true` -6. use the output of step 4 as `API_KEY` +6. use the output of step 3 as `API_KEY` 7. make sure `API_URL` is set to `http://127.0.0.1:8080` 9. save the file 10. restart the npm diff --git a/rootfs/usr/local/bin/launch.sh b/rootfs/usr/local/bin/launch.sh index 34833944..a4b48468 100755 --- a/rootfs/usr/local/bin/launch.sh +++ b/rootfs/usr/local/bin/launch.sh @@ -46,7 +46,7 @@ fi if [ "$PHP81" = "true" ]; then PHP_INI_SCAN_DIR=/data/php/81/conf.d php-fpm81 -c /data/php/81 -y /data/php/81/php-fpm.conf -FOR; fi & if [ "$PHP82" = "true" ]; then PHP_INI_SCAN_DIR=/data/php/82/conf.d php-fpm82 -c /data/php/82 -y /data/php/82/php-fpm.conf -FOR; fi & if [ "$PHP83" = "true" ]; then PHP_INI_SCAN_DIR=/data/php/83/conf.d php-fpm83 -c /data/php/83 -y /data/php/83/php-fpm.conf -FOR; fi & -if [ "$LOGROTATE" = "true" ]; then logrotate --state /data/etc/logrotate.status /etc/logrotate; fi & +if [ "$LOGROTATE" = "true" ]; then while true; do logrotate --state /data/etc/logrotate.status /etc/logrotate; sleep 1d; done; fi & # shellcheck disable=SC2086 if [ "$GOA" = "true" ]; then goaccess --no-global-config --num-tests=0 --tz="$TZ" --date-format="%d/%b/%Y" --time-format="%H:%M:%S" --log-format='[%d:%t %^] %v %h %T "%r" %s %b %b %R %u' --no-ip-validation --addr=127.0.0.1 --port="$GOAIWSP" \ -f /data/nginx/access.log --real-time-html -o /tmp/goa/index.html --persist --restore --db-path=/data/etc/goaccess/data -b /etc/goaccess/browsers.list -b /etc/goaccess/podcast.list $GOACLA; fi &