-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-29115 Fix website cannot load some resources because of CSP #6668
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
HBASE-29115 Fix website cannot load some resources because of CSP #6668
Conversation
|
I'm not sure if this is the most efficient way to download and extract the CSS and JS files with Maven, so any feedback is appreciated. |
|
Would be great to upgrade from Bootstrap 2.3.2 as it contains 6 CVE-s and it is end of life since 11 years... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
3b3a7fa to
8b4549c
Compare
|
Still looking into the last problem: The Reference Guide HTML page tries to load the MathJax.js library from cdnjs.cloudflare.com (which is also blocked by CSP). |
Unfortunately it seems that right now there is no way to influence from where the Reference Guide Asciidoc includes the MathJax.js library.
|
|
Is it possible to replace the location string in the generated HTML when committing the changes to our site repo? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
8b4549c to
512dba7
Compare
512dba7 to
52fba14
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Hi @Apache9, @ndimiduk, @NihalJain, Can you please have a look on this? As far as I understand, the new Content Security Policy (CSP) will be turned on March 1st, 2025. While the website seemed to be functional, the reference guide (book.html) had some smaller issues (missing icons, not rendered mathematical formulas, etc). The PR build failed but as I saw it was unrelated. |
This comment has been minimized.
This comment has been minimized.
ndimiduk
left a comment
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 have nothing to add here, @NihalJain has got you. Thanks for picking this up, @PDavid !
| <configuration> | ||
| <artifactItems> | ||
| <artifactItem> | ||
| <groupId>org.webjars</groupId> |
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.
wow, Today I Learn
This comment has been minimized.
This comment has been minimized.
|
@PDavid Please let me know if I can go ahead and merge this now. |
Many thanks @NihalJain. 👍 I now added a comment and links to the MathJax workaround in the shell script. I'd wait until the PR build is done and then I think this is ready to be merged. |
This comment has been minimized.
This comment has been minimized.
|
BTW the PR site build is failing because of checkstyle is not able to parse ReplicaKey.java (because of instanceOf pattern match): Probably checktyle needs to be updated. @petersomogyi is already mentioned that he is looking into this issue. |
Please file an issue to use java 8 style instanceof to fix the problem, to align the code between branch-3+ and branch-2.x? @rmdmattingly ? |
|
This comment has been minimized.
This comment has been minimized.
…f CSP Self-host Boostrap CSS, highlight.js (CSS and JS) instead of trying load it from CDN-s. Because of the new CSP, loading these from CDN-s is blocked.
…` to new property
d04d898 to
6d93675
Compare
|
The website build is now fixed on master, so rebased this PR on master to have a better PR build. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
@NihalJain The PR build looks good to me, I think this PR is now ready to be merged. |
|
Merged this to master. Thanks @PDavid . I am away from my laptop. Could you raise backports for all affected branches.? Although I am not sure if these changes are needed by other branches at all. |
Thank you very much @NihalJain! 🎉
In this PR we changed how we include static resources in the website and in the Reference Guide (book.html). Maybe I can raise the backports, so that we could regenerate the old reference guides (if possible) and the code in pom.xml and site.xml does not get too different between branches. What do you think? |
|
I believe that we only generate the site and book content from |


stylesdirso that book.html will include/css/font-awesome.css(where the file is) and not/font-awesome.css.