A site's tale
Setting
Henry Ford is credited with saying “Any customer can have a car painted any color that he wants, so long as it is black." about customer choices on buying the model T. He wasn’t being a jerk so much as understanding the value of limited choices in delivering a mass produced product in large quantity at a low price. If he had offered a choice of any color the product would either suffer in quality or gone up in price on par with a professional car paint job that you or I would buy at a body shop. Basically, we can make this easy and cheap if you just choose what we are currently doing.
As someone who creates things (not a “creative” as the design community uses the word though), I know I can build something to be exactly the way I want it. That is given the time to do things from scratch, which doesn’t exist in this modern world. We all look for precanned solutions to pile up and stand a top of. The problem is when I think I can bend someone else’s efforts to my will and make them my own.
Where I was
This site is the classic example of that. Here is a list of things that I have wanted to do in relation to it.
- Build my own generator
- Run it in the browser (why pay for my CPU time when you will donate it for me)
- Write the content in ASCIIDOC
- Host the site on a custom server
For the moment I’ve thrown out the first 3. Hugo is really a great option if not more complicated than I wanted. I think a lot of that complication would creep in as I wanted to do more with the site. I decided to accept this and rely on the excellent work already done by the community.
I did find a bunch of ways of running all of the generation in the browser and doing it in ASCIIDOC. The concept is kind of cool if you think about it and is close to the original concepts of HTML and SGML. Place the content in layout/format free form that tells which parts are titles, headings, tables, etc. Let the local display renderer do the right thing and it should look great on every device. That never really happened and the designers hated the idea.
As the site restarted I tried w3.css theme in Hugo to do more of the rendering locally. It didn’t work the way I liked and the Clarity theme did (I do plan on using W3.CSS for projects though). In the end it would be a little wasteful for me to have you rerun everything on every view, so I did it and cached it here. Your welcome.
I had been hosting the site on a very simple cpanel based site that came with the domain registration. It was simple, but I had almost no control. Even uploading the content was limited in choices. I had to change the way I wanted to do things to make the site basically functional. They would roll a website painted black off the web in nothing flat for pennies a day, but that was the only option you had.
The journey
I’ve been using Linux since you had to bootstrap it from Minix (yes I predate the concept of a distribution), and it is the OS that I use on my desktop and laptop for home and work. Setting up a Linux server is not an issue for me, until I make it one.
Using Digital Ocean I created a droplet using Ubuntu 20.04 LTS, but immediately had the distaste of systemd grow over me. There it sat consuming memory, doing things I didn’t want and requiring subsystems that had nothing to do with my desires. Why do I need to run DBus when I’m not going to use it? Really? I revolted and started to look for an alternative distro (no time for Linux from scratch or you would be reading this in 2024). Alpine has been an interesting option in the past. I got an instance running in my local Hypervisor in nothing flat. Loaded the tools I liked and was fairly happy with it.
Making a custom image into a droplet isn’t hard, but isn’t what you think it is either. Install the cloud init to make sure the droplet configures itself correctly (there is documentation on how to do this for AWS that look more like encyclopedias). Got it, that wasn’t so bad. Wait a minute, where is my storage? The image doesn’t get resized or releveled on the underlying block device, it just assumes that drive is the size it was on my system. Looking around Digital Ocean knows this and makes a comment about it. I could probably auto grow the filesystem (I’ve done it on AWS), but is this a systems programming project or a blog? Back to Ubuntu and I will make peace with systemd one more time.
This site was always going to be about static serving. I just don’t like the idea of server based rendered pages when the content is static. I know that is all the rage, but is such a waste and sometimes opens up security problems along the way. While I would love to host the site via something as simple as DJB’s publicfile it doesn’t support newer protocols or TLS.
My next stop was Caddy. It is a simple Go based server. Well designed and does Let’s Encrypt in a way that makes sense (it does it for you to make sure it happens and happens correctly). I don’t need to do something fancy with TLS so this was a great choice.
The Ubuntu 20.04 system though had some things that didn’t really need to be there. First off, SNAP. The concept of having a distroless, self contained package is a great one, but SNAP is a horrible choice. Why are you consuming all of my loop devices and making simple tools like mount and df unusable? SNAP breaks UNIX for me. Good intentions but fail on implementation. The good news is removing it was fairly painless.
DBus is another one, but don’t try to disable it as systemd will fail to boot. That’s right. I’ll rant on that more another time. Don’t need FUSE or remote file systems running. Overall, I ended up with a light system that only used 128MB of RAM while running. That will leave enough on the smallest droplet to keep my site in memory.
Where I ended up
So I have a droplet running on Digital Ocean that has been stripped down. Caddy is installed and does simple file serving and logging. I can rsync my content to the proper directory from my desktop at home. Given Hugo can render a small site like this in seconds the whole publish and push takes under a minute. That’s what you are reading now (if you are reading this before I do something crazy that adds no value to you, but I imagine will for me).
This can scale quite a ways and I can get onto doing other things. In the end that is the key. I now have time to create content for the site rather than muck around with what might have been possible but never used.