Back to the Blogosphere

Aaron Poffenberger

I've been absent from blogging for quite a while. Last year I embarked on project to move my blog from Drupal to Emacs org-mode. It took a little longer than expected.

Leaving Drupal Behind

I decided to move away from Drupal for two reasons:

But Drupal's Dynamic

Sure, Drupal's dynamic, has numerous plugins available and will let you program it to your heart's content. But I don't need that for a blog. With css and javascript I can recreate almost any client-side feature I want without the headache of security updates.

Drupal Security

Drupal is nice CMS. But it's also huge. Large code bases typically have more surface area for attacks. Attack vectors mean patches and updates and that's not including upgrades to major release. It was getting to the point that I was installing security updates for Drupal or a Drupal module every time I logged into the backend. Moving everything to Drupal 7 was more than I wanted to deal with for a single-person blog.

Simple, Easy to Understand Can Lead to Secure

Running a simple, static blog also fits well with my many reasons for using OpenBSD. It's "Secure by Default" and requires minimal maintenance. Part of the "Secure by Default" philosophy is a lean code base. A lean blog has fewer moving parts to worry about. OpenBSD chroot's Apache by default. With no php or mysql database to worry about I have less vulnerable server that requires less of my time.

Making the Move

I've mode my blog to Emacs org-mode. I chose org-mode because I already use it daily for note taking and project tracking. It just makes sense to use it for my other writing.

The Transfer

The first step was to get my blog posts out of Drupal. I wrote a perl script to get me most of the way. The script exported all the posts from MySQL and wrapped the html-styled body with proper html document. I then used a sweet Haskell project called "Pandoc" (called from within the perl script) to convert them to org-mode and check them into a newly-creted git repositoy. Finally I made final tweaks by hand (mostly to clean up layout and fix hyperlinks).

The Template

I created my own template based in part on the org-mode "Worg" blog template. I used it notably to get the "Table of Contents" floater in the right corner and some of the nice org-mode-like styling.

Building the Site

The site is built using Emacs whenever there's something to publish. I use the publishing features of org-mode to generate the static html. The pages are then transferred to my OpenBSD server.

The Server

An Intel Celeron 535 MHz box with a few hundred GB of disk space. That's right. An Intel Celeron literally from the last century powers my site. I didn't choose the server because of it's processing power (or lack thereof). It was a computer a friend gave me. A Celeron is more than adequate for the workload it deals with.

The Software

The server is running OpenBSD and as is usual with the OpenBSD-maintained fork of Apache 1.3.29. In front of Apache is Varnish that serves all the static pages and images from memory. Static pages would server plenty fast with just Apache. Varnish just makes it that much peppier.

The Code

I'm not ready to post the code yet. Most of it you can get by using Emacs. If I put anything really useful together for publishing the site I'll post it here.