Disabling external includes (fonts.googleapis.com and similar)

Hello,

I am new to XWiki so excuse me for stupid questions :slight_smile: I have just installed Standard Flavor XWiki 10.11.7 on local network and have chosen Sandstone color theme… What I noticed is that XWiki tries to include some resources from the Internet ex.: https://fonts.googleapis.com/css?family=Roboto:400,500

How can I change that? I would like to have those resources locally…

I have tried grep’ing webapp’s and XWiki permanent folders for “fonts.googleapis.com” but it looks that everything is not so simple… :slight_smile:

Thank you in advance!

Hi @mirkt
There is already an issue reported at Loading...
The thing is that Paper (mentioned in the issues) or Sandstone (mentioned by you) are themes that we have from Bootswatch (these are open source Bootstrap theme created by an external community that we don’t control). We are using Bootswatch themes in order to provide more options for users until they create their own theme.

If you look in the Sandstone colortheme editor (https://extensions.xwiki.org/xwiki/bin/view/Extension/Flamingo%20Theme%20Application#HHowtomodifyatheme) you will see the theme is manually importing the font https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-themes/xwiki-platform-flamingo-theme-bootswatch/src/main/resources/FlamingoThemes/Sandstone.xml#L1803

You could try copying this theme and customizing it to your need, like removing the external Google Font call and relying on the local resources.

For the default XWiki theme (Iceberg) we also are using a custom font (Open Sans) which we are bringing with Webjars, see https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-themes/xwiki-platform-flamingo-theme-ui/pom.xml#L82

You could also download the font locally from Roboto - Google Fonts


Conclusion: we don’t control the Sandstone team. Try copying / customizing it or use another theme?

The conclusion for me is that we need to fix the issue since I agree that we shouldn’t force being online to use XWiki by default. Maybe we could have some themes that don’t need to be online while others would need to be online?

We provide in XS:

  • 5 own themes - for these the user doesn’t need to be online.
    • the default Iceberg theme has no issue being on a secure / isolated instance.
  • 16 Bootswatch themes - for some of these theme, the user should be online to have that particular font, but the CSS also provides fallback on system fonts.

There are also some 5 extra contrib themes and other ~28 xar themes in color themes extesions.

I don’t consider this as a blocker / critical. We could remove the XS themes because of the ‘font issues’, but this will limit the selection / experimentation the users will have with the initial themes. Beginner users might not know they can install additional themes.
Since we don’t control them, the only solution would be to remove them. It’s a matter of what we lose versus what we gain.

Then I don’t see any issue. Maybe we should just document somewhere that they require to be online (maybe it’s already mentioned on e.x.o, didn’t check).

I think it’s critical/blocker that we provide some themes that don’t require to be online to work but as you mentioned it’s already the case!

I don’t see why we would remove the bootswatch themes. They’re interesting to have IMO.

It is mentioned on their extension page https://extensions.xwiki.org/xwiki/bin/view/Extension/Bootswatch%20Themes%20for%20Flamingo :

These themes use some fonts from the Google Fonts webservice. This mean that if you are behind a proxy that filters some requests, or if you are browsing XWiki on an intranet without having an Internet connection, you will not have the same fonts, but a default one instead.

I agree.

Thank you for answers! Situation is clearer now :slight_smile: At the moment I have selected one of your 5 themes.

Thanks

1 Like