From 9c39606aab04ef641b56f1b8eac0b2b6c56c37b6 Mon Sep 17 00:00:00 2001 From: nachoparker Date: Sat, 23 Feb 2019 11:07:59 -0700 Subject: [PATCH] nc-nextcloud: disable .user.ini --- bin/ncp/CONFIG/nc-limits.sh | 4 ++-- bin/ncp/CONFIG/nc-nextcloud.sh | 24 +++++++++++++++++------- changelog.md | 4 +++- update.sh | 27 ++++++++++++++++++++++++++- 4 files changed, 48 insertions(+), 11 deletions(-) diff --git a/bin/ncp/CONFIG/nc-limits.sh b/bin/ncp/CONFIG/nc-limits.sh index 219b426ee..b16bd06d4 100644 --- a/bin/ncp/CONFIG/nc-limits.sh +++ b/bin/ncp/CONFIG/nc-limits.sh @@ -18,12 +18,12 @@ configure() AUTOMEM=$(( TOTAL_MEM * 75 / 100 )) # MAX FILESIZE - local CONF=/var/www/nextcloud/.user.ini + local CONF=/etc/php/${PHPVER}/fpm/conf.d/90-ncp.ini local CURRENT_FILE_SIZE="$( grep "^upload_max_filesize" "$CONF" | sed 's|.*=||' )" [[ "$MAXFILESIZE" == "0" ]] && MAXFILESIZE=10G # MAX PHP MEMORY - local CONF=/var/www/nextcloud/.user.ini + local CONF=/etc/php/${PHPVER}/fpm/conf.d/90-ncp.ini local CURRENT_PHP_MEM="$( grep "^memory_limit" "$CONF" | sed 's|.*=||' )" [[ "$MEMORYLIMIT" == "0" ]] && MEMORYLIMIT=$AUTOMEM && echo "Using ${AUTOMEM}B for PHP" sed -i "s/^post_max_size=.*/post_max_size=$MAXFILESIZE/" "$CONF" diff --git a/bin/ncp/CONFIG/nc-nextcloud.sh b/bin/ncp/CONFIG/nc-nextcloud.sh index 7f5160b97..007cf4783 100644 --- a/bin/ncp/CONFIG/nc-nextcloud.sh +++ b/bin/ncp/CONFIG/nc-nextcloud.sh @@ -213,13 +213,23 @@ EOF echo "Setting up system..." ## SET LIMITS - sed -i "s/post_max_size=.*/post_max_size=$MAXFILESIZE/" /var/www/nextcloud/.user.ini - sed -i "s/upload_max_filesize=.*/upload_max_filesize=$MAXFILESIZE/" /var/www/nextcloud/.user.ini - sed -i "s/memory_limit=.*/memory_limit=$MEMORYLIMIT/" /var/www/nextcloud/.user.ini - - # slow transfers will be killed after this time - cat >> /var/www/nextcloud/.user.ini <<< "max_execution_time=$MAXTRANSFERTIME" - cat >> /var/www/nextcloud/.user.ini <<< "max_input_time=$MAXTRANSFERTIME" + cat > /etc/php/${PHPVER}/fpm/conf.d/90-ncp.ini < /tmp/crontab_http diff --git a/changelog.md b/changelog.md index 3000d2554..56544eeb2 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ -[v1.8.2](https://github.com/nextcloud/nextcloudpi/commit/3315e2e) (2019-02-23) nc-limits: autocalculate database memory +[v1.8.3](https://github.com/nextcloud/nextcloudpi/commit/978fb73) (2019-02-23) nc-nextcloud: disable .user.ini + +[v1.8.2](https://github.com/nextcloud/nextcloudpi/commit/1dfa11a) (2019-02-23) nc-limits: autocalculate database memory [v1.8.1 ](https://github.com/nextcloud/nextcloudpi/commit/2a0dc38) (2019-02-22) lamp: adjust mariadb parameters diff --git a/update.sh b/update.sh index c716fcbbd..5f029f19d 100755 --- a/update.sh +++ b/update.sh @@ -163,7 +163,7 @@ cp -r ncp-app /var/www/ # fix LE update bug [[ -d /etc/letsencrypt/archive ]] || { sleep 3 - cp -ravT /etc/letsencrypt-old/archive /etc/letsencrypt/archive || true + cp -ravT /etc/letsencrypt-old/archive /etc/letsencrypt/archive &>/dev/null || true bash -c "sleep 2 && service apache2 reload" &>/dev/null & } @@ -207,6 +207,31 @@ EOF ncc maintenance:mode --off } + # disable .user.ini + PHPVER=7.2 + [[ -f /etc/php/${PHPVER}/fpm/conf.d/90-ncp.ini ]] || { + MAXFILESIZE="$(grep upload_max_filesize /var/www/nextcloud/.user.ini | cut -d= -f2)" + MEMORYLIMIT="$(grep memory_limit /var/www/nextcloud/.user.ini | cut -d= -f2)" + cat > /etc/php/${PHPVER}/fpm/conf.d/90-ncp.ini < https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815968 # Bug #416 reappeared after we moved to php7.2 and debian buster packages. (keep last) [[ "$( ls -l /etc/php/7.2/fpm/conf.d/*-opcache.ini | wc -l )" -gt 1 ]] && rm "$( ls /etc/php/7.2/fpm/conf.d/*-opcache.ini | tail -1 )"