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

[FEATURE_REQUEST] Option for removing Google Fonts #58

Closed
Robert-Ernst opened this issue Jun 24, 2021 · 5 comments
Closed

[FEATURE_REQUEST] Option for removing Google Fonts #58

Robert-Ernst opened this issue Jun 24, 2021 · 5 comments
Assignees
Labels
🦄 Feature Request [ISSUE] Suggestion for new feature, update or change

Comments

@Robert-Ernst
Copy link

Is your feature request related to a problem? If so, please describe.
externaldependencies
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

@Robert-Ernst Robert-Ernst added the 🦄 Feature Request [ISSUE] Suggestion for new feature, update or change label Jun 24, 2021
@Lissy93
Copy link
Owner

Lissy93 commented Jun 24, 2021

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.

@Lissy93
Copy link
Owner

Lissy93 commented Jun 24, 2021

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).

@Lissy93 Lissy93 closed this as completed Jun 24, 2021
@Robert-Ernst
Copy link
Author

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.

@Lissy93
Copy link
Owner

Lissy93 commented Jun 24, 2021

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 [email protected]: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.

Lissy93 added a commit that referenced this issue Jul 3, 2021
[REFACTOR] Use local font assets
Requested by @Robert-Ernst in #58 - Fixed.
@Lissy93
Copy link
Owner

Lissy93 commented Jul 3, 2021

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.

asterling8516 pushed a commit to asterling8516/dashy that referenced this issue Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🦄 Feature Request [ISSUE] Suggestion for new feature, update or change
Projects
None yet
Development

No branches or pull requests

2 participants