fix: DREAM_AGENT_KEY lifecycle completeness (docs + macOS preservation)
Consolidated from: #394 + #396
Scope
Make DREAM_AGENT_KEY fully first-class across all three platforms now that PR-5 landed Windows generation:
Files
Rationale for merge
Coherent single story: "DREAM_AGENT_KEY is now generated on all three platforms — make the documentation and macOS installer catch up." Shipping #394 alone misleads users (docs say key is preserved on reinstall when macOS still isn't). Shipping #396 without #394 hides the behavior from anyone reading .env.example. Two small files, zero conflict risk, one story.
Implementation notes
- macOS env-generator currently only preserves: DASHBOARD_API_KEY, OPENCLAW_TOKEN, SEARXNG_SECRET. Add DREAM_AGENT_KEY to that list.
.env.example comment should note: "Auto-generated 32-byte hex by installer; do not change after first install (rotating breaks host-agent authentication)."
Discovery context
Filed during 23APR audit/fix cycle. PR-5 added Windows DREAM_AGENT_KEY generation with preserve-on-reinstall via Get-EnvOrNew; macOS has the Linux pattern partially (for 3 other keys) but not DREAM_AGENT_KEY. .env.example has never had the line.
Closes #394, #396. Labels: bug, macos
fix: DREAM_AGENT_KEY lifecycle completeness (docs + macOS preservation)
Consolidated from: #394 + #396
Scope
Make
DREAM_AGENT_KEYfully first-class across all three platforms now that PR-5 landed Windows generation:DREAM_AGENT_KEY=CHANGEMEline to.env.examplenext to the existingDASHBOARD_API_KEYentry, with a comment explaining it's generated by the installer.installers/macos/lib/env-generator.shsoDREAM_AGENT_KEYis preserved on reinstall (mirror the Linux_env_get-or-generate pattern; Windows PR-5 already does this viaGet-EnvOrNew).Files
dream-server/.env.example(docs: add DREAM_AGENT_KEY to .env.example #394)dream-server/installers/macos/lib/env-generator.sh(macos: preserve existing DREAM_AGENT_KEY across installs in env-generator.sh #396)Rationale for merge
Coherent single story: "DREAM_AGENT_KEY is now generated on all three platforms — make the documentation and macOS installer catch up." Shipping #394 alone misleads users (docs say key is preserved on reinstall when macOS still isn't). Shipping #396 without #394 hides the behavior from anyone reading
.env.example. Two small files, zero conflict risk, one story.Implementation notes
.env.examplecomment should note: "Auto-generated 32-byte hex by installer; do not change after first install (rotating breaks host-agent authentication)."Discovery context
Filed during 23APR audit/fix cycle. PR-5 added Windows DREAM_AGENT_KEY generation with preserve-on-reinstall via
Get-EnvOrNew; macOS has the Linux pattern partially (for 3 other keys) but not DREAM_AGENT_KEY..env.examplehas never had the line.Closes #394, #396. Labels: bug, macos