Skip to content

Commit cfbce05

Browse files
committed
set upload_tmp_dir to prevent cross-fs copies of every chunks
1 parent 9d39457 commit cfbce05

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

file-manager/config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
// Maximum file upload size
9898
// Increase the following values in php.ini to work properly
9999
// memory_limit, upload_max_filesize, post_max_size
100-
$max_upload_size_bytes = 20000000000; // size 5,000,000,000 bytes (~5GB)
100+
$max_upload_size_bytes = 80000000000; // size 80,000,000,000 bytes (~80GB)
101101

102102
// chunk size used for upload
103103
// eg. decrease to 1MB if nginx reports problem 413 entity too large

file-manager/entrypoint

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ then
3232
ln -s manager_auth.php auth.php
3333
fi
3434

35+
mkdir -p /data/.php
36+
# make sur in-progress uploads are on same (mounted) filesystem
37+
sed -i 's,;upload_tmp_dir =,upload_tmp_dir = /data/.php,' /etc/php83/php.ini
38+
# tfm uploads using 2MB chunks
39+
sed -i 's,upload_max_filesize = 2M,upload_max_filesize = 20M,' /etc/php83/php.ini
40+
sed -i 's,post_max_size = 8M,post_max_size = 20M,' /etc/php83/php.ini
41+
sed -i 's,max_file_uploads = 20,max_file_uploads = 100,' /etc/php83/php.ini
42+
3543
# run php-fpm as root so we can write to destination without fumbling with perms
3644
if [[ "$ACCESS_MODE" != "listing" ]]
3745
then

0 commit comments

Comments
 (0)