diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index 1625bda1..ebda6206 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -4,6 +4,10 @@ on: release: types: [released] +permissions: {} + jobs: update: + permissions: + contents: write uses: laravel/.github/.github/workflows/update-changelog.yml@main diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f2a9c8a..2f6b0e94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ # Release Notes -## [Unreleased](https://github.com/laravel/sail/compare/v1.41.0...1.x) +## [Unreleased](https://github.com/laravel/sail/compare/v1.41.1...1.x) + +## [v1.41.1](https://github.com/laravel/sail/compare/v1.41.0...v1.41.1) - 2025-04-22 + +* Update logo and socialcard by [@iamdavidhill](https://github.com/iamdavidhill) in https://github.com/laravel/sail/pull/781 +* Fix `DB_DATABASE` replacement in `phpunit.xml` by [@choowx](https://github.com/choowx) in https://github.com/laravel/sail/pull/783 +* Added configurable user for shell commands by [@fkrzski](https://github.com/fkrzski) in https://github.com/laravel/sail/pull/785 +* fix: typesense healthcheck by [@Barbapapazes](https://github.com/Barbapapazes) in https://github.com/laravel/sail/pull/788 ## [v1.41.0](https://github.com/laravel/sail/compare/v1.40.0...v1.41.0) - 2025-01-24 diff --git a/art/logo.svg b/art/logo.svg index 8f089215..844d5d51 100644 --- a/art/logo.svg +++ b/art/logo.svg @@ -1,15 +1,19 @@ - + - - - - - - - - - - + + + + + + + + + + + + + diff --git a/art/socialcard.png b/art/socialcard.png index 534b1d8c..6a94a6b8 100644 Binary files a/art/socialcard.png and b/art/socialcard.png differ diff --git a/bin/sail b/bin/sail index 1c1cf903..816dc0a4 100755 --- a/bin/sail +++ b/bin/sail @@ -141,6 +141,7 @@ fi # Define environment variables... export APP_PORT=${APP_PORT:-80} export APP_SERVICE=${APP_SERVICE:-"laravel.test"} +export APP_USER=${APP_USER:-"sail"} export DB_PORT=${DB_PORT:-3306} export WWWUSER=${WWWUSER:-$UID} export WWWGROUP=${WWWGROUP:-$(id -g)} @@ -213,7 +214,7 @@ if [ "$1" == "php" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" "php") else @@ -227,7 +228,7 @@ elif [ "$1" == "bin" ]; then if [ "$EXEC" == "yes" ]; then CMD=$1 shift 1 - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" ./vendor/bin/"$CMD") else @@ -241,7 +242,7 @@ elif [ "$1" == "run" ]; then if [ "$EXEC" == "yes" ]; then CMD=$1 shift 1 - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" "$CMD") else @@ -253,7 +254,7 @@ elif [ "$1" == "docker-compose" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" "${DOCKER_COMPOSE[@]}") else @@ -265,7 +266,7 @@ elif [ "$1" == "composer" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" "composer") else @@ -277,7 +278,7 @@ elif [ "$1" == "artisan" ] || [ "$1" == "art" ] || [ "$1" == "a" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" php artisan) else @@ -289,7 +290,7 @@ elif [ "$1" == "debug" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail -e XDEBUG_TRIGGER=1) + ARGS+=(exec -u "$APP_USER" -e XDEBUG_TRIGGER=1) [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" php artisan) else @@ -301,7 +302,7 @@ elif [ "$1" == "test" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" php artisan test) else @@ -313,7 +314,7 @@ elif [ "$1" == "phpunit" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" php vendor/bin/phpunit) else @@ -325,7 +326,7 @@ elif [ "$1" == "pest" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" php vendor/bin/pest) else @@ -337,7 +338,7 @@ elif [ "$1" == "pint" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" php vendor/bin/pint) else @@ -349,7 +350,7 @@ elif [ "$1" == "dusk" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=(-e "APP_URL=http://${APP_SERVICE}") ARGS+=(-e "DUSK_DRIVER_URL=http://selenium:4444/wd/hub") @@ -363,7 +364,7 @@ elif [ "$1" == "dusk:fails" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=(-e "APP_URL=http://${APP_SERVICE}") ARGS+=(-e "DUSK_DRIVER_URL=http://selenium:4444/wd/hub") @@ -377,7 +378,7 @@ elif [ "$1" == "tinker" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" php artisan tinker) else @@ -389,7 +390,7 @@ elif [ "$1" == "node" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" node) else @@ -401,7 +402,7 @@ elif [ "$1" == "npm" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" npm) else @@ -413,7 +414,7 @@ elif [ "$1" == "npx" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" npx) else @@ -425,7 +426,7 @@ elif [ "$1" == "pnpm" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" pnpm) else @@ -437,7 +438,7 @@ elif [ "$1" == "pnpx" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" pnpx) else @@ -449,7 +450,7 @@ elif [ "$1" == "yarn" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" yarn) else @@ -461,7 +462,7 @@ elif [ "$1" == "bun" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" bun) else @@ -473,7 +474,7 @@ elif [ "$1" == "bunx" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" bunx) else @@ -524,7 +525,7 @@ elif [ "$1" == "shell" ] || [ "$1" == "bash" ]; then shift 1 if [ "$EXEC" == "yes" ]; then - ARGS+=(exec -u sail) + ARGS+=(exec -u "$APP_USER") [ ! -t 0 ] && ARGS+=(-T) ARGS+=("$APP_SERVICE" bash) else diff --git a/src/Console/Concerns/InteractsWithDockerComposeServices.php b/src/Console/Concerns/InteractsWithDockerComposeServices.php index 8299e853..d2f59126 100644 --- a/src/Console/Concerns/InteractsWithDockerComposeServices.php +++ b/src/Console/Concerns/InteractsWithDockerComposeServices.php @@ -226,7 +226,14 @@ protected function configurePhpUnit() $phpunit = file_get_contents($path); $phpunit = preg_replace('/^.*DB_CONNECTION.*\n/m', '', $phpunit); - $phpunit = str_replace('', '', $phpunit); + $phpunit = str_replace( + [ + '', + '', + ], + '', + $phpunit + ); file_put_contents($this->laravel->basePath('phpunit.xml'), $phpunit); } diff --git a/stubs/typesense.stub b/stubs/typesense.stub index 30cc28dd..b8ec0587 100644 --- a/stubs/typesense.stub +++ b/stubs/typesense.stub @@ -11,6 +11,6 @@ typesense: networks: - sail healthcheck: - test: ["CMD", "wget", "--no-verbose", "--spider", "http://localhost:8108/health"] + test: [CMD, bash, -c, "exec 3<>/dev/tcp/localhost/8108 && printf 'GET /health HTTP/1.1\\r\\nConnection: close\\r\\n\\r\\n' >&3 && head -n1 <&3 | grep '200' && exec 3>&-"] retries: 5 timeout: 7s