Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Save CustomCSS settings to user data #227

Open
hkcomori opened this issue Apr 5, 2024 · 6 comments · May be fixed by FreshRSS/FreshRSS#6267
Open

[Feature] Save CustomCSS settings to user data #227

hkcomori opened this issue Apr 5, 2024 · 6 comments · May be fixed by FreshRSS/FreshRSS#6267

Comments

@hkcomori
Copy link

hkcomori commented Apr 5, 2024

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
Copy link
Member

Alkarex commented Apr 5, 2024

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 Change CSS load order to help CustomCSS extension FreshRSS#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
Copy link
Member

Frenzie commented Apr 5, 2024

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

@hkcomori
Copy link
Author

hkcomori commented Apr 5, 2024

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
Copy link
Member

Alkarex commented Apr 5, 2024

A few points:

  • If we promote CustomCSS and CustomJS to core extensions, they will get a slightly different name, and both the old and new extensions can co-exist for some time, without breaking anything

  • In any case, we could consider copying automatically from the old location to the new

  • https://github.com/FreshRSS/FreshRSS/blob/edge/p/ext.php might have to be adapted a bit

@hkcomori
Copy link
Author

hkcomori commented Apr 6, 2024

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

@hkcomori hkcomori linked a pull request Apr 6, 2024 that will close this issue
4 tasks
@hkcomori
Copy link
Author

hkcomori commented Apr 6, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants