Allow setting admin pass to specific string

This commit is contained in:
Christopher Cookman 2026-02-18 13:37:30 -07:00
parent 279f18f8d6
commit e5880a9e49

View file

@ -55,7 +55,7 @@ pool.getConnection().then((conn) => {
// delete all users (The big scary one lol)
conn.query("DELETE FROM users").then(() => {
// Generate 32 char random string
const passwd = crypto.randomBytes(32).toString('hex');
const passwd = process.env.SET_ADMIN_PASS || crypto.randomBytes(32).toString('hex');
bcrypt.hash(passwd, 10).then((hash) => {
conn.query("INSERT INTO users (id, username, passwordHash) VALUES (1, 'admin', ?)",
[hash]).then(() => {