Skip to content

YAML config, atomic JSON writes, and startup error visibility - #479

Merged
earentir merged 7 commits into
masterfrom
config-yaml-and-crash-safe-json
Nov 14, 2026
Merged

earentir merged 7 commits into
masterfrom
config-yaml-and-crash-safe-json

Conversation

@earentir

Copy link
Copy Markdown
Collaborator

Summary

  • Add atomic temp+fsync+rename writes for persisted JSON, config YAML, and cluster state.
  • Migrate main config to dnsplane.yaml with JSON read/migration and stderr nags when both exist.
  • Recover from corrupt dnscache.json on startup; surface fatals and slog errors on stderr even when log_severity is none.
  • Bump app version to 1.4.201; systemd units use dnsplane.yaml.

Test plan

  • go test ./... (local)
  • CI on merge

Add temp+fsync+rename helper and use it for cluster_state.json so a power
cut cannot leave a half-written state file.
Marshal data files to memory then atomic write, tolerate truncated
dnscache.json on startup, and include file paths in load errors. Save
settings through config WriteConfigPath for YAML-aware configs.
Print fatal resolver errors and tee slog Error+ to stderr even when
log_severity is none, so silent exits are visible in the terminal.
Canonical dnsplane.yaml with startup migration from JSON, nags when both
exist, saves always target YAML, and atomic config writes.
Point packaged units and operator docs at YAML as the canonical config file.
Use WriteConfigPath for cluster manager; group stdlib vs third-party imports.
@earentir
earentir merged commit 0be0499 into master Nov 14, 2026
10 of 14 checks passed
@earentir
earentir deleted the config-yaml-and-crash-safe-json branch November 14, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant