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

Remove Google Analytics from the Druid Website #17647

Open
niallkp opened this issue Jan 20, 2025 · 11 comments · May be fixed by #17661
Open

Remove Google Analytics from the Druid Website #17647

niallkp opened this issue Jan 20, 2025 · 11 comments · May be fixed by #17661

Comments

@niallkp
Copy link

niallkp commented Jan 20, 2025

Hi Druid Team

The ASF Privacy Policy[1][2] does not permit the use of Google Analytics on any ASF websites and the ASF Infra team will soon enforce a Content Security Policy(CSP) that will block access to external trackers:

Please could you remove the use of the Google Analytics from the Druid website? I would have submitted a PR but cloning Druid locally fails on windoze - but it looks like docusaurus.config.js needs to be modified to remove the gtag trackingID

The ASF hosts its own Matomo instance to provide projects with analytics and you can request a tracking id for your project by sending a mail to privacy AT apache.org.

Additionally I would recommend reviewing any external resources loaded by your website. The Content Security Policy will prevent any resources being loaded from 3rd Party providers that the ASF does not have a Data Processing Agreement (DPA) with. On the 1st February Infra will begin a temporary "brownout" when the CSP will be turned on for a short period. This will allow projects to check which parts, if any, of their websites will stop working. The Privacy FAQ answers a number of questions about which external providers are permitted or not:

Thanks

Niall

[1] https://privacy.apache.org/policies/website-policy.html
[2] https://privacy.apache.org/faq/committers.html#can-i-use-google-analytics

@techdocsmith
Copy link
Contributor

Thanks @niallkp , we're looking into it.

@akulabs8
Copy link

@techdocsmith Hey can I pick this up?

@317brian
Copy link
Contributor

Hi @akulabs8, thanks for volunteering to take this on.

There seems to be a few changes needed:

  • When making updates to docusaurus.config.js, it needs to be done in both this repo and https://github.com/apache/druid-website-src`. That is the repo actually used to build the site for deployment.

    • For example, you need to remove the gtag config from the docusaurus config in both places
  • In druid-website-src, the published_versions directory has all the built HTML files. We can likely just find/replace in bulk to remove the google analytics code

More tricky is replacing the font awesome and clipboard.min.js external scripts and updating those and the CSS.

So, find/replace to fix existing docs and update docusaurus.config.js so that future builds are correct.

Let me know if you have any questions.

@akulabs8
Copy link

Hey @317brian , based on what I understood, I have created a first version of 2 PRs , one for each repo

#17661

apache/druid-website-src#516

Please take a look at let me know what more might be needed

@akulabs8
Copy link

@317brian

More tricky is replacing the font awesome and clipboard.min.js external scripts and updating those and the CSS.

I didn't understand this part though.

@niallkp
Copy link
Author

niallkp commented Feb 9, 2025

Thanks @akulabs8 for working on this, any chance of getting your PRs merged?

More tricky is replacing the font awesome and clipboard.min.js external scripts and updating those and the CSS.

For both it should just be the case of downloading files locally within your website and changing the references to reflect that:

@akulabs8
Copy link

akulabs8 commented Feb 9, 2025

Hey @niallkp ,
I am stuck here,

This is how I have kept my files in static directory

Image

"stylesheets": [
"./static/fontawesome/css/all.css",
],

This is how I am referencing the css but still, the webfonts is not loading up and thus no fonts is shown

Image

@niallkp
Copy link
Author

niallkp commented Feb 9, 2025

Difficult to see where its going wrong remotely:

Do you see the font files deployed in /static/fontawesome/webfonts in your website? If you see the font files deployed, then EITHER the CSS is not loading (need to look at why) OR there's something wrong with the references to the font files in all.css (they should be relative URLs, like src: url("../webfonts/fa-solid-900.eot"); ).

@akulabs8
Copy link

akulabs8 commented Feb 9, 2025

@niallkp , no the WebFont directory is not getting deployed..

@niallkp
Copy link
Author

niallkp commented Feb 9, 2025

I'm not familiar with docusaurus, but the docs seem to say that anything in static should be copied to the build output file, but so actually it looks like you should see the /fontawesome/css and /fontawesome/webfonts folders (without the static prefix) - so looks a bit strange that you have /static/fontawesome/css - so maybe look at that & the docusaurus config.

@akulabs8
Copy link

@niallkp Hey I have handled it, actually inside the docusaurus, 'static' is not supposed to be added in the path as static is by default added to the build. Thus just the files path was needed. Fixed it, Please review the PR

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