164 Commits

Author SHA1 Message Date
Alexandre Alapetite
1a3912f25a Improve configuration checks (#8334)
Add a distinction between recommended and required extensions.
Add check for recommended php-intl extension as follow-up of https://github.com/FreshRSS/FreshRSS/pull/8329#issuecomment-3677686581
Improve related checks such as ZIP.
Reduce duplicated translations and tests.
2025-12-21 19:26:08 +01:00
Inverle
fd9e2843f1 Minor refactor <img class="icon"> -> _i('...') (#8297) 2025-12-08 20:32:28 +01:00
Alexandre Alapetite
a18c35046d Housekeeping lib_rss.php (#8193)
* Housekeeping lib_rss.php
`lib_rss.php` had become much too large, especially after https://github.com/FreshRSS/FreshRSS/pull/7924
Moved most functions to other places.
Mostly no change of code otherwise (see comments).

* Extension: composer run-script phpstan-third-party
2025-11-11 08:17:12 +01:00
Inverle
25250f46b4 Safer calling of install.php (#7971)
To prevent `install.php` from being accessed in unintended places
2025-09-16 00:53:15 +02:00
Alexis Degrugillier
6ad625812a Add a default language constant (#7933)
This replace the use of `en` through out the code.
2025-09-09 22:01:04 +02:00
Alexis Degrugillier
23ba48c71f Change how files are included (#7916)
1. `include`, `include_once`, `require` and `require_once` are expressions not functions, parentheses are not necessary.
2. to move up the directory tree, it's better to use the `dirname` function instead of relying on `/..`.
2025-09-05 15:56:46 +02:00
Inverle
a6948218fb frame-ancestors CSP (#7677) 2025-06-18 22:20:17 +02:00
Alexandre Alapetite
f620f16e2b Install: add test PDO typing (#7651)
fix https://github.com/FreshRSS/FreshRSS/issues/7647
2025-06-06 09:56:27 +02:00
maTh
1f624bc5e2 Referrer-Policy: same-origin (#6303)
* Referrer-Policy: same-origin

* same-origin for our own images

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2025-04-01 12:23:56 +02:00
Alexandre Alapetite
d80171ebfd Back-compatibility cURL 7.51 (#7409)
* Back-compatibility cURL 7.51
fix https://github.com/FreshRSS/FreshRSS/issues/7381
And add cURL version to system info.
Do not require a specific version of cURL for now, but maybe later.

* Fix CI

* make fix-all

* Add TODOs

* Add ssl_version

* Update app/i18n/it/index.php

Co-authored-by: UserRoot-Luca <55756898+UserRoot-Luca@users.noreply.github.com>

---------

Co-authored-by: UserRoot-Luca <55756898+UserRoot-Luca@users.noreply.github.com>
2025-03-08 11:49:05 +01:00
Alexandre Alapetite
bb7236e263 Better authorization label for OIDC (#7264)
* Better authorization label for OIDC
Reword description of HTTP login method to include OIDC
fix https://github.com/FreshRSS/FreshRSS/issues/7254#issuecomment-2615838151
And remove several duplicated i18n entries.
And add to documentation https://www.authelia.com/integration/openid-connect/freshrss/

* Update app/i18n/it/admin.php

Co-authored-by: UserRoot-Luca <55756898+UserRoot-Luca@users.noreply.github.com>

* Update app/i18n/nl/admin.php

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

---------

Co-authored-by: UserRoot-Luca <55756898+UserRoot-Luca@users.noreply.github.com>
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2025-01-28 15:33:17 +01:00
Alexandre Alapetite
b1d24fbdb7 PHPStan 2.0 (#7131)
* PHPStan 2.0
fix https://github.com/FreshRSS/FreshRSS/issues/6989
https://github.com/phpstan/phpstan/releases/tag/2.0.0
https://github.com/phpstan/phpstan/blob/2.0.x/UPGRADING.md

* More

* More

* Done

* fix i18n CLI

* Restore a PHPStan Next test
For work towards PHPStan Level 10

* 4 more on Level 10

* fix getTagsForEntry

* API at Level 10

* More Level 10

* Finish Minz at Level 10

* Finish CLI at Level 10

* Finish Controllers at Level 10

* More Level 10

* More

* Pass bleedingEdge

* Clean PHPStan options and add TODOs

* Level 10 for main config

* More

* Consitency array vs. list

* Sanitize themes get_infos

* Simplify TagDAO->getTagsForEntries()

* Finish reportAnyTypeWideningInVarTag

* Prepare checkBenevolentUnionTypes and checkImplicitMixed

* Fixes

* Refix

* Another fix

* Casing of __METHOD__ constant
2024-12-27 12:12:49 +01:00
Alexandre Alapetite
0f4bcdad9b Fix HTML pattern in install (#7009)
Slashes now need to be escaped because of `v` mode:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Character_class#v-mode_character_class

https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern#overview

Edge:
> Pattern attribute value [0-9A-Z/a-z_.\-]{1,64}(:[0-9]{2,5})? is not a valid regular expression: Uncaught SyntaxError: Invalid regular expression: /[0-9A-Z/a-z_.\-]{1,64}(:[0-9]{2,5})?/v: Invalid character in character class

Firefox:
> Impossible de vérifier <input pattern='[0-9A-Z/a-z_.\-]{1,64}(:[0-9]{2,5})?'> car « /[0-9A-Z/a-z_.\-]{1,64}(:[0-9]{2,5})?/v » n’est pas une expression régulière valide : invalid character in class in regular expression
2024-11-19 23:05:09 +01:00
Alexandre Alapetite
14b397afdf PostgreSQL database case (#6482)
fix https://github.com/FreshRSS/FreshRSS/issues/6479
2024-05-23 16:34:53 +02:00
maTh
6bd6494ad4 fixed HTML: <fieldset> + <legend> (#6202)
* legend tags cleaned

* formgroup -> fieldset tag

* add bookmarklet class

* Update logs.phtml

* Update logs.phtml

* fixed log table text alignment
2024-03-17 22:49:12 +01:00
Alexandre Alapetite
cf29ca19c0 Fix crash during update of existing install (#6205)
fix https://github.com/FreshRSS/FreshRSS/issues/6204
Mess due to https://github.com/FreshRSS/FreshRSS/pull/5511
2024-03-14 22:44:51 +01:00
Alexandre Alapetite
314077a457 PHPStan prepare exceptions (#6037)
Take advantage of
https://phpstan.org/blog/bring-your-exceptions-under-control

Minimum changes to pass `tooWideThrowType` and `implicitThrows`.

Revert some mistakes from:
https://github.com/FreshRSS/FreshRSS/pull/5504
Preparation needed before new PRs of the same type:
https://github.com/FreshRSS/FreshRSS/pull/5962

Fix several wrong PHPDocs and catches:

> Method ... has ...Exception in PHPDoc @throws tag but it's not thrown.

> Dead catch - ...Exception is never thrown in the try block.
2024-01-15 10:36:30 +01:00
Alexandre Alapetite
79604aa4b3 Fix login (#5955)
fix https://github.com/FreshRSS/FreshRSS/issues/5953
Regression due to https://github.com/FreshRSS/FreshRSS/pull/5946
2023-12-20 16:36:55 +01:00
Alexandre Alapetite
a80a5f48a1 Pass PHPStan level 8 (#5946)
* Pass PHPStan level 8
And prepare for PHPStan level 9 https://phpstan.org/user-guide/rule-levels

* Revert wrong replace in comment

* Fix PHPStan level 8

* Update PHPStan and other dev dependencies

* Remove obsolete comment

* noVariableVariables and towards bleedingEdge
https://github.com/phpstan/phpstan-strict-rules
https://phpstan.org/blog/what-is-bleeding-edge

* More bleedingEdge

* A bit more PHPStan level 9

* More PHPStan level 9

* Prepare for booleansInConditions
Ignore int and null

* Revert wrong line

* More fixes

* Fix keep_max_n_unread

* Stricter attribute functions

* Stricter callHooks and more PHPStan level 9

* More typing

* A tiny more
2023-12-18 17:59:16 +01:00
Luc SANCHEZ
30c7a61a9b Use strict_types (#5830)
* Little's optimisations and booleans in conditions

* Apply strict type

* Apply strict type

* Apply strict type

* Fix multiple bugs with PHP 8.2 and 8.3

* Many declares missing, more errors fixed

* Apply strict type

* Another approach

* Stronger typing for Minz_Session

* Fix case of SQLite

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-11-16 22:43:00 +01:00
Alexandre Alapetite
5a383c1054 Update DB recommendations (#5793)
* Update DB recommendations
Favour PostgreSQL, based on tests such as:
https://github.com/FreshRSS/FreshRSS/pull/5648#issuecomment-1715843198
https://github.com/FreshRSS/FreshRSS/issues/5707

SQLite is generally very fine, although with the challenge that the DB model cannot easily be updated https://www.sqlite.org/lang_altertable.html#why_alter_table_is_such_a_problem_for_sqlite
(We should ship a command-line update mechanism)

I have verified that FreshRSS still works with `mysql:5.5.62`
https://hub.docker.com/layers/library/mysql/5.5.62/images/sha256-d404d78aa797c87c255e5ae2beb5d8d0e4d095f930b1f20dc208eaa957477b74?context=explore

* sqlite
2023-10-31 23:37:16 +01:00
Luc SANCHEZ
4a02352ccc applies several small optimizations (#5511)
declare(strict_types=1);
Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
2023-10-30 20:40:13 +01:00
Alexandre Alapetite
e7689459f2 Rework trusted proxies (#5549)
* Rework trusted proxies
Fix https://github.com/FreshRSS/FreshRSS/issues/5502
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/3226

New environment variable `TRUSTED_PROXY`: set to 0 to disable, or to a list of trusted IP ranges compatible with https://httpd.apache.org/docs/current/mod/mod_remoteip.html#remoteiptrustedproxy

New internal environment variable `CONN_REMOTE_ADDR` to remember the true IP address of the connection (e.g. last proxy), even when using mod_remoteip.

Current working setups should not observe any significant change.

* Minor whitespace

* Safer trusted sources during install
Rework of https://github.com/FreshRSS/FreshRSS/pull/5358
https://github.com/FreshRSS/FreshRSS/issues/5357

* Minor readme
2023-07-30 12:59:18 +02:00
Luc SANCHEZ
f8f163d054 Chore/processing of depreciations and updating code to php72 minimum (#5504)
* processing of depreciations and updating of code to php7.2 minimum

* Autoformat many strange array indenting
And revert a few unwanted changes

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-07-07 22:36:27 +02:00
maTh
deb306c33f Improved: Install process: give more infos (#5350)
* comments added for each step

* infos about FreshRSS added in first step

* Remove reference to Kriss and Leed from install page
I do not find that informative, and quite confusing. Moved to readme instead.

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-05-11 13:08:23 +02:00
Alexandre Alapetite
6e2f2f1c1e A few additional PHPStan rules (#5388)
A subset of
https://github.com/phpstan/phpstan-strict-rules
2023-05-11 13:02:04 +02:00
Alexandre Alapetite
0a38aa7456 Automatic trusted_sources during install (#5358)
* Automatic trusted_sources during install
Fix https://github.com/FreshRSS/FreshRSS/issues/5357

* Fix install for http_auth

* Update lib/lib_rss.php

Co-authored-by: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com>

* Fill null exception e-mail

* Revert some syntax

* Minor parentheses
2023-05-03 00:37:04 +02:00
Alexandre Alapetite
f3760f138d Complete PHPStan Level 6 (#5305)
* Complete PHPStan Level 6
Fix https://github.com/FreshRSS/FreshRSS/issues/4112
And initiate PHPStan Level 7

* PHPStan Level 6 for tests
* Use phpstan/phpstan-phpunit
* Update to PHPStan version 1.10

* Fix mixed bug

* Fix mixed return bug

* Fix paginator bug

* Fix FreshRSS_UserConfiguration

* A couple more Minz_Configuration bug fixes

* A few trivial PHPStan Level 7 fixes

* A few more simple PHPStan Level 7

* More files passing PHPStan Level 7
Add interface to replace removed class from https://github.com/FreshRSS/FreshRSS/pull/5251

* A few more PHPStan Level 7 preparations

* A few last details
2023-04-17 08:30:21 +02:00
Luc SANCHEZ
5f898dcc5e Modernize Constants and use new constant for string 'currentUser' (#5089)
* Modernize Constants and use new constant 'currentUser'

* Add FreshRSS_Context::currentUser() function and use

* Add FreshRSS_Context::currentUser() function and use

* Add FreshRSS_Context::currentUser() function and use

* Add FreshRSS_Context::currentUser() function and use

* Add FreshRSS_Context::currentUser() function and use

* Update app/Controllers/userController.php

* Update app/Controllers/userController.php

* Update app/Controllers/userController.php

* Update app/Models/Auth.php

* Update p/api/greader.php

* Update p/api/greader.php

* Update p/api/greader.php

* Update app/Models/Context.php

* Update app/Models/LogDAO.php

* Update lib/Minz/Log.php

* Update p/api/greader.php

* Update app/layout/header.phtml

* Update app/views/helpers/export/articles.phtml

* Update cli/do-install.php

* Remarque's from Alkarex

* Remarque's from Alkarex

* Refactor using new Minz_User class

* Consistent naming of public constants

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-03-26 14:17:22 +02:00
maTh
27c7367534 Improve UI/UX install process (#5147)
* less buttons on step 1

* add form-group

* jump to next step as link not as button

* improve navigation bar HTML structure

* sync password-show button with extra.js

* fix CSS

* i18n: step 4: split text strings for help text (max chars default user)

* show menu button if mobile view

* improve header layout with empty div

* step 5: button in form-actions

* improve buttons in goup-controls

* Favicon added

* Button: Font color  hover btn-attention

* install check step: add subtitles

* fix .btn

* improve tabindex

* improve showPW_this()
2023-03-04 13:57:52 +01:00
Sadetdin EYILI
bbe3eb8f41 Lazy load logo on install, logo on header and theme thumbs in config slide (#4998)
* feat: lazy load logo on install, logo on header and theme thumbs in config slide
2023-01-09 10:37:35 +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
maTh
fedbda4f6a Rename template.css (#4644)
* Fix conflicts

* Update doc

* Misses

* Update prefix in CSS

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-09-29 12:40:50 +02:00
Alexandre Alapetite
f89819bd64 Custom logo HTML (#4369)
* Custom logo HTML
Add option for custom HTML logo/title in the main Web UI view.
Can potentially be different per user.
#fix https://github.com/FreshRSS/FreshRSS/pull/3830/files#r850472247

* logo_html in main config
With new `./data/config.custom.php` to provide custom values before install

* Docker documentation

* whitespace

* Auto relax CSP to allow images for HTML logo

* Documentation
2022-05-23 14:03:19 +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
maTh
09c84fb3bc Improved: install.php code quality (#4099)
* delete unused $user_default_config

* move inner named function

* moved $auth_type

* improve readability

* phpcs fixes
2021-12-31 13:50:32 +01:00
maTh
a54aa19dc7 Fix: double main tags (#4014)
* replace div with main

* include the slider into main

* format source

* add close icon for the extension slider

* replace div with main

* Update shortcut.phtml

* fixed the nits
2021-12-03 00:57:32 +01:00
maTh
079b7b961f Improve install routine: database password input with "show password" button (#3962)
* wip

* CSS better btn

* CSS: RTL

* button is better than a

* improved CSS for button
2021-11-11 20:01:28 +01:00
maTh
5506b71051 Install routine: Reload button if checks fail (#3771)
* template + translations

translation made with Google translate + check with my knowledge + recheck with invers translation

* Update app/install.php

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2021-08-15 23:35:36 +02:00
Alexandre Alapetite
7d83321286 Better catch when a user does not exists (#3751)
#fix https://github.com/FreshRSS/FreshRSS/issues/3735
Before, we were relying on an exception during the first stages of user initalisation. Now the check is explicit and cleaner, producing a more appropriate HTTP response for the API.
2021-08-14 12:22:42 +02:00
Alexandre Alapetite
eb5f3a5cf2 Minor fix phpcbf
Minor whitespace from https://github.com/FreshRSS/FreshRSS/pull/3721
2021-08-04 12:42:42 +02:00
maTh
8dc9fde24d Install routine freshup (#3721)
* navigation: disable next steps

* change icon to full icon (incl. text)

* navigation is a ordered list

* set mouse title on each navigation item

* navigation: next steps in grey italc
2021-08-04 11:38:54 +02:00
maTh
fe59d02066 install routine: template to html5 (#3713) 2021-07-24 19:13:39 +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
a62d6288b1 Fix init in CLI install (#3544)
#fix https://github.com/FreshRSS/FreshRSS/issues/3528
config was not properly reloaded after being populated
2021-03-20 18:25:55 +01:00
ThomasSmallert
efba11ee37 If cURL is not installed, the script stops with a fatal error. (#3519)
* If cURL is not installed, the script stops with a fatal error.

The script stops with the following message.
Fatal error: Uncaught Error: Call to undefined function curl_version()

* Update app/install.php

Fix whitespace

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2021-03-14 16:53:34 +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
hesch
13b03b232b refactor: remove referer checks, as they are no longer needed (replaced by csrf tokens) (#3432) 2021-02-11 17:38:39 +01:00
Alexandre Alapetite
a626e5fff8 Check that PHP session is working during install (#3430)
* Check that PHP session is working during install

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

* Minor whitespace

* Missing he
2021-02-07 15:19:29 +01:00