diff --git a/index.js b/index.js index 761a33a..7f8c35a 100644 --- a/index.js +++ b/index.js @@ -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(() => {