Expand description
Process configuration, read from the environment.
The two DSNs are deliberately not interchangeable. GWK_ADMIN_DATABASE_URL
owns the schema and exists only for the one-shot admin init;
GWK_DATABASE_URL is the least-privilege runtime credential the daemon
receives. A daemon that can reach the admin DSN can re-DDL its own store, so
KernelConfig::from_env REFUSES to start when the admin variable is
present rather than trusting itself to ignore it. Putting both in one unit
file is the mistake this catches.
Structs§
- Admin
Config - The one-shot initializer’s configuration.
- Blob
Config - The blob spine’s configuration.
- Kernel
Config - The daemon’s configuration.
Constants§
- ADMIN_
DATABASE_ URL_ ENV - The schema-owner connection string. One-shot initialization only.
- BLOB_
KEK_ ENV - The key-encryption key, base64 over exactly
DEK_BYTESbytes. - BLOB_
KEK_ ID_ ENV - The nonsecret label recorded beside every blob this KEK wraps.
- BLOB_
ROOT_ ENV - Where blob containers are written. Required, absolute, no default.
- DATABASE_
URL_ ENV - The runtime (least-privilege) connection string.
- DEFAULT_
SOCKET_ PATH - The default socket path (ADR 0002: UDS only, no network listener).
- MAX_
IDENTIFIER_ BYTES - Longest legal PostgreSQL identifier —
NAMEDATALEN - 1. - MAX_
KEK_ ID_ BYTES - Longest legal KEK label. It is copied into every container header, so it is kept short on purpose — this is a name, not a place to stash material.
- RUNTIME_
ROLE_ ENV - The already-created role the runtime credential authenticates as.
- SOCKET_
PATH_ ENV - Where the daemon binds its Unix domain socket.
Functions§
- validate_
kek_ id - The label is written into every container header and is what a rotation matches on, so it stays a plain short name: no separators to confuse a parser, nothing that could carry material, nothing that changes meaning under a different locale.
- validate_
role - PostgreSQL cannot bind an identifier as a parameter, so the role name is interpolated into the GRANT script. This allowlist is what keeps that safe: a bare lowercase identifier needs no quoting and cannot carry a statement separator, a quote, or a comment.