feat(security): implement bcrypt hashing for admin password and cleanup Dockerfile

This commit is contained in:
Hördle Bot
2025-11-22 22:37:46 +01:00
parent 23e145e05f
commit aff752d4cb
7 changed files with 55 additions and 41 deletions

21
scripts/hash-password.js Normal file
View File

@@ -0,0 +1,21 @@
const bcrypt = require('bcryptjs');
const password = process.argv[2];
if (!password) {
console.error('Please provide a password to hash.');
console.error('Usage: node scripts/hash-password.js <password>');
process.exit(1);
}
const saltRounds = 10;
bcrypt.hash(password, saltRounds, (err, hash) => {
if (err) {
console.error('Error hashing password:', err);
return;
}
console.log('Plaintext:', password);
console.log('Bcrypt Hash:', hash);
console.log('\nSet this hash as your ADMIN_PASSWORD environment variable.');
});