From cc8e4f17291ac08423e5372fb56635c37dd15b57 Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Mon, 20 Nov 2023 18:01:12 +0100 Subject: [PATCH 1/4] feat(slic-stack.yml) control the WP_HTTP_BLOCK_EXTERNAL const Use the SLIC_WP_HTTP_BLOCK_EXTERNAL env var. --- .env.slic | 4 ++++ slic-stack.yml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.env.slic b/.env.slic index b705e7a..e261249 100644 --- a/.env.slic +++ b/.env.slic @@ -77,3 +77,7 @@ WORDPRESS_HTTP_PORT=8888 # Directory the host machine's cache directory will be mapped to. COMPOSER_CACHE_DIR=./.cache + +# This value will be assigned to the WP_HTTP_BLOCK_EXTERNAL constant defined in the wp-config.php file. +# Set to `true` to block all external HTTP requests from WordPress, set to `false` to allow all requests. +SLIC_WP_HTTP_BLOCK_EXTERNAL=true diff --git a/slic-stack.yml b/slic-stack.yml index 7332761..a426eb9 100644 --- a/slic-stack.yml +++ b/slic-stack.yml @@ -90,7 +90,7 @@ services: define( 'WP_DEBUG_DISPLAY', true ); define( 'WP_DEBUG_LOG', true ); define( 'DISABLE_WP_CRON', true ); - define( 'WP_HTTP_BLOCK_EXTERNAL', true ); + define( 'WP_HTTP_BLOCK_EXTERNAL', ${SLIC_WP_HTTP_BLOCK_EXTERNAL:-true} ); # Configure this to debug the tests with XDebug. # Map the `_wordpress` directory to `/var/www/html' directory in your IDE of choice. # Map the `_plugins` directory to `/plugins` directory in your IDE of choice. From 4a5e24e4b9a360251935d8add075bb01a0032e0c Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Mon, 20 Nov 2023 18:10:53 +0100 Subject: [PATCH 2/4] feat(slic-stack.yml) support control of DISABLE_WP_CRON env var --- .env.slic | 4 ++++ slic-stack.yml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.env.slic b/.env.slic index e261249..2c895ad 100644 --- a/.env.slic +++ b/.env.slic @@ -81,3 +81,7 @@ COMPOSER_CACHE_DIR=./.cache # This value will be assigned to the WP_HTTP_BLOCK_EXTERNAL constant defined in the wp-config.php file. # Set to `true` to block all external HTTP requests from WordPress, set to `false` to allow all requests. SLIC_WP_HTTP_BLOCK_EXTERNAL=true + +# This value will be assigned to the DISABLE_WP_CRON constant defined in the wp-config.php file. +# Set to `true` to disable the WordPress cron system, set to `false` to enable it. +SLIC_DISABLE_WP_CRON=true diff --git a/slic-stack.yml b/slic-stack.yml index a426eb9..7f87d51 100644 --- a/slic-stack.yml +++ b/slic-stack.yml @@ -89,7 +89,7 @@ services: define( 'TRIBE_NO_FREEMIUS', true ); define( 'WP_DEBUG_DISPLAY', true ); define( 'WP_DEBUG_LOG', true ); - define( 'DISABLE_WP_CRON', true ); + define( 'DISABLE_WP_CRON', ${SLIC_DISABLE_WP_CRON:-true} ); define( 'WP_HTTP_BLOCK_EXTERNAL', ${SLIC_WP_HTTP_BLOCK_EXTERNAL:-true} ); # Configure this to debug the tests with XDebug. # Map the `_wordpress` directory to `/var/www/html' directory in your IDE of choice. From e30147fb5c3fdc1b35f0fb8a2d390041b023fed2 Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Mon, 20 Nov 2023 18:19:42 +0100 Subject: [PATCH 3/4] doc(slic.php,changelog.md) add 1.5.1 version notes --- changelog.md | 4 ++++ slic.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 2c3605e..295285e 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +# [1.5.1] - 2023-11-20 +* Change - Allow controlling the value of the `WP_HTTP_BLOCK_EXTERNAL` constant using the `SLIC_WP_HTTP_BLOCK_EXTERNAL` environment variable defined in the `.env.slic.run` configuration file; set to `false` by default to block all outgoing HTTP requests from WordPress. +* Change - Allow controlling the value of the `DISABLE_WP_CRON` constant using the `SLIC_DISABLE_WP_CRON` environment variable defined in the `.env.slic.run` configuration file; set to `true` by default to disable the WordPress cron system. + # [1.5.0] - 2023-09-06 * Fix - Added `extra_hosts:"${host:-host}:host-gateway"` to slick-stack.yml for Linux compatibility, enabling Xdebug without modifying the XDH environment variable. [Ref](https://github.com/docker/for-linux/issues/264#issuecomment-785247571). diff --git a/slic.php b/slic.php index 25f4668..fd4ac6e 100644 --- a/slic.php +++ b/slic.php @@ -33,7 +33,7 @@ ] ); $cli_name = 'slic'; -const CLI_VERSION = '1.5.0'; +const CLI_VERSION = '1.5.1'; // If the run-time option `-q`, for "quiet", is specified, then do not print the header. if ( in_array( '-q', $argv, true ) || ( in_array( 'exec', $argv, true ) && ! in_array( 'help', $argv, true ) ) ) { From 45a72ddd8744df2f7a92902164c648376d0266b7 Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Mon, 20 Nov 2023 18:22:23 +0100 Subject: [PATCH 4/4] doc(changelog.md) fix default var value --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 295285e..33f7bec 100644 --- a/changelog.md +++ b/changelog.md @@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). # [1.5.1] - 2023-11-20 -* Change - Allow controlling the value of the `WP_HTTP_BLOCK_EXTERNAL` constant using the `SLIC_WP_HTTP_BLOCK_EXTERNAL` environment variable defined in the `.env.slic.run` configuration file; set to `false` by default to block all outgoing HTTP requests from WordPress. +* Change - Allow controlling the value of the `WP_HTTP_BLOCK_EXTERNAL` constant using the `SLIC_WP_HTTP_BLOCK_EXTERNAL` environment variable defined in the `.env.slic.run` configuration file; set to `true` by default to block all outgoing HTTP requests from WordPress. * Change - Allow controlling the value of the `DISABLE_WP_CRON` constant using the `SLIC_DISABLE_WP_CRON` environment variable defined in the `.env.slic.run` configuration file; set to `true` by default to disable the WordPress cron system. # [1.5.0] - 2023-09-06