s.esmaeiliandCursor c34bf80e6f fix(api): start in production with safe fallbacks instead of crash-looping (502)
A production API with incomplete config threw before listening, so the
container restarted forever and every /api request through nginx was a 502.
The problems are now printed as one loud warning and each gets a safe
fallback:

- JWT_SECRET / JWT_CUSTOMER_SECRET missing, weak or equal: a random key is
  generated once and kept in the Setting table (boot-secrets.ts), so tokens
  survive restarts. A strong value in the environment always wins.
  JwtModule now uses registerAsync so it reads the key after boot fills it.
- OTP_MASTER_CODE: ignored in production unless
  TEST_SERVER_ALLOW_MASTER_CODE=yes.
- CORS_ORIGINS: invalid entries dropped; empty allows every origin.

Tests: boot-secrets.spec, production-checks.spec. 118 tests pass.

سرور با تنظیمات ناقص دیگر مدام ریست نمی‌شود و ورود دوباره کار می‌کند.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-10 16:19:30 +03:30
2026-10-07 16:45:36 +03:30
2026-09-18 17:16:36 +03:30
2026-10-04 20:11:09 +03:30
2026-10-04 20:11:09 +03:30
2026-10-04 20:11:09 +03:30
2026-09-10 12:17:47 +03:30
2026-09-18 17:16:36 +03:30
2026-09-09 06:46:27 +03:30
2026-09-09 06:46:27 +03:30
2026-09-09 06:46:27 +03:30
S
Description
No description provided
113 MiB
Languages
JavaScript 69.8%
TypeScript 15.2%
Vue 13.9%
Less 0.6%
PLpgSQL 0.3%
Other 0.1%