chore: remove db credentials from tracking and add template file

This commit is contained in:
2025-12-28 23:04:08 +11:00
parent fc16340c25
commit 64bdc868b2
4 changed files with 17 additions and 10 deletions

11
lib/db-config.template.js Normal file
View File

@@ -0,0 +1,11 @@
// Database Configuration Template
// Copy this file to lib/db-config.js and update with your actual credentials
// NEVER commit lib/db-config.js to Git - it's in .gitignore for security
module.exports = {
host: 'YOUR_DATABASE_HOST', // e.g., 'localhost' or '172.16.69.219'
user: 'YOUR_DATABASE_USER', // e.g., 'postgres'
password: 'YOUR_DATABASE_PASSWORD', // Database password
database: 'YOUR_DATABASE_NAME', // e.g., 'webperformance'
port: 5432, // Default PostgreSQL port
};

View File

@@ -264,10 +264,13 @@ async function _executeTest(url, options) {
];
try {
console.log('📝 Attempting DB Insert for Test:', testId);
console.log('👤 User UUID:', options.userUuid);
const db = require('../lib/db');
await db.pool.query(insertQuery, values);
console.log('✅ DB Insert Success!');
} catch (dbErr) {
console.error('Failed to save result to DB:', dbErr);
console.error('Failed to save result to DB:', dbErr);
// Don't fail the whole test if DB save fails, just log it
}