From fdd507c179d9b2a9fd6635c658b0c0767b00d284 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 --- app/Dockerfile | 2 +- app/config.docker.php | 6 +++++- app/config.php-config.d | 5 ++++- app/config.php-xaccel | 1 + app/prepare-config.php | 2 +- app/startup.sh | 4 ---- 6 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 app/config.php-xaccel diff --git a/app/Dockerfile b/app/Dockerfile index 2b88b20..00b2164 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -54,7 +54,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/app/config.docker.php b/app/config.docker.php index 1729b84..a546b18 100644 --- a/app/config.docker.php +++ b/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/app/config.php-config.d b/app/config.php-config.d index 2091a6f..4c6a7a7 100644 --- a/app/config.php-config.d +++ b/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/app/config.php-xaccel b/app/config.php-xaccel new file mode 100644 index 0000000..8b77dd0 --- /dev/null +++ b/app/config.php-xaccel @@ -0,0 +1 @@ + define('NGINX_XACCEL_PREFIX', '/tt-rss'); diff --git a/app/prepare-config.php b/app/prepare-config.php index 32ee765..1a82ce9 100755 --- a/app/prepare-config.php +++ b/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/app/startup.sh b/app/startup.sh index 197f66e..c8a417a 100755 --- a/app/startup.sh +++ b/app/startup.sh @@ -72,10 +72,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