From 079c79e4685559359cdf5d0a79bb6addc1bd279e Mon Sep 17 00:00:00 2001 From: Mark Shust Date: Thu, 25 Apr 2024 12:18:34 -0400 Subject: [PATCH 1/8] Release 47.0.0 (#1138) Co-authored-by: Michael Lehmkuhl Co-authored-by: Jenyamba Co-authored-by: Tu Van Co-authored-by: Cid Lopes --- CHANGELOG.md | 14 +++++++++++++ compose/bin/download | 5 +++++ compose/bin/setup-ssl | 3 ++- compose/compose.dev-linux.yaml | 2 -- compose/compose.dev-ssh.yaml | 2 -- compose/compose.dev.yaml | 2 -- compose/compose.healthcheck.yaml | 2 -- compose/compose.yaml | 20 ++++++++++--------- compose/env/elasticsearch.env | 3 --- compose/env/opensearch.env | 4 ---- .../etc/install-config-mysql.php.2.4.dist | 6 ++++-- lib/template | 6 ++++++ 12 files changed, 42 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0ab25bdd..659c9eae2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [47.0.0] - 2024-04-25 + +### Added +- Check to ensure directory does not already exist in project directory [PR #1127](https://github.com/markshust/docker-magento/pull/1127). + +### Updated +- Remove obsolete version directive from docker compose files [PR #1125](https://github.com/markshust/docker-magento/pull/1125). +- Predefined version from 2.4.6-p4 to 2.4.7 [PR #1128](https://github.com/markshust/docker-magento/pull/1128). +- Integration testing configuration to use OpenSearch [PR #1131](https://github.com/markshust/docker-magento/pull/1131). + +### Fixed +- SSL cert generation when domain has a port included [PR #1136](https://github.com/markshust/docker-magento/pull/1136). +- OpenSearch container fails to start due to memory heap size configuration [PR #1137](https://github.com/markshust/docker-magento/pull/1137). + ## [46.1.1] - 2024-04-16 ### Fixed diff --git a/compose/bin/download b/compose/bin/download index 452fcba85..9ae09b959 100755 --- a/compose/bin/download +++ b/compose/bin/download @@ -10,6 +10,11 @@ NC='\033[0m' # No Color bin/stop +if [ -d "./bin" ]; then + echo "Error: The current directory is not empty. Please remove all contents within this directory and try again." + exit 1 +fi + bin/start --no-dev [ $? != 0 ] && echo "Failed to start Docker services" && exit diff --git a/compose/bin/setup-ssl b/compose/bin/setup-ssl index 405552735..9d8f29e3c 100755 --- a/compose/bin/setup-ssl +++ b/compose/bin/setup-ssl @@ -7,7 +7,8 @@ if ! bin/docker-compose exec -T -u root app cat /root/.local/share/mkcert/rootCA fi # Generate the certificate for the specified domain -bin/docker-compose exec -T -u root app mkcert -key-file nginx.key -cert-file nginx.crt "$@" +DOMAIN_WITHOUT_PORT=$(echo "$@" | cut -d ':' -f1) +bin/docker-compose exec -T -u root app mkcert -key-file nginx.key -cert-file nginx.crt "$DOMAIN_WITHOUT_PORT" echo "Moving key and cert to /etc/nginx/certs/..." bin/docker-compose exec -T -u root app chown app:app nginx.key nginx.crt bin/docker-compose exec -T -u root app mv nginx.key nginx.crt /etc/nginx/certs/ diff --git a/compose/compose.dev-linux.yaml b/compose/compose.dev-linux.yaml index 8df350fa0..fae7d78cb 100644 --- a/compose/compose.dev-linux.yaml +++ b/compose/compose.dev-linux.yaml @@ -1,5 +1,3 @@ -version: "3" - services: app: volumes: &appvolumes diff --git a/compose/compose.dev-ssh.yaml b/compose/compose.dev-ssh.yaml index 6744b8a54..c05c72234 100644 --- a/compose/compose.dev-ssh.yaml +++ b/compose/compose.dev-ssh.yaml @@ -1,5 +1,3 @@ -version: "3" - services: app: volumes: &appvolumes diff --git a/compose/compose.dev.yaml b/compose/compose.dev.yaml index 44d2d5114..641fc7b56 100644 --- a/compose/compose.dev.yaml +++ b/compose/compose.dev.yaml @@ -1,5 +1,3 @@ -version: "3" - services: app: volumes: &appvolumes diff --git a/compose/compose.healthcheck.yaml b/compose/compose.healthcheck.yaml index e18245944..b53891ca7 100644 --- a/compose/compose.healthcheck.yaml +++ b/compose/compose.healthcheck.yaml @@ -1,5 +1,3 @@ -version: "3" - services: app: healthcheck: diff --git a/compose/compose.yaml b/compose/compose.yaml index 2059562e9..c0e987cb0 100644 --- a/compose/compose.yaml +++ b/compose/compose.yaml @@ -1,7 +1,7 @@ ## Mark Shust's Docker Configuration for Magento ## (https://github.com/markshust/docker-magento) ## -## Version 46.1.1 +## Version 47.0.0 ## To use SSH, see https://github.com/markshust/docker-magento#ssh ## Linux users, see https://github.com/markshust/docker-magento#linux @@ -10,8 +10,6 @@ ## 172.17.0.1 in this file with the result of: ## docker network inspect bridge --format='{{(index .IPAM.Config 0).Gateway}}' -version: "3" - services: app: image: markoshust/magento-nginx:1.24-0 @@ -80,8 +78,10 @@ services: ## More info at https://github.com/markshust/docker-magento/issues/488 - "cluster.routing.allocation.disk.threshold_enabled=false" - "index.blocks.read_only_allow_delete" - ## Uncomment the following line to increase the virtual memory map count - # - "max_map_count=262144" + ## Uncomment to set custom heap size to avoid memory errors + #- "OPENSEARCH_JAVA_OPTS=-Xms1g -Xmx1g" + ## Uncomment to increase the virtual memory map count + #- "max_map_count=262144" ## If you wish to use Elasticsearch, comment out opensearch image above and ## uncomment this block. Do the same in the composer.healthcheck.yaml file. @@ -100,8 +100,10 @@ services: # ## More info at https://github.com/markshust/docker-magento/issues/488 # - "cluster.routing.allocation.disk.threshold_enabled=false" # - "index.blocks.read_only_allow_delete" - # ## Uncomment the following line to increase the virtual memory map count - # - "max_map_count=262144" + # ## Uncomment to set custom heap size to avoid memory errors + # #- "ES_JAVA_OPTS=-Xms1g -Xmx1g" + # ## Uncomment to increase the virtual memory map count + # #- "max_map_count=262144" rabbitmq: image: markoshust/magento-rabbitmq:3.12-0 @@ -116,14 +118,14 @@ services: image: sj26/mailcatcher ports: - "1080:1080" - + ## Cloudflare tunnel support, uncomment to enable #tunnel: # container_name: cloudflared-tunnel # image: cloudflare/cloudflared:latest # command: tunnel run # env_file: env/cloudflare.env - + ## Blackfire support, uncomment to enable #blackfire: # image: blackfire/blackfire:2 diff --git a/compose/env/elasticsearch.env b/compose/env/elasticsearch.env index acc1712ee..5856225ce 100644 --- a/compose/env/elasticsearch.env +++ b/compose/env/elasticsearch.env @@ -1,5 +1,2 @@ ES_HOST=elasticsearch ES_PORT=9200 - -## Set custom heap size to avoid memory errors -ES_JAVA_OPTS="-Xms1g -Xmx1g" diff --git a/compose/env/opensearch.env b/compose/env/opensearch.env index 9ae75b55b..2a5680329 100644 --- a/compose/env/opensearch.env +++ b/compose/env/opensearch.env @@ -1,9 +1,5 @@ OPENSEARCH_HOST=opensearch OPENSEARCH_PORT=9200 -OPENSEARCH_HEALTHCHECK_TIMEOUT=100 - -## Set custom heap size to avoid memory errors -OPENSEARCH_JAVA_OPTS="-Xms1g -Xmx1g" # Prevent security patch conflicts with core M2 code DISABLE_SECURITY_PLUGIN=true diff --git a/compose/template/dev/tests/integration/etc/install-config-mysql.php.2.4.dist b/compose/template/dev/tests/integration/etc/install-config-mysql.php.2.4.dist index 68acd8359..29ae77348 100644 --- a/compose/template/dev/tests/integration/etc/install-config-mysql.php.2.4.dist +++ b/compose/template/dev/tests/integration/etc/install-config-mysql.php.2.4.dist @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + return [ 'db-host' => 'db', 'db-user' => 'magento', @@ -10,8 +11,8 @@ return [ 'db-name' => 'magento_integration_tests', 'db-prefix' => '', 'backend-frontname' => 'backend', - 'search-engine' => 'elasticsearch7', - 'elasticsearch-host' => 'elasticsearch', + 'search-engine' => 'opensearch', + 'opensearch-host' => 'opensearch', 'admin-user' => \Magento\TestFramework\Bootstrap::ADMIN_NAME, 'admin-password' => \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD, 'admin-email' => \Magento\TestFramework\Bootstrap::ADMIN_EMAIL, @@ -21,4 +22,5 @@ return [ 'amqp-port' => '5672', 'amqp-user' => 'magento', 'amqp-password' => 'magento', + 'consumers-wait-for-messages' => '0', ]; diff --git a/lib/template b/lib/template index 3ef44a660..8f3a4833e 100755 --- a/lib/template +++ b/lib/template @@ -3,6 +3,12 @@ git init -qqq git remote add origin https://github.com/markshust/docker-magento git fetch origin -qqq git checkout origin/master -- compose + +if [ -d "./bin" ]; then + echo "Error: The current directory is not empty. Please remove all contents within this directory and try again." + exit 1 +fi + mv compose/* ./ mv compose/.gitignore ./ mv compose/.vscode ./ From 44d3db95271b4a98af36e10681a2ff368544845d Mon Sep 17 00:00:00 2001 From: Jenyamba Date: Sat, 10 Aug 2024 10:38:43 +0300 Subject: [PATCH 2/8] Update README and script with backend login credentials and 2FA instructions --- compose/bin/setup | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compose/bin/setup b/compose/bin/setup index 6cb747a29..f89d117b4 100755 --- a/compose/bin/setup +++ b/compose/bin/setup @@ -53,3 +53,9 @@ cp -r .vscode src/ echo "Docker development environment setup complete." echo "You may now access your Magento instance at https://${DOMAIN}/" + +echo "You may now access your Magento backend instance at https://${DOMAIN}/admin/" + +echo "Use the following default credentials to log in:" +echo "Username: john.smith" +echo "Password: password123" From 75d93ec44c36c4413089b9fb1bc1733323994704 Mon Sep 17 00:00:00 2001 From: Jenyamba Date: Sat, 10 Aug 2024 10:39:59 +0300 Subject: [PATCH 3/8] Update README --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index eed46f803..e08ac98a0 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,28 @@ The `magento.test` above defines the hostname to use, and the `2.4.7` defines th After the one-liner above completes running, you should be able to access your site at `https://magento.test`. +## Accessing the Magento Backend + +After successfully installing the Magento 2.4.7 environment, you can access the backend by following these steps: + +1. Open your web browser and go to the following URL: `https://magento.test/admin`. + + +2. Use the following default credentials to log in: +- **Username:** `john.smith` +- **Password:** `password123` + +3. Upon logging in, you might be prompted to configure Two-Factor Authentication (2FA). By default, the email address used for this purpose is: +- **Email:** `john.smith@gmail.com` + +If you are testing in a local environment or development setup, and wish to disable 2FA, you can do so by running the following commands in your terminal: + +```bash +bin/magento module:disable {Magento_TwoFactorAuth,Magento_AdminAdobeImsTwoFactorAuth} + +bin/magento cache:clean +``` + #### Install sample data After the above installation is complete, run the following lines to install sample data: From f1ddaa625e25d36d904df3980426db753e84b8d8 Mon Sep 17 00:00:00 2001 From: Jenyamba Date: Sat, 10 Aug 2024 10:42:44 +0300 Subject: [PATCH 4/8] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e08ac98a0..1135629ec 100644 --- a/README.md +++ b/README.md @@ -159,10 +159,9 @@ After the one-liner above completes running, you should be able to access your s ## Accessing the Magento Backend -After successfully installing the Magento 2.4.7 environment, you can access the backend by following these steps: - -1. Open your web browser and go to the following URL: `https://magento.test/admin`. +After successfully installing the Magento environment, you can access the backend by following these steps: +1. Open your web browser and go to the following URL: `https://magento.test/admin/`. 2. Use the following default credentials to log in: - **Username:** `john.smith` From 08a30dd079a0b1fad5d792934df6e6d4c6b48912 Mon Sep 17 00:00:00 2001 From: Jenyamba Date: Sat, 10 Aug 2024 10:43:43 +0300 Subject: [PATCH 5/8] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 1135629ec..8710239e2 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,6 @@ If you are testing in a local environment or development setup, and wish to disa ```bash bin/magento module:disable {Magento_TwoFactorAuth,Magento_AdminAdobeImsTwoFactorAuth} - bin/magento cache:clean ``` From 68dfff84dde495dce2fcb26b42b4af134c900936 Mon Sep 17 00:00:00 2001 From: Jenyamba Date: Mon, 12 Aug 2024 19:38:31 +0300 Subject: [PATCH 6/8] Updated setup script to use environment variables from magento.env for login credentials Co-authored-by: vlecluse --- compose/bin/setup | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compose/bin/setup b/compose/bin/setup index f89d117b4..945ad40a6 100755 --- a/compose/bin/setup +++ b/compose/bin/setup @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -o errexit +source env/magento.env MEM_BYTES=$(docker info -f '{{.MemTotal}}') MEM_MB=$(( MEM_BYTES / 1000000 )) @@ -57,5 +58,5 @@ echo "You may now access your Magento instance at https://${DOMAIN}/" echo "You may now access your Magento backend instance at https://${DOMAIN}/admin/" echo "Use the following default credentials to log in:" -echo "Username: john.smith" -echo "Password: password123" +echo "Username: $MAGENTO_ADMIN_USER" +echo "Password: $MAGENTO_ADMIN_PASSWORD" From 120a5998ecc8972a371db4e65efa556bd2f836c0 Mon Sep 17 00:00:00 2001 From: Jenyamba Date: Mon, 12 Aug 2024 19:44:35 +0300 Subject: [PATCH 7/8] Fixed path to magento.env file in setup script to ensure correct sourcing --- compose/bin/setup | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compose/bin/setup b/compose/bin/setup index 945ad40a6..3329b89eb 100755 --- a/compose/bin/setup +++ b/compose/bin/setup @@ -1,6 +1,10 @@ #!/usr/bin/env bash set -o errexit -source env/magento.env +if [ -f "../env/magento.env" ]; then + source "../env/magento.env" +else + echo "Warning: magento.env file not found." +fi MEM_BYTES=$(docker info -f '{{.MemTotal}}') MEM_MB=$(( MEM_BYTES / 1000000 )) From 34c4867c1e76ec7baa74e300eed15f15cf26052a Mon Sep 17 00:00:00 2001 From: Mark Shust Date: Wed, 13 Nov 2024 15:14:46 -0500 Subject: [PATCH 8/8] Fixed mention of email checking --- README.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 597b4a263..552f4796d 100644 --- a/README.md +++ b/README.md @@ -167,15 +167,10 @@ After successfully installing the Magento environment, you can access the backen - **Username:** `john.smith` - **Password:** `password123` -3. Upon logging in, you might be prompted to configure Two-Factor Authentication (2FA). By default, the email address used for this purpose is: +3. Upon logging in, you might be prompted to configure Two-Factor Authentication (2FA). This emails you a code to log in with (which you can check with Mailcatcher by visiting `http://{yourdomain}:1080`). By default, the email address used for this purpose is: - **Email:** `john.smith@gmail.com` -If you are testing in a local environment or development setup, and wish to disable 2FA, you can do so by running the following commands in your terminal: - -```bash -bin/magento module:disable {Magento_TwoFactorAuth,Magento_AdminAdobeImsTwoFactorAuth} -bin/magento cache:clean -``` +If you are testing in a local development environment and wish to disable 2FA, you can do so by installing [Mark's DisableTwoFactorAuth module](https://github.com/markshust/magento2-module-disabletwofactorauth). #### Install sample data @@ -440,7 +435,7 @@ Copy `src/auth.json.sample` to `src/auth.json`. Then, update the username and pa ### Email / Mailcatcher -View emails sent locally through Mailcatcher by visiting [http://{yourdomain}:1080](http://{yourdomain}:1080). During development, it's easiest to test emails using a third-party module such as [Mageplaza's SMTP module](https://github.com/mageplaza/magento-2-smtp). In order to use mailcatcher, set the mailserver host to `mailcatcher` and set port to `1025`. Note that this port is different from the mailcatcher interface to read the emails. +View emails sent locally through Mailcatcher by visiting [http://{yourdomain}:1080](http://{yourdomain}:1080). In order to use mailcatcher, set the mailserver host to `mailcatcher` and set port to `1025`. Note that this port (`1025`) is different from the mailcatcher interface to read the emails (`1080`). ### Redis