Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Nexus Dashboard: vendor fonts

The Nexus Dashboard admin control panel for the Lego Universe server emulator DarkflameServer works really well. It just uses some bog-standard Internet stuff where it pulls in Google fonts. It makes the site look really nice, but for people who don't want to leak the referer and/or are not on the world wide web, you can vendor the font yourself.

In the docker-compose.yml, add to the container darkflamserverweb a volume:

- ${HOME}/web/css:/app/static/css

Then make that directory, and pull down the included url yourself, once.

/* stackrpms,8 This pulls down https://fonts.gstatic.com/s/nunito/v26/XRXI3I6Li01BKofiOc5wtlZ2di8HDFwmdTQ3ig.ttf so I put that here. */
/* @import url(https://fonts.googleapis.com/css?family=Nunito:700); */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  src: url(XRXI3I6Li01BKofiOc5wtlZ2di8HDFwmdTQ3ig.ttf) format('truetype');
}

So my directory contents are as follows.

$ ls -al web/css
total 220
drwxr-xr-x. 2 bgstack15 admins        72 Oct 11 08:54 ./
drwxr-xr-x. 6 bgstack15 admins        54 Oct 11 08:29 ../
-rw-r--r--. 1 bgstack15 bgstack15 181989 Oct 11 08:28 site.css
-rw-rw-r--. 1 bgstack15 bgstack15  39108 Sep 13  2023 XRXI3I6Li01BKofiOc5wtlZ2di8HDFwmdTQ3ig.ttf

Cruddy, and silly, but it works. Now I get the nice fonts without telling Google every time I visit the admin console.

Nexus dashboard with nice fonts

Comments