Nate Town's Infrastructure

This blogpost is just a draft. It's pretty much word vomit right now.

I spoke to an former silocon engineer the other day. He described certain types of software as 'turn-key', meaning that once they were setup, very little maintenance or configuration had to be done. I'd like to consider Nate Town to be turn-key.

The downside of turn-key is it's easy to forget how things are setup! So this details the infrastructure (aka. the stack) that runs Nate Town.

Keep in mind, I wrote server setup guides and those describe my process much more clearly than this overview.

The Domain

I rent my domain name from Epik. The pricing is fair, and again, this is just what I started with arbitrarily. I've never needed to speak to customer service. The service works and that's that.

Hardware

I use a VPS (Virtual Private Server) provided by Vultr. Essentially, I'm renting a computer from them with a static IP address. I've never had any issues with them, and customer service was good when I wanted to unlock my email ports. For my purposes, a VPS is what I want, rather than something more vendor specific that could be cheaper. I don't pay more than $5 a month for this.

OS

Vultr allows you to configure what OS you want. I selected OpenBSD since they're focused on being a secure OS by default. In my opinion, securing your web services is just as important as actually distributing web content. OpenBSD thinks so too, so the choice was easy. Vultr takes care of setting up the basics of the OS. Networking, resolution and such.

SSH

Once my server was up, I set up an SSH server running on a private port so I could connect. The private port is just to reduce on spam connections in the log. More importantly, the SSH does key authentication only, and I use ed25519 keys.

Name Server Records / Routing

I wanted my IP to be discoverable over the internet at nate.town. So I changed the settings in Epik to point to the IP address Vultr gave me. The way I understand name resolution is as follows:

I couldn't get IPv6 to work. I can't remember if it was due to me configuring the NS records wrong records, or my software, or what. Regardless, I only bothered with IPv4 for this after some time.

Webserver and Development

I run OpenBSD httpd for my webserver. Since all I'm doing is serving files, it does enough.

All my content is written in Typst, and generated using their (experimental) html output. I prefer Typst to Markdown because it is much easier to add new to Typst using their function / macro system than it is with Markdown. As a result, although Typst HTML is experimental, I'm able to extend it with the features I'd like in just a few lines of code, and the result is some pretty nice styling on my site with very clean and readable syntax.

The site is all stored in a git repo which is kept in a folder on my webserver. It's a bare git server, meaning it's essentially a database, there are no working files. This is because I thought it'd be nice to be able to back up my server by backing up my home directory. Git is extremely easy to set up server side, you simply set your client's remote to the server's SSH path, and so long as your SSH permissions are good, Git works.

The site is stored in a directory called src. I compile all the typst files, and copy over all other files to a directory called pub. To do this, I used to use bash script to iterate over all the files in src. I switched to using makefiles in order to:

  1. parallelize the build process in an easy way
  2. only recompile files that have been changed

There is a serial bottleneck at the start of the Makefile, because it must search through the repository for all files. This hurts parallelization, but I don't think this is a bottleneck. Regardless, with careful recompilation, site generates in under 1 seconds right now, which is less time than it takes for me to switch to my browser and for my refresh to finish. So it is not a problem.

I have a git hook which, upon pushing to either the main or dev branches, will checkout the files into the appropriate webserver directory. And thus, hosting is taken care of automatically.

The dev site goes unused these days, because adding extra information to prevent crawlers from indexing it is a little complex. Instead, I just host a local webserver of the site's contents instead. I host this with the live-server command line utility.

RSS is done manually simply by updating the RSS file.

The contact form is done using Web3Forms, which provides free usage if there are under 250 contacts a month. So far, there haven't been. I don't expect there will be either. No need to waste brainpower on this right now. I prefer the contact form to email addresses because I've heard email addresses get extreme spam when posted in plaintext online.