Caching fonts proxy for Googel Fonts
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

update readme and stuff


Signed-off-by: MLC Bloeiman <mar@strawmelonjuice.com>

+15 -8
+9 -4
README.md
··· 1 - # fonts 1 + # Strawmelonjuice's google fonts proxy 2 2 3 - [![Package Version](https://img.shields.io/hexpm/v/fonts)](https://hex.pm/packages/fonts) 4 - [![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/fonts/) 3 + The public instance for this service can be found at <https://fonts.mar.ollie.earth> and <https://fonts.strawmelonjuice.com>. But you can also host one yourself. 5 4 5 + ```sh 6 + # That simple! 7 + podman run -p 8080:8080 docker.io/strawmelonjuice/fonts-proxy:latest 8 + ``` 9 + If you want the cache to be a bit stronger, you can mount `/app/data`. 6 10 11 + This thing just checks if the url provided belongs to google fonts, fetches the resource, stores it and serves it. 7 12 8 - Further documentation can be found at <https://hexdocs.pm/fonts>. 13 + Not much to configure! 9 14 10 15 ## Development 11 16
+1 -1
gleam.toml
··· 1 1 name = "fonts" 2 - version = "1.1.0" 2 + version = "1.1.1" 3 3 4 4 # Fill out these fields if you intend to generate HTML documentation or publish 5 5 # your project to the Hex package manager.
+3 -3
priv/index.html
··· 2 2 <html lang="en"> 3 3 <head> 4 4 <meta content="width=device-width, initial-scale=1.0" name="viewport" /> 5 - <title>Strawmelonfonts</title> 5 + <title>strawmelonjuice fonts proxy</title> 6 6 <link href="/favicon.ico" rel="icon" /> 7 7 <link href="/oat.min.css" rel="stylesheet" /> 8 8 <script defer="defer" src="/oat.min.js"></script> ··· 92 92 <div class="hstack"> 93 93 <a href="/" style="width: fit-content; height: fit-content"> 94 94 <figure 95 - aria-label="strawmelonfonts" 95 + aria-label="strawmelonjuice fonts proxy" 96 96 class="small" 97 97 data-variant="avatar" 98 98 style="display: flex" ··· 100 100 <img alt="icon" src="/favicon.ico" /> 101 101 </figure> 102 102 </a> 103 - <div style="font-size: var(--text-2)">strawmelonfonts</div> 103 + <div style="font-size: var(--text-2)">strawmelonjuice fonts proxy</div> 104 104 </div> 105 105 </div> 106 106 </nav>
+2
src/fonts.gleam
··· 1 + //// # strawmelonjuice fonts proxy 2 + 1 3 import ewe.{type Request, type Response} 2 4 import gleam/bit_array 3 5 import gleam/bool