Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2019-02-23 21:07:59 +0300
committernachoparker <nacho@ownyourbits.com>2019-03-05 21:22:12 +0300
commit9c39606aab04ef641b56f1b8eac0b2b6c56c37b6 (patch)
tree51cf8700e4fa3255d59b8cc71b802ad2e9900cb0
parentbf1fc1fd87b3efac2c8051e8bf09385f4e34460d (diff)
nc-nextcloud: disable .user.iniv1.8.4
-rw-r--r--bin/ncp/CONFIG/nc-limits.sh4
-rw-r--r--bin/ncp/CONFIG/nc-nextcloud.sh24
-rw-r--r--changelog.md4
-rwxr-xr-xupdate.sh27
4 files changed, 48 insertions, 11 deletions
diff --git a/bin/ncp/CONFIG/nc-limits.sh b/bin/ncp/CONFIG/nc-limits.sh
index 219b426e..b16bd06d 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 7f5160b9..007cf478 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 <<EOF
+; disable .user.ini files for performance and workaround NC update bugs
+user_ini.filename =
+
+; from Nextcloud .user.ini
+upload_max_filesize=$MAXFILESIZE
+post_max_size=$MAXFILESIZE
+memory_limit=$MEMORYLIMIT
+mbstring.func_overload=0
+always_populate_raw_post_data=-1
+default_charset='UTF-8'
+output_buffering=0
+
+; slow transfers will be killed after this time
+max_execution_time=$MAXTRANSFERTIME
+max_input_time=$MAXTRANSFERTIME
+EOF
## SET CRON
echo "*/15 * * * * php -f /var/www/nextcloud/cron.php" > /tmp/crontab_http
diff --git a/changelog.md b/changelog.md
index 3000d255..56544eeb 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 c716fcbb..5f029f19 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 <<EOF
+; disable .user.ini files for performance and workaround NC update bugs
+user_ini.filename =
+
+; from Nextcloud .user.ini
+upload_max_filesize=$MAXFILESIZE
+post_max_size=$MAXFILESIZE
+memory_limit=$MEMORYLIMIT
+mbstring.func_overload=0
+always_populate_raw_post_data=-1
+default_charset='UTF-8'
+output_buffering=0
+
+; slow transfers will be killed after this time
+max_execution_time=3600
+max_input_time=3600
+EOF
+ bash -c "sleep 3 && service php$PHPVER-fpm restart" &
+ }
+
# remove redundant opcache configuration. Leave until update bug is fixed -> 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 )"