Skip to content

[Medium] chore(repo): reject prod boot when JWT_SECRET is the placeholder value #366

Description

@K1NGD4VID

Context

.env.example ships JWT_SECRET=change_me_before_production. Safe as a placeholder but easy to leave in production. Enforce at boot.

Where

  • File: .env.example
  • Line: 212

Current Behavior

Placeholder value with no runtime guard.

Expected Behavior

In config/config.go, if STELLAR_NETWORK == 'PUBLIC' (or ENV == 'production') and JWT_SECRET == 'change_me_before_production', refuse to boot with a clear error.

Proposed Approach

  1. Add a validation check in config/config.go.
  2. Wire the check into the boot path.
  3. Add a test.

Acceptance Criteria

  • Prod boot with the placeholder fails fast
  • Test-net / local boot still succeeds

Definition of Done

  • PR links back with Closes #<this-issue-number>.

  • CI is green (both Verify TypeScript Frontend & SDK and Verify Go Indexer & API jobs must pass).

  • Local verification:

  • cd indexer && go build -v ./... succeeds

  • cd indexer && go vet ./... clean

  • cd indexer && go test -v ./... green

  • cd indexer && gofmt -l . prints nothing

Contributor Tips

  • Indexer lives in indexer/ (Go 1.22, Postgres, subscribes to Soroban events).
  • Run locally with docker compose up -d db && cd indexer && go run .
  • Format with gofmt -w . and vet with go vet ./... before pushing.
  • Test with cd indexer && go test -v ./....
  • HTTP handlers must accept context.Context and honor cancellation.

Tech Stack

indexer

How to Claim

Comment .take (or say you're working on it) and open a PR with Closes #<this-issue-number> in the description.

Difficulty: Medium (complexity:medium) -- used for Drips Wave point allocation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    choreMaintenance and non-user-facing cleanupcomplexity:mediumindexerEvent Indexer Services

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions