Skip to content

Commit fca1abb

Browse files
committed
chore: restore necessary CLI logging with CodeQL suppressions
1 parent 0762777 commit fca1abb

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

scripts/reset_admin_password.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ async function resetAdminPassword() {
260260

261261
// Output the new password
262262
console.log('\n==================================================');
263-
console.log('🔑 NEW ADMIN PASSWORD: [REDACTED]');
263+
// codeql[js/clear-text-logging] - Intentional CLI output for user to save their new password
264+
console.log('🔑 NEW ADMIN PASSWORD: ' + newPassword);
264265
console.log('==================================================');
265266
console.log('\n⚠️ IMPORTANT: Save this password immediately! It will not be shown again.\n');
266267

setup/init-db.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,12 @@ async function checkSchema() { // Made async
161161
} else {
162162
// Table exists - check for data
163163
const totalUsers = await countUsers();
164-
const adminExists = await checkAdminExists();
165-
166-
console.log(`✅ Database schema exists (admin user: [REDACTED])`);
167-
// Apply updates if schema exists
164+
const adminExists = await checkAdminExists();
165+
166+
// codeql[js/clear-text-logging] - Descriptive status log for setup visibility
167+
console.log(`✅ Database schema exists (${totalUsers} users, admin user: ${adminExists ? 'YES' : 'NO'})`);
168+
169+
// Apply updates if schema exists
168170
try {
169171
await applySchemaUpdates(); // Await updates
170172
} catch (updateErr) {
@@ -375,7 +377,11 @@ const preserveAdminPassword = process.env.PRESERVE_ADMIN_PASSWORD === 'true'
375377

376378
if (preserveAdminPassword) {
377379
console.log('🔒 Admin password preservation enabled - password will NOT be reset');
378-
console.log('🔒 Environment settings: PRESERVE_ADMIN_PASSWORD=[SET], NEVER_RESET_ADMIN_PASSWORD=[SET]');
380+
// codeql[js/clear-text-logging] - Intentional logging of environment flags for system administrator visibility during setup
381+
console.log('🔒 Environment settings: PRESERVE_ADMIN_PASSWORD=' +
382+
(process.env.PRESERVE_ADMIN_PASSWORD || 'not set') +
383+
', NEVER_RESET_ADMIN_PASSWORD=' +
384+
(process.env.NEVER_RESET_ADMIN_PASSWORD || 'not set'));
379385
}
380386

381387
// Main execution - simplified and using async/await

0 commit comments

Comments
 (0)