From 6ac738a8d58722d8e7a29fd3da92ea1dc4558276 Mon Sep 17 00:00:00 2001 From: GoodM4ven Date: Thu, 31 Oct 2024 19:24:51 +0300 Subject: [PATCH] [v4.2.3] Fixed a bug in MinIO env variables creation --- scripts/functions/minio_up.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/functions/minio_up.sh b/scripts/functions/minio_up.sh index d8821e3..22dcef7 100755 --- a/scripts/functions/minio_up.sh +++ b/scripts/functions/minio_up.sh @@ -18,6 +18,14 @@ EOF # ? Update the Laravel project's environment variables for MinIO storage cd $projects_directory/$escaped_project_name + + if ! grep -q '^AWS_ENDPOINT=' ./.env; then + sed -i "/^AWS_BUCKET=.*/a AWS_ENDPOINT=" ./.env + fi + if ! grep -q '^AWS_URL=' ./.env; then + sed -i "/^AWS_ENDPOINT=.*/a AWS_URL=" ./.env + fi + sed -i "/^FILESYSTEM_DISK=/c\FILESYSTEM_DISK=s3" ./.env sed -i "/^AWS_ACCESS_KEY_ID=/c\AWS_ACCESS_KEY_ID=minioadmin" ./.env sed -i "/^AWS_SECRET_ACCESS_KEY=/c\AWS_SECRET_ACCESS_KEY=minioadmin" ./.env