Repository navigation
fix(config+sec): align TRINITY_PASSWORD across compose files + close changeme propagation paths (#692) - #718
Closed
AndriiPasternak31 wants to merge 4 commits into
Closed
AndriiPasternak31 wants to merge 4 commits into
AndriiPasternak31 wants to merge 4 commits into
Conversation
…le drift (Abilityai#692) - docker-compose.yml: TRINITY_PASSWORD now reads ADMIN_PASSWORD directly so devs do not have to set the same secret twice. - docker-compose.prod.yml: replace silent ${ADMIN_PASSWORD:-changeme} with fail-loud ${ADMIN_PASSWORD:?...} on both backend and mcp-server. Matches the convention already used by the Redis password vars. - .env.example: collapse duplicate FRONTEND_URL block; add missing entries for GOOGLE_API_KEY, LOG_RETENTION_DAYS / LOG_ARCHIVE_ENABLED / LOG_CLEANUP_HOUR, TRINITY_DATA_PATH, and HOST_TEMPLATES_PATH (the last caught by autoplan dual-voice review — same pattern as TRINITY_DATA_PATH). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…bilityai#692) Drop the silent ` || "changeme"` fallback in trinityPassword resolution and add a guard that throws when MCP_REQUIRE_API_KEY=false, no token, and no TRINITY_PASSWORD/ADMIN_PASSWORD are set. Closes the only path through which the well-known "changeme" literal could ever reach client.authenticate(). Default-mode (MCP_REQUIRE_API_KEY=true, the shipped configuration) is unaffected — that branch never references trinityPassword. Audit-trail rationale: autoplan dual-voice review (Codex + Claude subagent) both flagged the original plan's choice to leave server.ts:85 alone as "defensible only as a narrow config-only scope trim." User confirmed this was small enough to land in the same PR rather than file a follow-up. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Abilityai#692) Adversarial review on the Abilityai#692 diff caught two siblings of the same bug the issue was filed to fix: the GCP deploy script and its config template still bake "changeme" into prod .env files, defeating the new prod compose :? guard at the source. - scripts/deploy/gcp-deploy.sh: refuse to write the prod .env if ADMIN_PASSWORD is unset or literally "changeme". Fail-loud at script time instead of silently shipping a known password. - deploy.config.example: drop the "changeme" default; add REQUIRED comment matching the .env.example pattern. - docs/memory/feature-flows/mcp-orchestration.md: update stale code snippet that quoted the now-removed `|| "changeme"` line. - docs/user-docs/guides/deploying/single-server.md: note that ADMIN_PASSWORD now drives both admin login and MCP auth, and that prod compose refuses to render without it. - src/mcp-server/TEST_REPORT.md: flag the frozen 2025-11 test report's "Default Credentials: admin / changeme" entry as HISTORICAL pre-Abilityai#692. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
mcp-orchestration.md was already updated in the previous commit; this just adds the one-row index entry. No other flow docs needed touching — admin-login.md and first-time-setup.md describe the auth flow itself (unchanged); only the upstream config layer changed, and that's documented in docs/user-docs/guides/deploying/single-server.md (also already updated). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
vybe
approved these changes
May 8, 2026
vybe
left a comment
Contributor
There was a problem hiding this comment.
Validated against Trinity development methodology. All 5 originally-flagged #692 issues addressed plus 2 siblings caught during adversarial review. Security scan clean, documentation updated, zero behavior change in the default MCP_REQUIRE_API_KEY=true path. LGTM.
Contributor
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
Closes #692. The validator flagged 5 config issues; this PR fixes those + 2 more sibling-bugs surfaced by adversarial review on the diff itself.
What started as a 5-line config-validation PR walked the full review gauntlet (autoplan dual-voice, /review with codex+subagent, /cso --diff). Each pass caught real issues that grew the diff into a more complete fix. Final scope is still small (10 files / 80 inserts / 15 deletes) and all changes are in the same blast radius — the
changeme/ADMIN_PASSWORD/TRINITY_PASSWORDenforcement triangle.What changed
Config alignment (originally-flagged validator findings):
docker-compose.yml:TRINITY_PASSWORDnow readsADMIN_PASSWORDdirectly so devs don't set the same secret twice.docker-compose.prod.yml: bothADMIN_PASSWORD(line 24) andTRINITY_PASSWORD(line 287) switch from silent fallback to fail-loud${VAR:?...}. Matches the convention already used by Redis password vars on lines 26 and 135..env.example: collapse duplicateFRONTEND_URLblock; add missing entries forGOOGLE_API_KEY,LOG_RETENTION_DAYS/LOG_ARCHIVE_ENABLED/LOG_CLEANUP_HOUR,TRINITY_DATA_PATH, andHOST_TEMPLATES_PATH.MCP server hardening (added during review):
src/mcp-server/src/server.ts:85: drop the|| "changeme"fallback. Add a startup guard that throws whenMCP_REQUIRE_API_KEY=false, noTRINITY_API_TOKEN, AND noTRINITY_PASSWORD. Closes the only path where the well-known password could ever reachclient.authenticate(). Default-mode (MCP_REQUIRE_API_KEY=true, the shipped configuration) is unaffected.Deploy script + config template (caught by adversarial review):
scripts/deploy/gcp-deploy.sh:135: previously bakedADMIN_PASSWORD=${ADMIN_PASSWORD:-changeme}into the prod.env, which would have defeated the new compose:?guard at the source. Now refuses to deploy if the var is unset or literally"changeme".deploy.config.example:48: drop theADMIN_PASSWORD="changeme"template default. Empty default +REQUIREDcomment matches the.env.examplepattern.Doc sync:
docs/memory/feature-flows/mcp-orchestration.md: update stale code snippet that quoted the now-removed|| "changeme"line; add note about the new throw guard.docs/user-docs/guides/deploying/single-server.md: note thatADMIN_PASSWORDnow drives both admin login and MCP auth, and that prod compose refuses to render without it.src/mcp-server/TEST_REPORT.md: flag the frozen 2025-11Default Credentials: admin / changemeentry as HISTORICAL pre-Config Validation: 5 critical config issues found (TRINITY_PASSWORD P0, 4x undocumented vars) #692.docs/memory/feature-flows.md: add one-row Recent Updates entry.Behavior delta
MCP_REQUIRE_API_KEY=true, the shipped value): zero behavior change.ADMIN_PASSWORDset: previously rendered withchangemeand a wide-open admin login. Nowdocker compose -f docker-compose.prod.yml configexits non-zero with the messageADMIN_PASSWORD must be set in .env (admin login + MCP auth). Verified empirically — fails on both unset and explicitly-empty values.MCP_REQUIRE_API_KEY=false) without creds: previously authenticated asadmin/changeme. Now throws on container startup with a message that names all three preconditions. Container exits before serving any request.gcp-deploy.shwithout settingADMIN_PASSWORDindeploy.config: previously got a working prod stack with thechangemepassword live on the admin login. Now the script exits non-zero before writing the remote.env.Verification
tsc --noEmitclean onsrc/mcp-server(newstring | undefinednarrows correctly tostringafter the throw):?guard fires on unset (env -i ... --env-file /dev/null) AND explicitly-empty (ADMIN_PASSWORD="")ADMIN_PASSWORD=testrenders bothADMIN_PASSWORDandTRINITY_PASSWORDtotest; nochangemeliteral anywhere.env.examplelint:FRONTEND_URLcount = 1; all 6 new vars presentchangemeliterals are guards (gcp-deploy.sh, password_validation.py blocklist) or HISTORICAL-flagged docsTest plan
ADMIN_PASSWORD— verify admin login works and MCP server boots clean.env— verifydocker compose configexits with the new error messagegcp-deploy.sh envagainst a test instance withADMIN_PASSWORD=""— verify script refuses/validate-config— verify 0 findings from the original listOut of scope (deliberately deferred)
FRONTEND_PORT,VITE_API_URL,SCHEDULER_LOG_LEVEL,MCP_REQUIRE_API_KEY,TRINITY_USERNAMEto.env.example(have sensible defaults; mostly debug knobs).env.exampleadvertises SMTP/SendGrid vars that compose doesn't forward (separate cleanup)SLACK_CLIENT_ID/SECRET,GITHUB_CLIENT_ID/SECRET,NOTION_CLIENT_ID/SECRETparity between local and prod composeCommits
Closes #692
🤖 Generated with Claude Code