From 934f032c19ba0ae16a4d19702c8e95c377f64c14 Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 5 Feb 2021 21:59:21 +0100 Subject: Better error message on failure (#3407) * bump default logout from 30 to 365 days * * Change cookie duration to constant * Change cookie duration to three months * use class * use 90 days (otherwise login form says 91.3 days) * change class * also this works now * Better error message * inconsistent dot with the other message * Better error message * add errorMessage() * fix style * html escape the error title * also html escape error message * remove spaces before parentheses * rework the error message * Minz-friendly * Update message Do not advise running this script as wrong user * Update lib/lib_rss.php Co-authored-by: Martin Co-authored-by: Martin Rys Co-authored-by: Frans de Jonge Co-authored-by: Alexandre Alapetite --- lib/lib_rss.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'lib/lib_rss.php') diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 37eea7c0f..cf1cd1b50 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -578,3 +578,30 @@ function validateShortcutList($shortcuts) { } return $shortcuts_ok; } + +function errorMessage($errorTitle, $error = '') { + // Prevent empty

tags by checking if error isn't empty first + if ('' !== $error) { + $error = htmlspecialchars($error, ENT_NOQUOTES, 'UTF-8'); + $error = "

{$error}

"; + } + $errorTitle = htmlspecialchars($errorTitle, ENT_NOQUOTES, 'UTF-8'); + return <<{$errorTitle} + {$error} +

Common problems

+

A typical problem leading to this message is wrong file permissions in the ./FreshRSS/data/ folder so make sure the Web server can write there and in sub-directories.

+

Common locations for additional logs

+

N.B.: Adapt names and paths according to your local setup.

+
    +
  • If using Docker: docker logs -f freshrss
  • +
  • To check Web server logs on a Linux system using systemd: journalctl -xeu apache2 + and if you are using php-fpm: journalctl -xeu php-fpm
  • +
  • Otherwise, Web server logs are typically located in /var/log/apache2/ or similar
  • +
  • System logs may also contain relevant information in /var/log/syslog, or if using systemd: sudo journalctl -xe
  • +
+

More logs can be generated by enabling 'environment' => 'development', in ./FreshRSS/data/config.php

+

Running the feed update script (with the same user and PHP version as your Web server) might provide other hints, e.g.: + sudo -u www-data /usr/bin/php ./FreshRSS/app/actualize_script.php

+ MSG; +} -- cgit v1.2.3