diff --git a/CHANGELOG.md b/CHANGELOG.md index 715e5f5..93e1801 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +## v1.2.0 - [February 24, 2024](https://github.com/lando/backdrop/releases/tag/v1.2.0) + +### New Features + +* Added support for `php:8.3`. +* Added config testing. + +### Fixes + +* Fixed `CRITICAL` issue with default config files not loading correctly + +### Internal + +* Updated to `@lando/php@1.2.0` + ## v1.0.0 - [December 7, 2023](https://github.com/lando/backdrop/releases/tag/v1.0.0) * Changed default `php` version to `8.2` diff --git a/builders/backdrop.js b/builders/backdrop.js index a868bd2..fe0c5a9 100644 --- a/builders/backdrop.js +++ b/builders/backdrop.js @@ -19,7 +19,9 @@ module.exports = { build_as_root_internal: [], confSrc: path.resolve(__dirname, '..', 'config'), composer_version: '2', - defaultFiles: {}, + defaultFiles: { + php: 'php.ini', + }, database: 'mariadb:10.6', drush: '8.4.12', php: '8.2', @@ -59,7 +61,6 @@ module.exports = { // Rebase on top of any default config we might already have options.defaultFiles = _.merge({}, require('../utils/get-config-defaults')(_.cloneDeep(options)), options.defaultFiles); // eslint-disable-line max-len - // add relevant build steps for backdrush if (options.backdrush !== false) options.build.unshift(require('../utils/get-backdrush')(options)); // add relevant build steps for bee diff --git a/config/default.conf.tpl b/config/default.conf.tpl index 984f59a..5612a0d 100644 --- a/config/default.conf.tpl +++ b/config/default.conf.tpl @@ -1,3 +1,5 @@ +# LANDOBACKDROPNGINXCONF + server { listen 80 default_server; listen 443 ssl; diff --git a/config/mysql.cnf b/config/mysql.cnf index d85e082..0556bd3 100644 --- a/config/mysql.cnf +++ b/config/mysql.cnf @@ -1,6 +1,7 @@ # # The MySQL database server configuration file for Lando # +# LANDOBACKDROPMYSQLCNF [mysqld] # @@ -71,7 +72,7 @@ max_binlog_size = 100M #innodb_buffer_pool_size = 384M #innodb_additional_mem_pool_size = 20M # Set .._log_file_size to 25 % of buffer pool size -innodb_log_file_size = 100M +innodb_log_file_size = 101M #innodb_log_buffer_size = 8M innodb_flush_log_at_trx_commit = 0 #innodb_lock_wait_timeout = 50 @@ -82,7 +83,7 @@ innodb_open_files = 256 innodb_io_capacity = 512 innodb_flush_method = O_DIRECT innodb_thread_concurrency = 8 -innodb_lock_wait_timeout = 120 +innodb_lock_wait_timeout = 121 # # * Security Features # diff --git a/config/mysql8.cnf b/config/mysql8.cnf index de0fd89..e7cd1cd 100644 --- a/config/mysql8.cnf +++ b/config/mysql8.cnf @@ -1,6 +1,7 @@ # # The MySQL database server configuration file for Lando # +# LANDOBACKDROPMYSQL8CNF [mysqld] # @@ -49,7 +50,7 @@ read_buffer_size = 2M #server-id = 1 #log_bin = /src/.lando/log/mysql-bin.log expire_logs_days = 10 -max_binlog_size = 100M +max_binlog_size = 101M #binlog_do_db = include_database_name #binlog_ignore_db = include_database_name # @@ -77,7 +78,7 @@ innodb_open_files = 256 innodb_io_capacity = 512 innodb_flush_method = O_DIRECT innodb_thread_concurrency = 8 -innodb_lock_wait_timeout = 120 +innodb_lock_wait_timeout = 127 # # * Security Features # diff --git a/config/php.ini b/config/php.ini index a33dacf..026e681 100644 --- a/config/php.ini +++ b/config/php.ini @@ -1,5 +1,6 @@ [PHP] +; LANDOBACKDROPPHPINI ;;;;;;;;;;;;;;; ; PHP Globals ; ;;;;;;;;;;;;;;; @@ -36,8 +37,8 @@ xdebug.mode = ${XDEBUG_MODE} ; Globals expose_php = on -max_execution_time = 90 -max_input_time = 900 +max_execution_time = 91 +max_input_time = 901 max_input_vars = 10000 memory_limit = ${PHP_MEMORY_LIMIT} upload_max_filesize = 100M diff --git a/docs/index.md b/docs/index.md index 1c5f241..fd0a78c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,7 +12,7 @@ Lando offers a configurable [recipe](https://docs.lando.dev/core/v3/recipes.html #### Features of this plugin: -* Configurable `php` version from `5.3` all the way to `8.2` +* Configurable `php` version from `5.3` all the way to `8.3` * Configurable `webroot` * Configurable web server (`apache` or `nginx`) * Configurable database backend (`mariadb` or `mysql`) diff --git a/examples/backdrop-custom/.lando.yml b/examples/backdrop-custom/.lando.yml index 0652718..2c80e5b 100644 --- a/examples/backdrop-custom/.lando.yml +++ b/examples/backdrop-custom/.lando.yml @@ -1,7 +1,7 @@ name: backdrop-custom recipe: backdrop config: - php: '7.4' + php: '8.3' composer_version: '2.0.7' via: nginx:1.17 webroot: bob diff --git a/examples/backdrop-custom/README.md b/examples/backdrop-custom/README.md index 0821d10..71b48bd 100644 --- a/examples/backdrop-custom/README.md +++ b/examples/backdrop-custom/README.md @@ -28,8 +28,8 @@ lando ssh -s appserver -c "curl -L appserver_nginx" | grep "HI BOB" lando ssh -s appserver_nginx -c "nginx -v" 2>&1 | grep "nginx version" | grep "nginx/1.17" lando ssh -s appserver -c "curl -IL appserver_nginx" | grep Server | grep nginx -# Should use php 7.4 -lando php -v | grep "PHP 7.4" +# Should use php 8.3 +lando php -v | grep "PHP 8.3" # Should use composer 2.0.7 lando ssh -s appserver -c "/bin/sh -c 'NO_COLOR=1 composer -V'" | grep "Composer version 2.0.7" diff --git a/examples/backdrop-defaults/README.md b/examples/backdrop-defaults/README.md index 07e69e3..fa9869a 100644 --- a/examples/backdrop-defaults/README.md +++ b/examples/backdrop-defaults/README.md @@ -45,6 +45,12 @@ lando bee version | grep "Bee for Backdrop CMS" | grep "1.x-1.x" # Should use composer 2 by default lando ssh -s appserver -c "/bin/sh -c 'NO_COLOR=1 composer -V'" | grep "Composer version 2." + +# Should use the correct default config files +lando ssh -s appserver -c "cat /usr/local/etc/php/conf.d/zzz-lando-my-custom.ini" | grep "; LANDOBACKDROPPHPINI" +lando ssh -s appserver -c "curl -L http://localhost/info.php" | grep max_execution_time | grep 91 +lando ssh -s database -c "cat /opt/bitnami/mariadb/conf/my_custom.cnf" | grep "LANDOBACKDROPMYSQLCNF" +lando mysql -u root -e "show variables;" | grep innodb_lock_wait_timeout | grep 121 ``` Destroy tests diff --git a/examples/backdrop-mysql8/README.md b/examples/backdrop-mysql8/README.md index f2b201d..a821b11 100644 --- a/examples/backdrop-mysql8/README.md +++ b/examples/backdrop-mysql8/README.md @@ -36,6 +36,10 @@ lando mysql -V | grep "mysql"| grep "Ver 8.0.22" # Should be able to connect to the database with the default creds lando mysql backdrop -e quit + +# Should use the defauly mysql8 config file +lando ssh -s database -c "cat /opt/bitnami/mysql/conf/my_custom.cnf" | grep "LANDOBACKDROPMYSQL8CNF" +lando mysql -u root -e "show variables;" | grep innodb_lock_wait_timeout | grep 127 ``` Destroy tests diff --git a/examples/backdrop-nginx/README.md b/examples/backdrop-nginx/README.md index e9846e0..d4a0426 100644 --- a/examples/backdrop-nginx/README.md +++ b/examples/backdrop-nginx/README.md @@ -32,6 +32,9 @@ lando nginx -v 2>&1 | grep "nginx version" | grep "nginx/1.25" # Should use the php version specified by the user eg 7.4 lando php -v | grep "PHP 7.4" + +# Should load the correct default nginx config +lando ssh -s appserver_nginx -c "cat /opt/bitnami/nginx/conf/vhosts/lando.conf" | grep "LANDOBACKDROPNGINXCONF" ``` Destroy tests diff --git a/package-lock.json b/package-lock.json index bae7ebd..d457374 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,14 +6,14 @@ "packages": { "": { "name": "@lando/backdrop", - "version": "1.0.0", + "version": "1.1.0", "license": "GPL-3.0", "dependencies": { "@lando/mariadb": "^1.0.0", "@lando/mssql": "^1.0.0", "@lando/mysql": "^1.0.0", "@lando/nginx": "^1.0.0", - "@lando/php": "^1.0.0", + "@lando/php": "^1.2.0", "@lando/postgres": "^1.0.0", "lodash": "^4.17.21" }, @@ -1481,9 +1481,9 @@ "license": "MIT" }, "node_modules/@lando/php": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@lando/php/-/php-1.0.0.tgz", - "integrity": "sha512-V8agZOazxpeytCV/OxcL7oxgRQq+lVyb7EyOCPNsBAlXQ2LEOVzbXhFufC1exhOoLxTHu18jdOyx44E5vlc3mg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@lando/php/-/php-1.2.0.tgz", + "integrity": "sha512-afFC6qiUZHR61KeRAwGmJUrCtd0LfMyHhArsluT+xuscBR1/55h7SXgl3os6pHoyJl0oKEFGkbiAdxlqOq3ZKA==", "bundleDependencies": [ "@lando/nginx", "lodash", @@ -8620,9 +8620,9 @@ } }, "@lando/php": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@lando/php/-/php-1.0.0.tgz", - "integrity": "sha512-V8agZOazxpeytCV/OxcL7oxgRQq+lVyb7EyOCPNsBAlXQ2LEOVzbXhFufC1exhOoLxTHu18jdOyx44E5vlc3mg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@lando/php/-/php-1.2.0.tgz", + "integrity": "sha512-afFC6qiUZHR61KeRAwGmJUrCtd0LfMyHhArsluT+xuscBR1/55h7SXgl3os6pHoyJl0oKEFGkbiAdxlqOq3ZKA==", "requires": { "@lando/nginx": "0.11.0", "lodash": "^4.17.21", diff --git a/package.json b/package.json index 232a11f..4aa6279 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "@lando/mssql": "^1.0.0", "@lando/mysql": "^1.0.0", "@lando/nginx": "^1.0.0", - "@lando/php": "^1.0.0", + "@lando/php": "^1.2.0", "@lando/postgres": "^1.0.0", "lodash": "^4.17.21" }, diff --git a/utils/get-config-defaults.js b/utils/get-config-defaults.js index 7d62fb8..dcaeea3 100644 --- a/utils/get-config-defaults.js +++ b/utils/get-config-defaults.js @@ -6,7 +6,7 @@ const fs = require('fs'); module.exports = options => { // Get the viaconf - if (options.webserver.type === 'nginx') options.defaultFiles.vhosts = 'default.conf.tpl'; + if (_.startsWith(options.via, 'nginx')) options.defaultFiles.vhosts = 'default.conf.tpl'; // Get the default db conf const dbConfig = _.get(options, 'database', 'mysql'); @@ -26,4 +26,7 @@ module.exports = options => { delete options.defaultFiles[type]; } }); + + // Return + return options.defaultFiles; }; diff --git a/utils/get-service-config.js b/utils/get-service-config.js index 07171ba..c065eb7 100644 --- a/utils/get-service-config.js +++ b/utils/get-service-config.js @@ -2,6 +2,7 @@ // Modules const _ = require('lodash'); +const path = require('path'); module.exports = (options, types = ['php', 'server', 'vhosts']) => { const config = {};