FreshRSS / Extensions

A repository containing all the official FreshRSS extensions
GNU Affero General Public License v3.0
350 stars 53 forks source link

[Feature] Save CustomCSS settings to user data #227

Closed hkcomori closed 3 months ago

hkcomori commented 5 months ago

Is your feature request related to a problem? Please describe.

I faced the issue of not being able to write CustomCSS settings and solved it in #182. However, if the extentsions directory has user data, it becomes more complicated to manage. Because the extensions directory is managed outside of the application, but the user data is variable data that the application writes.

Describe the solution you’d like

I think CustomCSS settings should be stored in the database or in each user's data directory, because they are user data.

For example, Readable stores settings in data/users/<username>/config.php. If it needs to be saved in an independent file, data/users/<username>/custom.css would be better.

Is it a technical difficulty to store CSS in the same way as general user data because it is a file delivered over HTTP?

Describe alternatives you’ve considered

Additional context

Alkarex commented 5 months ago

Indeed, that would be very welcome.

I suggest the following:

  1. Promote CustomCSS and CustomJS to core extensions (i.e. move the code from the Extensions repo to the core FreshRSS repo)
  2. For system extensions (not relevant for CustomCSS), save extension data in data/extensions-data/{extension-name}/ (some initial work was done in https://github.com/FreshRSS/FreshRSS/pull/1547)
  3. For user extensions (relevant for CustomCSS), save extension data in data/users/{user-name}/{extension-name}/

Would you feel like sending a PR? (maybe @Frenzie could help?)

Frenzie commented 5 months ago

I'm not really sure what that would entail without investigating, but happy to answer some questions if asked.

hkcomori commented 5 months ago

Thanks for the reply. It will take me a long time because I'm a PHP beginner, but I will try it. I will decide which approach to adopt after a better understanding of the code.

BTW, any approach would lose compatibility with existing configurations, is that a problem?

Alkarex commented 5 months ago

A few points:

hkcomori commented 5 months ago

OK, then I'll avoid duplicate names so that they can be used at the same time.

hkcomori commented 5 months ago

I submitted a pull request FreshRSS/FreshRSS#6267. Please review.