fix(config): add missing env vars to example files and fix key generation #262
+62
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SECRET_STORE_MASTER_KEYandLOG_KAFKA_BROKERSto all.env.exampleand.env.dockerfiles (backend + worker)docker-compose.full.ymldefaultSECRET_STORE_MASTER_KEYfrom 64-char hex to 32-char string — the old default crashedparseMasterKeywhich expects exactly 32 raw bytes viaTextEncoderjustfileprod-initrecipe to generate 32-char keys (openssl rand -base64 24 | head -c 32) instead of 64-char hex (openssl rand -hex 32)backend/README.mdwith correct env var name (LOG_KAFKA_BROKERS, notKAFKA_BROKERS) and key format documentationContext
The backend failed to start with
Key must be exactly 32 bytesbecauseparseMasterKeyinpackages/shared/src/secrets/encryption.tsusesTextEncoder.encode()(which treats input as UTF-8, 1 byte per char) — not hex decoding. A 64-char hex string produces 64 bytes, not 32.LOG_KAFKA_BROKERSwas also missing from all example/template files, causing a second crash:LOG_KAFKA_BROKERS must be configured for node I/O ingestion.Test plan
bun --cwd=backend run devwith a fresh.envcopied from.env.example(after setting a real 32-char key)just prod-initand verify the generatedSECRET_STORE_MASTER_KEYis exactly 32 charactersdocker compose -f docker/docker-compose.full.yml configand verify no syntax errors