Skip to content

init: the database's password comes from the sealed env relay, not MMDS - #17

Merged
jaredLunde merged 1 commit into
mainfrom
pg-init-env-relay
Nov 16, 2026
Merged

jaredLunde merged 1 commit into
mainfrom
pg-init-env-relay

Conversation

@jaredLunde

Copy link
Copy Markdown
Contributor

The node's postgres driver generates the superuser password and the Beyond API stores only a sealed blob, so MMDS no longer carries POSTGRES_PASSWORD. PID 1 now asks its driver for it over the substrate vsock it already owns, merges it into the metadata file before the supervisor spawns, and exits if a substrate gives none within 300 s (any password MMDS carried is dropped, never used). With no substrate at all (the Docker test image) the metadata file is used as it is.

post_start already runs ALTER ROLE postgres PASSWORD on every start, so a fork or restore, whose data directory carries the source's role hash, takes the new value: nothing else changes there.

The wire (AppMessage [0xE1] ask, [0xE2][msgpack {generation, vars}] answer) is mirrored from the Beyond repo's rustlib/wire env.rs and pinned by tests. Tests: cargo test -p beyond-pg-init (40 pass). Docs: beyond-pg-init/ARCHITECTURE.md, DESIGN.md, DECISIONS.md.

Reaches a node through a release tag and dev/.scripts/publish-primitives.sh postgres in the Beyond repo (POSTGRES_INIT_URL/SHA256).

🤖 Generated with Claude Code

https://claude.ai/code/session_01LBGuEttMZVcyx4YEaaAvWE

The node generates it and the API stores only a sealed blob. PID 1 asks for it over the
substrate vsock, writes it into the metadata file before the supervisor spawns, and fails
closed when a substrate gives none. post_start's ALTER ROLE already runs on every start,
so a fork's data directory takes this instance's value.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LBGuEttMZVcyx4YEaaAvWE
@jaredLunde
jaredLunde merged commit 13ba9c3 into main Nov 16, 2026
3 checks passed
@jaredLunde
jaredLunde deleted the pg-init-env-relay branch November 16, 2026 06:05
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