diff --git a/templates/drupal10.settings.php.tmpl b/templates/drupal10.settings.php.tmpl index 532940c..17d47ce 100644 --- a/templates/drupal10.settings.php.tmpl +++ b/templates/drupal10.settings.php.tmpl @@ -35,6 +35,12 @@ $wodby['redis']['port'] = '{{ getenv "REDIS_PORT" "6379" }}'; $wodby['redis']['password'] = '{{ getenv "REDIS_PASSWORD" }}'; {{- end }} +$wodby['valkey']['host'] = '{{ getenv "VALKEY_HOST" "" }}'; +$wodby['valkey']['port'] = '{{ getenv "VALKEY_PORT" "6379" }}'; +{{- if getenv "VALKEY_PASSWORD" }} +$wodby['valkey']['password'] = '{{ getenv "VALKEY_PASSWORD" }}'; +{{- end }} + $wodby['solr_cloud']['password'] = '{{ getenv "SOLR_CLOUD_PASSWORD" }}'; $wodby['solr_cloud']['server'] = '{{ getenv "SOLR_CLOUD_SERVER" "solr" }}'; @@ -165,6 +171,22 @@ if (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'install') { $settings['container_yamls'][] = "$redis_module_path/example.services.yml"; } + + if (!empty($wodby['valkey']['host']) && $redis_module_path) { + $settings['redis.connection']['host'] = $wodby['valkey']['host']; + $settings['redis.connection']['port'] = $wodby['valkey']['port']; + if(isset($wodby['valkey']['password'])) { + $settings['redis.connection']['password'] = $wodby['valkey']['password']; + } + $settings['redis.connection']['base'] = 0; + $settings['redis.connection']['interface'] = 'PhpRedis'; + $settings['cache']['default'] = 'cache.backend.redis'; + $settings['cache']['bins']['bootstrap'] = 'cache.backend.chainedfast'; + $settings['cache']['bins']['discovery'] = 'cache.backend.chainedfast'; + $settings['cache']['bins']['config'] = 'cache.backend.chainedfast'; + + $settings['container_yamls'][] = "$redis_module_path/example.services.yml"; + } } if (!empty($wodby['solr_cloud']['password'])) { diff --git a/templates/drupal7.settings.php.tmpl b/templates/drupal7.settings.php.tmpl index 14a8ac7..61bedfd 100644 --- a/templates/drupal7.settings.php.tmpl +++ b/templates/drupal7.settings.php.tmpl @@ -36,6 +36,12 @@ $wodby['redis']['port'] = '{{ getenv "REDIS_PORT" "6379" }}'; $wodby['redis']['password'] = '{{ getenv "REDIS_PASSWORD" }}'; {{- end }} +$wodby['valkey']['host'] = '{{ getenv "VALKEY_HOST" "" }}'; +$wodby['valkey']['port'] = '{{ getenv "VALKEY_PORT" "6379" }}'; +{{- if getenv "VALKEY_PASSWORD" }} +$wodby['valkey']['password'] = '{{ getenv "VALKEY_PASSWORD" }}'; +{{- end }} + $conf['reverse_proxy_addresses'] = (function () { $internalSubnet = '172.17.0.0'; $internalBits = 16; @@ -163,6 +169,21 @@ if (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'install') { $conf['lock_inc'] = "$redis_module_path/redis.lock.inc"; $conf['path_inc'] = "$redis_module_path/redis.path.inc"; } + + if (!empty($wodby['valkey']['host']) && $redis_module_path) { + $conf['redis_client_host'] = $wodby['valkey']['host']; + $conf['redis_client_port'] = $wodby['valkey']['port']; + if(isset($wodby['valkey']['password'])) { + $conf['redis_client_password'] = $wodby['valkey']['password']; + } + $conf['redis_client_base'] = 0; + $conf['redis_client_interface'] = 'PhpRedis'; + $conf['cache_backends'][] = "$redis_module_path/redis.autoload.inc"; + $conf['cache_default_class'] = 'Redis_Cache'; + $conf['cache_class_cache_form'] = 'DrupalDatabaseCache'; + $conf['lock_inc'] = "$redis_module_path/redis.lock.inc"; + $conf['path_inc'] = "$redis_module_path/redis.path.inc"; + } } ini_set('session.gc_probability', 1); diff --git a/templates/drupal8.settings.php.tmpl b/templates/drupal8.settings.php.tmpl index 51fe0a7..0c2c6bf 100644 --- a/templates/drupal8.settings.php.tmpl +++ b/templates/drupal8.settings.php.tmpl @@ -35,6 +35,12 @@ $wodby['redis']['port'] = '{{ getenv "REDIS_PORT" "6379" }}'; $wodby['redis']['password'] = '{{ getenv "REDIS_PASSWORD" }}'; {{- end }} +$wodby['valkey']['host'] = '{{ getenv "VALKEY_HOST" "" }}'; +$wodby['valkey']['port'] = '{{ getenv "VALKEY_PORT" "6379" }}'; +{{- if getenv "VALKEY_PASSWORD" }} +$wodby['valkey']['password'] = '{{ getenv "VALKEY_PASSWORD" }}'; +{{- end }} + $wodby['solr_cloud']['password'] = '{{ getenv "SOLR_CLOUD_PASSWORD" }}'; $wodby['solr_cloud']['server'] = '{{ getenv "SOLR_CLOUD_SERVER" "solr" }}'; @@ -171,6 +177,22 @@ if (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'install') { $settings['container_yamls'][] = "$redis_module_path/example.services.yml"; } + + if (!empty($wodby['valkey']['host']) && $redis_module_path) { + $settings['redis.connection']['host'] = $wodby['valkey']['host']; + $settings['redis.connection']['port'] = $wodby['valkey']['port']; + if(isset($wodby['valkey']['password'])) { + $settings['redis.connection']['password'] = $wodby['valkey']['password']; + } + $settings['redis.connection']['base'] = 0; + $settings['redis.connection']['interface'] = 'PhpRedis'; + $settings['cache']['default'] = 'cache.backend.redis'; + $settings['cache']['bins']['bootstrap'] = 'cache.backend.chainedfast'; + $settings['cache']['bins']['discovery'] = 'cache.backend.chainedfast'; + $settings['cache']['bins']['config'] = 'cache.backend.chainedfast'; + + $settings['container_yamls'][] = "$redis_module_path/example.services.yml"; + } } if (!empty($wodby['solr_cloud']['password'])) { diff --git a/templates/drupal9.settings.php.tmpl b/templates/drupal9.settings.php.tmpl index 66dea60..c0828cb 100644 --- a/templates/drupal9.settings.php.tmpl +++ b/templates/drupal9.settings.php.tmpl @@ -35,6 +35,12 @@ $wodby['redis']['port'] = '{{ getenv "REDIS_PORT" "6379" }}'; $wodby['redis']['password'] = '{{ getenv "REDIS_PASSWORD" }}'; {{- end }} +$wodby['valkey']['host'] = '{{ getenv "VALKEY_HOST" "" }}'; +$wodby['valkey']['port'] = '{{ getenv "VALKEY_PORT" "6379" }}'; +{{- if getenv "VALKEY_PASSWORD" }} +$wodby['valkey']['password'] = '{{ getenv "VALKEY_PASSWORD" }}'; +{{- end }} + $wodby['solr_cloud']['password'] = '{{ getenv "SOLR_CLOUD_PASSWORD" }}'; $wodby['solr_cloud']['server'] = '{{ getenv "SOLR_CLOUD_SERVER" "solr" }}'; @@ -165,6 +171,22 @@ if (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'install') { $settings['container_yamls'][] = "$redis_module_path/example.services.yml"; } + + if (!empty($wodby['valkey']['host']) && $redis_module_path) { + $settings['redis.connection']['host'] = $wodby['valkey']['host']; + $settings['redis.connection']['port'] = $wodby['valkey']['port']; + if(isset($wodby['valkey']['password'])) { + $settings['redis.connection']['password'] = $wodby['valkey']['password']; + } + $settings['redis.connection']['base'] = 0; + $settings['redis.connection']['interface'] = 'PhpRedis'; + $settings['cache']['default'] = 'cache.backend.redis'; + $settings['cache']['bins']['bootstrap'] = 'cache.backend.chainedfast'; + $settings['cache']['bins']['discovery'] = 'cache.backend.chainedfast'; + $settings['cache']['bins']['config'] = 'cache.backend.chainedfast'; + + $settings['container_yamls'][] = "$redis_module_path/example.services.yml"; + } } if (!empty($wodby['solr_cloud']['password'])) { diff --git a/tests/10/compose.yml b/tests/10/compose.yml index 338e75b..edf350e 100644 --- a/tests/10/compose.yml +++ b/tests/10/compose.yml @@ -22,10 +22,10 @@ services: MYSQL_PASSWORD: drupal MYSQL_DATABASE: drupal - redis: - image: wodby/redis + valkey: + image: wodby/valkey environment: - REDIS_PASSWORD: redis + VALKEY_PASSWORD: valkey php: image: $IMAGE @@ -45,9 +45,9 @@ services: DB_PASSWORD: drupal DB_NAME: drupal DB_DRIVER: mysql - REDIS_HOST: redis - REDIS_PORT: 6379 - REDIS_PASSWORD: redis + VALKEY_HOST: valkey + VALKEY_PORT: 6379 + VALKEY_PASSWORD: valkey PHP_SENDMAIL_PATH: /bin/true PHP_ERROR_REPORTING: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED volumes: diff --git a/tests/10/tests.sh b/tests/10/tests.sh index 5bdfb9f..43f778b 100755 --- a/tests/10/tests.sh +++ b/tests/10/tests.sh @@ -59,10 +59,10 @@ run_action init-drupal drush si -y --db-url="${DB_DRIVER}://${DB_USER}:${DB_PASSWORD}@${DB_HOST}/${DB_NAME}" -# Comment out redis settings before enabling the module. -sed -i "s#^\$wodby\['redis'\]#//&#" "${CONF_DIR}/wodby.settings.php" +# Comment out valkey settings before enabling the module. +sed -i "s#^\$wodby\['valkey'\]#//&#" "${CONF_DIR}/wodby.settings.php" drush en redis -y --quiet -sed -i "s#^//\(\$wodby\['redis'\]\)#\1#" "${CONF_DIR}/wodby.settings.php" +sed -i "s#^//\(\$wodby\['valkey'\]\)#\1#" "${CONF_DIR}/wodby.settings.php" run_action cache-clear target=render run_action cache-rebuild diff --git a/tests/7/compose.yml b/tests/7/compose.yml index 5db2afc..176d169 100644 --- a/tests/7/compose.yml +++ b/tests/7/compose.yml @@ -22,10 +22,10 @@ services: MYSQL_PASSWORD: drupal MYSQL_DATABASE: drupal - redis: - image: wodby/redis + valkey: + image: wodby/valkey environment: - REDIS_PASSWORD: redis + VALKEY_PASSWORD: valkey varnish: image: wodby/varnish:4 @@ -63,9 +63,9 @@ services: VARNISH_TERMINAL_PORT: 6082 VARNISH_SECRET: secret VARNISH_VERSION: 4 - REDIS_HOST: redis - REDIS_PORT: 6379 - REDIS_PASSWORD: redis + VALKEY_HOST: valkey + VALKEY_PORT: 6379 + VALKEY_PASSWORD: valkey PHP_SENDMAIL_PATH: /bin/true volumes: - codebase:/var/www/html