Comments

I deeply regret moving away from Wordpress. It was a terrible choice. Self-hosting is much, much faster, more secure and I have more freedom to do what I want with this site, but even something as simple as making a comment form involves so many decisions and so much future maintenance burden that it just makes me sad.

Anyway, it's working. There's comments again now. I have to regenerate the entire site to make this work, but it's not something that should happen too often. I had planned to go with a full AWS-based solution but ended up incredibly frustrated because everything AWS is just so needlessly complex. Lambdas and SES seem like a great way to handle "serverless" comment form submissions, but hooking it all up and figuring out which set of permissions to use made me vow never to use AWS again if I can avoid it. Instead, pythonanywhere.com lets you very easily spin up any kind of python server, which made it super easy to get started, and the free tier provides more than enough capacity for a blog of this size. I gave up on SES as well and ended up going with mailjet which again provides a very usable free tier and a straightforward API.

I also had to add a captcha to avoid abuse. It's unfortunate, but kind of necessary on today's internet. An alternative would have been to ask people to tie an identity to their comment and authenticate them with Google, Facebook or whatever, but that runs counter to what I'd like this blog to be. If you do think this would have been better, feel free to leave a comment! You can do that now!

So in the end I had to use three new cloud services to make comments work on my static blog: a non-static web hosting service to handle the comment form submissions, a mail service to send out the comment notifications, and a captcha service to prevent abuse. In return, what I get is data that remains under my control: comments (and email addresses used in comments) are in my inbox and on my PC, rather than on some external commenting service. No ads, no spam, no bullshit. Mild hassle because of the captcha, but hey, you can't have everything.

What I would do different in the future if I still had to stick to a static/custom solution: just load everything in memory. All the 17 years of content on this blog, compiled into html, is less than 256 megabytes. Even if I became twice as prolific over the next 17 years it would still easily fit into memory. Single server, maybe with a CDN in front of it, though I doubt it'd need it. Optionally I could parse the original templates on-demand to save even more memory, but it doesn't really matter. That way I wouldn't need to jump through hoops to make static hosting work and could have everything be contained in a single web service. All of this is of course still worse than moving back to Wordpress.

Posted in Tech | Tagged

Submit comment






After approval your comment will be visible publicly. Your email will never be visible publicly.