A free, self-hostable news aggregator…
COPY_SYSLOG_TO_STDERR (#2213)
Alexandre Alapetiteb73d4c807f8b
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex ff306cb7c..ce9ce145f 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -11,7 +11,7 @@* Performance: Disable unused Apache modules* Add option to mount custom `.htaccess` for HTTP authentication* Docker logs gets PHP syslog messages (e.g. from cron job and when fetching external content)- * Send a copy of PHP syslog messages to STDERR [#2208](https://github.com/FreshRSS/FreshRSS/pull/2208)+ * New environment variable `COPY_SYSLOG_TO_STDERR` or in `constants.local.php` to copy PHP syslog messages to STDERR [#2213](https://github.com/FreshRSS/FreshRSS/pull/2213)* Run Docker cron job with Apache user instead of root [#2208](https://github.com/FreshRSS/FreshRSS/pull/2208)* Accept HTTP header `X-WebAuth-User` for delegated HTTP Authentication [#2204](https://github.com/FreshRSS/FreshRSS/pull/2204)* APIdiff --git a/Docker/Dockerfile b/Docker/Dockerfileindex 52ac5f2fc..7aaee52a0 100644--- a/Docker/Dockerfile+++ b/Docker/Dockerfile@@ -23,6 +23,7 @@ RUN rm -f /etc/apache2/conf.d/languages.conf /etc/apache2/conf.d/info.conf \echo "17,37 * * * * su apache -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" >> \/var/spool/cron/crontabs/root+ENV COPY_SYSLOG_TO_STDERR OnENV CRON_MIN ''ENTRYPOINT ["./Docker/entrypoint.sh"]diff --git a/constants.php b/constants.phpindex 3a8c213d4..89eb5cda1 100644--- a/constants.php+++ b/constants.php@@ -32,6 +32,9 @@ safe_define('FRESHRSS_USERAGENT', 'FreshRSS/' . FRESHRSS_VERSION . ' (' . PHP_OS// PHP text output compression http://php.net/ob_gzhandler (better to do it at Web server level)safe_define('PHP_COMPRESSION', false);+// For cases when syslog is not available+safe_define('COPY_SYSLOG_TO_STDERR', isset($_SERVER['COPY_SYSLOG_TO_STDERR']) ? filter_var($_SERVER['COPY_SYSLOG_TO_STDERR'], FILTER_VALIDATE_BOOLEAN) : false);+// Maximum log file size in Bytes, before it will be divided by twosafe_define('MAX_LOG_SIZE', 1048576);diff --git a/lib/lib_rss.php b/lib/lib_rss.phpindex 738ccf641..89e9ddfea 100644--- a/lib/lib_rss.php+++ b/lib/lib_rss.php@@ -203,7 +203,7 @@ function html_only_entity_decode($text) {}function prepareSyslog() {- return openlog("FreshRSS", LOG_PERROR | LOG_PID, LOG_USER);+ return COPY_SYSLOG_TO_STDERR ? openlog("FreshRSS", LOG_PERROR | LOG_PID, LOG_USER) : false;}function customSimplePie($attributes = array()) {