Weird title, eh? Think about it though… It’s actually quite unique. With static sites - like this one - people generally go with any of the following options:

  • Cloudflare Pages
  • Github Pages
  • Gitlab Pages
  • Netlify

There are many, many more. All of them provide a CDN out of the box. In case you don’t know, a CDN is basically a network of computers and will help you serve your content closest to your visitor (very generalized, but that’s besides the point). The main issue I have with these providers is that most of them use one of the big guys to host your site. Let’s take a look:

  • Cloudflare Pages: AWS (Amazon)
  • Github Pages: AWS (Amazon)
  • Gitlab Pages: GCP (Google)
  • Netlify: GCP (Google), AWS (Amazon) and Rackspace Cloud

All of them use either Amazon or Google. In an attempt to make the internet decentralized again, I prefer to not host with any of them - even if that’s coming at a cost for me. Over the past few years, we have seen a few instances where one of the main hosting providers went down - causing a large part of the internet to go down. From my point of view, this is wrong. Being dependant on a few big guys is not the way to go to keep the internet open and protected against people trying to censor others.

I fully recognize that this blog is super small. Heck, if you are reading this, then consider yourself to be unique in that regard. Moving this site away from any of the big ones isn’t going to make any dents, but from my idealistic standpoint, I still stand by the decision to host this blog with one of the smaller hosting companies. In my case, I went for Greenhost. They are Dutch, green and privacy friendly.

So… how did I make deployment not a hassle?

To be fair, you could host a static site by moving over the files through SFTP. Just like way back in the day, when this was considered normal. And I still do… in a way. Here is how I deploy with Github actions:

name: deploy site to server 
on:
  push:
    branches:
      - main 
jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
        with:
          submodules: recursive
      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: '0.83.1'
      - name: Build
        run: hugo --minify
      - name: Brotli Compression
        id: brotli
        uses: charlesworth/compress-action@1.0.0
        with:
          target-directory: 'public'
      - name: Uploading files with rclone 
        uses: wei/rclone@v1
        env:
          RCLONE_CONF: ${{ secrets.RCLONE_CONF }}
        with:
          args: sync ./public/ server:/caddy/stantriepelscom/

Whenever I push a commit to the master branch in my git repository, it will start running that job. It will checkout the repo and download any submodules. Then it will use the hugo action package to build the site.

Up next, it will use brotli to compress any js/css and at last, it will push everything to the server. Over SFTP.

The server is super minimal, it has 10GB of SSD, 0.5gb of RAM and 1vCPU. I use Rclone to sync the files over from the container the job is running into my server. I previously used copy, but that doesn’t delete old files. This setup actually works really well and hasn’t failed me yet. Another upside is that I don’t have to connect my Github account to yet another provider.

In regards to security, there isn’t that much to worry about here. I use Caddy as my reverse proxy. I have made sure that the SFTP account is pretty locked down. It can only access the caddy folder, in which the static files live for each site I have. Except for a SSH tunnel, I have not hosted anything else on this server.

The downside of having only one server instead of a CDN is that the site will likely be slower on the other side of the world. To quickly test this, I have put my site into pingdom and let it test the site from Sydney, Australia.

The results:

  • Performance grade: A (98).
  • Page size: 35.6 KB.
  • Load time: 1.74 s.
  • Requests: 7.

A little under 2 seconds is not crazy fast, but not bad either. I am okay with that.