Remove hardcoded credentials; replace with env var references#48
Draft
Copilot wants to merge 2 commits into
Draft
Remove hardcoded credentials; replace with env var references#48Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Agent-Logs-Url: https://github.com/datacendia/datacendia-components/sessions/ba1acb3f-782b-4d7e-b6c8-244a4dbda45c Co-authored-by: datacendia <247299412+datacendia@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Replace hardcoded credentials with env variables
Remove hardcoded credentials; replace with env var references
Apr 8, 2026
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.
Three files contained hardcoded database passwords and admin credentials committed to source code. This replaces all of them with
process.env.*lookups and safe placeholder fallbacks.Changes
backend/scripts/check-all-dbs.ts— PostgreSQL connection string, MySQL, and MariaDB credentials all moved to env vars:backend/scripts/verify-marketing-data.ts— Same pattern applied to the matching PostgreSQL, MySQL, and MariaDB connection blocks.docs/API_DOCUMENTATION.md— Hardcodedadmin@datacendia.com/DatacendiaAdmin2024!in the auth example replaced withyour-email@company.com/your-password.Type of Change
Community/Enterprise Boundary
Checklist
npm run test)npm run typecheck)npm run lint)Screenshots / Recordings
N/A — no UI changes.
Testing Instructions
DATABASE_URL,MYSQL_HOST,MYSQL_PASSWORD,MYSQL_DATABASE,MARIADB_HOST,MARIADB_PASSWORD,MARIADB_DATABASEin your local.env.npx ts-node backend/scripts/check-all-dbs.ts— verify it connects using env var values.Original prompt
Problem
A security audit identified multiple hardcoded credentials and secrets committed to source code in this repository. These must be replaced with environment variable references and safe placeholder values.
Files to Fix
1.
backend/scripts/check-all-dbs.ts(BlobSha: 2f2be172a45ad5be2b6e5ac098b596f70a8a4315)Line 12: Hardcoded PostgreSQL connection string with password:
Fix: Replace with:
Line 39: Hardcoded MySQL credentials:
Fix: Replace with:
Line 56: Hardcoded MariaDB credentials (same pattern):
Fix: Replace with:
2.
backend/scripts/verify-marketing-data.ts(BlobSha: d266ba319889258be853f85022ed0bd60066a895)Line 13: Same hardcoded PostgreSQL connection string:
Fix: Same as above — use
process.env.DATABASE_URL.Line 24: Same hardcoded MySQL credentials:
Fix: Same env var pattern as above.
Line 36: Same hardcoded MariaDB credentials:
Fix: Same env var pattern as above.
3.
docs/API_DOCUMENTATION.md(BlobSha: 2cddb0432f29399e57509dc6c702c9ab9e84436b)Lines 332-335: Hardcoded demo admin credentials in the example:
Fix: Replace with placeholder values:
4.
src/lib/featureFlags.ts(BlobSha: 5a1fa4f9da1769e49c3ccafe1f35ebe1cf860a59)Line 21: The Unleash token fallback is an empty string, which is correct in
datacendia-components. However, the platform audit report (reports/PLATFORM_AUDIT_2026_02_17.md lines 178-180) flagged that thedatacendia-coreversion had'cendia-admin-token'hardcoded. Verify this file is correct (it appears to already be fixed in this repo with|| ''). No change needed if already using env var fallback to empty string.Summary of Changes Required
backend/scripts/check-all-dbs.tsdatacendia_secure_2024,cendia2025x2)process.env.*referencesbackend/scripts/verify-marketing-data.tsprocess.env.*referencesdocs/API_DOCUMENTATION.mdImportant Notes
.envor.env.examplefiles (those are in the other repo).your-email@company.comandyour-password.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Check for passwords or secrets
Assistant:
I'll check for any passwords, secrets, or sensitive credentials in your repositories. Let me search for common patterns.
Assistant: Here's a summary of the secrets and credentials findings across your
datacendia/datacendia-coreanddatacendia/datacendia-componentsrepositories:🔴 HIGH SEVERITY — Hardcoded Credentials in Source Code
1. Hardcoded database passwords in scripts