From 73efb584db5a223d15937ca5906948fa058a7128 Mon Sep 17 00:00:00 2001 From: Steven Sting Date: Fri, 23 Aug 2024 17:31:16 +0200 Subject: [PATCH 1/5] add some more wordpress options for file uploads --- abra.sh | 2 +- uploads.ini | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/abra.sh b/abra.sh index 36a6a5b..4dc92ac 100644 --- a/abra.sh +++ b/abra.sh @@ -1,4 +1,4 @@ -export PHP_UPLOADS_CONF_VERSION=v3 +export PHP_UPLOADS_CONF_VERSION=v4 export ENTRYPOINT_CONF_VERSION=v7 export ENTRYPOINT_MAILRELAY_CONF_VERSION=v2 export MSMTP_CONF_VERSION=v4 diff --git a/uploads.ini b/uploads.ini index a60fde7..37f881d 100644 --- a/uploads.ini +++ b/uploads.ini @@ -1,3 +1,6 @@ file_uploads = On upload_max_filesize = 256M post_max_size = 256M +memory_limit = 256M +max_execution_time = 30 +max_input_time = 30 \ No newline at end of file -- 2.47.2 From faf7335719f4c2fe79b6d3221b68f67a29987514 Mon Sep 17 00:00:00 2001 From: Steven Sting Date: Sun, 1 Dec 2024 13:06:14 +0100 Subject: [PATCH 2/5] review findings --- .env.sample | 4 ++++ uploads.ini | 6 ------ uploads.ini.tpl | 6 ++++++ 3 files changed, 10 insertions(+), 6 deletions(-) delete mode 100644 uploads.ini create mode 100644 uploads.ini.tpl diff --git a/.env.sample b/.env.sample index aa2af08..ca25d8e 100644 --- a/.env.sample +++ b/.env.sample @@ -41,6 +41,10 @@ SECRET_DB_PASSWORD_VERSION=v1 # Multisite (see README) #MULTISITE=enable # either 'enable', 'subdomain' or 'subfolder' +# File upload settings +#UPLOAD_MAX_SIZE=256M +#UPLOAD_MAX_TIME=30 + # Local SMTP relay #COMPOSE_FILE="$COMPOSE_FILE:compose.mailrelay.yml" #SMTP_HOST="postfix_relay_app" diff --git a/uploads.ini b/uploads.ini deleted file mode 100644 index 37f881d..0000000 --- a/uploads.ini +++ /dev/null @@ -1,6 +0,0 @@ -file_uploads = On -upload_max_filesize = 256M -post_max_size = 256M -memory_limit = 256M -max_execution_time = 30 -max_input_time = 30 \ No newline at end of file diff --git a/uploads.ini.tpl b/uploads.ini.tpl new file mode 100644 index 0000000..97a6284 --- /dev/null +++ b/uploads.ini.tpl @@ -0,0 +1,6 @@ +file_uploads = On +upload_max_filesize = {{ env "UPLOAD_MAX_SIZE" }} +post_max_size = {{ env "UPLOAD_MAX_SIZE" }} +memory_limit = {{ env "UPLOAD_MAX_SIZE" }} +max_execution_time = {{ env "UPLOAD_MAX_TIME" }} +max_input_time = {{ env "UPLOAD_MAX_TIME" }} \ No newline at end of file -- 2.47.2 From 1f91caf0fb3622ed455c9d8689be91ebad675869 Mon Sep 17 00:00:00 2001 From: Steven Sting Date: Sun, 1 Dec 2024 18:46:43 +0100 Subject: [PATCH 3/5] add default values for env vars --- uploads.ini.tpl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/uploads.ini.tpl b/uploads.ini.tpl index 97a6284..56fed73 100644 --- a/uploads.ini.tpl +++ b/uploads.ini.tpl @@ -1,6 +1,11 @@ +{{ $upload_max_size := "256M" }} +{{ if ne (env "UPLOAD_MAX_SIZE") "" }} {{ $upload_max_size = env "UPLOAD_MAX_SIZE" }} {{ end }} +{{ $upload_max_time := "30" }} +{{ if ne (env "UPLOAD_MAX_TIME") "" }} {{ $upload_max_time = env "UPLOAD_MAX_TIME" }} {{ end }} + file_uploads = On -upload_max_filesize = {{ env "UPLOAD_MAX_SIZE" }} -post_max_size = {{ env "UPLOAD_MAX_SIZE" }} -memory_limit = {{ env "UPLOAD_MAX_SIZE" }} -max_execution_time = {{ env "UPLOAD_MAX_TIME" }} -max_input_time = {{ env "UPLOAD_MAX_TIME" }} \ No newline at end of file +upload_max_filesize = {{ $upload_max_size }} +post_max_size = {{ $upload_max_size }} +memory_limit = {{ $upload_max_size }} +max_execution_time = {{ $upload_max_time }} +max_input_time = {{ $upload_max_time }} \ No newline at end of file -- 2.47.2 From 7a03867e2fd5582a3a59be6a80ad6a679920e17c Mon Sep 17 00:00:00 2001 From: Steven Sting Date: Mon, 2 Dec 2024 10:24:21 +0100 Subject: [PATCH 4/5] rename template file --- uploads.ini.tpl => uploads.ini.tmpl | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename uploads.ini.tpl => uploads.ini.tmpl (100%) diff --git a/uploads.ini.tpl b/uploads.ini.tmpl similarity index 100% rename from uploads.ini.tpl rename to uploads.ini.tmpl -- 2.47.2 From 0e9997a03ec99798eb7e2f37b2796aba5dc2e1d1 Mon Sep 17 00:00:00 2001 From: Steven Sting Date: Mon, 2 Dec 2024 10:27:43 +0100 Subject: [PATCH 5/5] reflect rename in compose --- compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose.yml b/compose.yml index 37060d7..3b28c32 100644 --- a/compose.yml +++ b/compose.yml @@ -113,7 +113,7 @@ configs: template_driver: golang php_uploads_conf: name: ${STACK_NAME}_php_uploads_conf_${PHP_UPLOADS_CONF_VERSION} - file: uploads.ini + file: uploads.ini.tmpl htaccess_conf: name: ${STACK_NAME}_htaccess_conf_${HTACCESS_CONF_VERSION} file: htaccess.tmpl -- 2.47.2