Skip to content

fix: add STELLAR_HORIZON_URL to required env vars and optional-var wa…#135

Open
OAKVISUALZ wants to merge 2 commits into
Savitura:mainfrom
OAKVISUALZ:feature/env-validation-startup
Open

fix: add STELLAR_HORIZON_URL to required env vars and optional-var wa…#135
OAKVISUALZ wants to merge 2 commits into
Savitura:mainfrom
OAKVISUALZ:feature/env-validation-startup

Conversation

@OAKVISUALZ
Copy link
Copy Markdown
Contributor

…rnings

Closes #131

Changes:

  • Add STELLAR_HORIZON_URL to the REQUIRED list in config/env.js (was present in .env.example and used by config/stellar.js but omitted from startup validation — a missing value caused a silent connection failure rather than a clear error on boot)

  • Add startup warnings (stderr, not exit) for optional vars:

    • PLATFORM_APPROVER_USER_ID: warns that withdrawal approvals are open to all users when unset (dev mode)
    • JWT_EXPIRES_IN: warns that the code-level default (15m) is in effect, so operators know tokens are not perpetual
  • Fix malformed comment in .env.example where the comment text for PLATFORM_APPROVER_USER_ID was accidentally merged with a section header; also comment-out the placeholder value so copying the file as-is doesn't accidentally set a zeroed-out UUID as the approver

Note: auth.js already sets expiresIn: process.env.JWT_EXPIRES_IN || '15m' so no change is needed there — the default is already safe.

…rnings

Closes Savitura#131

Changes:
- Add STELLAR_HORIZON_URL to the REQUIRED list in config/env.js
  (was present in .env.example and used by config/stellar.js but
  omitted from startup validation — a missing value caused a silent
  connection failure rather than a clear error on boot)

- Add startup warnings (stderr, not exit) for optional vars:
  - PLATFORM_APPROVER_USER_ID: warns that withdrawal approvals are
    open to all users when unset (dev mode)
  - JWT_EXPIRES_IN: warns that the code-level default (15m) is in
    effect, so operators know tokens are not perpetual

- Fix malformed comment in .env.example where the comment text for
  PLATFORM_APPROVER_USER_ID was accidentally merged with a section
  header; also comment-out the placeholder value so copying the file
  as-is doesn't accidentally set a zeroed-out UUID as the approver

Note: auth.js already sets expiresIn: process.env.JWT_EXPIRES_IN || '15m'
so no change is needed there — the default is already safe.
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@OAKVISUALZ 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

STELLAR_HORIZON_URL was added to the REQUIRED list in config/env.js as
part of fix Savitura#131. The CI test jobs were not supplying this variable, so
validateEnv() would call process.exit(1) before any tests could run.

Add STELLAR_HORIZON_URL (testnet Horizon URL) to:
- backend-checks: Run test suite env block
- e2e: Run E2E tests env block (also adds the other required backend
  vars that were missing — JWT_SECRET, PLATFORM_SECRET_KEY,
  STELLAR_NETWORK — which would have caused the same exit on startup)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add startup validation for required environment variables

1 participant