fix: Add Algolia domains to CSP config for DocSearch (#1082)

The Content-Security-Policy header was blocking Algolia DocSearch scripts
and API requests, causing the search functionality to not work on the
documentation site.

This fix adds the required Algolia domains to both script-src and
connect-src directives in the CSP header.

Issue: Search functionality not working on pulsar.apache.org
1 file changed
tree: 0e0169e737e5bed4d8c91c99e060e9da662d36c2
  1. .github/
  2. blog/
  3. client-feature-matrix/
  4. contribute/
  5. data/
  6. diagrams/
  7. docs/
  8. release-notes/
  9. scripts/
  10. security/
  11. src/
  12. static/
  13. tmp/
  14. tools/
  15. versioned_docs/
  16. versioned_sidebars/
  17. .asf.yaml
  18. .dockerignore
  19. .editorconfig
  20. .gitignore
  21. .yarnrc.yml
  22. babel.config.js
  23. docker-compose.yaml
  24. Dockerfile
  25. docusaurus.config.ts
  26. matomoClientModule.ts
  27. package.json
  28. preview.sh
  29. README.md
  30. releases.json
  31. sidebars.js
  32. sidebars.json
  33. sidebarsDevelopment.js
  34. sidebarsReleaseNotes.js
  35. site-baseurls.js
  36. tsconfig.json
  37. versions.json
  38. yarn.lock
README.md

Apache Pulsar Website and Documentation

This repository contains the Apache Pulsar website source code and Apache Pulsar documentation.

Apache Pulsar is an open-source, distributed messaging and streaming platform built for the cloud.

Quick start: Updating documentation and previewing changes

Make changes to the documentation in the docs directory.

To preview the changes, run the following command (prerequisites):

./preview.sh

This command starts a local web server on port 3000 and opens a browser window pointing to the website.

Updating versioned docs

When your documentation changes apply to existing supported versions, you should update both the versioned documentation in the versioned_docs directory and the documentation in the docs directory.

# List all supported major.minor.x versions
./scripts/docs-tool.sh supported_versions

After committing the changes for the docs directory, you can use the docs-tool to apply the changes to the versioned docs. This tool is a wrapper around git diff and patch. If the patch is not applied correctly, you will have to manually apply the changes to the versioned docs.

./scripts/docs-tool.sh apply_changes_to_versioned_docs

More information

Website not getting updated?

If the https://pulsar.apache.org website doesn't get updated, check the latest GitHub Actions workflow run for the main branch. If it succeeded, the problem could be that the git history for the asf-site-next branch is too large and needs to be truncated. Here are the commands to perform that task:

git clone -b asf-site-next https://github.com/apache/pulsar-site pulsar-site-static
cd pulsar-site-static
git checkout --orphan asf-site-next-reset
git add -A
git commit -m "History resetted"
git push -f HEAD:asf-site-next

Contact information