diff options
author | nachoparker <nacho@ownyourbits.com> | 2017-05-25 22:13:02 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2017-05-26 18:58:14 +0300 |
commit | a78d5ddf86b7963a316090fb867f10fed303782e (patch) | |
tree | 046ffc8d99c98d7696b24cd189c0a988878e5ce4 | |
parent | 3dbfd2b563e2f68e92a8b0f3b9ec7b3b9c925cfa (diff) |
fix big uploads. upload tmp dir
-rw-r--r-- | etc/nextcloudpi-config.d/nc-datadir.sh | 6 | ||||
-rw-r--r-- | etc/nextcloudpi-config.d/nc-limits.sh | 5 | ||||
-rwxr-xr-x | etc/nextcloudpi-config.d/nc-nextcloud.sh | 6 | ||||
-rw-r--r-- | nextcloud_lamp.sh | 1 | ||||
-rw-r--r-- | nextcloudpi.sh | 6 |
5 files changed, 19 insertions, 5 deletions
diff --git a/etc/nextcloudpi-config.d/nc-datadir.sh b/etc/nextcloudpi-config.d/nc-datadir.sh index 94bbdf1c..bf2883a3 100644 --- a/etc/nextcloudpi-config.d/nc-datadir.sh +++ b/etc/nextcloudpi-config.d/nc-datadir.sh @@ -55,6 +55,12 @@ configure() cp -ra "$SRCDIR" "$DATADIR_" || return 1 + # tmp upload dir + mkdir -p "$DATADIR_/tmp" + chown www-data:www-data "$DATADIR_/tmp" + sed -i "s|^;\?upload_tmp_dir =.*$|upload_tmp_dir = $DATADIR_/tmp|" /etc/php/7.0/fpm/php.ini + + # datadir cd /var/www/nextcloud sudo -u www-data php occ config:system:set datadirectory --value=$DATADIR_ service apache2 start diff --git a/etc/nextcloudpi-config.d/nc-limits.sh b/etc/nextcloudpi-config.d/nc-limits.sh index 1c176d15..4bea68ad 100644 --- a/etc/nextcloudpi-config.d/nc-limits.sh +++ b/etc/nextcloudpi-config.d/nc-limits.sh @@ -16,13 +16,14 @@ # DESCRIPTION="Configure system limits for NextCloudPi" -MAXFILESIZE_=768M +MAXFILESIZE_=2G +MEMORYLIMIT_=768M configure() { 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=$MAXFILESIZE_/" /var/www/nextcloud/.user.ini + sed -i "s/memory_limit=.*/memory_limit=$MEMORYLIMIT_/" /var/www/nextcloud/.user.ini } install() { :; } diff --git a/etc/nextcloudpi-config.d/nc-nextcloud.sh b/etc/nextcloudpi-config.d/nc-nextcloud.sh index c63cb2e2..edb20815 100755 --- a/etc/nextcloudpi-config.d/nc-nextcloud.sh +++ b/etc/nextcloudpi-config.d/nc-nextcloud.sh @@ -19,7 +19,8 @@ VER_=12.0.0 ADMINUSER_=admin DBADMIN_=ncadmin DBPASSWD_=ownyourbits -MAXFILESIZE_=768M +MAXFILESIZE_=2G +MEMORYLIMIT_=768M MAXTRANSFERTIME_=3600 OPCACHEDIR=/var/www/nextcloud/data/.opcache DESCRIPTION="Install any NextCloud version" @@ -126,10 +127,11 @@ EOF 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=$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_" echo "*/15 * * * * php -f /var/www/nextcloud/cron.php" > /tmp/crontab_http crontab -u www-data /tmp/crontab_http diff --git a/nextcloud_lamp.sh b/nextcloud_lamp.sh index 96a8e4db..7cfa80b0 100644 --- a/nextcloud_lamp.sh +++ b/nextcloud_lamp.sh @@ -23,7 +23,6 @@ DBADMIN_=ncadmin DBPASSWD_=ownyourbits OPCACHEDIR=/var/www/nextcloud/data/.opcache -CONFDIR=/usr/local/etc/nextcloudpi-config.d/ STATE_FILE=/home/pi/.installation_state APTINSTALL="apt-get install -y --no-install-recommends" diff --git a/nextcloudpi.sh b/nextcloudpi.sh index 1460eb66..1dfd165d 100644 --- a/nextcloudpi.sh +++ b/nextcloudpi.sh @@ -16,6 +16,7 @@ # CONFDIR=/usr/local/etc/nextcloudpi-config.d/ +UPLOADTMPDIR=/var/www/nextcloud/data/tmp APTINSTALL="apt-get install -y --no-install-recommends" @@ -115,6 +116,11 @@ exit EOF chmod a+x /usr/local/bin/ncp-update + # TMP UPLOAD DIR + mkdir -p "$UPLOADTMPDIR" + chown www-data:www-data "$UPLOADTMPDIR" + sed -i "s|^;\?upload_tmp_dir =.*$|upload_tmp_dir = $UPLOADTMPDIR|" /etc/php/7.0/fpm/php.ini + # update to latest version from github as part of the build process /usr/local/bin/ncp-update } |