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

Better privacy through local hosting of JS and fonts #76

Merged
merged 7 commits into from
Nov 5, 2018

Conversation

poempelfox
Copy link
Contributor

@poempelfox poempelfox commented Feb 24, 2018

This PR makes it convenient to host the Javascript and Fonts used by the default templates locally, so there is no need to use external third-party CDNs that can (and will) track your users.
It consists of

  • a script (contrib/localjs/fetchfiles.sh) that will download files into a local directory tree, that can then be served by your webserver (or some 'static.domain.tld' if you have such a thing).
  • a new config option 'LocalJSPath' that will insert this path to the locally hosted files in the right places in the templates.

As long as LocalJSPath is not set, the templates will behave as before, loading stuff from Google/cloudflare/bootstrapcdn, because of course, this makes initial setup easier for new users. There are however two unavoidable changes to before in that case, in order to keep consistency between locally hosted and not-locally hosted:

  • Google Charts API has been replaced with another library, Flot Pie. The reason for this is that Google does not permit to host its charts "API" JS locally, the licensing terms require you to subject your users to Googles invasive tracking.
  • font-awesome had to be updated from V4.1.0 to 4.7.0 because 4.1.0 is no longer available for download.

Google charts does not permit offline or selfhosted use. If you want to use it, you HAVE to consign your users to googles disgusting everpresent tracking, and that seems a bit of a high price to pay for just displaying a simple pie chart.
…e local copies of JavaScript files instead of external CDNs that will violate users privacy through tracking.
Note: This will also update the version of fontawesome used in the non-local case from 4.1.0 to 4.7.0 for consistency (because 4.1.0 is not available for download anymore).
@infertux
Copy link
Contributor

infertux commented Nov 2, 2018

Nice PR. However I wonder whether this project is still being maintained seeing the last commit was 9 months ago? @etix

@etix
Copy link
Owner

etix commented Nov 2, 2018

I'll allocate some time next week to review this and maybe plan a new release.

@etix
Copy link
Owner

etix commented Nov 5, 2018

Thanks for your great contribution!

Few remarks:

  1. It seems there is a JS error if mirrordistchartdata is empty, this occurs if the user IP address does not match any location (your can try this by adding a query argument <somefile>?mirrorlist&fromip=127.0.0.1). Anyway I fixed it by adding a single point representing 100% if no data are returned from the backend.
  2. Some commits could have been squashed but that's a minor issue.

Beside that seems good.

@etix etix merged commit 97a2fdf into etix:master Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants