diff --git a/.env b/.env index 191754107f..f1e13fd3fa 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 -------------------- @@ -21,6 +23,9 @@ MAX_BODY_SIZE=2G # Max input var MAX_INPUT_VARS=12000 +MAX_EXECUTION_TIME=120 +MAX_INPUT_TIME=60 + # Enable opcache ? (0/1) OPCACHE_ENABLED=1 # session cache limiter (off/on) @@ -34,6 +39,8 @@ 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 provide by PHRASEANET_ADMIN_ACCOUNT_PASSWORD env value. +PHRASEANET_ADMIN_ACCOUNT_ID= PHRASEANET_ADMIN_ACCOUNT_EMAIL=admin@alchemy.fr PHRASEANET_ADMIN_ACCOUNT_PASSWORD=iJRqXU0MwbyJewQLBbra6IWHsWly # Database parameters diff --git a/docker-compose.yml b/docker-compose.yml index 34ec5133dd..6556872889 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 @@ -40,9 +41,12 @@ services: - PHRASEANET_PROJECT_NAME - MAX_BODY_SIZE - MAX_INPUT_VARS + - MAX_EXECUTION_TIME + - MAX_INPUT_TIME - OPCACHE_ENABLED - SESSION_CACHE_LIMITER - PHP_LOG_LEVEL + - PHRASEANET_ADMIN_ACCOUNT_ID - PHRASEANET_ADMIN_ACCOUNT_EMAIL - PHRASEANET_ADMIN_ACCOUNT_PASSWORD - PHRASEANET_DB_HOST diff --git a/docker/nginx/root/entrypoint.sh b/docker/nginx/root/entrypoint.sh index e46ea44296..4c9bbba5c8 100755 --- a/docker/nginx/root/entrypoint.sh +++ b/docker/nginx/root/entrypoint.sh @@ -2,6 +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/\$MAX_BODY_SIZE/$MAX_BODY_SIZE/g" | sed "s/\$GATEWAY_SEND_TIMEOUT/$GATEWAY_SEND_TIMEOUT/g" > /etc/nginx/conf.d/default.conf exec "$@" 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; } diff --git a/docker/phraseanet/entrypoint.sh b/docker/phraseanet/entrypoint.sh index 74757c3a26..820023455e 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 [[ -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 else @@ -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 $@ 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