omnivore/packages/api/scripts/hash-password.js
Rohit Amarnath 09a1a8b80d feat: make demo user configurable via environment variables
- Move demo user credentials from hardcoded values to environment variables
- Add DEMO_USER_EMAIL, DEMO_USER_PASSWORD_HASH, DEMO_USER_NAME, DEMO_USERNAME env vars
- Add password hashing utility script for generating secure password hashes
- Update docker-compose.yml to properly load .env files and add restart policies
- Update .env.example with demo user configuration documentation

BREAKING CHANGE: Demo user is now configured via environment variables instead of hardcoded values
2025-09-21 20:06:59 -04:00

23 lines
No EOL
454 B
JavaScript

#!/usr/bin/env node
const bcrypt = require('bcryptjs')
async function main() {
const password = process.argv[2]
if (!password) {
console.error('Usage: yarn hash-password <password>')
process.exit(1)
}
try {
const hash = await bcrypt.hash(password, 10)
console.log(`Password: ${password}`)
console.log(`Hash: ${hash}`)
} catch (error) {
console.error('Error generating hash:', error)
process.exit(1)
}
}
main()