Update boop-keys/setup-boop.sh

This commit is contained in:
Kakious 2023-07-21 09:02:43 -07:00
parent a08476370f
commit 0294ab64af

View file

@ -5,10 +5,10 @@ echo "[BOOTSTRAP] Running initial setup for BOOP..."
mysql -u root -e "CREATE DATABASE IF NOT EXISTS oauth_provider;" mysql -u root -e "CREATE DATABASE IF NOT EXISTS oauth_provider;"
password=$(openssl rand -base64 32) password=$(openssl rand -base64 32)
echo $password > /home/coder/oauth-provider/.dbpass echo $password > /home/coder/oauth-provider/.dbpass
mysqladmin -u root password $password 2>&1 /dev/null mysqladmin -u root password $password
mysql -u root -p$password -e "CREATE USER 'oauth_provider'@'%' IDENTIFIED BY '$password';" 2>&1 /dev/null mysql -u root -p$password -e "CREATE USER 'oauth_provider'@'%' IDENTIFIED BY '$password';"
mysql -u root -p$password -e "GRANT ALL PRIVILEGES ON oauth_provider.* TO 'oauth_provider'@'%';" 2>&1 /dev/null mysql -u root -p$password -e "GRANT ALL PRIVILEGES ON oauth_provider.* TO 'oauth_provider'@'%';"
mysql -u root -p$password -e "FLUSH PRIVILEGES;" 2>&1 /dev/null mysql -u root -p$password -e "FLUSH PRIVILEGES;"
chown coder:coder /home/coder/oauth-provider/.dbpass chown coder:coder /home/coder/oauth-provider/.dbpass
echo "[BOOTSTRAP] DB Configured, setting up .env file..." echo "[BOOTSTRAP] DB Configured, setting up .env file..."