Files
rack-planner/scripts/hashPassword.ts

21 lines
456 B
TypeScript
Raw Normal View History

/**
* Generates a bcrypt hash for use as ADMIN_PASSWORD_HASH env var.
*
* Usage:
* npx tsx scripts/hashPassword.ts yourpassword
*
* Copy the output and paste it into your Docker env var or .env file.
*/
import bcrypt from 'bcryptjs';
const password = process.argv[2];
if (!password) {
console.error('Usage: npx tsx scripts/hashPassword.ts <password>');
process.exit(1);
}
bcrypt.hash(password, 12).then((hash) => {
console.log(hash);
});