Add better logging/Other stuff #3

Merged
ChrisChrome merged 6 commits from dev into main 2026-02-18 13:46:00 -07:00
Showing only changes of commit e5880a9e49 - Show all commits

View file

@ -55,7 +55,7 @@ pool.getConnection().then((conn) => {
// delete all users (The big scary one lol) // delete all users (The big scary one lol)
conn.query("DELETE FROM users").then(() => { conn.query("DELETE FROM users").then(() => {
// Generate 32 char random string // 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) => { bcrypt.hash(passwd, 10).then((hash) => {
conn.query("INSERT INTO users (id, username, passwordHash) VALUES (1, 'admin', ?)", conn.query("INSERT INTO users (id, username, passwordHash) VALUES (1, 'admin', ?)",
[hash]).then(() => { [hash]).then(() => {