Well – it has taken some time (and partially explains the lack of posts), but I think I’ve got my personal websites set up “just so” now.
The core engine is still WordPress, which is running headless to provide all the content to the front-end. I use WordPress admin to manage the site, write posts, update pages, and so on. The interaction is via WPGraphQL, which took a bit of effort to get working, but provides a nice standard API to access the details.
The front end (www.eutony.net) now runs off nextjs, running on a node server. So the majority of the site is rendered at build time, with the semi-dynamic pages (the front page, photos, and archive) using Incremental Static Regeneration (ISR). The truly dynamic pages (infinite scroll on front page, and search results) are still built on demand. It does mean that if I want to change the style or certain aspects of the context I need to rebuild the whole site, but I think it’s worth it. Nextjs is a pretty steep learning curve. I started off trying to host it in Vercel, but unfortunately my hardware wasn’t able to keep up with the API demands the free Vercel puts on it, so it’s self-hosted.
The photos site (photo.eutony.net) is still served by a standard HTTP daemon. There are one or two other sites also running in this way.
The really exciting thing is that all of these (including the database) are running in Docker containers, behind an nginx server, which handles the SSL offloads, and reverse proxying. Docker compose brings up the whole shebang. The best bit is that it’s essentially zero-configuration for the host machine, beyond installing Docker. As it happens, it’s all running on a Raspberry Pi, and the move to Docker was a result of having to reformat the SD card to upgrade the OS. The thought of having to install and configure Apache, WordPress, MySql, LetsEncrypt, was too much.
In practice this means that my entire website is host agnostic – if I want to move it to an cloud provider such as Azure, it’s a simple as spinning up the containers there instead (plus a bit of DNS jiggery-pokery). All the code and configuration (except for secrets) is managed in source control. Docker is so good, in that it helps me keep the host environment clean and light, it means I can run the containers anywhere, and it means my exposed services are sandboxed so if they do get compromised the attackers don’t gain access to my server. It’s also so lightweight I can run the 7 or so containers alongside each other without overloading the very limited hardware.
Finally, the whole thing is sitting behind Cloudflare. I don’t get enough traffic to really need a CDN, but it lifts a bit of the load off the Pi, plus of course means that my IP address doesn’t get exposed, which is a good thing.
In terms of backups, I mainly rely on all the configuration and HTML/CSS/JS being in source control, so it’s just the database and any uploaded files which need backups. There’s a nightly script which takes care of that, but in the next exciting instalment I’ll be sharing my backup strategy!
I periodically record the instructions for silly games that I came across, usually in the setting of a youth group.
This game is called “Empire”. Each player starts off as the “Ruler” of their Empire (which consists of only them at the start), and tries to add other players to their Empire by correctly guessing their secret identities. But if another person else guesses theirs, then they and their entire Empire gets subsumed into that other person’s Empire! The winner is the person who has all the other players in their Empire.
It works best with between 8 and 20 people.
To start, every player will need a pen and a small piece of paper. They chose the name of a famous person (alive or dead, real or fictional) who they will “be” for the purposes of the game, and write it on the piece of paper. All the names then go into a hat (or other suitable container).
The organiser then reads out all the names which have been submitted – e.g. “Lady Gaga”, “Harrison Ford”, “Pooh Bear”, etc., and the game begins.
The first player – say Alice – points to a person – say Bob – and asks them if they are a specific person? For example “Bob – are you Lady Gaga?”.
If Bob isn’t “Lady Gaga”, i.e. Alice guessed incorrectly, then play passes to Bob to make the next guess.
If, on the other hand, Alice guessed correctly (so Bob did write down “Lady Gaga”), then Bob moves over to sit with Alice. Alice’s “Empire” now consists of her and Bob, and she can make another guess. Bob plays no further active role in the game, except to advise Alice on her guesses, and to move with her.
If another player subsequently correctly guesses who Alice is, then both Alice and Bob move over to become part of that person’s Empire, and they can make no further guesses.
The physical movement is important, as it shows who is in which Empire, and how big they are. When you’re doing to 2 or 4 active players, people are usually having at rack their brains for which names haven’t been guessed.
The only other rules are:
The list of names is only read out once at the start of the game – the players have to remember all the names.
The names should be of people that all the players could reasonably be expected to have heard of and be able to remember.
If there are duplicate names, there are 3 options:
Start again, with everyone writing down the names again, but the people who had a duplicate have to choose a different name
Play with the duplicates – so “Harrison Ford” has to be guessed twice.
Treat the duplicates as one person, so as soon as “Harrison Ford” is correctly guessed, both “Harrison Ford”s join the guesser’s Empire
It doesn’t have to be people – it could be films, books, meals, places. Any subject where the players are likely to choose different options from one another.
With younger or less reliable players, they could also have to write their own name on the paper, so the host can resolve disputes.
The host doesn’t usually play, as they have the advantage of seeing the handwriting.
This is a game of memory and psychology – especially if you play more than one round! Subsequent rounds can start with the winner of the previous round.
What did the dad say when his kids asked him for money? “Money doesn’t grow on trees, you know.”
Why was the dad’s belt arrested? For holding up his pants!
Why don’t dads ever have any money? Because they always spend it on their kids!
How do you know when a dad is about to make a joke? When he starts to twinkle.
What do you call a dad who’s always on the phone? A chatterbox!
How does a dad make a coffee run? Very carefully.
What did the dad say when he heard his son was stealing? “I hope he takes after his mother.”
Why did the dad cross the playground? To get to the other slide!
How do you know when a dad is done mowing the lawn? He’s sweating profusely.
What did the dad say when his son asked him how to make a sandwich? “Put it together yourself, I’m not your sandwich maker.”
I think part of what is interesting about this is the way in which the jokes are wrong. There are ghosts or echoes of jokes in many of these, and they read a bit like bad translations.
With nextjs “getInitialProps” will run server-side when the page first loads, but then run client-side on reloads (i.e. if you navigate back to it).
This means my website breaks if you go “back” to a search results page, as it tries to hit the headless WordPress back-end – which it can’t. So it errors out, and you get this lovely message:
Application error: a client-side exception has occurred (see the browser console for more information).
Solution – put the WordPress call behind an api, and then either always hit that api from “getInitialProps”, or work out whether you’re running client side or server side, as below:
I saw a post on Mastodon this morning about the futility of making resolutions for an arbitrary 365 day period.
This didn’t sit quite right with me, so I pondered it for a while and realised what my objection is. I don’t really mind the notion that resolutions are futile (back in 2011 I moved away from the idea and language of resolutions), but I don’t agree that the time period is arbitrary.
Of course, the 1st January is semi-arbitrary – but today we return to the same relative position in the solar system that we were at 365.25 days ago, having travelled an astronomical 9×1011m in the meantime. In July 2022 we were 3×1011m away from where we are now.*
Having completed our annual pilgrimage aboard the good ship Earth, I think that it’s fair enough to stop and reflect on what has happened and changed, to celebrate making such a grand journey in time and space, and to look ahead to what might be this time around.
It made me appreciate again just how governed by “the stars” our timekeeping is. Days obviously correspond to the spinning of the earth. Months broadly correspond with the orbit of the moon. Seasons are entirely due to the orbit of the earth, as is the year. In fact the only artificial constructs are time periods less than a day (hours, minutes) – at least until you get to atomic vibrations and light wavelengths – and the grouping of days into a week, which is arguably a theological construct (and there have been interesting studies on the effects that different lengths of week have on humans).
The 1st January is only semi-arbitrary because it’s likely related to the winter solstice (and possibly the perihelion of it’s orbit), as is Christmas Day. But it also made me wonder whether Australians are more laid back than us Brits because their New Year celebration is heading into the height of summer, rather than the depth of winter? I guess in theory starting the year with days getting longer should be nicer than days getting shorter, but I do slightly shudder at the thought of the cold, dark, and wet months ahead in the UK.
Anyway, my not-resolutions are to follow. The last few years could be summarised as “make it to next year”, but it would be nice to have a slightly higher bar this time around!!
Every blessing for 2023, and I pray that God’s light would illume whatever darkness you are facing.
As I’ve already mentioned, I’ve migrated this website over to nextjs. There is a headless WordPress installation behind it still, but the pages are now pre-rendered and served statically, including pre-loading, so navigation around should be blazing fast.
The pages which aren’t pre-rendered are the archive and search pages, which are rendered server-side on demand, with infinite scroll. You’ll notice a few seconds load time for these, which is a reflection of the hardware this is running on.
There are were some bits and which didn’t quite work properly yet in this brave new world:
The formatting is iffy – in paticular the paragraph spacing, and blockquotes (done)
Easy Table doesn’t work (done)
Front page needs paging (done)
Mastodon auto-post should include an excerpt (done)
Turns out there were all pretty easy to fix, plus very straightforward to pre-render the first ‘page’ of an infinite scroll, then load the rest as one scrolls down.
Well, 2022 was even worse for us than 2021 – once again as reflected by my social media presence (or lack thereof).
However, one of the habits that has emerged for us as a family is our “Good Things” jar – where each week we take a slip of paper, and write on it all the good things from that week, and put it in the jar. This evening (on New Years’ Eve) we are going to open it and read through all the Good Things which have happened this year together.
So in that spirit, here are some Good Things from 2022:
I became a STEM ambassador, and did a careers fair at Skipton Girls’ School.
I became professionally registered, and am now a Chartered Engineer (MBCS).
I migrated my websites to Docker and nginx, and this blog to nextjs.
I preached some of my best sermons yet, and led worship at the new evening service.
More widely in my family:
My elder son passed his driving test, did brilliantly at his A-Levels, got grade 8 piano, all but finished his gold DofE, and successfully started at University.
My younger son finished primary school and successfully started secondary school, got grade 4 drums, and discovered Warhammer.
My work (JBA Consulting) has been a great place to work, and also hugely supportive when I’ve had to change plans at short notice.
I’m sure I’ve forgotten some things, but I give thanks for the Good Things and blessings, and continue to hope and pray for a light to shine in the areas that are still dark.
Well, the radio silence since May has been for a number of reasons, a large aspect of which was some infrastructure work behind the scenes.
I manage to b0rk the pi which hosts this website, but rather than spending ages recreating all the websites, database, config, etc. I decided to put everything into Docker containers, so they can, in theory, be deployed anywhere, and should have a very rapid restore time if anything breaks. All the config files are in source control.
So each of my sites running on this host is now in its own Docker container, with an nginx running in front and doing the SSL termination and routing. Even more excitingly, this blog is now running on static HTML generated in nextjs, with a headless WordPress behind the scenes supplying some of the content.
I only switched www.eutony.net over this afternoon, and I’m not sure how long it will take new posts to appear, so it’s quite exciting really!!