feat: harden production storage readiness

This commit is contained in:
Codex
2026-06-30 01:05:34 +08:00
parent f0cbc0b35a
commit b8242429bb
9 changed files with 435 additions and 2 deletions

View File

@@ -722,6 +722,7 @@ async function testProductionConfigFailFast() {
AUTH_CODE_PEPPER: 'development-code-pepper-change-me',
AUTH_SESSION_SECRET: 'development-session-secret-change-me',
PLATFORM_ADMIN_API_KEY: 'local-platform-admin-key',
STORAGE_DEFAULT_PROVIDER: 'local_dev',
},
stdio: ['ignore', 'pipe', 'pipe'],
windowsHide: true,
@@ -738,6 +739,7 @@ async function testProductionConfigFailFast() {
const result = await waitForProcessExit(child);
assert.notEqual(result.code, 0, 'production server with unsafe defaults should fail to start');
assert.match(logs, /Invalid production API configuration/, 'production fail-fast should explain unsafe config');
assert.match(logs, /STORAGE_DEFAULT_PROVIDER=local_dev/, 'production fail-fast should reject local_dev storage');
}
async function loginBySms(phone = '13800000000') {