Closed Robert-Ernst closed 3 years ago
Heya, thanks for raising this. Yes some of the themes contain Google Fonts, as it was not feasible to bundle a ton of TTF files in the package. I will look into making fonts optional, it's on my to-do list :)
In the meantime, you can either stick to just the default theme which has all the required fonts pre-bundled locally, or use ad/ tracker blocker and deny access to https://fonts.googleapis.com/*
.
Another external request I see you've got is for the favicon fetching service, you can disable this by setting appConfig.faviconApi: local
. You can also set appConfig.enableFontAwesome: false
so that the Font-Awesome icons feature is disabled.
I've made an update to fix this, by replacing the CDN with local assets. You can switch to branch REFACTOR_Use-local-fonts
to use this.
I did submit a PR (#60) for it, but am in two minds about weather to merge this. Although I'm the biggest hater of Google, using their CDN does mean that for most users these assets will already be cached on their system. Since font files are quite heavy, this has quite a serious impact on performance. Another solution could be to configure the service worker to cache fonts indefinitely, meaning only the first load will be slow, but if a user is only going to use a single theme, it doesn't make a lot of sense to download assets for all the themes.
I may think about it, and see if there's anything else that would make sense before I merge this. If you've got any other ideas for a performant implementation, please do feel free to submit a PR yourself, it would be much appreciated :) But in the meantime, you can either use the new branch, or just use one of the solutions mentioned above (use Default theme, or block CDN).
Thank you for the detailed response. Glad to see that someone else tries to avoid Google. Furthermore thank you for addressing the favicon topic. I am aware about this and haven't finished setting it up. Luckily the documentation is good in this part and I see the different paths I can take.
Sadly your solution is not feasible for me since I'm running on your docker images and thus can't make use of your feature branch.
I'm a bit surprised that the change cannot be done via a config change? Because I don't care for any fancy font but I care about what requests are done from my server. Laziest implementation of a config setting would be something like
NoGoogleFont=true/false
In case of true
then it simply defaults to browser default fonts. Ugly but solves the Google issue.
Well for it to be done via config, then the font assets would need to be loaded with JavaScript, which isn't a great approach, as fonts have to be in a stylesheets root in order to be available immediately on page load.
Maybe I'm missing something, if you know of an implementation method to conditionally load certain aspects of a stylesheet based on a property defined at runtime I would be very interested. It's easy to modify functionality using anything in the config file, but page styling, less so.
And in terms of the Docker, you can run it from any branch, just build the container yourself-
git clone git@github.com:Lissy93/dashy.git
, cd dashy
, git checkout REFACTOR_Use-local-fonts
, docker build .
then docker compose up
. Or you can just use a container registry, by passing the URL to the repo with branch (here), and the pull the image from there.
Heya @Robert-Ernst - Just to let you know I updated and merged the PR which removes all instances of fonts loading from the CDN. They're now all bundled within the project, and so loaded locally.
There are still other parts of the app (all optional, and off by default) which make external requests. This includes the favicon-fetching (if your fetching for a public service), status checks (again, only if your checking for a public online website), Font-Awesome icons, generative icons, and the backup & sync functionality (if used). It's not possible to remove these, but since you care about privacy, thought I'd let you know. I'm going to make a Privacy section in the docs which outlines which features require external requests to be made sometime in the future.
Is your feature request related to a problem? If so, please describe. I'm using uMatrix and it shows that font.googleapis.com and gstatic.com are getting called from my own server. Since we care about privacy this is not acceptable for us. We don't care much about the font quality. Any standard font would be fine. Is there any option yet to simply disable all calls towards Google?
Describe the solution you'd like Implement an option to disable calls for Fonts to Google. Just default to any standard font instead.
Priority: Medium: Would be useful