@open-mercato/starter 0.10.1-develop.8123.1.acf6ca6db8 → 0.10.1-develop.8126.1.ccf499ef4c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/starter",
|
|
3
|
-
"version": "0.10.1-develop.
|
|
3
|
+
"version": "0.10.1-develop.8126.1.ccf499ef4c",
|
|
4
4
|
"description": "One-command, cross-platform bootstrap for Open Mercato dev environments: prerequisite doctor, corporate TLS trust, idempotent setup steps, and a supervised hybrid or fully containerized stack.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -239,6 +239,7 @@ test('supplied root, ambient and company key/KMS settings survive missing app en
|
|
|
239
239
|
{ root: 'TENANT_DATA_ENCRYPTION_KEY=root-fixture-key\n', env: {}, extraDefaults: {}, expected: ['TENANT_DATA_ENCRYPTION_KEY', 'root-fixture-key'] },
|
|
240
240
|
{ root: 'TENANT_DATA_ENCRYPTION_FALLBACK_KEY=user-original\n', env: {}, extraDefaults: { TENANT_DATA_ENCRYPTION_FALLBACK_KEY: 'company-default' }, expected: ['TENANT_DATA_ENCRYPTION_FALLBACK_KEY', 'user-original'] },
|
|
241
241
|
{ env: { TENANT_DATA_ENCRYPTION_KEY: 'ambient-fixture-key' }, extraDefaults: {}, expected: ['TENANT_DATA_ENCRYPTION_KEY', 'ambient-fixture-key'] },
|
|
242
|
+
{ env: { VAULT_ADDR: 'https://ambient-vault.fixture', VAULT_TOKEN: 'ambient-fixture-token' }, extraDefaults: {}, expected: ['VAULT_ADDR', 'https://ambient-vault.fixture'] },
|
|
242
243
|
{ env: { VAULT_ADDR: '' }, extraDefaults: { VAULT_ADDR: 'https://vault.fixture', VAULT_TOKEN: 'fixture-token', POSTGRES_PASSWORD: 'private-fixture-password' }, expected: ['VAULT_ADDR', 'https://vault.fixture'] },
|
|
243
244
|
]
|
|
244
245
|
for (const configuration of cases) {
|
|
@@ -252,11 +253,16 @@ test('supplied root, ambient and company key/KMS settings survive missing app en
|
|
|
252
253
|
assert.ok(!logs.join(' ').includes('fixture-token'))
|
|
253
254
|
assert.ok(!logs.join(' ').includes('private-fixture-password'))
|
|
254
255
|
assert.ok(!logs.join(' ').includes(configuration.expected[1]))
|
|
256
|
+
const rootSettings = parseEnv(fs.readFileSync(path.join(dir, '.env'), 'utf8'))
|
|
255
257
|
const appSettings = parseEnv(fs.readFileSync(path.join(app, '.env'), 'utf8'))
|
|
256
258
|
assert.equal(appSettings[configuration.expected[0]], configuration.expected[1])
|
|
257
259
|
const expectedFallback = configuration.expected[0] === 'TENANT_DATA_ENCRYPTION_FALLBACK_KEY' ? configuration.expected[1] : ''
|
|
258
260
|
assert.equal(appSettings.TENANT_DATA_ENCRYPTION_FALLBACK_KEY, expectedFallback)
|
|
259
|
-
|
|
261
|
+
assert.equal(rootSettings.TENANT_DATA_ENCRYPTION_FALLBACK_KEY, expectedFallback || undefined)
|
|
262
|
+
if (configuration.root || configuration.extraDefaults[configuration.expected[0]]) {
|
|
263
|
+
assert.equal(rootSettings[configuration.expected[0]], configuration.expected[1])
|
|
264
|
+
}
|
|
265
|
+
if (configuration.env.VAULT_TOKEN) assert.equal(appSettings.VAULT_TOKEN, configuration.env.VAULT_TOKEN)
|
|
260
266
|
const result = await assertEncryptionCompatible({ projectDir: app, env: {}, runProbe: async (_project, settings) => {
|
|
261
267
|
assert.equal(settings[configuration.expected[0]], configuration.expected[1])
|
|
262
268
|
assert.equal(settings.TENANT_DATA_ENCRYPTION_FALLBACK_KEY, expectedFallback)
|
package/src/env-setup.mjs
CHANGED
|
@@ -76,13 +76,6 @@ export function ensureEnvFiles(repoRoot, { log = console.log, warn = console.war
|
|
|
76
76
|
content = renderEncryptionValues(content, suppliedSettings)
|
|
77
77
|
content = replaceEnvLine(content, 'AUTH_SECRET', secretHex(32))
|
|
78
78
|
content = replaceEnvLine(content, 'LOOKUP_HASH_PEPPER', secretHex(16))
|
|
79
|
-
// .env.example ships no tenant encryption key (#7231); reuse the compose
|
|
80
|
-
// key so the host app and containers encrypt with the same root secret.
|
|
81
|
-
content = replaceEnvLine(
|
|
82
|
-
content,
|
|
83
|
-
'TENANT_DATA_ENCRYPTION_FALLBACK_KEY',
|
|
84
|
-
readEnvValue(rootEnv, 'TENANT_DATA_ENCRYPTION_FALLBACK_KEY')?.trim() || secretHex(32),
|
|
85
|
-
)
|
|
86
79
|
// 127.0.0.1, never `localhost`: on modern Windows localhost resolves
|
|
87
80
|
// to ::1 first while the published container ports listen on IPv4.
|
|
88
81
|
content = replaceEnvLine(
|