devops
Technical notes on web development, DevOps, and AI integration.
115 articles
- 21:53devops
A 502 from Cloudflare Tunnel, caused by a compose service name
The tunnel said 502 while every container was green. Compose DNS only knows service names, and a six-line alias solved it in one step.
TL;DR: Public URL returned 502 while everything looked healthy and curl to the proxy worked fine. Ingress pointed to proxy on port 8199 but the service is actually plane-proxy, so Docker DNS had no record and cloudflared couldn't reach the origin. Adding a network alias proxy to plane-proxy fixed it, keeping the name stable for anything outside the repo.
#docker#compose#cloudflared - 21:07devops
Self-hosting Plane without a single public port
A 13-service Plane stack on a single-admin VPS: a cloudflared sidecar as the only public door, bind-mounted state, and no public host ports.
TL;DR: Running Plane on a packed VPS clashed with its default host ports 80 and 443. I kept the 13-service stack fully internal and exposed it only via a Cloudflare Tunnel sidecar aimed at the proxy, not port 8000 which is just the API. This keeps the firewall to SSH only, handles TLS at the edge, and removes public port exposure.
#self-hosting#plane#docker - 06:26devops
KTM Joins Inventory: From Custom 0.5.81 to Vendor 0.5.86
KTM was invisible to Ansible until I added it to two inventory groups. One playbook run later, it swapped from custom 0.5.81 to vendor 0.5.86 with data intact.
TL;DR: Ansible skipped KTM because the host wasn't in inventory, so --limit couldn't target it until two group edits added it. The playbook then upgraded the container from a custom 0-5-81 build to vendor latest 0-5-86, now back in sync. Dashboard password persisted via bind-mounted datadir, while the old custom image remains on disk for later cleanup.
#docker#ansible#automation - 23:32devops
Why Selftest R97 Failed While the Audit Was Running
The audit re-hashed after render ran, and the selftest failed. Derived artifacts must stay out of the canonical digest, and execution order defines what a hash means.
TL;DR: R97 failed because the audit hashed the canonical digest after render ran, and render's output mutated the very directory being hashed. Fix: hash only sources of truth, excluding derived artifacts like nav.json and pages.json, with render now check-first and stdout silenced. Flaky fixture string substitution was replaced with path-based mutation and a re-frozen checksum.
#python#testing#ci - 23:30devops
The Validator Vanished, CI Stayed Green
A mirror sync deleted a validation script and CI stayed green. Three validator failure classes and two cheap fences: mandatory anchors plus a frozen checksum.
TL;DR: A git mirror sync silently deleted our validation script, yet CI stayed green because nothing verified the checker's existence. The postmortem surfaced three silent failure modes: missing, broken, and environment-brittle validators. The fix adds two cheap fences, a missing-anchor rule and a frozen checksum, so green finally means something.
#git#bash#python - 21:30devops
Swapped Arguments, Burned Budget: Validate at the Very Top
set -euo pipefail will not save a script from swapped arguments. Whitelist guards and custom exit codes at the entry point stop the waste.
TL;DR: The script ran to completion on swapped arguments because set -euo pipefail only catches unset variables, not wrong values. The fix: eight guard lines at the top that validate the recipe path, integer, and budget using simple case globs with custom exit codes 45 and 46. Validate at the trust boundary, quote variables, keep it lightweight.
#bash#shellcheck#linux - 20:49devops
Two Constants, One Silent Lie: Catching Drift with ast Instead of Imports
A constant that projects from another constant drifts the day the source changes. ast.parse compares them without executing a line.
TL;DR: A new CLOSE_ACTIONS value slipped through deploys because the kernel's STATE_ACTIONS in another file never learned about it. Importing the wrapper risks side effects and copied comments rot, so a shell script parses both files as text using Python's ast module. It checks CLOSE_ACTIONS against the expected projection and flags any drift.
#python#testing#debugging - 20:47devops
The Launcher That Pays Twice: Three Guard Layers Before a Delegation Script Fires
Launching a delegation script twice burns the budget twice. flock, artifact check, and pgrep refuse before anything starts.
TL;DR: The author re-ran a Claude Code command thinking it was stuck, accidentally spawning a duplicate that burned the same budget in parallel. Their launcher now refuses to start using three pre-flight checks: flock -n on a file descriptor, a valid result JSON check, and pgrep -f for a live twin. Each refusal gets a distinct exit code.
#bash#devops#automation - 14:14testing
The 14/19 Selftest and the Fixture Defect
When a selftest scores 14/19, the first instinct is to blame the validator. The real cause — broken bash fixture transforms — is a reminder that a reliable failure is more honest than a rigged green.
TL;DR: After pushing commit bc77087, the selftest scored 14/19, and I initially blamed my new validator logic. The real culprit was defective bash fixture transforms producing invalid JSON, so the validator correctly rejected corrupt input. I froze the suite at 14/19 with documented defects rather than patch the fixture, because honest reliability beats inflated vanity metrics.
#testing#bash#fixture