From 0a45e46d53d36bfbf71ceb7c3d6e57dc2b3b5f28 Mon Sep 17 00:00:00 2001 From: nmaillat Date: Mon, 22 Feb 2021 23:47:59 +0100 Subject: [PATCH 1/2] PHRAS-3372 add debugger alloweb ip, fix issue case single entry for trusted proxies and language [SKIP CI] --- .env | 3 ++- docker-compose.yml | 1 + docker/phraseanet/entrypoint.sh | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 17c7777355..a50a0e7319 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 @@ -201,7 +203,6 @@ PHRASEANET_PHPMYADMIN_PORT=8089 XDEBUG_ENABLED=1 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 From 33f36cb48f8dd53ec407a8bfc0fb628981cfd0d9 Mon Sep 17 00:00:00 2001 From: Nicolas Maillat Date: Thu, 25 Feb 2021 14:05:05 +0100 Subject: [PATCH 2/2] xdebug false --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index a50a0e7319..5a0db3089b 100644 --- a/.env +++ b/.env @@ -200,7 +200,7 @@ IMAGEMAGICK_POLICY_TEMPORARY_PATH=/tmp PHRASEANET_PHPMYADMIN_PORT=8089 # Xdebug -XDEBUG_ENABLED=1 +XDEBUG_ENABLED=0 XDEBUG_PROFILER_ENABLED=0 IDE_KEY=PHPSTORM XDEBUG_REMOTE_HOST=172.32.0.1