https://github.com/trajano/google-fonts-proxy-docker
Google Fonts Proxy
https://github.com/trajano/google-fonts-proxy-docker
docker gdpr google-fonts
Last synced: about 1 year ago
JSON representation
Google Fonts Proxy
- Host: GitHub
- URL: https://github.com/trajano/google-fonts-proxy-docker
- Owner: trajano
- License: epl-2.0
- Created: 2022-02-03T01:29:33.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-08-11T12:02:39.000Z (almost 2 years ago)
- Last Synced: 2025-03-31T00:01:41.184Z (over 1 year ago)
- Topics: docker, gdpr, google-fonts
- Language: Shell
- Homepage: https://hub.docker.com/r/trajano/google-fonts
- Size: 43.9 KB
- Stars: 13
- Watchers: 3
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Google Fonts Proxy
This is a drop in replacement for Google Fonts requests so that the source IP of a calling service will not be sent to Google to avoid [fines in the EU](https://www.theregister.com/2022/01/31/website_fine_google_fonts_gdpr/)
It's an Apache HTTPd server running mod_proxy which forwards to Google and subsitutes the responses so that references to google are replaced with the request of this server.
Note this *does not* support URL prefixing nor SSL. So you need to route on `/s` and `/css` as needed using Traefik.
It also uses the proxy cache to reduce the requests to Google. However, it's a simple disk cache so make sure you have enough room to handle DoS attacks.
## Labels
This comes in two flavors:
1. `httpd` - supports `X-Forwarded-*` headers for automatic determination
2. `caddy` - supports only `STATIC_URL`
## Usage
```yaml
service:
fonts:
image: trajano/google-fonts
```
## Build test locally
```bash
docker rm -f fp ; docker build . -t f && docker run --rm --name fp -p 4000:80 -d f
curl -v 'localhost:4000/css?family=Roboto:300,400,400i,700,700i&display=swap'
```
## Test with env var
```bash
docker rm -f fp ; docker build . -t f && docker run --rm --name fp -p 4000:80 --env STATIC_URL=http://localhost:4000/s -d f
curl -v 'localhost:4000/css?family=Roboto:300,400,400i,700,700i&display=swap'
```