<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Fabian Schultz</title>
    <description>The latest articles on DEV Community by Fabian Schultz (@fabe).</description>
    <link>https://dev.to/fabe</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F96644%2F98a05246-8766-4d5e-bfc2-ffb54c64dc89.jpeg</url>
      <title>DEV Community: Fabian Schultz</title>
      <link>https://dev.to/fabe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fabe"/>
    <language>en</language>
    <item>
      <title>Avoiding Font Piracy On GitHub &amp; Netlify</title>
      <dc:creator>Fabian Schultz</dc:creator>
      <pubDate>Tue, 28 Aug 2018 21:50:55 +0000</pubDate>
      <link>https://dev.to/fabe/avoiding-font-piracy-on-github--netlify-198f</link>
      <guid>https://dev.to/fabe/avoiding-font-piracy-on-github--netlify-198f</guid>
      <description>

&lt;p&gt;After reading &lt;em&gt;&lt;a href="https://pixelambacht.nl/2017/github-font-piracy/"&gt;How GitHub became the web’s largest font piracy site (and how to fix it)&lt;/a&gt;&lt;/em&gt; 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.&lt;/p&gt;

&lt;p&gt;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:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="s2"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="s2"&gt;"build"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npm run fonts:fetch &amp;amp;&amp;amp; gatsby build"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="s2"&gt;"fonts:fetch"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"wget -O Fonts.zip $SECRET_FONTS_URL; unzip Fonts.zip -d ./static/fonts; rm Fonts.zip"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I run an NPM Script called &lt;code&gt;fonts:fetch&lt;/code&gt;, 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.&lt;/p&gt;

&lt;p&gt;Inside my deploy settings, I can then set that secret URL:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nWfJ06yJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/t3gv6j83e577im57v8wp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nWfJ06yJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/t3gv6j83e577im57v8wp.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;... which ensures that no trace of the font files is left inside the repository! 👮‍♂️&lt;/p&gt;


</description>
      <category>github</category>
      <category>opensource</category>
      <category>licensing</category>
      <category>webfonts</category>
    </item>
  </channel>
</rss>
