From e444e67215343ed3015b4cf5df6268e80fbdb36f Mon Sep 17 00:00:00 2001 From: gjacobjn <52928254+gjacobjn@users.noreply.github.com> Date: Thu, 2 Jul 2020 12:31:45 +0200 Subject: [PATCH 01/12] Update .env --- .env | 1 + 1 file changed, 1 insertion(+) diff --git a/.env b/.env index 191754107f..b18d09366e 100644 --- a/.env +++ b/.env @@ -34,6 +34,7 @@ PHP_LOG_LEVEL=warning # These variables are used in the configuration.yml . # set here the first user / email couple +PHRASEANET_ADMIN_ACCOUNT_ID=1 PHRASEANET_ADMIN_ACCOUNT_EMAIL=admin@alchemy.fr PHRASEANET_ADMIN_ACCOUNT_PASSWORD=iJRqXU0MwbyJewQLBbra6IWHsWly # Database parameters From 2b61f1963fbaf801e2f85d04d95e5a05c9220c82 Mon Sep 17 00:00:00 2001 From: gjacobjn <52928254+gjacobjn@users.noreply.github.com> Date: Thu, 2 Jul 2020 12:33:45 +0200 Subject: [PATCH 02/12] Update docker-compose.yml --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 34ec5133dd..1f906e4cb1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -43,6 +43,7 @@ services: - OPCACHE_ENABLED - SESSION_CACHE_LIMITER - PHP_LOG_LEVEL + - PHRASEANET_ADMIN_ACCOUNT_ID - PHRASEANET_ADMIN_ACCOUNT_EMAIL - PHRASEANET_ADMIN_ACCOUNT_PASSWORD - PHRASEANET_DB_HOST From b647f172286837bea97dfeed1401c7fb92142069 Mon Sep 17 00:00:00 2001 From: gjacobjn <52928254+gjacobjn@users.noreply.github.com> Date: Thu, 2 Jul 2020 12:37:36 +0200 Subject: [PATCH 03/12] Update entrypoint.sh --- docker/phraseanet/entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/phraseanet/entrypoint.sh b/docker/phraseanet/entrypoint.sh index 74757c3a26..ed23d9d253 100755 --- a/docker/phraseanet/entrypoint.sh +++ b/docker/phraseanet/entrypoint.sh @@ -32,8 +32,8 @@ if [ -f "$FILE" ]; then bin/setup system:config set registry.email.emitter-email $PHRASEANET_EMITTER_EMAIL bin/setup system:config set registry.email.prefix $PHRASEANET_MAIL_OBJECT_PREFIX fi - if [[ $PHRASEANET_ADMIN_ACCOUNT_PASSWORD ]]; then - bin/console user:password --user_id=1 --password $PHRASEANET_ADMIN_ACCOUNT_PASSWORD -y + if [[ $PHRASEANET_ADMIN_ACCOUNT_ID && $PHRASEANET_ADMIN_ACCOUNT_ID =~ ^[0-9]+$ ]]; then + bin/console user:password --user_id=$PHRASEANET_ADMIN_ACCOUNT_ID --password $PHRASEANET_ADMIN_ACCOUNT_PASSWORD -y fi else From 7b4e82a487c7f407b0f4d183bb6b29262531b5ee Mon Sep 17 00:00:00 2001 From: Nicolas Maillat Date: Mon, 6 Jul 2020 13:24:14 +0200 Subject: [PATCH 04/12] Update .env --- .env | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.env b/.env index b18d09366e..d43441b99b 100644 --- a/.env +++ b/.env @@ -34,7 +34,8 @@ PHP_LOG_LEVEL=warning # These variables are used in the configuration.yml . # set here the first user / email couple -PHRASEANET_ADMIN_ACCOUNT_ID=1 +#set to id of phraseanet root account, if you want activate a sync for phraseanet root account password from env value. +PHRASEANET_ADMIN_ACCOUNT_ID= PHRASEANET_ADMIN_ACCOUNT_EMAIL=admin@alchemy.fr PHRASEANET_ADMIN_ACCOUNT_PASSWORD=iJRqXU0MwbyJewQLBbra6IWHsWly # Database parameters From 4cf43797b9a6df846dc18522d5556e354c5af8d6 Mon Sep 17 00:00:00 2001 From: Nicolas Maillat Date: Mon, 6 Jul 2020 13:25:13 +0200 Subject: [PATCH 05/12] Update .env --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index d43441b99b..b151a9a7d7 100644 --- a/.env +++ b/.env @@ -34,7 +34,7 @@ PHP_LOG_LEVEL=warning # These variables are used in the configuration.yml . # set here the first user / email couple -#set to id of phraseanet root account, if you want activate a sync for phraseanet root account password from env value. +#set to id of Phraseanet root account, if you want activate a sync for Phraseanet root account password provide by PHRASEANET_ADMIN_ACCOUNT_PASSWORD env value. PHRASEANET_ADMIN_ACCOUNT_ID= PHRASEANET_ADMIN_ACCOUNT_EMAIL=admin@alchemy.fr PHRASEANET_ADMIN_ACCOUNT_PASSWORD=iJRqXU0MwbyJewQLBbra6IWHsWly From 7e5f020703d5626438393eb88cfc3fdb919cdcbc Mon Sep 17 00:00:00 2001 From: gjacobjn <52928254+gjacobjn@users.noreply.github.com> Date: Mon, 6 Jul 2020 16:21:50 +0200 Subject: [PATCH 06/12] Fix for PHRASEANET_ADMIN_ACCOUNT_ID not set Fix condition when PHRASEANET_ADMIN_ACCOUNT_ID is not set in :env --- docker/phraseanet/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/phraseanet/entrypoint.sh b/docker/phraseanet/entrypoint.sh index ed23d9d253..c7db40255f 100755 --- a/docker/phraseanet/entrypoint.sh +++ b/docker/phraseanet/entrypoint.sh @@ -32,7 +32,7 @@ if [ -f "$FILE" ]; then bin/setup system:config set registry.email.emitter-email $PHRASEANET_EMITTER_EMAIL bin/setup system:config set registry.email.prefix $PHRASEANET_MAIL_OBJECT_PREFIX fi - if [[ $PHRASEANET_ADMIN_ACCOUNT_ID && $PHRASEANET_ADMIN_ACCOUNT_ID =~ ^[0-9]+$ ]]; then + if [[ -n ${PHRASEANET_ADMIN_ACCOUNT_ID} && $PHRASEANET_ADMIN_ACCOUNT_ID =~ ^[0-9]+$ ]]; then bin/console user:password --user_id=$PHRASEANET_ADMIN_ACCOUNT_ID --password $PHRASEANET_ADMIN_ACCOUNT_PASSWORD -y fi From 3f476360942509213e3592896325912a3cf6826e Mon Sep 17 00:00:00 2001 From: Nicolas Maillat Date: Mon, 6 Jul 2020 17:15:57 +0200 Subject: [PATCH 07/12] typo fix --- docker/phraseanet/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/phraseanet/entrypoint.sh b/docker/phraseanet/entrypoint.sh index 74757c3a26..c4dbc04ee5 100755 --- a/docker/phraseanet/entrypoint.sh +++ b/docker/phraseanet/entrypoint.sh @@ -58,7 +58,7 @@ chown -R app:app \ www if [ -d "plugins/" ];then -chown -R app:app plugin; +chown -R app:app plugins; fi bash -e docker-php-entrypoint $@ From 7eb95a97c5d595243d5ea3563891f9d97b0668ef Mon Sep 17 00:00:00 2001 From: nmaillat Date: Mon, 6 Jul 2020 19:03:54 +0200 Subject: [PATCH 08/12] set php timeout --- .env | 3 +++ docker-compose.yml | 2 ++ docker/phraseanet/php.ini.sample | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 191754107f..9cde37640c 100644 --- a/.env +++ b/.env @@ -21,6 +21,9 @@ MAX_BODY_SIZE=2G # Max input var MAX_INPUT_VARS=12000 +MAX_EXECUTION_TIME=600 +MAX_INPUT_TIME=60 + # Enable opcache ? (0/1) OPCACHE_ENABLED=1 # session cache limiter (off/on) diff --git a/docker-compose.yml b/docker-compose.yml index 34ec5133dd..2456b33650 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -40,6 +40,8 @@ services: - PHRASEANET_PROJECT_NAME - MAX_BODY_SIZE - MAX_INPUT_VARS + - MAX_EXECUTION_TIME + - MAX_INPUT_TIME - OPCACHE_ENABLED - SESSION_CACHE_LIMITER - PHP_LOG_LEVEL diff --git a/docker/phraseanet/php.ini.sample b/docker/phraseanet/php.ini.sample index 7f5fc97430..86634486a7 100644 --- a/docker/phraseanet/php.ini.sample +++ b/docker/phraseanet/php.ini.sample @@ -380,7 +380,7 @@ expose_php = On ; Maximum execution time of each script, in seconds ; http://php.net/max-execution-time ; Note: This directive is hardcoded to 0 for the CLI SAPI -max_execution_time = 9999 +max_execution_time = $MAX_EXECUTION_TIME ; Maximum amount of time each script may spend parsing request data. It's a good ; idea to limit this time on productions servers in order to eliminate unexpectedly @@ -390,7 +390,7 @@ max_execution_time = 9999 ; Development Value: 60 (60 seconds) ; Production Value: 60 (60 seconds) ; http://php.net/max-input-time -max_input_time = 60 +max_input_time = $MAX_INPUT_TIME ; Maximum input variable nesting level ; http://php.net/max-input-nesting-level From 72d2bc028d0ad328c01922f448f43b4819ac6599 Mon Sep 17 00:00:00 2001 From: nmaillat Date: Mon, 6 Jul 2020 20:13:27 +0200 Subject: [PATCH 09/12] set gateway fpm timeout --- .env | 2 ++ docker-compose.yml | 1 + docker/nginx/root/entrypoint.sh | 1 + 3 files changed, 4 insertions(+) diff --git a/.env b/.env index 9cde37640c..c383641f01 100644 --- a/.env +++ b/.env @@ -13,6 +13,8 @@ RABBITMQ_MANAGEMENT_PORT=10811 MYSQL_ROOT_PASSWORD=root SERVER_NAME=phraseanet-docker +# --------------- GATEWAY TIMEOUT ----------------------- +$GATEWAY_SEND_TIMEOUT=120 # --------------- PHP CONFIGURATION -------------------- diff --git a/docker-compose.yml b/docker-compose.yml index 2456b33650..7a26da7505 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,6 +19,7 @@ services: - phraseanet environment: - MAX_BODY_SIZE + - GATEWAY_SEND_TIMEOUT ports: - ${PHRASEANET_APP_PORT}:80 diff --git a/docker/nginx/root/entrypoint.sh b/docker/nginx/root/entrypoint.sh index e46ea44296..30ca3e635e 100755 --- a/docker/nginx/root/entrypoint.sh +++ b/docker/nginx/root/entrypoint.sh @@ -3,5 +3,6 @@ set -xe cat /nginx.conf.sample | sed "s/\$MAX_BODY_SIZE/$MAX_BODY_SIZE/g" > /etc/nginx/conf.d/default.conf +cat /nginx.conf.sample | sed "s/\$GATEWAY_SEND_TIMEOUT/$GATEWAY_SEND_TIMEOUT/g" > /etc/nginx/conf.d/default.conf exec "$@" From e828e9891608e9f4aa8e29c59bbf2d5241de0d12 Mon Sep 17 00:00:00 2001 From: nmaillat Date: Mon, 6 Jul 2020 20:18:26 +0200 Subject: [PATCH 10/12] set timeout default value to 120 sec --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index c383641f01..4fd40b91d1 100644 --- a/.env +++ b/.env @@ -23,7 +23,7 @@ MAX_BODY_SIZE=2G # Max input var MAX_INPUT_VARS=12000 -MAX_EXECUTION_TIME=600 +MAX_EXECUTION_TIME=120 MAX_INPUT_TIME=60 # Enable opcache ? (0/1) From f3750e987b12dea0e9fc1e3b43fa15810eacdf33 Mon Sep 17 00:00:00 2001 From: nmaillat Date: Mon, 6 Jul 2020 20:42:08 +0200 Subject: [PATCH 11/12] add nginx.conf --- docker/nginx/root/nginx.conf.sample | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/nginx/root/nginx.conf.sample b/docker/nginx/root/nginx.conf.sample index ad015e7c5a..f1df63f892 100644 --- a/docker/nginx/root/nginx.conf.sample +++ b/docker/nginx/root/nginx.conf.sample @@ -1,3 +1,4 @@ +send_timeout $GATEWAY_SEND_TIMEOUT; upstream backend { server phraseanet:9000; } From 25319e6b184901dfd182760bdbf8a628acf6fd75 Mon Sep 17 00:00:00 2001 From: nmaillat Date: Mon, 6 Jul 2020 21:35:15 +0200 Subject: [PATCH 12/12] fix sed src --- .env | 2 +- docker/nginx/root/entrypoint.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 4fd40b91d1..db34db0c83 100644 --- a/.env +++ b/.env @@ -14,7 +14,7 @@ MYSQL_ROOT_PASSWORD=root SERVER_NAME=phraseanet-docker # --------------- GATEWAY TIMEOUT ----------------------- -$GATEWAY_SEND_TIMEOUT=120 +GATEWAY_SEND_TIMEOUT=120 # --------------- PHP CONFIGURATION -------------------- diff --git a/docker/nginx/root/entrypoint.sh b/docker/nginx/root/entrypoint.sh index 30ca3e635e..4c9bbba5c8 100755 --- a/docker/nginx/root/entrypoint.sh +++ b/docker/nginx/root/entrypoint.sh @@ -2,7 +2,6 @@ set -xe -cat /nginx.conf.sample | sed "s/\$MAX_BODY_SIZE/$MAX_BODY_SIZE/g" > /etc/nginx/conf.d/default.conf -cat /nginx.conf.sample | sed "s/\$GATEWAY_SEND_TIMEOUT/$GATEWAY_SEND_TIMEOUT/g" > /etc/nginx/conf.d/default.conf +cat /nginx.conf.sample | sed "s/\$MAX_BODY_SIZE/$MAX_BODY_SIZE/g" | sed "s/\$GATEWAY_SEND_TIMEOUT/$GATEWAY_SEND_TIMEOUT/g" > /etc/nginx/conf.d/default.conf exec "$@"