Files
chaos666888 7b3fae52e2 fix(host): default loopback HTTP, safe ZAP socket cleanup, and atomic master key handling
Addresses review feedback on #7:
- Default cmd/host HTTP listener to loopback (127.0.0.1:3690) when -addr/-listen/CLOUD_LISTEN/CLOUD_ADDR/PORT are unset, and only auto-enable staged functions on loopback listeners.
- Validate existing ZAP socket paths with os.Lstat before os.Remove in Serve() so regular files, directories, and symlinks are never deleted.
- Use O_CREATE|O_EXCL (mode 0600) for <stateDir>/master.key, log minted/loaded status without leaking key material, and fail closed on write errors instead of keeping a process-only key.
- Add unit tests covering key mode 0600, existing key reuse, concurrent exclusive create, failed write cleanup, non-socket preservation, and loopback default.
2026-11-19 11:12:38 +08:00
..