From 52b7a1260f244cc5db06d59bbb37cc96a9781ac2 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 1 Feb 2021 10:30:31 +0300 Subject: [PATCH] re-enable nginx_xaccel; remove the rest of sed stuff from startup --- src/app/Dockerfile | 2 +- src/app/config.docker.php | 6 +++++- src/app/config.php-config.d | 5 ++++- src/app/config.php-xaccel | 1 + src/app/prepare-config.php | 2 +- src/app/startup.sh | 4 ---- 6 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 src/app/config.php-xaccel diff --git a/src/app/Dockerfile b/src/app/Dockerfile index 564ef79..899663d 100644 --- a/src/app/Dockerfile +++ b/src/app/Dockerfile @@ -57,7 +57,7 @@ ENV TTRSS_SMTP_FROM_ADDRESS="noreply@your.domain.dom" ENV TTRSS_DIGEST_SUBJECT="[tt-rss] New headlines for last 24 hours" ENV TTRSS_CHECK_FOR_UPDATES="true" ENV TTRSS_ENABLE_GZIP_OUTPUT="" -ENV TTRSS_PLUGINS="auth_internal, note" +ENV TTRSS_PLUGINS="auth_internal, note, nginx_xaccel" ENV TTRSS_LOG_DESTINATION="sql" ENV TTRSS_CONFIG_VERSION="26" diff --git a/src/app/config.docker.php b/src/app/config.docker.php index 1729b84..a546b18 100644 --- a/src/app/config.docker.php +++ b/src/app/config.docker.php @@ -170,5 +170,9 @@ // vim:ft=php $snippets = glob("/opt/tt-rss/config.d/*.php"); - foreach ($snippets as $snippet) + foreach ($snippets as $snippet) { require_once $snippet; + } + + + define('NGINX_XACCEL_PREFIX', '/tt-rss'); diff --git a/src/app/config.php-config.d b/src/app/config.php-config.d index 2091a6f..4c6a7a7 100644 --- a/src/app/config.php-config.d +++ b/src/app/config.php-config.d @@ -1,4 +1,7 @@ $snippets = glob("/opt/tt-rss/config.d/*.php"); - foreach ($snippets as $snippet) + foreach ($snippets as $snippet) { require_once $snippet; + } + + diff --git a/src/app/config.php-xaccel b/src/app/config.php-xaccel new file mode 100644 index 0000000..8b77dd0 --- /dev/null +++ b/src/app/config.php-xaccel @@ -0,0 +1 @@ + define('NGINX_XACCEL_PREFIX', '/tt-rss'); diff --git a/src/app/prepare-config.php b/src/app/prepare-config.php index 32ee765..1a82ce9 100755 --- a/src/app/prepare-config.php +++ b/src/app/prepare-config.php @@ -3,4 +3,4 @@ sed -e "s/define('\([A-Z_]\+\)', [^)]\+/define('\1', getenv('TTRSS_\1')/" \ < config.php-dist > config.docker.php -cat config.php-config.d >> config.docker.php +cat config.php-config.d config.php-xaccel >> config.docker.php diff --git a/src/app/startup.sh b/src/app/startup.sh index 772c12f..f02ba85 100755 --- a/src/app/startup.sh +++ b/src/app/startup.sh @@ -67,10 +67,6 @@ fi if [ ! -s $DST_DIR/config.php ]; then cp /config.docker.php $DST_DIR/config.php - - cat >> $DST_DIR/config.php << EOF - define('NGINX_XACCEL_PREFIX', '/tt-rss'); -EOF else egrep -q 'SELF_URL_PATH.*getenv' $DST_DIR/config.php || \ echo -e "\nWARNING: you're using old-style config.php, overrides via .env will not work.\n" >/dev/stderr