Skip to content

Commit

Permalink
set upload_tmp_dir to prevent cross-fs copies of every chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaudin committed Jan 15, 2024
1 parent 9d39457 commit cfbce05
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion file-manager/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
// Maximum file upload size
// Increase the following values in php.ini to work properly
// memory_limit, upload_max_filesize, post_max_size
$max_upload_size_bytes = 20000000000; // size 5,000,000,000 bytes (~5GB)
$max_upload_size_bytes = 80000000000; // size 80,000,000,000 bytes (~80GB)

// chunk size used for upload
// eg. decrease to 1MB if nginx reports problem 413 entity too large
Expand Down
8 changes: 8 additions & 0 deletions file-manager/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ then
ln -s manager_auth.php auth.php
fi

mkdir -p /data/.php
# make sur in-progress uploads are on same (mounted) filesystem
sed -i 's,;upload_tmp_dir =,upload_tmp_dir = /data/.php,' /etc/php83/php.ini
# tfm uploads using 2MB chunks
sed -i 's,upload_max_filesize = 2M,upload_max_filesize = 20M,' /etc/php83/php.ini
sed -i 's,post_max_size = 8M,post_max_size = 20M,' /etc/php83/php.ini
sed -i 's,max_file_uploads = 20,max_file_uploads = 100,' /etc/php83/php.ini

# run php-fpm as root so we can write to destination without fumbling with perms
if [[ "$ACCESS_MODE" != "listing" ]]
then
Expand Down

0 comments on commit cfbce05

Please sign in to comment.