Merge pull request #3735 from alchemy-fr/PHRAS-3372_debugger_allowed-ip

PHRAS-3372 merge add debugger allowed ip, fix issue single entry for language and trusted proxies
This commit is contained in:
Nicolas Maillat
2021-02-25 15:38:52 +01:00
committed by GitHub
3 changed files with 21 additions and 2 deletions

5
.env
View File

@@ -108,6 +108,8 @@ PHRASEANET_EXIFTOOL_TIMEOUT=120
# network : comma separated list of IP ou SUBNETS # network : comma separated list of IP ou SUBNETS
PHRASEANET_TRUSTED_PROXIES= PHRASEANET_TRUSTED_PROXIES=
PHRASEANET_DEBUG_ALLOWED_IP=
PHRASEANET_SUBNET_IPS=172.32.0.0/16
# api # api
PHRASEANET_API_ENABLED=true PHRASEANET_API_ENABLED=true
@@ -198,10 +200,9 @@ IMAGEMAGICK_POLICY_TEMPORARY_PATH=/tmp
PHRASEANET_PHPMYADMIN_PORT=8089 PHRASEANET_PHPMYADMIN_PORT=8089
# Xdebug # Xdebug
XDEBUG_ENABLED=1 XDEBUG_ENABLED=0
XDEBUG_PROFILER_ENABLED=0 XDEBUG_PROFILER_ENABLED=0
IDE_KEY=PHPSTORM IDE_KEY=PHPSTORM
PHRASEANET_SUBNET_IPS=172.32.0.0/16
XDEBUG_REMOTE_HOST=172.32.0.1 XDEBUG_REMOTE_HOST=172.32.0.1
PHP_IDE_CONFIG=serverName=docker-server-phraseanet PHP_IDE_CONFIG=serverName=docker-server-phraseanet

View File

@@ -52,6 +52,7 @@ services:
- PHRASEANET_UPGRADE - PHRASEANET_UPGRADE
- PHRASEANET_PROJECT_NAME - PHRASEANET_PROJECT_NAME
- PHRASEANET_TRUSTED_PROXIES - PHRASEANET_TRUSTED_PROXIES
- PHRASEANET_DEBUG_ALLOWED_IP
- MAX_BODY_SIZE - MAX_BODY_SIZE
- MAX_INPUT_VARS - MAX_INPUT_VARS
- MAX_EXECUTION_TIME - MAX_EXECUTION_TIME

View File

@@ -48,6 +48,7 @@ if [[ -f "$FILE" && $PHRASEANET_SETUP = 1 ]]; then
counter=$(( counter+1 )) counter=$(( counter+1 ))
if [[ $counter -eq 1 ]] ; then if [[ $counter -eq 1 ]] ; then
bin/setup system:config set languages.available $i bin/setup system:config set languages.available $i
bin/setup system:config add languages.available $i
else else
bin/setup system:config add languages.available $i bin/setup system:config add languages.available $i
fi fi
@@ -64,12 +65,28 @@ if [[ -f "$FILE" && $PHRASEANET_SETUP = 1 ]]; then
counter=$(( counter+1 )) counter=$(( counter+1 ))
if [[ $counter -eq 1 ]] ; then if [[ $counter -eq 1 ]] ; then
bin/setup system:config set trusted-proxies $i bin/setup system:config set trusted-proxies $i
bin/setup system:config add trusted-proxies $i
else else
bin/setup system:config add trusted-proxies $i bin/setup system:config add trusted-proxies $i
fi fi
done done
fi 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 " 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.ffmpeg_timeout $PHRASEANET_FFMPEG_TIMEOUT
bin/setup system:config set main.binaries.ffprobe_timeout $PHRASEANET_FFPROBE_TIMEOUT bin/setup system:config set main.binaries.ffprobe_timeout $PHRASEANET_FFPROBE_TIMEOUT