Commit Graph

624 Commits

Author SHA1 Message Date
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
Alexandre Alapetite
607f7e7254 Fix several comments syntaxes (#3615)
Mainly wrong `@return` types in comments
2021-05-08 10:27:18 +02:00
Alexandre Alapetite
a65097f1b3 Make SSL options available to non-admins (#3612)
#fix https://github.com/FreshRSS/FreshRSS/issues/3611
2021-05-07 17:21:16 +02:00
Alexandre Alapetite
83a352e4bf Removed unused variable (#3587)
From https://github.com/FreshRSS/FreshRSS/pull/2335
2021-04-17 18:11:03 +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
eeff1a17b0 Suport standard HTTP 410 Gone (#3561)
When a feed returns an HTTP 410 Gone, mute the corresponding feed, i.e. stop refreshing it.
Example of such feed, Les Décodeurs (Libération) https://rss.liberation.fr/rss/100893/
2021-03-26 19:13:23 +01:00
Alexandre Alapetite
de40f3ad56 Fix TT-RSS import (#3553) 2021-03-24 19:04:51 +01:00
Alexandre Alapetite
90a0028d49 Fix DB lock bug during refresh (MariaDB) (#3559)
#fix https://github.com/FreshRSS/FreshRSS/issues/3552
2021-03-23 22:31:48 +01:00
Alexis Degrugillier
4f4ce3c71b Remove shortcut validation (#3548)
Before, only standard shortcuts were supported. When other shortcuts were
configured, they were filtered out.
Now, those shortcuts are stored in the configuration and an alert message
is displayed to alert the user that he is using non-standard shortcuts.

See #3481
2021-03-21 15:42:27 +01:00
Alexandre Alapetite
e2533bd946 Fix undefined variable & dead code when adding feed (#3546)
Related to https://github.com/FreshRSS/FreshRSS/issues/3537
2021-03-21 12:23:32 +01:00
Alexis Degrugillier
789a166496 Fix search param encoding in user query (#3541)
Before, the chosen encoding was not the best for the task since some part
of the value was truncated when used with quotes.
Now, the encoding allows to work smoothly with quotes.

See #3538
2021-03-19 13:51:42 +01:00
Jules-Bertholet
800a42172d Add an option to set a custom user agent to retrieve individual feeds (#3494)
* Add an option to set a custom user agent to retrieve individual feeds

This allows retrieving the original RSS feed when websites use services like FeedBurner.

* Use !== instead of != in subscriptionController.php

* Add proxy and user-agent to subscription/add

Co-authored-by: Georgelemental <georgelemental@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2021-03-09 20:51:09 +01:00
Alexandre Alapetite
ef4a826e34 Reload full content when changed (#3506)
* Reload full content when changed
If an article is changed, reload also its full content when applicable.

* Compute hash before getting full content

* Revert mix two PRs

* Update app/Controllers/feedController.php
2021-03-09 08:41:01 +01:00
Alexandre Alapetite
b10cd770ee SQLite: fix updateEntry (#3461)
* Draft of fix for updateEntry

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

* Fix for SQLite

* Update app/Models/EntryDAO.php

Fixed in https://github.com/FreshRSS/FreshRSS/pull/3500

* Unbuffered streaming only for MySQL
2021-03-07 17:34:47 +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
Alexis Degrugillier
fd80387541 Change zip handling methods (#3470)
Before, we were using zip function but they are marked as deprecated as of
PHP 8.0. It's not safe to use them anymore since they can be removed at any
given time.
Now, we are using the ZipArchive class to handle our zip methods. It's safe
to use it since it's available for PHP 5.2 and higher.

See #3460
2021-02-21 00:51:53 +01:00
Alexis Degrugillier
fe1fba9828 Add a content action parameter to work with CSS selector (#3453)
Before, when retrieving article contents with CSS selector, the content
of the RSS feed was replaced by the content of the CSS selector. It works
well in most of the cases but if there is a different content in the feed
and in the selector, the former is lost.
Now, there is a parameter to decide which action is performed after retrieving
the content. By default, the previous behavior is kept. But now, it is
possible to append or prepend the CSS selector content to the feed content.

See #3451
2021-02-16 18:00:49 +01:00
Alexandre Alapetite
4a87f34bcf API implement OPML import/export (#3424)
#fix https://github.com/FreshRSS/FreshRSS/issues/3421
2021-02-06 12:43:30 +01:00
Alexis Degrugillier
0954c76866 Fix load default action on shortcuts (#3394)
See #3388
2021-01-24 00:42:21 +01:00
Alexandre Alapetite
2981714f15 Fix form login if user does not exist (#3377)
Small bug from https://github.com/FreshRSS/FreshRSS/pull/3070 , leading
to an exception due to not being able to log the error.

Minor: Also add some very primitive mitigation of timing attacks (to
find out whether a user exists or not, although I have not checked
whether this might be guessed through other means) - before, if the user
did not exist, the response was always measurably faster; now it is
harder to tell due to the noise
2021-01-17 19:57:39 +01:00
Eris
ee175dd616 CURLOPT parameters per feed (#3367)
* Working curlopt_params

* Examples

* curl_params for fetching the article

* cleanup

* clarification

* Remove debugging

* Options corrected

* Removed Debugging

* i18n not needed (right now)

* Translations and UI rework

* Checks in update.phtml

* Unset Proxy&Cookies

* remove clutter

* minor fuckup

* i18n added properly

* resolve Errors

* linting errors

* linting errors, again

* Review

* Minor revert

* Minor i18n: de

Co-authored-by: maru <maru@nyx.im>
Co-authored-by: Aeris <a3x@eris.cc>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2021-01-16 22:32:18 +01:00
Alexis Degrugillier
5c18c64afb Change integration configuration page (#3372)
I've refactored the user query code to be able to use it also on the
integration configuration page. Now, items can be re-organized as in
the user query list.
2021-01-16 22:11:30 +01:00
Alexis Degrugillier
c5da4e56a6 Add a query configuration page (#3366)
* Add a query configuration page

Before, there was no way to modify a user query. Thus you need to
create a new one and delete the old one afterward.
Now, every user query can be modified if needed. They have their
own configuration page on which it can be modified or deleted.

* Change drag and drop action on queries

Before, the drag and drop action needed to be validated by submitting
the form to be persisted.
Now, it's done automatically after the query is dropped to its final
location.
2021-01-15 00:14:53 +01:00
Alexis Degrugillier
29fe125b4a Add constant for PHP requirements (#3369)
* Add constant for PHP requirements

This new constant is used for PHP version check.
This way, we won't forget to modify some part of the code base.

* Remove PHP version checks

Some checks were obsolete because they were checking unsupported
PHP versions.
2021-01-14 23:28:45 +01:00
Alexandre Alapetite
ee7938ed5f Do not import feed causing DB error (#3347)
* Do not import feed causing DB error

The DB error might be that the new feed tries to redirect to an already
existing feed, in which case
#fix https://github.com/FreshRSS/FreshRSS/issues/3339

* Add feed bug
2021-01-09 20:51:33 +01:00
Alexis Degrugillier
896f9d3363 Add user query manual sorting (#3346)
* Add user query manual sorting

Before, to change the user query order, you'll have to delete them
and recreate them. It was not really efficient.
Now, you can drag and drop them to ease reordering.

See #2216 and #2015

* Remove cancel action on user query configuration

Before, the cancel action was useless since it was not wired.
Now, there is no cancel action.

See #2015
2021-01-09 01:47:20 +01:00
Alexis Degrugillier
85cbfcedb5 Update user query feature (#3338)
* Change user query wording

There was some misunderstanding in the use of the user query feature,
probably because of the wording. I've change it to make it more obvious.

* Fix feedback when a query is bookmarked

Before, the displayed query name was not the one intended. Now, the name is the one of the current bookmark

* Document user queries

I've added a few words on how to use the user queries because it seems there was some misunderstanding. See #3219
2021-01-07 21:47:39 +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
99c3263cbe Trim rid param from user query (#3306)
Caused by https://github.com/FreshRSS/FreshRSS/pull/3208
Before, the 'rid' parameter was saved as part of the user query.
2020-12-29 19:17:06 +01:00
Alexis Degrugillier
e93675e036 Fix tag management translation (#3292)
Before, feedback messages were not translated.
Now, they are.
2020-12-28 13:08:38 +01:00
Martin
6ecfc01c1f bump default logout from 30 days to 3 months (#3170)
* 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

Co-authored-by: Martin Rys <martin@rys.pw>
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2020-12-26 23:40:24 +01:00
Alexandre Alapetite
4f74215199 Better OPML import of feeds in multiple categories (#3286)
#fix https://github.com/FreshRSS/FreshRSS/issues/3284
Helps https://github.com/FreshRSS/FreshRSS/issues/1989

In OPMLs files in which feeds are listed several times, favour the
version in a category instead of in no category.
2020-12-26 17:23:23 +01:00
Alexis Degrugillier
4abb30228b Fix user queries with labels (#3285)
Before user queries with labels were not translated. Actually, it was not
even processed.
Now those user queries are translated properly.

See #3215
2020-12-26 12:50:09 +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
knasdk
e43b7ecd09 Use of existing tag name via input field (#3213)
* Use of existing tag name via input field

Use existing tag name, when tag name is typed into tag list's text field

* Indentation mistake

Just an indentation correction

* Final correction

Missed line 35.
2020-10-06 23:15:02 +02:00
Alexandre Alapetite
7652369359 Minz: Attach a notification to a request (#3208)
* Minz: Attach a notification to a request

Notifications should be attached to a request, not to a global session.
Fix
https://github.com/FreshRSS/FreshRSS/pull/3096#issuecomment-654891906
Prepare https://github.com/FreshRSS/FreshRSS/pull/3096

* Rename array

* Avoid string constants

Implement
https://github.com/FreshRSS/FreshRSS/pull/3208#issuecomment-703243863

* Improved logic

* Simplify storage

https://github.com/FreshRSS/FreshRSS/pull/3208#discussion_r499511213

* Fix notification bug in configuration/system
2020-10-05 19:03:33 +02:00
Alexandre Alapetite
bb9b166eb1 Fix CLI api_password (#3179)
* Fix CLI api_password

#fix https://github.com/FreshRSS/FreshRSS/issues/3177
Fix regression from https://github.com/FreshRSS/FreshRSS/pull/2675

* Update cli/_update-or-create-user.php

Co-authored-by: oupala <oupala@users.noreply.github.com>

Co-authored-by: oupala <oupala@users.noreply.github.com>
2020-09-17 09:43:39 +02:00
Alexandre Alapetite
48345403df Trim whitespace for feed passwords (#3158)
We output a space by default in the user interface for setting feed
passwords, in order to prevent aggressive password autocompletion
https://github.com/FreshRSS/FreshRSS/pull/881
However, user might not always override this white space when entering
the password. So here we trim.
(I believe legitimate leading / trailing spaces in passwords are
sufficiently rare not to be a problem)
2020-08-29 12:16:20 +02:00
Alexis Degrugillier
909fdaca31 Add tag management page (#3121)
The new page allows to create, delete and rename tags.

See #3058
2020-07-23 11:31:38 +02:00
Alexis Degrugillier
35eed83b64 Add a way to disable shortcuts (#3114)
When the user do not want to use a shortcut, he can let the shortcut value
empty. This will save an empty configuration thus disabling the shortcut.
The load default action allows to use default shortcut only for disabled
shortcuts.

See #3110
2020-07-14 11:02:30 +02:00
Alexandre Alapetite
051f1649f7 FeedMe table manage feeds + fix warning addFeed (#3075)
FeedMe is able to add/remove subscriptions.

Fix minor bug introduced by
https://github.com/FreshRSS/FreshRSS/pull/1731
If the category ID is provided, we must first search for the existing
category before trying to add a category with the provided name.
Fix:

```
SQL error addCategory: ["23000",19,"UNIQUE constraint failed:
category.name"]
```
2020-06-21 10:30:12 +02:00
Alexandre Alapetite
b9d2e6457a Fetch feed name / website / description if empty (#3071)
#fix https://github.com/FreshRSS/FreshRSS/issues/3067
2020-06-20 16:54:03 +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
Marien Fressinaud
15505a0377 tec: Refactor the export feature (#3045)
Even if the issue #3035 seemed pretty simple at a first glance, it was
more complicated than I expected. Because we send CSP headers AFTER
running the controller actions, it means we can't "echo" any content
from the controller. It's in fact a good practice, but it was easier at
the time we developed the feature.

To fix that, the only thing I had to do was to move the `print()` and
`readfile()` function into the view. The problem was that we needed to
output the content from the CLI too. Then, things became more
complicated. I decided to extract the export-related methods in a
`FreshRSS_Export_Service` class, in order to use it from both the
controller and the CLI. It was an opportunity to refactor the whole
feature in order to make it a bit more linear and easy to read.

Reference: https://github.com/FreshRSS/FreshRSS/issues/3035
2020-06-13 19:36:24 +02:00
Alexis Degrugillier
b2b249d6d6 Fix user queries when they contain " (#3037)
Before, the user queries were working filter-wise but they failed at being displayed
properly in the configuration page. Thus they were stored without the search param.
Now, the search is URL encoded to avoid that kind of behavior and keep the search
param through out the user query's life.
2020-06-06 20:59:53 +02:00
Alexis Degrugillier
8c4d71da2e Add missing translations (#3034)
* Add missing translations

* Add a simple way to check if an i18n key exists

There is a rule in the makefile to access it directly
2020-06-05 20:16:04 +02:00
Alexis Degrugillier
36bda2e715 Add language detection when the user is not logged in (#3022)
Before, when the user was not logged in, pages where translated with the '_' user language.
Now, they are translated with the user preferred language if there is one supported by FreshRSS or with the system default language.
2020-06-05 10:10:46 +02:00
Alexis Degrugillier
d4554fa087 Change add feed action (#3027)
* Docker Alpine 3.12 (#3025)

https://alpinelinux.org/posts/Alpine-3.12.0-released.html
With PHP 7.3.18 (from 7.3.17) (and Apache 2.4.43 unchanged).
No other significant change spotted

* Ensure feed attributes are used before load

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2020-06-05 10:09:31 +02:00
Alexandre Alapetite
857f588790 Fix fetch preview (#2993)
* Fix fetch preview

#fix https://github.com/FreshRSS/FreshRSS/issues/2923
In MariaDB / MySQL, we cannot start a new query if we have not consumed
the previous buffered query fully.

* Fix for reload

* Typo in comment
2020-05-21 20:55:06 +02:00
Alexandre Alapetite
0442243037 Fix nav_menu mark-as-read (#2909)
* Fix nav_menu mark-as-read

#Fix https://github.com/FreshRSS/FreshRSS/issues/2905
Fix regression from https://github.com/FreshRSS/FreshRSS/pull/2588

We need info about the first item (id_max) before being able to output
nav_menu. Before https://github.com/FreshRSS/FreshRSS/pull/2588 we used
to output everything in memory before starting to produce an output. Now
that we stream the output, we need a temporary buffer until we have
received the first item/article.

* Repair loading page

* Simplify CSS

Make it work in Chrome as well

* Lint

* Partial revert

* Base max_id solely on current time
2020-05-18 18:45:47 +02:00