[#138] Finding 4: Indexer .env.example + production config hygiene #142
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega#142
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent: Split from #138 — Pre-deploy review pass 2 (Finding 4).
Severity: Low
Problem
indexer/.env.exampleships with a weak/trivial Postgres password in theDATABASE_URLtemplate and testnet-oriented defaults forRPC_URL/CHAIN_IDwithout strong warnings.Operators using copy-paste workflows risk production deployments with default credentials or pointing infra at the wrong chain.
References
indexer/.env.exampleindexer/src/config.rsdocs/testing/qa-local-full-stack.md.cursor/skills/yieldomega-guardrails/SKILL.mdRecommended fix
CHANGE_ME_BEFORE_DEPLOYin URL and comments.RPC_URL/CHAIN_ID: defaults are testnet/local only; mainnet requires explicit operator review.config.rs, whenINDEXER_PRODUCTION=1(or equivalent), refuse startup ifDATABASE_URLcontains a configured list of forbidden placeholder substrings (document the list in code comment).Acceptance criteria
.env.examplecannot be mistaken for production-ready secrets.indexer/README.mdor deploy docs if present.Verification checklist
INDEXER_PRODUCTION=1and placeholder URL → expected error..env.examplesees warnings before first deploy.mentioned in issue #138
mentioned in commit
f842d8bed7Implemented and merged to `main` (commit
f842d8b).Summary
Verification checklist for @brouie
Issue left open per contributor request — please confirm and close when satisfied.
@PlasticDigits — verification PASS on
f842d8b. walked your checklist:cargo testgreen: 31/31 PASS includesproduction_database_url_testsmodule atconfig.rs:188. CI Postgres URL has no forbidden substring (usesyieldomega_indexer_testcred path).FORBIDDEN_PRODUCTION_DATABASE_URL_SUBSTRINGSatconfig.rs:20listschange_me_before_deployand:password@(case-insensitive).ensure_production_database_urlat L33 fires only whenINDEXER_PRODUCTIONis truthy via L156 wiring..env.examplereads cleanly: L5DATABASE_URLusesCHANGE_ME_BEFORE_DEPLOYplaceholder. L7-9 block comment warns testnet defaults need operator review for mainnet. L24-26 explicitINDEXER_PRODUCTION+ placeholder substring rejection note with cross-link to README +config.rs. Test DB URL line at the bottom uses the same placeholder convention.indexer/README.mddocuments the production gate. INV-INDEXER-142 invariant added. cross-links indocs/indexer/design.md, QA checklists, skills.copy-paste deploy in production mode now aborts with a pointer back to README + #142. fail-fast on the misconfig class. clean.
ready for close on your side.
mentioned in issue #156
mentioned in issue #266
mentioned in issue #325
mentioned in issue #326
mentioned in issue #341