diff options
| author | 2022-08-21 22:44:03 +0200 | |
|---|---|---|
| committer | 2022-08-21 22:44:03 +0200 | |
| commit | 4214954ea169e6cf6b9a7b2927dce892463c851c (patch) | |
| tree | 2ef0a50dfe56343a51eaeb4864f3eee77d7d82d2 /lib/lib_rss.php | |
| parent | 85991d1c5ca1b29503e11be65a33da9a7e0c154a (diff) | |
Improved: error page (#4465)
* error page: true HTML page
* error page: http500 erorr
* error page: add CSP header
* 'log.txt' replaced by LOG_FILENAME
* use ADMIN_LOG
* log.txt => LOG_FILENAME
* error message: add <title>
* Docs created
* delete: documentation on error message page
* line break added
* added: new line at the end
* typo fixed
* Update lib/lib_rss.php
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
* Update lib/lib_rss.php
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
* Minz HTTP 500
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'lib/lib_rss.php')
| -rw-r--r-- | lib/lib_rss.php | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php index b485d379b..743aa7840 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -508,7 +508,7 @@ function invalidateHttpCache($username = '') { Minz_Session::_param('touch', uTimeString()); $username = Minz_Session::param('currentUser', '_'); } - $ok = @touch(DATA_PATH . '/users/' . $username . '/log.txt'); + $ok = @touch(DATA_PATH . '/users/' . $username . '/' . LOG_FILENAME); //if (!$ok) { //TODO: Display notification error on front-end //} @@ -569,9 +569,9 @@ function get_user_configuration($username) { FRESHRSS_PATH . '/config-user.default.php'); } catch (Minz_ConfigurationNamespaceException $e) { // namespace already exists, do nothing. - Minz_Log::warning($e->getMessage(), USERS_PATH . '/_/log.txt'); + Minz_Log::warning($e->getMessage(), ADMIN_LOG); } catch (Minz_FileNotExistException $e) { - Minz_Log::warning($e->getMessage(), USERS_PATH . '/_/log.txt'); + Minz_Log::warning($e->getMessage(), ADMIN_LOG); return null; } @@ -823,25 +823,16 @@ function errorMessageInfo($errorTitle, $error = '') { $details = "<pre>{$details}</pre>"; } + header("Content-Security-Policy: default-src 'self'"); + return <<<MSG - <h1>{$errorTitle}</h1> + <!DOCTYPE html><html><header><title>HTTP 500: {$errorTitle}</title></header><body> + <h1>HTTP 500: {$errorTitle}</h1> {$message} {$details} - <h2>Check the logs</h2> - <p>FreshRSS logs are located in <code>./FreshRSS/data/users/*/log*.txt</code></p> - <p><em>N.B.:</em> A typical problem is wrong file permissions in the <code>./FreshRSS/data/</code> folder - so make sure the Web server can write there and in sub-directories.</p> - <h3>Common locations for additional logs</h3> - <p><em>N.B.:</em> Adapt names and paths according to your local setup.</p> - <ul> - <li>If using Docker: <code>docker logs -f freshrss</code></li> - <li>To check Web server logs on a Linux system using systemd: <code>journalctl -xeu apache2</code> - and if you are using php-fpm: <code>journalctl -xeu php-fpm</code></li> - <li>Otherwise, Web server logs are typically located in <code>/var/log/apache2/</code> or similar</li> - <li>System logs may also contain relevant information in <code>/var/log/syslog</code>, or if using systemd: <code>sudo journalctl -xe</code></li> - </ul> - <p>More logs can be generated by enabling <code>'environment' => 'development',</code> in <code>./FreshRSS/data/config.php</code></p> - <p>Running the feed update script (with the same user and PHP version as your Web server) might provide other hints, e.g.: - <code>sudo -u www-data /usr/bin/php ./FreshRSS/app/actualize_script.php</code></p> + <hr /> + <small>For help see the documentation: <a href="https://freshrss.github.io/FreshRSS/en/admins/logs_and_errors.html" target="_blank"> + https://freshrss.github.io/FreshRSS/en/admins/logs_and_errors.html</a></small> + </body></html> MSG; } |
