1b4b497fdf
Mirror to GitHub / mirror (push) Successful in 44s
Test and Lint / backend-test (push) Successful in 1m42s
Test and Lint / frontend-test (push) Has been cancelled
Version and Release / version-bump (push) Has been cancelled
Version and Release / trigger-drone (push) Has been cancelled
- Remove all console.log/debug statements from production code - Add NODE_ENV checks for development-only logging - Remove test scripts (test-feedback, test-image-security, test-backup-*, test-restore) - Remove one-time fix scripts (fix-temp-photos, fix-migration-state, mark-migration-applied) - Remove sensitive files (.env.backup, ADMIN_CREDENTIALS.txt) - Update package.json to remove references to deleted scripts - Replace console statements with logger utility in backend - Secure error boundaries to not expose stack traces in production This makes the codebase production-ready with no debug output or test scripts. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
39 lines
1007 B
JavaScript
39 lines
1007 B
JavaScript
#!/usr/bin/env node
|
|
|
|
const bcrypt = require('bcrypt');
|
|
const path = require('path');
|
|
require('dotenv').config({ path: path.join(__dirname, '../.env') });
|
|
|
|
const knex = require('knex');
|
|
const db = knex({
|
|
client: process.env.DB_CLIENT || 'pg',
|
|
connection: {
|
|
host: process.env.DB_HOST || 'localhost',
|
|
port: process.env.DB_PORT || 5432,
|
|
user: process.env.DB_USER || 'picpeak',
|
|
password: process.env.DB_PASSWORD || 'picpeak',
|
|
database: process.env.DB_NAME || 'picpeak_dev'
|
|
}
|
|
});
|
|
|
|
async function setAdminPassword() {
|
|
try {
|
|
const password = 'admin123';
|
|
const hashedPassword = await bcrypt.hash(password, 10);
|
|
|
|
await db('admin_users')
|
|
.where('username', 'admin')
|
|
.update({
|
|
password_hash: hashedPassword,
|
|
updated_at: new Date()
|
|
});
|
|
|
|
console.log('✅ Admin password set to: admin123');
|
|
process.exit(0);
|
|
} catch (error) {
|
|
console.error('❌ Error setting password:', error);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
setAdminPassword(); |