diff --git a/cli/template/extras/start-database/mysql.sh b/cli/template/extras/start-database/mysql.sh index 5564d101a1..61fbfe1f9b 100755 --- a/cli/template/extras/start-database/mysql.sh +++ b/cli/template/extras/start-database/mysql.sh @@ -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 diff --git a/cli/template/extras/start-database/postgres.sh b/cli/template/extras/start-database/postgres.sh index 56d2edd8d1..d2c3662f45 100755 --- a/cli/template/extras/start-database/postgres.sh +++ b/cli/template/extras/start-database/postgres.sh @@ -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