/ markdown

Moved to Ghost blog engine

I recently fell in love with writing everything in markdown, so I looked for a blog engine that would support this new habit. Ghost was the one, and a combination of Docker and my Synology NAS made it easy peasy to set up and host locally.

Photo by Toa Heftiba / Unsplash

There are plenty of blog posts around describing Ghost and Synology and I'll just post my own experience on top of those.

I'm hosting the content locally on a volume on the NAS. It's easy to back up to another offline secure folder. Easier than having it in another container. I don't need to scale it out so it works for me.

On the Synology NAS - Only thing needed apart from installing docker, is to configure the built in Nginx server to act as a reverse proxy and forward requests to the new site, based on ports and hostheaders.

  1. Add a new file here: /etc/nginx/sites-enabled Name it something like myredirect.conf
  2. Add a Server construct like this one:
server {
  listen 443;
    server_name factus.dk blog.factus.dk www.factus.dk;
      location / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;

Set the host header names at the server_name line, and replace ip adresses and ports with whatever you use.

Then sudo nginx -s reload to make sure nginx picks up the changes.

Upgrading Ghost

I'll just manually go

docker pull ghost:alpine      #Getting the latest image
docker rm -f  the container   #Kill off the running container
docker run -d -p 8080:2368 -e url=http://factus.dk  -v /volume1/Ghost/Factus:/var/lib/ghost/content ghost:alpine   #Start up the new one

I know. I should really put it in a bash script, and run it in a cron job every other day but I'll get around to it when it bothers me to do it manually ...

Cloudflare SSL and caching

If you are not using cloudflare you are probably doing something wrong. Check out the pluralsight course from Troy Hunt

DNS, Caching using their worldwide CDN network, SSL and HSTS, security against ddos and all sorts of other evil stuff and on and on ... and most of it is free.

I have set up pagerules to cache the blog using their CDN, and HSTS to enable all browsers that have visited the site once, to locally request SSL instead of redirecting a http request serverside.

Cloudflare and Ghost

There is one incompatibility with Ghost. If you enable the Cloudflare Auto Minify for JavaScript, there is an issue with the login page. You will end up staring at the spinning cirle. There was a check in to help with the compatibility, but as of 1.17 I am still seeing the issue

So .. don't check that JavaScript box.

Migrating old stuff

I decided to leave most of the old stuff behind ... who cares about BizTalk Server 2010 anyway ... :-D