Skip to content
Merged
7 changes: 0 additions & 7 deletions Blog.code-workspace
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Standard workspace fragment carried by every fleet repo (catalog/snippets/vscode/base.jsonc,
// https://github.com/ptr727/ProjectTemplate/blob/main/catalog/snippets/vscode/README.md).
// This repo ships no dotnet/python/docker target, so it carries base.jsonc only.
{
"folders": [{ "path": "." }],
"settings": {
Expand All @@ -13,14 +10,10 @@
},
"extensions": {
"recommendations": [
"anthropic.claude-code",
"arahata.linter-actionlint",
"davidanson.vscode-markdownlint",
"editorconfig.editorconfig",
"fanaticpythoner.better-todo-tree",
"github.vscode-github-actions",
"streetsidesoftware.code-spell-checker",
"timonwong.shellcheck",
"yzhang.markdown-all-in-one"
]
}
Expand Down
2 changes: 1 addition & 1 deletion CONTENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Treat that as a judgment about the archive, never as a precedent for a new post.
- **`##` carries the spine, `###` only for genuinely nested steps.** The migration post uses `###` for numbered procedure steps inside one section and nowhere else.
- **A heading states a finding rather than labeling a topic.** "Your export is not a complete copy of your media" beats "Media". Sentence case, no trailing question mark.
- **No hand-written table of contents.** The theme generates one from the headings.
- **Three unheaded paragraphs open a post**: the concrete situation, what the post is really about, and one sentence on what it covers.
- **A one-sentence lede opens a post, followed by `<!--more-->`.** It says what the post covers and stands on its own. The post list shows it under the title, and it becomes the page's meta description and social card. It carries no links, since the list and the meta description drop them, so a name's first link is in the body. The unheaded paragraphs after it give the concrete situation and what the post is really about.
- **Every fenced code block carries a language tag**, so highlighting picks the right lexer instead of guessing.

## Voice
Expand Down
14 changes: 7 additions & 7 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

Pieter Viljoen's blog, and the tooling that builds, verifies, and deploys it.

The blog's public address is [blog.insanegenius.com][blog-link]. Until its DNS records are cut over, that address still serves the old WordPress site, and the site this repository builds is served at `blog.insanegenius.net`.
The blog's public address is [blog.insanegenius.com][blog-link].

> Until its DNS records are cut over, that address still serves the old WordPress site, and the site this repository builds is served at `blog.insanegenius.net`.

## Release History

- Version 1.0:
- The blog's content, media, URL contract, and deploy tooling live in one repository, under version control and gated by CI.
- 108 posts and 2 pages as Hugo content, in a tree that mirrors the URLs it serves, with 778 media files carried at their original bytes.
- The URL contract as committed ground truth: 328 addresses that must render, 917 that must redirect, and 778 legacy image URLs that must resolve, each verified with a live request rather than predicted.
- CI gates that contract on every pull request, alongside the doc, shell, and workflow linters, with the Hugo version pinned by checksum so a build is reproducible.
- A self-contained release bundle carrying the site, the web-server config, and the redirect maps together, so a rollback reverts the rules and the content they refer to as one unit.
- The site is not yet serving its public address. This release is the source and its pipeline, not the cutover.
- The blog moved from WordPress to a Hugo site built and verified by GitHub Actions and served by Caddy. The public address cuts over separately.
- 108 posts, 2 static pages, 778 media files, converted to a Hugo site in a tree that mirrors the original URLs.
- Personal data gates: image metadata stripped to an allowlist, archive redactions declared in a manifest and verified by hash, and the text of the pages and new posts scanned for addresses, coordinates, and other identifiers.
- Publishes a self-contained release bundle carrying the site, the web-server config, and the redirect maps together, so a rollback reverts the rules and the content they refer to as one unit.

<!-- External -->

Expand Down
29 changes: 23 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Blog <!-- omit from toc -->
# Blog

Pieter Viljoen's blog, and the tooling that builds, verifies, and deploys it.

The blog's public address is [blog.insanegenius.com][blog-link]. Until its DNS records are cut over, that address still serves the old WordPress site, and the site this repository builds is served at `blog.insanegenius.net`.
The blog's public address is [blog.insanegenius.com][blog-link].

> Until its DNS records are cut over, that address still serves the old WordPress site, and the site this repository builds is served at `blog.insanegenius.net`.

## Build and Distribution <!-- omit from toc -->

Expand All @@ -25,9 +27,7 @@ The blog's public address is [blog.insanegenius.com][blog-link]. Until its DNS r

**Summary**:

- First public release. The content, media, URL contract, and deploy tooling are published as a repository for the first time.
- The URL contract is committed ground truth and gated in CI: 328 addresses that must render, 917 that must redirect, and 778 legacy image URLs that must resolve.
- The site is not yet serving its public address. This release is the source and its pipeline, not the cutover.
- The blog moved from WordPress to a Hugo site built and verified by GitHub Actions and served by Caddy. The public address cuts over separately.

See [Release History][history] for complete release notes and older versions.

Expand All @@ -36,6 +36,8 @@ See [Release History][history] for complete release notes and older versions.
- [Overview](#overview)
- [Migration from WordPress](#migration-from-wordpress)
- [How a Change Reaches the Site](#how-a-change-reaches-the-site)
- [Keeping Personal Data Off the Site](#keeping-personal-data-off-the-site)
- [What Happens While the Site Runs](#what-happens-while-the-site-runs)
- [Configuration](#configuration)
- [Questions or Issues](#questions-or-issues)
- [Development Environment Setup](#development-environment-setup)
Expand Down Expand Up @@ -123,7 +125,17 @@ flowchart LR
main -.->|manual dispatch| prod["production site"]
```

### What Happens While the Site Runs <!-- omit from toc -->
### Keeping Personal Data Off the Site

A post is public the moment it deploys, and a photo or a pasted configuration can carry more than its author meant to publish. Three gates keep personal data out. Each runs in this repository's validate action on every pull request, under the required status check, so a finding blocks the merge.

- **Image metadata.** Before an image is committed, its author runs [`scripts/normalize-media.py`][normalize-media], which strips it to an allowlist of what it needs to render. That is its dimensions, a pinned color profile, and on a JPEG its orientation. A JPEG keeps its capture time only when nothing else in its Exif fails the gate. Location, device, and authorship are not on the list, so they go without anyone having to name them. The removal is lossless, and a file it cannot clean unambiguously is refused rather than guessed at. [`checks/check-media-metadata.py`][check-media-metadata] is the gate, and it fails the build on anything left over, including inside a `.zip`.
- **Redactions.** A house number, a face, or a serial number is covered with a flat opaque fill, never a blur. A fill on an image already published is declared in [`checks/media-redactions.json`][media-redactions] and applied by a script. [`checks/check-media-redactions.py`][check-media-redactions] fails when a redacted file no longer matches its recorded hash, which is how a quietly restored original is caught.
- **Text.** [`checks/check-text-pii.py`][check-text-pii] reads every page and post under `content/` outside the imported archive years, front matter and code blocks included. It reports email addresses, hardware addresses, public IP addresses, coordinates, street addresses, and phone numbers. It also reports a URL that carries coordinates or names one specific sensor or station. A finding names the file, the line, and the class, never the value, so the CI log does not republish it. A value a post prints on purpose is declared in an allow file with a reason, and an entry that stops matching fails the gate.

A fuzzer feeds the metadata parsers malformed images in the same action, because the carried tree is all well formed and would never exercise a refusal. What no gate can judge, whether a picture locates the home or identifies a person, is the checklist in [CONTENT.md][content].

### What Happens While the Site Runs

Publishing is half of it. The other half runs on its own cadence, because the contract proves only the addresses someone wrote down.

Expand Down Expand Up @@ -220,6 +232,9 @@ Licensed under the [MIT License][license]\

[capture]: ./capture/
[capture-readme]: ./capture/README.md
[check-media-metadata]: ./checks/check-media-metadata.py
[check-media-redactions]: ./checks/check-media-redactions.py
[check-text-pii]: ./checks/check-text-pii.py
[checks]: ./checks/
[content]: ./CONTENT.md
[deploy]: ./deploy/
Expand All @@ -229,7 +244,9 @@ Licensed under the [MIT License][license]\
[history]: ./HISTORY.md
[hugo-config]: ./hugo.yaml
[license]: ./LICENSE
[media-redactions]: ./checks/media-redactions.json
[migration-post]: ./content/posts/2026/08/01/moving-this-blog-from-wordpress-to-hugo.md
[normalize-media]: ./scripts/normalize-media.py
[operations]: ./OPERATIONS.md
[workflow]: ./WORKFLOW.md

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ tags:
- migration
discussions: https://github.com/ptr727/Blog/discussions
---
I moved this blog from WordPress to a Hugo static site, and the real work was not converting the posts but keeping every inbound link since 2008 working.

<!--more-->

This blog has been quiet since May 2024, and it was still costing about $140 a year to sit there. That is a silly amount to pay for a site nobody was updating, so I moved it: the content is now a [Hugo](https://gohugo.io/) static site, the source lives on GitHub, CI builds and verifies it, and [Caddy](https://caddyserver.com/) serves it from a small VPS.

The interesting part of this migration was not Hugo. Converting the posts took an afternoon. The interesting part was that this blog has been at the same domain since 2008 across **three** platforms, and each platform left its own URL shapes behind. Getting the content across is easy. Not breaking sixteen years of inbound links is the actual job.

This post is about what that took, and about the things that silently went wrong and only showed up because I went looking.

## This is the second time I have done this

The first move is documented on this blog, which turned out to be genuinely useful fourteen years later.
Expand Down Expand Up @@ -249,6 +251,16 @@ Two things I would do again:

**Demonstrate each gate failing before trusting it.** I deleted a post and confirmed the parity check failed. I deleted one media file and confirmed the media and asset checks failed separately. I pointed a redirect map entry at a page that does not exist and confirmed the live check caught it. A gate that has only ever passed is indistinguishable from one that checks nothing.

## Your original photos know where you live

A few weeks after the move, I found that keeping the originals from the export tar had a cost. **206 files held GPS coordinates that located my house to about a meter**, along with camera bearing and altitude. Once the files sit in a public repository, anyone can read that metadata.

So personal data became a gate too. A normalizer strips every image down to what it needs to render: its dimensions, a standard color profile, and a JPEG's orientation. A JPEG keeps its capture time only when the rest of its Exif is already clean. Location, device, and authorship are not on that list, so they go without anyone having to think of them. The strip is lossless, and it refuses a file it cannot clean unambiguously rather than guessing. CI then fails the build on any image carrying anything else, including inside a zip.

Metadata is only half of it. A house number, a face, or a license plate is in the pixels, so those get a flat opaque fill, never a blur, which can be reversed for a short string. The fills on old images are declared in a manifest and checked by hash, so a restored original fails the build. A third check reads the text of every page and every new post for email addresses, hardware addresses, public IP addresses, coordinates, street addresses, and phone numbers. It also flags a link that carries coordinates or points at one specific sensor or station. It reports the file, the line, and the kind of finding, but never the value, so the CI log does not publish what it caught.

All three run on every pull request, next to the URL checks. How it works in detail is in the [repository README](https://github.com/ptr727/Blog/blob/main/README.md).

## Do not do this by hand

I did almost none of this manually. I ran it as a series of tasks through [Claude Code](https://claude.com/claude-code), and it is worth saying plainly that this is the kind of work it is genuinely good at.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ tags:
- claude
discussions: https://github.com/ptr727/ESPHome-Config/discussions
---
I decoded the Bluetooth protocol of my Micro-Air EasyStart soft starters from the vendor's Android app, with help from Claude Code, and now read their compressor data into Home Assistant through ESPHome.

<!--more-->

I have [Micro-Air EasyStart](https://www.microair.net/products/easystart-flex-home-ac-soft-starter) soft starters installed on both my HVAC compressors. I installed them in the summer of 2023, after I started getting frequent brownouts whenever a compressor started. The brownouts came from a combination of low supply voltage, later addressed by my electricity provider, and rising neighborhood demand. Older homes are being torn down and replaced with much larger ones, so panels are going from 80 A to 400 A. Every year more homes add AC and electric car chargers.

The EasyStart modules have built-in Bluetooth Low Energy (BLE), and the vendor's phone app shows live current, line frequency, peak startup current, and a start counter. I monitor whole-home power usage and solar generation in [Home Assistant](https://www.home-assistant.io/). I wanted to use the BLE data for more granular AC power usage reporting, without installing additional current monitors in my panel. I reached out to Micro-Air, but they would not share the protocol. At the time I could not find anyone else who had decoded the protocol, and I lost interest.

In the meantime I had been watching [Matt Brown's YouTube channel](https://www.youtube.com/@mattbrwn) on reverse engineering and Internet of Things (IoT) hacking. [ESPHome](https://esphome.io/) had also made BLE device support much easier. With renewed motivation I set out to reverse engineer the BLE protocol myself, or rather, myself with a lot of automation and decoding help from [Claude Code](https://claude.com/claude-code). This post walks through pulling the protocol out of the vendor's Android app and checking the decode against the live module. It ends with the result running in Home Assistant through ESPHome.
In the meantime I had been watching [Matt Brown's YouTube channel](https://www.youtube.com/@mattbrwn) on reverse engineering and Internet of Things (IoT) hacking. [ESPHome](https://esphome.io/) had also made BLE device support much easier. With renewed motivation I set out to reverse engineer the BLE protocol myself, or rather, myself with a lot of automation and decoding help from [Claude Code](https://claude.com/claude-code).

## The app already has the protocol in it

Expand Down
Loading
Loading