DEV Community

Fabian Schultz
Fabian Schultz

Posted on

Avoiding Font Piracy On GitHub & Netlify

After reading How GitHub became the web’s largest font piracy site (and how to fix it) I was wondering how I can avoid uploading/publishing font files on GitHub, considering that most of my sites are deployed by Netlify, and require all files to be inside the repository.

At first I tried to encrypt the fonts using a 7z archive. Unfortunately, 7zip can not be used inside Netlify deploys, so I decided to try and download an archive from a secret, remote location before building the project:

"scripts": {
  "build": "npm run fonts:fetch && gatsby build",
  "fonts:fetch": "wget -O Fonts.zip $SECRET_FONTS_URL; unzip Fonts.zip -d ./static/fonts; rm Fonts.zip",
}

I run an NPM Script called fonts:fetch, which will download a zip file from a secret location specified inside an environment variable. This zip file can then be extracted to a desired location and Netlify can use it inside the building process.

Inside my deploy settings, I can then set that secret URL:

... which ensures that no trace of the font files is left inside the repository! 👮‍♂️

Top comments (5)

Collapse
 
securemepro profile image
Seb

How to stop digital piracy & redistribution

  1. De-incentivize content Removing the incentive for the consumers to look for pirated content. Effectively this can be characterised

offering a good product and a good user experience at a fair price.

  1. Education & public relations
    Piracy is a crime and it is illegal. Redistribution can lead to legal challenges and exposure to cybersecurity flaws. Like exposure to malicious materials.

  2. Tech Ops
    Identifying your pirated content is important in reducing piracy and illegal redistribution.

You need to know the technical know how so you can intervene.

Continuous monitoring will keep the pirates out.

  1. Legal enforcement You can enforce take-down notices. This process is cumbersome. Host provider are notorious in ignoring notices too.

With the correct anti-piracy services, operators can identify consumers who are pirating and redistrubing your product

While you can never fully stop piracy, you can reduce the effect of losing revenue by implementing these processes.

Priveguard.com proactively detects and protects your creative works from piracy, so you can earn more & focus on creating incredible assets!

How it works

Get started in just two simple steps:

  1. Sign up and add your assets

  2. Every week, PriveGuard scans and removes illegal copies of your assets online

  3. Enjoy the peace of mind that your creative works are protected! You can cancel anytime 🙂

Collapse
 
qm3ster profile image
Mihail Malo

We can fix this. But should we?

Collapse
 
mogery profile image
Gergő Móricz

Nice solution! A bit complicated tho'. Would be nice to have an automated solution for this.

Collapse
 
securemepro profile image
Seb

Yes, we will be automating the process once we get the word out there. Thank you.

Collapse
 
davecoded profile image
David Bernhard

This is great. Well done.