-
-
Notifications
You must be signed in to change notification settings - Fork 952
Add support for custom stylesheet URL in UserCSS extension #7107
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
base: edge
Are you sure you want to change the base?
Add support for custom stylesheet URL in UserCSS extension #7107
Conversation
This update introduces the ability for users to specify a custom stylesheet URL in the UserCSS extension. It includes configuration fields, backend handling, and CSP updates to allow external stylesheets while maintaining security. Existing functionality remains untouched.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
link: FreshRSS/Extensions#261 |
Adjusted method bracket placement to align with coding standards. These changes improve code readability and maintain consistency across the codebase. No functional behavior was altered.
941f241
to
65befc0
Compare
I am a bit worried of having something like that in the core, which dynamically modifies CSP security headers. |
I have the CSS file sitting in another docker container on the same server though its referenced using a full domain Since this is a user based plugin and the CSS URL entered will only be displayed to the current logged in user after they themselves have set the URL, would it be a huge concern? Perhaps a warning message about the potential perils of not using a domain under your control? |
We should in particular double-check that this is not used for instance on the login screen, if used by the default user |
Introduced hasValidStylesheetUrl method to encapsulate URL validation, enhancing readability and maintainability. This change also addresses static analysis issues.
8aab4c2
to
8df544b
Compare
My 2 cents here: But open a potential stream into the web just for a very very very very rare use case makes me a bad gut feeling |
The stylesheet I am using is actually shared by a few applications so that's why I needed something like this over a custom theme.
The only time anything is changed is if a user sets a URL otherwise the CSP values remain unchanged, but I also get where you are coming from. Originally I just had this as a custom extension but when I opened a PR to add my extension to the list of third party extensions available I was told to do this instead and that PR there hasn't been merged. |
That's talking from the perspective of a server administrator. From the perspective of a user that isn't very simple but completely impossible.
Imho the complete opposite of rare among the audience most likely to use FreshRSS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to take this opportunity to vehemently object to making things worse for the purposes of "security".
Imo it should either be part of CustomCSS or part of the server config and it doesn't make sense as a separate extension, but my expectation would be that if you disagreed you would've said so rather than jumping straight into implementing it in CustomCSS. ;-) |
Ensure URL is not null before validation and simplify the `hasValidStylesheetUrl` method. This improves code clarity and prevents potential null value issues.
Changes proposed in this pull request:
How to test the feature manually:
Pull request checklist: