Skip to content

Commit

Permalink
fix: create url safe db passwords (t3-oss#1799)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobenna authored Mar 13, 2024
1 parent c4b3d67 commit 388fcd8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cli/template/extras/start-database/mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ if [ "$DB_PASSWORD" == "password" ]; then
echo "Please set a password in the .env file and try again"
exit 1
fi
DB_PASSWORD=$(openssl rand -base64 12)
# Generate a random URL-safe password
DB_PASSWORD=$(openssl rand -base64 12 | tr '+/' '-_')
sed -i -e "s#:password@#:$DB_PASSWORD@#" .env
fi

Expand Down
3 changes: 2 additions & 1 deletion cli/template/extras/start-database/postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ if [ "$DB_PASSWORD" = "password" ]; then
echo "Please set a password in the .env file and try again"
exit 1
fi
DB_PASSWORD=$(openssl rand -base64 12)
# Generate a random URL-safe password
DB_PASSWORD=$(openssl rand -base64 12 | tr '+/' '-_')
sed -i -e "s#:password@#:$DB_PASSWORD@#" .env
fi

Expand Down

0 comments on commit 388fcd8

Please sign in to comment.