boxes-api/scripts/createAdminUser.bash

20 lines
684 B
Bash
Raw Normal View History

2024-10-18 15:00:04 +00:00
#!/binb/ash
# Set the password you want to use
PASSWORD="boxuser"
<<<<<<< Updated upstream
DATABASE="/Users/stwhite/CODE/Boxes-App/boxes-api/data/boxes.db"
=======
DATABASE="../data/boxes.db"
>>>>>>> Stashed changes
2024-10-18 15:00:04 +00:00
# Use htpasswd to create a bcrypt hash of the password
HASHED_PASSWORD=$(htpasswd -nbBC 10 "" "$PASSWORD" | tr -d ':\n')
# Create the user in the SQLite database
<<<<<<< Updated upstream
sqlite3 $DATABASE "INSERT INTO users (username, password, email) VALUES ('boxuser', '$HASHED_PASSWORD','boxuser@r8z.us')"
=======
sqlite3 $DATABASE "INSERT INTO users (username, password, email) VALUES ('boxuser', '$HASHED_PASSWORD','boxuser@r8z.us');"
>>>>>>> Stashed changes