From 5c17fefb0830c9b0b518728dc7a38b293da690a6 Mon Sep 17 00:00:00 2001 From: r-xyz <100710244+r-xyz@users.noreply.github.com> Date: Thu, 18 Jul 2024 11:54:58 +0200 Subject: [PATCH] Implement `PHP_UPLOAD_LIMIT` in Alpine images. --- docker/entrypoint_alpine.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docker/entrypoint_alpine.sh b/docker/entrypoint_alpine.sh index 783b50b69c..c1a75b0cbd 100644 --- a/docker/entrypoint_alpine.sh +++ b/docker/entrypoint_alpine.sh @@ -39,6 +39,14 @@ chown -R apache:root /var/lib/snipeit/data/* chown -R apache:root /var/lib/snipeit/dumps chown -R apache:root /var/lib/snipeit/keys +# Fix php settings +if [ ! -z "${PHP_UPLOAD_LIMIT}" ] +then + echo "Changing upload limit to ${PHP_UPLOAD_LIMIT}" + sed -i "s/^upload_max_filesize.*/upload_max_filesize = ${PHP_UPLOAD_LIMIT}M/" /etc/php*/php.ini + sed -i "s/^post_max_size.*/post_max_size = ${PHP_UPLOAD_LIMIT}M/" /etc/php*/php.ini +fi + # If the Oauth DB files are not present copy the vendor files over to the db migrations if [ ! -f "/var/www/html/database/migrations/*create_oauth*" ] then