Commit Graph

41 Commits

Author SHA1 Message Date
maTh
4214954ea1 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>
2022-08-21 22:44:03 +02:00
Alexandre Alapetite
1acd3ab09b Use typographic quotes (#4133)
* Use typographic quotes

* A few fixes

* Fix

* Fix not saved

* Implement feedback

* Detail

* Revert spoken English fixes
Left for a future dedicated discussion

* More reverts

* Final reverts

* Final minor
2022-01-08 21:58:55 +01:00
Alexandre Alapetite
1335a0e3cf PHPStan level 5 (#4110)
* Fix most PHPDocs errors
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103
https://phpstan.org/writing-php-code/phpdoc-types

* Avoid func_get_args
Use variadic syntax instead https://php.net/manual/functions.arguments#functions.variable-arg-list
And avoid dynamic functions names when possible to more easily identify calls and unused functions.
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103

* PHPStan level 3

* PHPStand level 4

* Update default to PHPStan level 4

* Towards level 5

* Fix level 4 regression

* Towards level 5

* Pass PHPStan level 5

* Towards level 6

* Remove erronenous regression from changelog
https://github.com/FreshRSS/FreshRSS/pull/4116
2022-01-04 13:59:09 +01:00
Alexandre Alapetite
77e9877316 Add PHPStan (#4021)
* Add PHPStan
#fix https://github.com/FreshRSS/FreshRSS/issues/4016
https://phpstan.org/

```sh
composer run-script phpstan
```

* More fixes

* Fix global variables

* Add .phtml

* Fix merge
https://github.com/FreshRSS/FreshRSS/pull/4090

* Fix more warnings

* Fix view errors and enable in CI

* ReturnTypeWillChange

* Dynamic view type

* Fix Minz static/self bug
2021-12-31 17:00:51 +01:00
Alexis Degrugillier
787e8fa463 Add user maintenance hooks (#3440)
The new hook allows to add maintenance extensions at the user level.

See #3398
2021-02-17 16:34:54 +01:00
Alexandre Alapetite
d42b4c299c Add requirements check in CLI (#3410)
* Add requirements check in CLI

#fix https://github.com/FreshRSS/FreshRSS/issues/1853

* More checks

#fix https://github.com/FreshRSS/FreshRSS/issues/1853
2021-02-05 22:21:31 +01:00
Alexandre Alapetite
9c6682e7ed Avoid manual initialisations of system or user configuration (#3070)
* Avoid manual intialisations of system or user configuration

More consistent use of Context

* Simplify FreshRSS_Context::initUser

* Remove a few manual get_user_configuration

* A bit of debugging

* Fix context user init

* Fix install

* Fix concurrency

Concurrent requests could lead to bad race condition

* Fix actualize cron

Fix case when system i initialised several times
2021-01-02 21:20:19 +01:00
Alexandre Alapetite
0319cc9d23 Minz allow parallel sessions (#3096)
* Minz allow parallel sessions

#fix https://github.com/FreshRSS/FreshRSS/issues/3093

* Array optimisation

* Array optimisation missing

* Reduce direct access to $_SESSION except in install process

* Fix session start headers warning

* Use cookie only the first time the session is started:
`PHP Warning:  session_start(): Cannot start session when headers
already sent in /var/www/FreshRSS/lib/Minz/Session.php on line 39`

* New concept of volatile session for API calls

Optimisation: do not use cookies or local storage at all for API calls
without a Web session
Fix warning:

```
PHP Warning:  session_destroy(): Trying to destroy uninitialized session
in Unknown on line 0
```

* Only call Minz_Session::init once in our index

It was called twice (once indirectly via FreshRSS->init())

* Whitespace

* Mutex for notifications

Implement mutex for notifications
https://github.com/FreshRSS/FreshRSS/pull/3208#discussion_r499509809

* Typo

* Install script is not ready for using Minz_Session
2020-10-06 23:19:45 +02:00
Alexis Degrugillier
caeb660f29 Add a way to disable/enable users (#3056)
If you want to block users without deleting their account, you can now
disable them from the interface.
2020-06-14 19:50:09 +02:00
Alexis Degrugillier
1694264e2c Modify shebang to be more portable (#3038)
The new shebang is a portable way to find the php interpreter. It works
on Mac, GNU/Linux and BSD.
2020-06-06 19:04:21 +02:00
Alexandre Alapetite
6f3e5d99b4 Revert to STDOUT for cron messages (#2979)
#fix https://github.com/FreshRSS/FreshRSS/issues/2975
2020-05-15 18:23:15 +02:00
Craig Andrews
62a42a2063 Delay the feeds actualization start notice (#2974)
* Delay the feeds actualization start notice

Move the actualization start notice until after SIMPLEPIE_SYSLOG_ENABLED is defined.

Fixes https://github.com/FreshRSS/FreshRSS/issues/2973

* Update app/actualize_script.php

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2020-05-15 17:23:20 +02:00
Alexandre Alapetite
11dd6e91b7 Improve logs during cron actualization (#2964)
For
https://github.com/FreshRSS/FreshRSS/issues/2952#issuecomment-626218921
And fix a little bug writing logs with the wrong user name
2020-05-14 21:21:39 +02:00
Alexandre Alapetite
aea3806590 Attempt to reduce max memory usage during actualize (#2955)
* Attempt to reduce max memory usage during actualize

#Fix https://github.com/FreshRSS/FreshRSS/issues/2952

* Use memory_get_peak_usage
2020-05-10 21:34:12 +02:00
Alexandre Alapetite
acc50df0ef Fix logging environment constants (#2745)
* Fix logging environment constants

* COPY_LOG_TO_SYSLOG was only working when Syslog was used
* FRESHRSS_ENV was not properly used to set logging level

* Simplify code

Always call `openlog()` even when it is not used

* Always specify syslog properties

https://github.com/FreshRSS/FreshRSS/pull/2745#discussion_r362207445

* $username is also needed further down

* No new line in syslog
2020-01-03 18:50:33 +01:00
Alexandre Alapetite
802c264574 Copy syslog to STDERR (#2208)
* Use openlog before syslog
In order to have a copy on stderr when syslog is not available.

* Take advantage of syslog for actualization
Pipe cron job STDERR and syslog to Docker log
Cf. 00bd467655
2019-01-06 00:46:48 +01:00
David souza
7e9a29b719 add shebang to actualize script (#1886)
* add shebang to actualize script

* Update actualize_script.php
2018-05-20 12:27:17 +02:00
Alexandre Alapetite
26d4ba63d6 Merge branch 'dev' into logfilesize 2017-12-10 22:12:07 +01:00
Kevin Papst
5c52d9b34b Check requirement in CLI script (#1711)
* check requirements in actualize_script before executing, fixes #1710

* removed empty whiteline

* testing all requirements

* incorporated code review feedback

* removed code that is already executed in _cli.php

* added newline at eof

* fixed include problems

* fixed include problems
2017-12-10 22:09:54 +01:00
Alexandre Alapetite
b1c317a253 Log rotation, use Minz_Log, new log constants
ADMIN_LOG, API_LOG, PSHB_LOG
2017-12-10 21:58:24 +01:00
Alexandre Alapetite
e1f214e9e2 CLI list-users and create-user
https://github.com/FreshRSS/FreshRSS/issues/1095
https://github.com/FreshRSS/FreshRSS/issues/1090
2016-10-22 12:58:06 +02:00
Alexandre Alapetite
e8d1a6dcc9 Cron refresh favicons
Related to
https://github.com/FreshRSS/FreshRSS/issues/1181
https://github.com/FreshRSS/FreshRSS/issues/1298
2016-10-12 15:47:04 +02:00
Marien Fressinaud
59ea9f2a3b Remove calls to syslog()
Temporary fix:

- Change syslog by Minz_Log::notice in most of the files
- Logs are stored in USERS_PATH/_/log.txt for actualize_script.php
- Simply comment syslog in SimplePie

See https://github.com/FreshRSS/FreshRSS/issues/711
2015-01-29 10:14:45 +01:00
Alexandre Alapetite
12081f7ba2 Quick fix cron actualization due to problematic FreshRSS constructor/init
https://github.com/FreshRSS/FreshRSS/issues/759
Suggestion: the static objects should be user-independent (or at least
with the possibility to be re-set), while the FreshRSS object and its
attributes should be user-dependent.
2015-01-20 23:29:04 +01:00
Marien Fressinaud
c96e1d9aec Coding style in actualize_script 2015-01-06 23:07:57 +01:00
Marien Fressinaud
cf406fc575 Fix a bug of authentication in actualize_script
See https://github.com/FreshRSS/FreshRSS/issues/730
2015-01-06 23:06:17 +01:00
Marien Fressinaud
5cdfd6d493 Fix and improve actualize_script
See https://github.com/FreshRSS/FreshRSS/issues/730
2015-01-06 22:12:48 +01:00
Marien Fressinaud
c391ca62f1 Remove all old references to LOG_PATH
See https://github.com/FreshRSS/FreshRSS/issues/729
2014-12-28 18:05:02 +01:00
Alexandre Alapetite
9f97f7df88 Ne pas rafraîchir les flux des utilisateurs non logués depuis x jours
https://github.com/marienfressinaud/FreshRSS/issues/681
Warning: needs some testing
2014-10-29 00:45:42 +01:00
Luc Didry
e861e5789d Fix errors + improvements on bug #683 fix. 2014-10-26 19:00:00 +01:00
Luc Didry
956896bf87 Fixes #683 2014-10-26 17:01:31 +01:00
plopoyop
fe29390006 start with admin only if exists 2014-10-20 22:28:40 +02:00
Alexandre Alapetite
5081ffaf39 Minz: remove one layer of ob_ (experimental)
https://github.com/marienfressinaud/FreshRSS/issues/303#issuecomment-38351311
https://github.com/marienfressinaud/FreshRSS/issues/163
* Remove Minz_Response (not needed anymore)
* Move Minz_Request::reseted to Minz_Dispatcher::reset()
2014-03-22 17:56:07 +01:00
Alexandre Alapetite
0cabd1f50d Mutex par flux pour les actualisations
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/351
Nouvelle constante TMP_PATH comme répertoire pour stocker des fichiers
temporaires (si possible en mémoire et non sur disque, tel tmpfs pour
/tmp sur certaines distributions Linux)
Requiert PHP 5.2.1+ (contre 5.2.0 auparavant) pour le
`sys_get_temp_dir()`
2014-02-11 21:48:10 +01:00
Alexandre Alapetite
5e9c60752c Actualize : Tolère PHP lancé en CGI plutôt que CLI
Corrige https://github.com/marienfressinaud/FreshRSS/issues/405
+ Message d'erreur en cas de problème de droits dans ./data/ (par
exemple si le cron utilise un mauvais utilisateur)
2014-02-01 12:23:12 +01:00
Alexandre Alapetite
cd10140346 actualize_script : messages d'erreur 2014-01-02 15:05:34 +01:00
Alexandre Alapetite
3b23ca881c Mutex pour actualize_script
Nouveau fichier temporaire ./data/actualize.lock.txt
2014-01-02 14:38:06 +01:00
Alexandre Alapetite
b4c477ca41 actualize_script compatible multi-utilisateur
* Messages plus verbeux dans actualize_script
* Ajout d'un message syslog lorsque SimplePie fait une requête HTTP
* Minz_Session ne fermait pas les sessions complètement.
* Nouvelle option dans Minz_Dispatcher et Minz_FrontController  pour ne
pas utiliser ob_gzhandler.
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126
2014-01-02 01:47:03 +01:00
Alexandre Alapetite
bd5d7a7bcb Cache HTTP compatible multi-utilisateur
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126
2013-12-30 15:00:41 +01:00
Alexandre Alapetite
92efd68a3a Début de mode multi-utilisateur avec http_auth
+ Légère optimisation de Minz_View.
+ Encore plus de tests de bibliothèques dans install.php
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126 et
https://github.com/marienfressinaud/FreshRSS/issues/303
2013-12-30 01:03:32 +01:00
Alexandre Alapetite
3ba5223e13 Déplacement de ./actualize_script.php sous ./app/
Pour une meilleure protection par défaut
2013-12-26 13:26:05 +01:00