diff --git a/.env b/.env index 17c7777355..5a0db3089b 100644 --- a/.env +++ b/.env @@ -108,6 +108,8 @@ PHRASEANET_EXIFTOOL_TIMEOUT=120 # network : comma separated list of IP ou SUBNETS PHRASEANET_TRUSTED_PROXIES= +PHRASEANET_DEBUG_ALLOWED_IP= +PHRASEANET_SUBNET_IPS=172.32.0.0/16 # api PHRASEANET_API_ENABLED=true @@ -198,10 +200,9 @@ IMAGEMAGICK_POLICY_TEMPORARY_PATH=/tmp PHRASEANET_PHPMYADMIN_PORT=8089 # Xdebug -XDEBUG_ENABLED=1 +XDEBUG_ENABLED=0 XDEBUG_PROFILER_ENABLED=0 IDE_KEY=PHPSTORM -PHRASEANET_SUBNET_IPS=172.32.0.0/16 XDEBUG_REMOTE_HOST=172.32.0.1 PHP_IDE_CONFIG=serverName=docker-server-phraseanet diff --git a/docker-compose.yml b/docker-compose.yml index 7708f20737..d2202ffeb5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -52,6 +52,7 @@ services: - PHRASEANET_UPGRADE - PHRASEANET_PROJECT_NAME - PHRASEANET_TRUSTED_PROXIES + - PHRASEANET_DEBUG_ALLOWED_IP - MAX_BODY_SIZE - MAX_INPUT_VARS - MAX_EXECUTION_TIME diff --git a/docker/phraseanet/entrypoint.sh b/docker/phraseanet/entrypoint.sh index 57081e0e61..59e1dbf67e 100755 --- a/docker/phraseanet/entrypoint.sh +++ b/docker/phraseanet/entrypoint.sh @@ -48,6 +48,7 @@ if [[ -f "$FILE" && $PHRASEANET_SETUP = 1 ]]; then counter=$(( counter+1 )) if [[ $counter -eq 1 ]] ; then bin/setup system:config set languages.available $i + bin/setup system:config add languages.available $i else bin/setup system:config add languages.available $i fi @@ -64,12 +65,28 @@ if [[ -f "$FILE" && $PHRASEANET_SETUP = 1 ]]; then counter=$(( counter+1 )) if [[ $counter -eq 1 ]] ; then bin/setup system:config set trusted-proxies $i + bin/setup system:config add trusted-proxies $i else bin/setup system:config add trusted-proxies $i fi done fi + echo `date +"%Y-%m-%d %H:%M:%S"` " - Phraseanet setting for debugger allowed IP" + counter=0 + if [[ -n $PHRASEANET_DEBUG_ALLOWED_IP ]]; then + for i in $(echo $PHRASEANET_DEBUG_ALLOWED_IP | sed "s/,/ /g") + do + counter=$(( counter+1 )) + if [[ $counter -eq 1 ]] ; then + bin/setup system:config set debugger.allowed-ips $i + bin/setup system:config add debugger.allowed-ips $i + else + bin/setup system:config add debugger.allowed-ips $i + fi + done + fi + echo `date +"%Y-%m-%d %H:%M:%S"` " - Phraseanet setting external Binaries timeout " bin/setup system:config set main.binaries.ffmpeg_timeout $PHRASEANET_FFMPEG_TIMEOUT bin/setup system:config set main.binaries.ffprobe_timeout $PHRASEANET_FFPROBE_TIMEOUT