From 5a9cac5986cd540a25e6effb8e646bc54257aea4 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 22 Feb 2021 12:50:15 +0300 Subject: [PATCH] default TTRSS_XDEBUG_PORT if unset (and is debugging enabled) --- app/Dockerfile | 3 ++- app/startup.sh | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Dockerfile b/app/Dockerfile index 93a9b0e..7601036 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -26,9 +26,10 @@ RUN sed -i.bak 's/;clear_env = .*/clear_env = no/i' /etc/php8/php-fpm.d/www.conf ENV OWNER_UID=1000 ENV OWNER_GID=1000 +# TTRSS_XDEBUG_HOST defaults to host IP if unset ENV TTRSS_XDEBUG_ENABLED="" ENV TTRSS_XDEBUG_HOST="" -ENV TTRSS_XDEBUG_PORT="" +ENV TTRSS_XDEBUG_PORT="9000" ENV TTRSS_DB_TYPE="pgsql" ENV TTRSS_DB_HOST="db" diff --git a/app/startup.sh b/app/startup.sh index ae2ee4c..dd605aa 100755 --- a/app/startup.sh +++ b/app/startup.sh @@ -78,6 +78,9 @@ cp ${SCRIPT_ROOT}/config.docker.php $DST_DIR/config.php rm -f $DST_DIR/config.php.bak if [ ! -z "${TTRSS_XDEBUG_ENABLED}" ]; then + if [ -z "${TTRSS_XDEBUG_HOST}" ]; then + export TTRSS_XDEBUG_HOST=$(ip ro sh 0/0 | cut -d " " -f 3) + fi echo enabling xdebug with the following parameters: env | grep TTRSS_XDEBUG cat > /etc/php8/conf.d/50_xdebug.ini <