Repository navigation
fix(config): read Stellar gateway settings from env and sync .env.example - #275
Merged
Merged
Conversation
…mple The pool, rate limiter and request queue services look up stellar.poolMinConnections, stellar.rateLimitPerMinute, etc., but configuration.ts never defined those keys, so the STELLAR_* values in .env.example had no effect and every gateway setting silently fell back to its hard-coded default. Map them under `stellar` and validate them. While here, bring .env.example in line with envValidationSchema: add the keys it was missing (Soroban, indexer, rate limit, notifications) and declare TELEGRAM_BOT_TOKEN / DISCORD_WEBHOOK_URL, which the notification providers read but nothing documented. Note on the boot error in the issue: @nestjs/config sets allowUnknown to true when validationOptions leaves it out, and the schema is checked against .env merged with process.env, so unknown keys never failed boot. I made that explicit in config.module.ts and wrote the policy down in env.validation.ts. The strict check lives in a spec instead, which also asserts that the schema and .env.example list the same keys. Closes Chulilee#67
|
@SungJiinwoo is attempting to deploy a commit to the Akargi Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
✅ Ready to merge — all CI checks pass (Build and TypeScript Check ✅). The Vercel deployment failures are authorization issues unrelated to the code changes. This PR adds Stellar gateway configuration to .env.example, reads settings from environment variables, and adds validation/tests for the new config keys. Safe to merge when a maintainer with write access reviews. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Stellar gateway services read
stellar.poolMinConnections,stellar.rateLimitPerMinute, etc., butconfiguration.tsnever defined those keys, so theSTELLAR_*values in.env.examplehad no effect and the gateway always ran on its hard-coded defaults. This maps them, validates them, and brings.env.examplein line with the schema.Related Issues
Closes #67
Type of Change
Changes
configuration.ts: read the ten gateway keys understellar(same defaults the services already fall back to, so nothing changes for anyone who hasn't set them).env.validation.ts: validate the gateway keys; addTELEGRAM_BOT_TOKENandDISCORD_WEBHOOK_URL, which the notification providers read..env.example: list every key the schema declares; optional secrets are left commented out..env.examplevalidates strictly against the schema, both sides list the same keys, andconfiguration.tspicks up the gateway values.Checklist
npm run lintpasses.npx tsc --noEmitpasses (no type errors).npm run buildsucceeds.npm testpasses, and I added/updated tests for my change where it made sense.stellarmodule services (no direct Horizon/RPC calls from feature modules).Notes for Reviewers
npm run lintandnpm testalready fail onmain(677 lint errors, 11 failing unit tests in analytics, notifications and the request queue). I ran both onmainand on this branch: the failures are the same, this PR adds none, ESLint is clean onsrc/config, and the 5 new tests pass.On the boot error in the issue: as far as I can tell it doesn't actually happen. When
validationOptionsomitsallowUnknown,@nestjs/configsets it totrue(config.module.ts). Strict mode couldn't work at boot anyway, because the schema is validated against.envmerged with the wholeprocess.env(PATH and so on). So I madeallowUnknown: trueexplicit with a comment and moved the strict check into a spec, which is what actually keeps the two files from drifting. That's a change from the plan in my comment on the issue.