Finally: Writing Blog Posts From Anywhere
I set up Keystatic CMS with a GitHub App and auto-deploy webhook so I can write blog posts from any browser without touching my PC.
Hej!
For a while I wanted a way to write blog posts without opening VS Code, committing a markdown file, and waiting for a deploy. The classic developer problem: the tooling gets in the way of actually writing anything.
Here's what I ended up with:
Keystatic. A CMS that runs inside my existing Next.js app at /keystatic. It gives me a nice editor UI and saves posts as .mdx files directly into my GitHub repo via a GitHub App. No external service, no monthly fee, fully self-hosted.
Auto-deploy webhook. A small Python HTTP server running as a systemd service on my Raspberry Pi. When GitHub detects a push to main, it sends a webhook to webhook.knabbiii.de, which runs docker compose up --build and rebuilds the site automatically. Post saved -> ~2 minutes later it's live.
The tricky part was running this behind Cloudflare Tunnel, which strips the original host from requests. Keystatic uses req.url to build the OAuth redirect URI, so I had to rewrite the request origin to https://knabbiii.de before passing it to the handler. Small fix, annoying to debug.
Anyway. I'm going to try writing here regularly. Like my streams: probably not. But I'll post whenever I actually solve something worth sharing or finish something cool.