From cb5763d5cfebdfd62425a886103efa8fe5dc7b7e Mon Sep 17 00:00:00 2001 From: enoch85 Date: Wed, 4 Sep 2019 07:51:34 +0200 Subject: [PATCH] improve logging Signed-off-by: enoch85 --- nextcloud-startup-script.sh | 2 +- nextcloud_install_production.sh | 10 +++++++--- static/setup_secure_permissions_nextcloud.sh | 5 +++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/nextcloud-startup-script.sh b/nextcloud-startup-script.sh index 0ecf4a8f..73b566b0 100644 --- a/nextcloud-startup-script.sh +++ b/nextcloud-startup-script.sh @@ -293,7 +293,6 @@ then clear else dpkg-reconfigure tzdata - clear fi # Change timezone in PHP @@ -301,6 +300,7 @@ sed -i "s|;date.timezone.*|date.timezone = $(cat /etc/timezone)|g" "$PHP_INI" # Change timezone for logging occ_command config:system:set logtimezone --value="$(cat /etc/timezone)" +clear # Check where the best mirrors are and update msg_box "To make downloads as fast as possible when updating you should have mirrors that are as close to you as possible. diff --git a/nextcloud_install_production.sh b/nextcloud_install_production.sh index 63ed81f4..70ef08ac 100644 --- a/nextcloud_install_production.sh +++ b/nextcloud_install_production.sh @@ -386,10 +386,14 @@ sed -i "s|post_max_size =.*|post_max_size = 1100M|g" $PHP_INI sed -i "s|upload_max_filesize =.*|upload_max_filesize = 1000M|g" $PHP_INI # Set loggging -occ_command config:system:set loglevel --value=3 -occ_command config:system:set log_type --value=file -occ_command config:system:set logfile --value="$VMLOGS/nextcloud.log" +-occ_command config:system:set log_type --value=file +-occ_command config:system:set logfile --value="$VMLOGS/nextcloud.log" +touch "$VMLOGS/nextcloud.log" +rm -f "$NCDATA/nextcloud.log" +occ_command config:system:set loglevel --value=2 occ_command config:app:set admin_audit logfile --value="$VMLOGS/audit.log" +touch "$VMLOGS/audit.log" +install_and_enable_app admin_audit # Set SMTP mail occ_command config:system:set mail_smtpmode --value="smtp" diff --git a/static/setup_secure_permissions_nextcloud.sh b/static/setup_secure_permissions_nextcloud.sh index c43f0689..125dc02e 100644 --- a/static/setup_secure_permissions_nextcloud.sh +++ b/static/setup_secure_permissions_nextcloud.sh @@ -30,14 +30,19 @@ print_text_in_color "$IGreen" "Setting secure permissions..." print_text_in_color "$ICyan" "Creating possible missing Directories" mkdir -p "$NCPATH"/data mkdir -p "$NCPATH"/updater +mkdir -p "$VMLOGS" mkdir -p "$NCDATA" print_text_in_color "$ICyan" "chmod Files and Directories" find "${NCPATH}"/ -type f -print0 | xargs -0 chmod 0640 +find "${VMLOGS}"/nextcloud.log -type f -print0 | xargs -0 chmod 0640 +find "${VMLOGS}"/audit.log -type f -print0 | xargs -0 chmod 0640 find "${NCPATH}"/ -type d -print0 | xargs -0 chmod 0750 print_text_in_color "$ICyan" "chown Directories" chown -R "${rootuser}":"${htgroup}" "${NCPATH}"/ +chown -R "${htuser}":"${htgroup}" "${VMLOGS}"/nextcloud.log +chown -R "${htuser}":"${htgroup}" "${VMLOGS}"/audit.log chown -R "${htuser}":"${htgroup}" "${NCPATH}"/apps/ chown -R "${htuser}":"${htgroup}" "${NCPATH}"/config/ chown -R "${htuser}":"${htgroup}" "${NCPATH}"/themes/