44 Commits

Author SHA1 Message Date
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
Alexis Degrugillier
032316155c Add a new hook in the UI (#8054)
* Add a new hook in the UI

The new hook allows extension to add their own tool bar to navigate between
entries. For instance, if the user wants less or more buttons that what's
available by default.

See #7912
See #7913

* add link data to ease navigation
2025-10-02 15:33:53 +02:00
Alexis Degrugillier
dac275ce3a Add support for extension priority (#8038)
Extension can now define their hook priority. This will allow to define the order in which hooks are triggered.

See #7110

Closes #7110

Changes proposed in this pull request:

- Add support for extension priority

How to test the feature manually:

1. Create an extension with 2 hooks on the same hook type but different priority
2. The hooks must be prepending the title with different values
3. Validate that changing the hook priority changes the final title accordingly.
2025-10-01 11:01:31 +02:00
maTh
2bcc090622 configurable notification timeout (#7942)
Ref #7931
Ref #5466
Ref #6409

added configuration in "Display"
<img width="636" height="167" alt="grafik" src="https://github.com/user-attachments/assets/7bbc9f26-d91b-4dd2-b715-1d3f9b7a9ad3" />

* i18n: fr

* Update app/i18n/pl/conf.php

Co-authored-by: Inverle <inverle@proton.me>

* make fix-all

* max()

* Minor whitespace
(I am not a fan of excessive vertical indenting)

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Co-authored-by: Inverle <inverle@proton.me>
2025-10-01 10:48:07 +02:00
Alexis Degrugillier
72884813e1 Add hook enums (#8036)
- add an enum to handle hook types (enum are available since PHP 8.1)
- change hook calls from string value to enum value
2025-09-30 22:59:41 +02:00
KleinMann
d670bf1e72 Add entry_before_update and entry_before_add hooks (#7977)
Discussion: https://github.com/FreshRSS/FreshRSS/discussions/7973

Changes proposed in this pull request:

- Add new extension hook "entry_before_add"
- Add new extension hook "entry_before_update"

How to test the feature manually:

1. Create extension that uses the hooks and confirm they are invoked correctly.

Extension to use for testing
https://github.com/rnkln/freshrss-xExtension-Discord/pull/2
2025-09-18 23:44:17 +02:00
Stefan
51298cd6bc Exposed the reading modes for extensions through Minz (#7668)
* + Exposed the reading modes for extensions through Minz. Now extensions can add a custom view mode. Graceful fallback to normal view in case the extension was disabled without resetting the view_mode through the uninstall method. In that case the user will be informed via Minz_Request::setBadNotification that the view has been reset to normal.
+ Added translation strings for de, en and en-us for the notification

* + Added missing, generated translations

* Simplify indexAction, performance

* Minor settings htmlspecialchars

* i18n: fr

* Minor wording

* Doc

* Fix i18n

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2025-06-22 00:36:32 +02:00
Alexandre Alapetite
cc35094bb2 Add API endpoint for extensions (#7576)
* Add API endpoint for extensions
Useful for https://github.com/FreshRSS/FreshRSS/issues/7572

* Support PATH_INFO
Now also support being invoked like `/api/misc.php/Extension%20Name/`

* More  documentation
2025-06-03 00:16:17 +02:00
Alexandre Alapetite
0c33d27139 Secure serving of user files from extensions (#7495)
* Secure serving of user files from extensions
fix https://github.com/FreshRSS/FreshRSS/issues/4930

* More fixes

* Typo
2025-04-07 08:47:42 +02:00
Luc SANCHEZ
15745d42b7 Upgrade code to php 8.1 (#6748)
* revert
Fix code indentation
Fix code

Upgrade code to php 8.1

* fix remarques

* code review

* code review

* code review

* Apply suggestions from code review

* code review

* Fixes

* Many remainging updates of array syntax

* Lost case 'reading-list'

* Uneeded PHPDoc

---------

Co-authored-by: Luc Sanchez <l.sanchez-prestataire@alptis.fr>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2024-11-28 17:11:04 +01:00
Alexandre Alapetite
278181572e Add extension hook simplepie_after_init (#7007)
* Add extension hook simplepie_after_init
fix https://github.com/FreshRSS/FreshRSS/issues/7006

* Add documentation note

* fix doc get_headers

* Syntax void

* Forgotten code
2024-11-21 08:22:13 +01:00
Alexandre Alapetite
df763eb8b3 Add hook entries_favorite (#6880)
Called when entries are starred or unstarred
2024-10-14 09:35:41 +02:00
Alexandre Alapetite
1a552bd60e Regex search (#6706)
* Regex search
fix https://github.com/FreshRSS/FreshRSS/issues/3549

* Fix PHPStan

* Fix escape

* Fix ungreedy

* Initial support for regex search in PostgreSQL and MySQL

* Improvements, support MySQL

* Fix multiline

* Add support for SQLite

* A few tests

* Added author: and inurl: support, documentation

* author example

* Remove \b for now

* Disable regex sanitization for now

* Fix getInurlRegex

* getNotInurlRegex

* Quotes for inurl:

* Fix test

* Fix quoted tags + regex for tags
https://github.com/FreshRSS/FreshRSS/issues/6761

* Fix wrong regex detection

* Add MariaDB

* Fix logic

* Increase requirements for MySQL and MariaDB
Check support for multiline mode in MySQL

* Remove sanitizeRegexes()

* Allow searching HTML code
Allow searching for instance `/<pre>/`
Fix https://github.com/FreshRSS/FreshRSS/issues/6775#issuecomment-2331769883

* Doc regex search HTML

* Fix Doctype
2024-09-06 09:35:58 +02:00
hkcomori
99b1d551e6 Add core extensions: UserCSS, UserJS (#6267)
* Copy CustomCSS and CustomJS

Original: FreshRSS/Extensions@9f21984

* Rename CustomCSS -> UserCSS

* Rename CustomJS -> UserJS

* Change metadata

The name is used for the directory where the configuration
is stored and should not contain spaces.
Since the name was changed, I reset the version number and
changed to semantic versioning.

* Change data directory

Changed the location of the configuration file to
the user data directory, because it is not `static`.
That way, the user's configurations are gathered
in the user directory, which makes it easier to backup them.

* Edit documentations

Remove procedures to install the extension
because it is no longer necessary.

* Fix wrong variables in the configuration page

Remove permission error indication because the storage location
is now in the user data directory managed by the application.

* Remove the `xExtension-` prefix for core extensions

* Set version to 1.0.0 for UserCSS, UserJS

* Refactoring

* Remove unused variables

* Remove version 0.0.1 in Changelog

Version 0.0.1 will not be merged, so only version 1.0.0 will remain.

* public getFileUrl

* Revert more protected

* Use entrypoint for extension user path instead of name

* Add space to extension name

* Add `#[\Override]`

* Add explains of User CSS and User JS to docs

* Remove README of User CSS and User JS

* Add migration code for extension user path

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2024-06-05 20:58:19 +02:00
Alexandre Alapetite
2ed91026fc Correct casing for GitHub (#6460) 2024-05-15 08:58:10 +02:00
Alexandre Alapetite
350edf398c PHP 8.3 #[\Override] (#6273)
* PHP 8.3 #[\Override]
https://php.watch/versions/8.3/override-attr

With PHPStan `checkMissingOverrideMethodAttribute` https://phpstan.org/config-reference#checkmissingoverridemethodattribute

And modified the call to phpstan-next on the model of https://github.com/FreshRSS/Extensions/pull/228 (more robust than the find method, which gave some strange errors)

* Update extension example accordingly
2024-04-10 15:33:43 +02:00
Benjamin Reich
8f07199777 add multi arch docker build (#5808)
* Add multi arch container build

Co-authored-by: EdJoPaTo <rfc-conform-git-commit-email@funny-long-domain-label-everyone-hates-as-it-is-too-long.edjopato.de>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>

* using label from github action

* dont remove static labels and split docker readme in seperate action

* pin 3rd party action to a commit

* enable pushing to dockerhub

* Update .github/workflows/build-images.yml

Co-authored-by: EdJoPaTo <github@edjopato.de>

* remove not needed checkout

* set github token permissions

* Update .github/workflows/push-dockerhub-readme.yml

* update docker readme to match new tags

* Apply suggestions from code review

* fix suffix for alpine image

* fix suffix for alpine image

* push images only at upstream repo

* push images only at upstream repo

* push images only at upstream repo

* tag latest-alpine as alpine

* tag latest-alpine as alpine

* remove no needed falvor

* keep falvor for build

* Clean more things

* Rename action
To use same default name than https://github.com/actions/starter-workflows/blob/main/ci/docker-publish.yml

* Rename readme action
To use same default name than https://github.com/peter-evans/dockerhub-description/blob/main/.github/workflows/dockerhub-description.yml

* Use default name for dockerhub-description
https://github.com/peter-evans/dockerhub-description/blob/main/.github/workflows/dockerhub-description.yml
Plus minor wording

* Experiment with build-args

* Debug

* Add checkout back

* Revert back to metadata-action

* Remove quotes in version

* Try to fix variables

* Experiment with automatic label values again

* Delete last Docker Hub hooks

* Use only git SHA for org.opencontainers.image.revision
https://specs.opencontainers.org/image-spec/annotations/#pre-defined-annotation-keys

* Comment out semver for now
Might be enabled later if desired

* Enable major semver

---------

Co-authored-by: EdJoPaTo <rfc-conform-git-commit-email@funny-long-domain-label-everyone-hates-as-it-is-too-long.edjopato.de>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Co-authored-by: EdJoPaTo <github@edjopato.de>
2023-11-05 22:46:01 +01:00
Alexandre Alapetite
1db606bc1b New extension hook entry_auto_read (#5505)
* New extension hook entry_auto_read
For extensions to be notified of articles being automatically marked as read for various reasons

* Documentation + entry_auto_unread
2023-07-05 11:00:26 +02:00
Alexandre Alapetite
8bf362838e Update dev dependencies (#5478) 2023-06-18 23:05:28 +02:00
maTh
2343f0ded1 Docs: delete 04_Changing_source_code.md (#5391)
* delete 04_Changing_source_code.md

* make pot

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-05-11 08:32:19 +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
maTh
859c48383a docs: Minz Framwork (#5102)
* done

* Update docs/fr/developers/Minz/index.md

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-02-23 22:20:36 +01:00
Sadetdin EYILI
de5f70c684 docs: fix formating (#4968)
Replace apostrophe backtick
2022-12-29 18:48:17 +01:00
Alexandre Alapetite
7c74653cc2 Update markdownlint-cli dev dependency (#4241)
* Update markdownlint-cli dev dependency
And fix https://github.com/advisories/GHSA-6vfc-qv3f-vr6c

* npm ci
2022-02-28 20:50:39 +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
0d31f89dd8 Remove remains of Travis (#3941)
* Remove remains of Travis
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/3920

* Update docs/en/developers/03_Running_tests.md

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

* Apply suggestions from code review

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Co-authored-by: Alexis Degrugillier <aledeg@users.noreply.github.com>
2021-11-02 23:46:26 +01:00
Alexandre Alapetite
acbba9adb2 Improved markdownlint (#3918)
* Improved markdownlint
* Relaxed rules slighlty
* `npm run markdownlint` for automatic tests
* `npm run markdownlint_fix` for automatic syntax fixing
* Applied the fixes on all our Markdown files
2021-10-23 13:43:24 +02:00
Alexandre Alapetite
1c3159058f Quick update the doc for master renaming to edge 2021-03-15 00:00:25 +01:00
Alexis Degrugillier
0910cf34c7 Add support for extensions in Docker environment (#3042)
By default, the container starts without extensions. But if for some reasons,
you need to add them without copying or moving some code, you can embed them
while starting the container. The syntax is:
```
make start extensions="/full/path/to/extension/1 /full/path/to/extension/2"
```
2020-06-10 23:16:14 +02:00
Frans de Jonge
8b1ccdac42 [i18n] Add documentation for new hooks (#2815)
See <https://github.com/FreshRSS/FreshRSS/pull/2704#issuecomment-592950971>.
2020-02-29 19:13:02 +01:00
Marien Fressinaud
6bc963569b tec: Add a test target to Makefile (#2725)
* tec: Add a test target to Makefile

Minor edit put php7-phar on third line

I try to keep on the third line the Alpine-specific PHP extensions (i.e.
that are not by default in Ubuntu), and in alphabetic order

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

* Allow to run make test without Docker
2019-12-29 13:55:45 +01:00
Marien Fressinaud
82851d2039 Make master the rolling release branch (#2705)
* Change default TAG in Makefile

We are going to drop the `dev` branch. The Docker tag `dev-*` are based
on this branch and so there will be no longer be generated. We must use
images based on the `master` branch (i.e. `latest`, `alpine` and `arm`).

* Remove references to dev branch in documentation

* Synchronize French documentation
2019-12-15 14:08:49 +01:00
Frans de Jonge
705318aa39 Translate docs with po4a (#2590)
* [i18n] Add docs po4a script

* Add proof of concept

* Add a few more translations

* Hush ShellCheck and shfmt

* Make that list po4a-friendly

* drat, this document could've probably been auto-generated

* Definitive proof that it's translated from French ;-)

* Add some brand spanking new French translation

* More translation

* Mostly finish that config page

* Fix up FAQ

* More contributing

* Dev first steps

* Let's ignore that admin stuff at the very least for now

* Translate release new version, make French the source first and copy all translations

Then replace French with English in the source.

Much quicker than any alternative route.

* And add the English translation

* Minor stylistic leftover from French

* Most of first steps

* Forgot the extensions

* Use po4a 0.56 to get rid of way too many newlines

* Fix up those newlines

* No point linking to Firefox integration anymore from the new user guide

* Start on main view

* A bunch of main view stuff

* More main view

* And some subscriptions before going to bed

* First steps for devs

* More dev first steps

* Incomplete French → English dev/GH translation

Because I need to ask about that mailing list thing

* Fix typo in docs/en/developers/02_Github.md

* Translate & complete devs/github to English

* Fix up most of extensions

* Is that supposed to be a non-breaking space? Let's see

* Match up some users/mobile access

* More users/mobile access

* Add fresh French translation to Fever API

* Fix typo

* Match frontend todo thingies

* Fix a typo

* Some extensions strings

* Remove Fx subscription service from the docs

Cf. https://github.com/FreshRSS/FreshRSS/pull/2606

* Add translation for https://github.com/FreshRSS/FreshRSS/pull/2643

* fix typo as per https://github.com/FreshRSS/FreshRSS/pull/2643#discussion_r345433009

* Add some more French translations

* Update French translation as per @aledeg comment https://github.com/FreshRSS/FreshRSS/pull/2590#discussion_r345465909

* Translate some of the meaningless stuff

* Translate the rest of contributing.md to French

* Fix conflicts

* Translate Docker first steps to French

* Update with change from #2665

* Add @aledeg corrections

* Overlooked a couple @aledeg corrections thanks to GitHub autohide

* Latest @aledeg suggestions
2019-12-03 22:37:40 +01:00
Alexandre Alapetite
7a5236de3f Take advantage of PHP 5.4+ short echo (#2585)
* Take advantage of PHP 5.4+ short echo

https://php.net/migration54.new-features thanks to
https://github.com/FreshRSS/FreshRSS/pull/2495

Use `<?=  ?>` instead of `<?php echo; ?>`
10kB of code saved :-)

Done with regular expression:
```
<\?php echo (.+?);? *\?>
<?= \1 ?>
```

* Try Travis fix

https://github.com/squizlabs/PHP_CodeSniffer/issues/2045#issuecomment-395238272
2019-10-23 11:18:20 +02:00
Alexandre Alapetite
37b52b7361 Trim whitespace (#2544) 2019-10-01 18:12:21 +02:00
Alexandre Alapetite
fd33d92d41 Require PHP 5.5+ (#2495)
* Require PHP 5.5+

https://github.com/FreshRSS/FreshRSS/issues/2469#issuecomment-522255093
I think it would be reasonable to require PHP 5.5+ for the core of
FreshRSS after all.

As Frenzie said, WordPress currently requires PHP 5.6.20+, and it is the
most popular PHP application.

We would loose about 20% of the PHP servers according to
https://w3techs.com/technologies/details/pl-php/5/all but I expect this
number to drop fast after the release of CentOS 8 (CentOS accounts for
17% of Linux servers
https://w3techs.com/technologies/details/os-linux/all/all ).

Distributions:
* no impact on Ubuntu, Fedora, Alpine, OpenWRT, FreeBSD, OpenSuze,
Mageia, as all active versions have PHP > 7
* no impact on OpenSuze, Synology, as all active versions have PHP > 5.5
* we drop Debian 8 Jessie (-2020) - we keep supporting Debian 9 Stretch
(2017-06) - current is Debian 10 Buster
* we drop Red Hat 7 (-2024) - we keep supporting RHEL 8 (2019-05)
* we drop CentOS 7 (-2024) - we will support CentOS 8 (to be released
soonish)

When dropping older versions, I can better like when it is for a good
reason, and there is actually one with PHP 5.5, namely generators
(yield) https://php.net/language.generators.overview which I consider
using.

* Version note for JSON.php

* hex2bin

* Update .travis.yml

Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
2019-08-20 14:55:43 +02:00
Alexandre Alapetite
38a4b22f7b Doc MariaDB (#2494) 2019-08-17 13:07:30 +02:00
Alexandre Alapetite
c00743b9b7 Update deployment links
Remove broken DP deploy links
https://github.com/DFabric/DPlatform-Shell/issues/51
2018-09-09 11:10:05 +02:00
Alexandre Alapetite
6a56894e94 New extension event + Tumblr GDPR (#1924)
* New extension event + Tumblr GDPR

https://github.com/FreshRSS/FreshRSS/issues/1894
simplepie_before_init event

* Refactor extension enabling + Tumblr GDPR enabled by default

Add possibility for extensions to be enabled by default, and disabled
back by users.

* Minor whitespace
2018-06-09 15:58:18 +02:00
Alexandre Alapetite
82ba185114 Minz Controllers directory uppercase
https://github.com/FreshRSS/FreshRSS/pull/1729
2017-12-17 15:33:11 +01:00
Frans de Jonge
e70e9e8e04 [doc] Extensions: translate various sections from French
See https://github.com/FreshRSS/FreshRSS/pull/1697#discussion_r154290857

* lowercase dir as pointed out by @kevinpapst in https://github.com/FreshRSS/FreshRSS/pull/1704#issuecomment-350458110

* Add French translation with improvements suggested by @aledeg
2017-12-15 21:01:57 +01:00
Alexandre Alapetite
92a1bf3917 Update some HTTP links (doc, HTTPS) (#1641)
https://github.com/FreshRSS/FreshRSS/issues/1605
2017-09-26 22:20:25 +02:00
Marien Fressinaud
afc38e43ec Provide documentation under ./docs 2017-04-24 23:08:43 +02:00