From f7b04cda0ea757c85b1ee3cb32e6a89270e20b87 Mon Sep 17 00:00:00 2001 From: szaimen Date: Wed, 25 May 2022 15:15:52 +0200 Subject: [PATCH] adjust log files to be stored in a volume Signed-off-by: szaimen --- Containers/nextcloud/Dockerfile | 2 -- Containers/nextcloud/entrypoint.sh | 9 +++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Containers/nextcloud/Dockerfile b/Containers/nextcloud/Dockerfile index 9d41c258..1e996a2d 100644 --- a/Containers/nextcloud/Dockerfile +++ b/Containers/nextcloud/Dockerfile @@ -222,8 +222,6 @@ RUN set -ex; \ chown www-data:root -R /usr/local/etc/php/conf.d && \ chown www-data:root -R /var/log/supervisord/ && \ chown www-data:root -R /var/run/supervisord/ && \ - mkdir -p /var/log/nextcloud/ && \ - chown -R www-data:root /var/log/nextcloud/ && \ rm -r /usr/src/nextcloud/apps/updatenotification COPY start.sh / diff --git a/Containers/nextcloud/entrypoint.sh b/Containers/nextcloud/entrypoint.sh index f1a082e3..70aaf9ca 100644 --- a/Containers/nextcloud/entrypoint.sh +++ b/Containers/nextcloud/entrypoint.sh @@ -170,10 +170,10 @@ if ! [ -f "/mnt/ncdata/skip.update" ]; then mkdir -p /var/www/html/data php /var/www/html/occ config:system:set loglevel --value=2 php /var/www/html/occ config:system:set log_type --value=file - php /var/www/html/occ config:system:set logfile --value="/var/log/nextcloud/nextcloud.log" + php /var/www/html/occ config:system:set logfile --value="/var/www/html/data/nextcloud.log" php /var/www/html/occ config:system:set log_rotate_size --value="10485760" php /var/www/html/occ app:enable admin_audit - php /var/www/html/occ config:app:set admin_audit logfile --value="/var/log/nextcloud/audit.log" + php /var/www/html/occ config:app:set admin_audit logfile --value="/var/www/html/data/audit.log" php /var/www/html/occ config:system:set log.condition apps 0 --value="admin_audit" # Apply preview settings @@ -272,6 +272,11 @@ echo "Applying one-click-instance settings..." php /var/www/html/occ config:system:set one-click-instance --value=true --type=bool php /var/www/html/occ config:system:set one-click-instance.user-limit --value=100 --type=int +# Adjusting log files to be stored on a volume +echo "Adjusting log files..." +php /var/www/html/occ config:system:set logfile --value="/var/www/html/data/nextcloud.log" +php /var/www/html/occ config:app:set admin_audit logfile --value="/var/www/html/data/audit.log" + # Apply network settings echo "Applying network settings..." php /var/www/html/occ config:system:set trusted_domains 1 --value="$NC_DOMAIN"