Skip to content

fix(server): require DATABASE_URL and JWT_SECRET, warn on missing Ste… - #223

Merged
dark-sarge merged 1 commit into
arflexx:mainfrom
cokehill:main
Aug 29, 2026
Merged

fix(server): require DATABASE_URL and JWT_SECRET, warn on missing Ste…#223
dark-sarge merged 1 commit into
arflexx:mainfrom
cokehill:main

Conversation

@cokehill

Copy link
Copy Markdown
Contributor

Problem

REQUIRED_ENV_VARS in server/src/index.ts was explicitly left
empty. A misconfigured production deployment would start, accept
requests, and only throw runtime errors on the first database query
or JWT sign — instead of failing fast at startup with a clear message.

Fix

  • DATABASE_URL and JWT_SECRET added to REQUIRED_ENV_VARS; server
    now exits(1) with [startup] Missing required environment variables: ...
    if either is absent.
  • STELLAR_NETWORK, HORIZON_URL, and SOROBAN_RPC_URL added as a
    separate optional list — logged as a warning (not fatal) since
    they're not required for auth-only flows.
  • Confirmed server/.env.example has non-empty placeholder values for
    both required variables, so cp .env.example .env produces a
    startable dev config.
  • New startup integration test asserting the process exits non-zero
    when DATABASE_URL is unset.

Testing

Closes #130
Closes #131
Closes #137
Closes #127

…llar vars


REQUIRED_ENV_VARS in server/src/index.ts was left empty, so the
server started successfully even without DATABASE_URL or JWT_SECRET,
failing only later with confusing runtime errors on first DB query
or JWT sign. Now validates both as required and exits(1) with a
clear [startup] log if either is missing. STELLAR_NETWORK,
HORIZON_URL, and SOROBAN_RPC_URL are validated as optional (warning
only) since they're not needed for auth-only flows.
@cokehill
cokehill requested a review from dark-sarge as a code owner August 28, 2026 23:02
@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@cokehill Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@dark-sarge
dark-sarge merged commit 5676fe9 into arflexx:main Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants