Opinionated Infrastructure or Open VPS Infra

May 21st, 2022 - Infra

Recently I’ve started codifying my setup for my personal Webserver. I’ve been running this on an AWS EC2 instance for quite some time, making use (where possible) of the generous free tier that Amazon offer. Whilst my setup is fairly customised to my needs, at the same time, my needs are pretty generic; I run a couple of WordPress websites, and a couple of static (built with Hugo) sites as well. Traffic is pretty low, they’re mostly just things like my personal website, this blog, my wife’s hobby blog, things I’m experimenting with etc. This got me to thinking: why is this not a solved problem? Many of the alternatives are “services” (e.g. “Oh just use S3”), which is no fun at all.

In software-land we have many “batteries-included” frameworks to use. Not only does this reduce the risks of newbies messing things up (the number of times I’ve heard the phrase “don’t roll your own {insert-thing-here}”) and causing security holes, but it also provides some great examples of some “good patterns”.

Sidebar: Django is an excellent example of this. Many times I’ve found myself digging through the source code and being almost in awe at the elegance of the solution they’ve found to tricky problems (password reset tokens is an excellent example). And, whilst it’s probably not wise to just outright copy/pasta this stuff, the inspiration it can give you for solving similar issues (say expiring token generation and validation) is awesome.

Anyways, where was I? Oh yeah, why don’t we have this for infrastructure? Well, in retrospect there probably are a few reasons:

So I’ve been pondering a bit as to whether to try and make my infrastructure codification generic enough to be re-used, and then, whether to publish it or not. But, fuck it, it’s not that hard to genericise once I have what I want, and it’s not that hard to publish things on Github either.

Cliffhanger / Statement of intent

So I’ve not finished it yet, obviously, but I think I will. In the worst case no-one uses it, but the best case is that it might be useful to someone. I might even get some good feedback that I’ve cocked something up and might catch a security/functionality loophole/improvement sooner rather than once it has bitten me in the arse. As such, here’s what I will be pushing in the next month or 2:

A clone-able repository that codifies everything needed to setup a VPS just like I do. It will:

Some Future Ideas

How can you reach out with suggestions if you have them

You can’t :D But I’m going to do it anyways so just wait until something is up on Github and you can get involved/complain in there.