Commit Graph

4681 Commits

Author SHA1 Message Date
Martin
934f032c19 Better error message on failure (#3407)
* 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

* Better error message

* inconsistent dot with the other message

* Better error message

* add errorMessage()

* fix style

* html escape the error title

* also html escape error message

* remove spaces before parentheses

* rework the error message

* Minz-friendly

* Update message

Do not advise running this script as wrong user

* Update lib/lib_rss.php

Co-authored-by: Martin <spleefer90@gmail.com>

Co-authored-by: Martin Rys <martin@rys.pw>
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2021-02-05 21:59:21 +01:00
Alexis Degrugillier
0577bc772b Add a method to retrieve a configuration value (#3422)
This will simplify extension code by removing a lot of logic from
the extension itself when it's not needed. I've tested it on one
of my extension with all the other recent extension modifications
and I could remove half of the code needed before.
2021-02-05 18:29:37 +01:00
Alexis Degrugillier
d7cfea155f Fix extension file search (#3413)
Before, it was possible to retrieve only the files from extensions. Thus
making core extension files unreachable.
Now, the selected file is search through all extensions folders.
2021-02-02 14:27:34 +01:00
Alexis Degrugillier
36f9d44d54 Fix user configuration in extension (#3412)
Before, only one extension could be configured at a time. Thus we
were loosing the configuration for other extensions when saving.
Now, each extension can be saved without overriding data.

See #3397
2021-02-02 12:40:03 +01:00
Alexandre Alapetite
1ee1fcce91 INSERT ... ON CONFLIT DO NOTHING for addEntry (#3409)
#fix https://github.com/FreshRSS/FreshRSS/issues/3402
Explicit `INSERT OR IGNORE` / `ON CONFLICT DO NOTHING` for the
`addEntry()` method, which does expect some duplicates.
2021-02-02 00:03:59 +01:00
Alexis Degrugillier
8285f1df43 Add comprehensive user configuration in extensions (#3397)
Before, the extension configuration was handled by its author. There
was discrepancies between extensions on how the configuration was
stored.
Now, we could rely on a single way of storing configuration. This won't
invalidate how the extensions are storing their configuration but will
allow authors to focus on what is important.
2021-02-02 00:03:09 +01:00
Alexis Degrugillier
bed710b260 Refactor extension file script (#3399) 2021-02-02 00:00:51 +01:00
Alexandre Alapetite
45ee7a36d5 PHP8: SimplePie wrong use of isset (#3404)
#fix https://github.com/FreshRSS/FreshRSS/issues/3401 (crash with PHP 8+)

`ceil()` crashes in PHP8+ in case of invalid input such as empty string.
`intval()` fixes the problem with almost identical behaviour than `ceil()` in PHP7- (except for floating point values)

#fix FreshRSS/FreshRSS#3401 (crash with PHP 8+)

Example with feed http://podcast.hr2.de/derTag/podcast.xml

```xml
<enclosure url="https://mp3podcasthr-a.akamaihd.net:443/mp3/podcast/derTag/derTag_20210129_87093232.mp3"
length="" type="audio/mpeg"/>
```

`isset("")` passes and then `ceil("")` crashes due to wrong type in PHP8+:

```
Uncaught TypeError: ceil(): Argument #1 ($num) must be of type
int|float, string given in ./SimplePie/SimplePie/Item.php:2871
```

Upstream patch https://github.com/simplepie/simplepie/pull/670
2021-01-31 13:04:36 +01:00
Alexandre Alapetite
2b007ee989 Explicit PDO::ERRMODE_SILENT (#3408)
`PDO::ERRMODE_SILENT` is the default value
https://php.net/pdo.error-handling
We just make it explicit
#fix https://github.com/FreshRSS/FreshRSS/issues/3402
But in the issue above, it looks like it is in `PDO::ERRMODE_EXCEPTION`
mode
2021-01-30 21:53:17 +01:00
Alexis Degrugillier
0954c76866 Fix load default action on shortcuts (#3394)
See #3388
2021-01-24 00:42:21 +01:00
Alexis Degrugillier
3e89086e45 Add username hint for permissions during install (#3373)
The username is retrieved by 2 different means to support different
configurations and architectures. If there is no way to find the
username, the "unknown" string is displayed instead.

See #2758
2021-01-23 23:04:01 +01:00
Alexis Degrugillier
297d188a46 Refactor requirement check in install (#3368)
I've extracted the template in the check requirement to
ensure that future modifications will be easier.
2021-01-23 22:53:17 +01:00
Alexandre Alapetite
d061e63fa5 GReader API add canonical information (#3391)
For fluent-reader
#fix https://github.com/FreshRSS/FreshRSS/issues/3389
Better compatibility InoReader
https://www.inoreader.com/developers/stream-contents
2021-01-22 21:56:54 +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
180ca4d168 Curlopt fixes (#3381)
* sort results in find() method

* Update lib/lib_phpQuery.php

Co-Authored-By: Alexandre Alapetite <alexandre@alapetite.fr>

* Update lib/lib_phpQuery.php

Co-Authored-By: Alexandre Alapetite <alexandre@alapetite.fr>

* Fix fetching articles

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2021-01-17 18:32:24 +01:00
rom-1
82a2a6f023 Updated German Translation (#3379)
* Updated German Translation

completed german translation, as of now 100%.

* changing the word display -> filter

The whole interface is a little mess, but I guess this might be fitting a bit better

* Fix ignore

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2021-01-17 18:29:21 +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
Alexandre Alapetite
bf639f9b98 Docker: Alpine 3.13 with PHP 8 (#3375)
* Docker: Alppine 3.13 with PHP 8

PHP 8.0.1, Apache 2.4.46
Bug https://bugs.php.net/bug.php?id=78681 fixed in Alpine, so workaround
removed from our Dockefile(s)
Supports MySQL 8+
#fix https://github.com/FreshRSS/FreshRSS/issues/3191

* Changelog

* Update CHANGELOG.md

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2021-01-16 19:39:15 +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
Alexis Degrugillier
e3457f7d7b Add drag & drop marker on user query list (#3355)
Before, it was nearly impossible to know exactly where the dragged
item will land when dropping it.
Now, there is a visual marker to show the drop location.

An HR tag is inserted dynamically in the DOM. It's possible to style
it if needed.
2021-01-13 20:34:45 +01:00
Alexis Degrugillier
b43b94dff8 Update extension documentation (#3352)
Before the extension documentation was not very clear about the methods
in the extension and how to use them. I hope that now it makes more
sense.
2021-01-13 18:42:57 +01:00
Alexis Degrugillier
39806c9456 Fix translation cli (#3364)
Before, adding a child to an existing key was not working. It was failing and
some data was lost in the process.
Now, it possible to add a child to an existing key. It is also possible to
remove the child and convert the parent key containing an underscore "_" to
a parent key without the underscore "_".
2021-01-13 18:42:21 +01:00
Alexis Degrugillier
78fdb6fa23 Remove useless action (#3365)
The cancel action was not wired. There is no value to have such thing
2021-01-13 18:41:22 +01:00
Clemens Neubauer
b1285466f2 fix layout changes since new hook nav_menu (#3362)
* fix layout if no hooks `nav_menu` are active

* Update app/layout/nav_menu.phtml

oh thx

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2021-01-12 20:30:32 +01:00
Alexis Degrugillier
eb51fd713a Fix coding standard (#3363)
Merged code was not following coding standard. Thus breaking all CI tests.
2021-01-12 16:49:46 +01:00
Alexandre Alapetite
6d8b1ba834 Fix images in enclosures without MIME type (#3361)
#fix https://github.com/FreshRSS/FreshRSS/issues/3358
Assume enclosures without a mime type, without a length, but with either
a width or a height are images
2021-01-12 09:34:13 +01:00
Alexandre Alapetite
8dfe209799 Possiblity to autoinstall in Docker Compose (#3353)
* Possiblity to autoinstall in Docker Compose

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

It is simply calling our existing CLI: do-install.php and
create-user.php
https://github.com/FreshRSS/FreshRSS/tree/master/cli

FreshRSS will typically be ready a few seconds before the database, so
introduce a tolerance when the database is not available / up (yet) by
trying a few times to connect. Also useful to avoid service interruption
when DB service is restarted.

Example:

```yml
freshrss-app:
    image: freshrss/freshrss
    container_name:
freshrss-app
    hostname: freshrss-app
    restart: unless-stopped

ports:
      - "8080:80"
    depends_on:
      - freshrss-db

volumes:
      - data:/var/www/FreshRSS/data
      -
extensions:/var/www/FreshRSS/extensions
    environment:
      CRON_MIN:
'*/20'
      FRESHRSS_ENV: development
      FRESHRSS_INSTALL: |-

--api_enabled
        --base_url https://rss.example.net

--db-base freshrss
        --db-host freshrss-db
        --db-password
freshrss
        --db-type pgsql
        --db-user freshrss

--default_user admin
        --language en
      FRESHRSS_USER: |-

--api_password freshrss
        --email user@example.net

--language en
        --password freshrss
        --user admin
      TZ:
Europe/Paris
```

* Minor type f in find

* shellcheck
2021-01-11 22:36:50 +01:00
Alexis Degrugillier
fd82587756 Add filters on images and video (#3356)
As this theme is a dark theme, I figured that it would be better
to filter images and videos to ease reading when bright elements
are included.
2021-01-11 22:36:06 +01:00
Craig Andrews
f9687ea18a Fix commitNewEntries query (#3357)
There was an erroneous '; at the end of the commitNewEntries DELETE query, resulting in an exception during actualization with this output:

```
FreshRSS starting feeds actualization at 2021-01-11T14:06:09+00:00
FreshRSS actualize candrews...
PHP Fatal error:  Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''' at line 1 in /var/www/localhost/htdocs/FreshRSS/lib/Minz/Pdo.php:45
Stack trace:
#0 /var/www/localhost/htdocs/FreshRSS/lib/Minz/Pdo.php(45): PDO->exec()
#1 /var/www/localhost/htdocs/FreshRSS/app/Models/EntryDAO.php(167): Minz_Pdo->exec()
#2 /var/www/localhost/htdocs/FreshRSS/app/Controllers/feedController.php(505): FreshRSS_EntryDAO->commitNewEntries()
#3 /var/www/localhost/htdocs/FreshRSS/app/Controllers/feedController.php(548): FreshRSS_feed_Controller::actualizeFeed()
#4 /var/www/localhost/htdocs/FreshRSS/lib/Minz/Dispatcher.php(119): FreshRSS_feed_Controller->actualizeAction()
#5 /var/www/localhost/htdocs/FreshRSS/lib/Minz/Dispatcher.php(47): Minz_Dispatcher->launchAction()
#6 /var/www/localhost/htdocs/FreshRSS/lib/Minz/FrontController.php(81): Minz_Dispatcher->run()
#7 /var/www/localhost/htdocs/FreshRSS/app/actualize_script.php(75): Minz_FrontController->run()
#8 {main}
  thrown in /var/www/localhost/htdocs/FreshRSS/lib/Minz/Pdo.php on line 45
Results:
```
2021-01-11 22:28:35 +01:00
ldv8434
8584f49858 adding self CREDITS.md (#3354) 2021-01-10 16:44:59 -05:00
ldv8434
bf344cd302 Update and add to documentation (#3348)
* remove outdated mailing list information

* add information about normal view

* add information about global and reader view

* fix import section header

* reorder documentation to reflect menu's order

* clarify setting as default in normal view

* add info about reading section for config

* fix heading levels, add info about archive + profile sections

* unfix heading levels

* move section on feed-specific settings to the subscription management page

* update information about adding feeds, add information about feed management

* fix link to security page in installation

* fix broken links

* fix broken link to install page

* add lighttpd from project readme

* add php modules to step 4, add horizontal line to better separate steps from footnotes visually

* fix broken link

* add index page for easier access of other pages

* move first steps document

* make dedicated bug reporting page

* make index page for linking to other pages

* moved fever API to relevant location, linked to index

* remove outdated mailing list information

* add information about normal view

* add information about global and reader view

* fix import section header

* reorder documentation to reflect menu's order

* clarify setting as default in normal view

* add info about reading section for config

* fix heading levels, add info about archive + profile sections

* unfix heading levels

* move section on feed-specific settings to the subscription management page

* update information about adding feeds, add information about feed management

* fix link to security page in installation

* fix broken links

* fix broken link to install page

* add lighttpd from project readme

* add php modules to step 4, add horizontal line to better separate steps from footnotes visually

* fix broken link

* add index page for easier access of other pages

* move first steps document

* make dedicated bug reporting page

* make index page for linking to other pages

* moved fever API to relevant location, linked to index

* re-fix link

* remove mention of defunct mailing list

* grammar fix

* replace stream with feed

* add optional items, replace stream with feed

* replace stream with feed

* fix word choice

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>

* fix word choice

better reflect age of project

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>

* grammar fixes

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>

* remove double headings

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>

* change single quote to double quote for consistency

* add subreddit link

* change php module list to Dockerfile link

* fix link to developer index, change html links to md for consistency

* update css selector terms

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2021-01-10 20:50:54 +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
f5fdbb9e82 Add class autoload for extension (#3350)
When an extension defines an `autoload` method, it will be registered
automatically before enabling the extension.
For the extension creator, it's easier because there is no need to
register it manually.
2021-01-09 20:49:45 +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
5e4c392cf2 Document the SQLite utilities usage (#3344)
There is a CLI command to export from any database to a SQLite database
and also a CLI command to import a SQLite database to any database than
need to be documented.

See #961
2021-01-09 01:45:36 +01:00
Alexandre Alapetite
69060cda33 Docker: Environment variable to change Apache port (#3343)
#fix https://github.com/FreshRSS/FreshRSS/issues/3341

New environment variable `LISTEN='0.0.0.0:8080'`

```
docker run -d --network host --uts host -e LISTEN='0.0.0.0:8080' -e
TZ=Europe/Paris --name freshrss   freshrss/freshrss
```
2021-01-07 23:32:39 +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
Clemens Neubauer
ef458992c1 two new hooks (#3342)
* add two new hooks

I develop a new extension and i need 2 new hooks for it

* update EN documentation

* Correct typing errors

* Update app/views/helpers/javascript_vars.phtml

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2021-01-07 21:45:48 +01:00
Alexis Degrugillier
bfd872e885 Change base extension class type (#3333)
Before, there were some guidelines on how to use the extension class and how to extend it. Those guidelines were defined as comments.
Now, those guidelines are enforced by the code itself. There is no need for those comments anymore.
2021-01-07 21:37:59 +01:00
Alexis Degrugillier
9aa3c03844 Add a deprecation log error for extensions (#3335)
Extensions must override some parent methods. The rule is just a
guideline because only described in comments. The idea is to
deprecate that flexibility and add it to the code. To warn users
beforehand, we log error message regarding incomplete extensions.

See #3333
2021-01-04 23:59:36 +01:00
Alexis Degrugillier
739080ff10 Add autofocus on subscription page (#3334)
Before, there was no autofocusing on the subscription page. It feels
a bit off since most of the time, when you're landing on that page
you want to add a new feed.
Now, the focus is on the feed URL input to smooth the process of adding
a feed.
2021-01-04 20:31:31 +01:00
Alexandre Alapetite
27e5d539d0 Changelog + credits 2021-01-03 23:43:19 +01:00
rom-1
f499551cd0 Fix British English Date Format (#3326)
* Update British English Date Format

The default Date Format for British English is actually not like the american one (M/D/Y), but more like the same as the rest of Europe (D/M/Y).

* update translations

* not American style though

* Update gen.php

* Date Format -> No dot after day (British)

* Date Format -> No dot after day (British)

* Date Format -> No dot after day (British)

* Apply suggestions from code review

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>

* getting rid of unnecessary slashes

* getting rid of unnecessary slashes

* american time format -> 12h

* adding format_date to ignore

have no idea what I am doing here ;)
https://github.com/FreshRSS/FreshRSS/pull/3326#issuecomment-753620690

* adding format_date to ignore

have no idea what I am doing here ;)
https://github.com/FreshRSS/FreshRSS/pull/3326#issuecomment-753620690

* adding format_date to ignore

have no idea what I am doing here ;)
https://github.com/FreshRSS/FreshRSS/pull/3326#issuecomment-753620690

* adding format_date to ignore

have no idea what I am doing here ;)
https://github.com/FreshRSS/FreshRSS/pull/3326#issuecomment-753620690

* adding format_date to ignore

have no idea what I am doing here ;)
https://github.com/FreshRSS/FreshRSS/pull/3326#issuecomment-753620690

* adding format_date to ignore

have no idea what I am doing here ;)
https://github.com/FreshRSS/FreshRSS/pull/3326#issuecomment-753620690

* adding format_date to ignore

have no idea what I am doing here ;)
https://github.com/FreshRSS/FreshRSS/pull/3326#issuecomment-753620690

* adding format_date to ignore

have no idea what I am doing here ;)
https://github.com/FreshRSS/FreshRSS/pull/3326#issuecomment-753620690

* adding format_date to ignore

have no idea what I am doing here ;)
https://github.com/FreshRSS/FreshRSS/pull/3326#issuecomment-753620690

* Revert "adding format_date to ignore"

This reverts commit 66527f806b.

* Revert "adding format_date to ignore"

This reverts commit 77927fbb04.

* Revert "adding format_date to ignore"

This reverts commit a43eca4df9.

* Revert "adding format_date to ignore"

This reverts commit c05d209592.

* Revert "adding format_date to ignore"

This reverts commit 032082037e.

* Revert "adding format_date to ignore"

This reverts commit a3ca9835da.

* Fix Travis

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2021-01-03 20:45:07 +01:00
rom-1
aa3e41d4b3 Adding info about combining css classes (#3329)
* Adding info about combining css classes 

Adding info about combining css classes using comma separation

* Update 05_Configuration.md

* Apply suggestions from code review

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2021-01-03 20:37:57 +01:00
Alexis Degrugillier
022ed9912a Fix share option sort (#3331)
Before, share options were displayed in the order defined in the
configuration file. So the order reflected the share history and
was not really usable.
Now, share options are displayed in alphabetical order which makes
much more sense.
2021-01-03 20:15:15 +01:00
Alexis Degrugillier
46c8f6e77b Add clipboard sharing (#3330)
When the discussion #3327 started, I thought that the clipboard share
is a good idea. It never occurred to me because I do not use a
smartphone.
It might need some polishing but it seems pretty usable as-is.

See #3327
2021-01-03 18:20:15 +01:00
Alexandre Alapetite
0567e38947 API more BazQux compatibility (#3320)
Implement compatibility fix, to allow the streamID / inclusion criteria
to be given as `&s=` parameter instead of in the URL path.
https://github.com/bazqux/bazqux-api#fetching-streams
This form of request is apparently sometimes used by FeedMe:

```

/api/greader.php/reader/api/0/stream/contents?output=json&n=100&xt=user%2F-%2Fstate%2Fcom.google%2Fread&ot=0&s=user%2F-%2Flabel%2FBlogs
```
2021-01-03 18:13:11 +01:00
rom-1
75440c6765 Update "Submit" -> "Save" as discussed in #3319 (#3325)
In German UI, "Submit" (Abschicken) is almost never used. Instead, people are used to have "Save" (Speichern) as text on their buttons.
https://github.com/FreshRSS/FreshRSS/issues/3319
2021-01-03 13:36:03 +01:00