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

GH-45720: [Docs] Kapa.ai widget not loading on the dev docs #45764

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

thisisnic
Copy link
Member

@thisisnic thisisnic commented Mar 13, 2025

Rationale for this change

Add the kapa.ai domain to the content security policy so that the AI bot we are trying out can load. Following the approach shown on apache/dubbo-website#2925 but being more restrictive on URLs.

What changes are included in this PR?

Updates to sphinx and pkgdown docs to fix this

Are these changes tested?

Nope - this wasn't an issue on the docs built in crossbow when I tested it on the PR, so I was thinking I just check it's working on the dev docs once they're built

Are there any user-facing changes?

Nope

@thisisnic thisisnic requested a review from jonkeane as a code owner March 13, 2025 14:18
@thisisnic thisisnic requested a review from assignUser March 13, 2025 14:18
Copy link

⚠️ GitHub issue #45720 has been automatically assigned in GitHub to PR creator.

@thisisnic
Copy link
Member Author

Hmm, looking at the original error, I'm now wondering if I need to add the others back in to prevent blocking access to others?

Content-Security-Policy: The page’s settings blocked a script (script-src-elem) at https://widget.kapa.ai/kapa-widget.bundle.js from being executed because it violates the following directive: “script-src 'self' 'unsafe-inline' 'unsafe-eval' https://analytics.apache.org/ https://www.apachecon.com/”

@thisisnic
Copy link
Member Author

I think this is wrong actually - I may need to open a ticket with infra...

@thisisnic
Copy link
Member Author

Or just update the .htaccess file on the arrow-site repo...

@kou
Copy link
Member

kou commented Mar 14, 2025

@ianmcook may know the Content-Security-Policy settings because Ian worked on it such as apache/arrow-site#603 recently.

@ianmcook
Copy link
Member

ianmcook commented Mar 14, 2025

I think this is wrong actually - I may need to open a ticket with infra...

AIUI, the only way to modify the CSP is to ask privacy@apache.org. See https://infra.apache.org/csp.html for details. I banged my head on the wall for several days trying to get the GitHub star count badge to work by modifying the CSP here using meta tags and then using .htaccess, but the ASF has the Apache web server configured to prevent those approaches from working. Ultimately I decided to just remove the star count from the badge. You can see PRs 595 through 603 in the arrow-site repo where I experimented with this with no success :)

@thisisnic
Copy link
Member Author

Thanks both, I was going round in circles a bit there; I will drop them an email!

@ianmcook
Copy link
Member

It sounds like they are setting a very high bar for adding any new sites to the CSP allowlist. May the odds be ever in your favor :)

@thisisnic
Copy link
Member Author

I'm hopeful - it's one of the few things expressly allowed as kapa.ai has signed a DPA with the ASF, so it feels like it's just the technical details to resolve here 🤞

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

Successfully merging this pull request may close these issues.

None yet

3 participants