Commit Graph

44 Commits

Author SHA1 Message Date
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
Marien Fressinaud
3ca8c7ec4c Litlle improvements (update system)
- Check UPDATE_FILENAME exists before applying update
- Add empty line at the end of files
2014-08-10 11:52:18 +02:00
Marien Fressinaud
9a5d6245fb Improve update API
Update script must implement 4 functions:
- apply_update() to perform the update (most important). Return true if
  all is ok, else false.
- need_info_update() returns true if we need more info for update, else
  false. If this function always returns false, you don't need to
  implement following functions (but it's better to not forget)
- ask_info_update() should be a HTML form to ask infos. Method must be
  post and action must point to _url('update', 'apply') (or leave it
  blank)
- save_info_update() is called for POST requests (to save form from
  ask_info_update())
2014-08-10 10:55:51 +02:00
Marien Fressinaud
7ed111b1bf Add translations for update system 2014-08-10 10:35:17 +02:00
Marien Fressinaud
e7dba0ce7c Add basic system of update
- Check on update.freshrss.org for new updates
- Download script
- Apply script
- Need translations and verifications

NOTE: current script on server indicates version 0.7.3 is an update
of 0.8-dev ==> IT'S ONLY FOR MY TESTS!

Script just does a backup of ./data actually...

See https://github.com/marienfressinaud/FreshRSS/issues/411
2014-08-09 23:29:13 +02:00