Commit Graph

54 Commits

Author SHA1 Message Date
Luc SANCHEZ
9172b65cdb phpstan level 7 for updateController.php (#5376)
* phpstan level 7 for updateController.php

* phpstan level 7 for updateController.php

* Minor array syntax

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-05-07 21:34:49 +02:00
Alexandre Alapetite
6c01e4e7d6 Use typed access to request parameters (#5267)
* Use typed access to request parameters
This was a big source of mixed datatypes in many places

* Fix notifications

* Fix bookmarkAction
2023-04-07 00:13:49 +02:00
Alexandre Alapetite
2118448133 PHPStan level 6 for more files (#5264)
7 more files passing (see phpstan-next.txt)
2023-04-05 23:26:38 +02:00
Alexandre Alapetite
36aa0122e1 Fix extensions in actualize_script (#5243)
* Fix extension freshrss_user_maintenance in actualize_script
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/3440

The hook was called before registering all the extensions for the current user

* PHPStan Level 6 for extensions
And remove 5-year old legacy format of enabled extensions < FreshRSS 1.11.1

* Fix multiple bugs in extensions

* Minor typing

* Don't change signature of methods supposed to be overridden

* PHPStan Level 9 and compatibility Intelliphense

* Set as final the methods not supposed to be overriden
2023-04-04 10:23:26 +02:00
Alexandre Alapetite
1d9d4e3e3c Update dev dependencies (#4993)
Related to https://github.com/FreshRSS/FreshRSS/pull/4991
Required a few changes in code to pass the tests
2023-01-09 12:59:30 +01:00
Alexandre Alapetite
42eeb402ad Fix type hints regressions (#4855)
Fix regressions from https://github.com/FreshRSS/FreshRSS/pull/4561

Example:

```
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to checkToken() must be an instance of FreshRSS_UserConfiguration, instance of Minz_Configuration given, called in /var/www/FreshRSS/p/api/greader.php on line 1091 and defined in /var/www/FreshRSS/p/api/greader.php:223
Stack trace:
#0 /var/www/FreshRSS/p/api/greader.php(1091): checkToken()
#1 {main}
  thrown in /var/www/FreshRSS/p/api/greader.php on line 223
```

Improvement of https://github.com/FreshRSS/FreshRSS/pull/4110
2022-11-15 15:42:26 +01:00
Alexandre Alapetite
8864d514c8 NFS-friendly is_writable() checks (#4780)
#fix https://github.com/FreshRSS/FreshRSS/issues/4779
2022-11-14 14:57:45 +01:00
Alexandre Alapetite
f56d1274c6 Fix opcache bug during Web update (#4629)
#fix https://github.com/FreshRSS/FreshRSS/issues/4624
#fix https://github.com/FreshRSS/FreshRSS/issues/4605
2022-09-20 10:36:07 +02:00
Alexandre Alapetite
f988b996ab Fix update URL (#4399)
#fix https://github.com/FreshRSS/FreshRSS/issues/4395 maybe
2022-06-02 08:40:18 +02:00
maTh
b127777887 class constant (#4194) 2022-02-04 15:47:54 +01: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
Alexandre Alapetite
c5ca737062 Git 2.21 compatiblity (#3669)
#fix https://github.com/FreshRSS/FreshRSS/issues/3665
`git branch --show-current` requires git 2.22+
https://stackoverflow.com/questions/1417957/show-just-the-current-branch-in-git
2021-06-07 23:10:25 +02:00
Alexandre Alapetite
54e0a6e553 Fix git update error message (#3645)
#fix https://github.com/FreshRSS/FreshRSS/issues/3644
2021-05-30 12:05:50 +02:00
Alexandre Alapetite
319d7dc185 Minor whitespace (#3639)
Spotted in https://github.com/FreshRSS/FreshRSS/issues/3638
2021-05-26 19:54:47 +02:00
Alexandre Alapetite
97ba6261a8 git update auto change to edge branch (#3589)
* git update auto change to edge branch
For existing installations using automatic git update, checkout *edge* branch if it was still using *master* or *dev*.

* One more prune

* Fix several small issues

* theirs does not work here

* Use migration mechanism

* Better handling of Migration errors

* Test details

* Fix tests

* Do not use new migration system for now
2021-05-15 21:33:43 +02:00
berumuron
cc6c529562 tec: Remove data/do-install.txt (#3555)
* Remove file data/do-install.txt

This file was painful during update because we had to remember to delete
it each time. It added a security issue by allowing an attacker to
reinstall FreshRSS during the update process.

The (more powerful) file data/applied_migrations.txt has been introduced
in 8619cf6fa to replace do-install.txt. We had to wait for at least one
release in order to make sure existing instances of FreshRSS created the
migration file. It should be ok now.

* Replace i18n install.not_deleted key

* Update documentation to update FreshRSS
2021-03-26 19:41:33 +01:00
Alexandre Alapetite
947e918f05 Travis: Enforce phpcs line length + whitespace (#3488)
* Update Travis line length

* Also check whitespace in CSS files

* Fix line length ext.php

* More syntax, string templates

* Fix exclude-pattern

* Test JS files as well
2021-02-28 12:26:24 +01:00
Alexandre Alapetite
2495172a05 Better git fetch (#2626)
Related to https://github.com/FreshRSS/FreshRSS/pull/2625

If for some reasons branches have diverged:, e.g.:

```
$ git status -sb --porcelain remote
## dev...origin/dev [ahead 4, behind 1]
```
2019-11-04 18:05:20 +01:00
Alexandre Alapetite
c277e15141 Git fetch+reset instead of clean+fetch+merge (#2625)
Fix https://github.com/FreshRSS/FreshRSS/issues/2619
Avoid potentially dangerous git clean, and use more robust fetch + reset
strategy instead
2019-11-02 13:38:04 +01:00
Marien Fressinaud
de26531178 tec: Provide a Minz_Mailer class (#2476)
* Add Minz_View::_path method (replace change_view)

The `_path` method is more powerful since it allows to choose the file
extension. It is also Minz_Request-agnostic, which is useful to reuse
the Minz_View class in other places.

`change_view` is now deprecated and a warning is logged if we use it.

* Provide a Minz_Mailer to send emails

It uses PHPMailer under the hood and only supports PHP >= 5.5
2019-08-15 17:19:12 +02:00
Alexis Degrugillier
0eea6d5ab5 Revert "Update git command (#2331)"
This reverts commit afd1a8784c.
2019-04-03 17:38:17 +02:00
Alexis Degrugillier
afd1a8784c Update git command (#2331)
I removed an unnecessary option and rewrote a short option
to use the long option. I find it's easier to understand
long options when you don't type them.
2019-04-03 08:02:43 +02:00
Alexandre Alapetite
83756c657f git clean before git auto-update (#2036)
* git clean before git auto-update

To avoid https://github.com/FreshRSS/FreshRSS/issues/2012 in the future

* More generic SQLite file filter

* Another -f

https://git-scm.com/docs/git-clean
2018-09-30 18:04:49 +02:00
Kevin Papst
8abfe1cf28 Update panel shows latest version message as success (#1701)
show latest version message as success, FIXES #1586
2017-12-02 13:45:26 +01:00
Alexandre Alapetite
20d1301b46 Do not require write access to check new version
Do not require write access to check if new ZIP version is available
https://github.com/FreshRSS/FreshRSS/issues/1450
2017-05-25 14:27:31 +02:00
Marien Fressinaud
9ce0bca45f fix: Fix update via ZIP archive
Code from the update server was not loaded anymore before the update
process. This commit brings back missing `require`.
2017-04-15 21:18:43 +02:00
Dennis Schwerdel
59d6f3593c Add config option to disable and hide self-update 2017-02-23 21:22:56 +01:00
Alexandre Alapetite
21e6359508 Add compatibility with git in Web update
https://github.com/FreshRSS/FreshRSS/issues/907
https://github.com/FreshRSS/FreshRSS/issues/1355
2016-11-05 15:08:10 +01:00
Marien Fressinaud
bb0556543d Move auto-update server URL in configuration
Fix https://github.com/FreshRSS/FreshRSS/issues/1019
2015-11-02 21:11:23 +01:00
Alexandre Alapetite
079150eee4 Updated log visibility
In particular, ensure that ERROR is only used for errors that may affect
FreshRSS integrity, and ensure that feed errors are visible also in
production, i.e. visibility of WARNING
https://github.com/FreshRSS/FreshRSS/issues/885
https://github.com/FreshRSS/FreshRSS/issues/884
2015-07-03 23:47:18 +02:00
Alexandre Alapetite
d30b3becfa Addressed warnings when reading from new files
There were warnings when reading extensions (trying to use e.g. README
and .gitignore as directories), and when reading update file.
https://github.com/FreshRSS/FreshRSS/issues/733
2015-01-19 13:54:57 +01:00
Marien Fressinaud
13cf8b5f9f Improve hook calls and add post_update hook
- To the hook is associated a method signature (OneToOne or NoneToNone for now) so
  it is easier to call hooks correctly
- post_update hook is called during the post update moment.
2015-01-15 12:02:42 +01:00
Marien Fressinaud
556f4ad4bf Remove restriction of 1h for update checking 2015-01-15 11:20:16 +01:00
Marien Fressinaud
e7c24b5d41 Show the version number during update process.
Number is stored inside the data/last_update.txt file and shown if there
is an update script.

See https://github.com/FreshRSS/FreshRSS/issues/699
2015-01-13 12:02:35 +01:00
Marien Fressinaud
59fc73baa9 Fix i18n for update and user controllers 2014-12-11 19:32:59 +01:00
Marien Fressinaud
58deab37cd Fix Minz_Error::error() -> use default values 2014-10-30 19:57:08 +01:00
Marien Fressinaud
9478d2f011 Add do_post_update support 2014-10-30 12:43:52 +01:00
Marien Fressinaud
7080a32650 Add checking installation feature 2014-10-20 11:54:31 +02:00
Marien Fressinaud
6009990935 Introduce FreshRSS_Auth::hasAccess('admin')
Replace Minz_Configuration::isAdmin($user). FreshRSS_Auth::hasAccess() could
be extended to others scopes later.

See https://github.com/marienfressinaud/FreshRSS/issues/655
2014-10-07 10:16:38 +02:00
Marien Fressinaud
79aa5beaf4 Refactor authentication system.
Big work, not finished. A lot of features have been removed.

See https://github.com/marienfressinaud/FreshRSS/issues/655
2014-10-06 23:29:20 +02:00
Marien Fressinaud
3b8c381689 No cache for update system
See https://github.com/marienfressinaud/FreshRSS/issues/616
2014-09-17 13:37:39 +02:00
Marien Fressinaud
a3b5e72729 Move button to apply update outside the message 2014-09-17 13:26:32 +02:00
Marien Fressinaud
a4e43e9c53 Message if last update checking is close
last_update.txt is updated even if there is no update
If last_update.txt has been modified during last hour, show a message

See https://github.com/marienfressinaud/FreshRSS/issues/480#issuecomment-55765373
2014-09-16 18:30:24 +02:00
Marien Fressinaud
098f5e6d74 Log error if update.freshrss.org is unreachable 2014-09-12 21:10:45 +02:00
Marien Fressinaud
213bc2b9dd Check if update has been done during last minute
Cancel check action if update has been done during last hour.
2014-09-12 21:07:53 +02:00
Marien Fressinaud
d59eebf542 Add data/last_update.txt
Remember last update timestamp.
2014-09-08 20:07:09 +02:00
Marien Fressinaud
48f91da2e5 Check FRESHRSS_PATH is writable.
FRESHRSS_PATH needs to be writable before performing update.
2014-09-08 19:52:21 +02:00
Marien Fressinaud
909d8747ba Update system now uses HTTPS connection
- Add some curl checks
- Refactor code
2014-08-12 20:15:46 +02:00