├── .node-version ├── docs ├── public │ ├── .!77352!favicon.ico │ ├── favicon.ico │ ├── images │ │ ├── icon.png │ │ ├── logo.png │ │ ├── drupal7-extant │ │ │ ├── landoInfo.jpg │ │ │ ├── landoInit.jpg │ │ │ ├── landoAppName.jpg │ │ │ ├── landoStart.jpg │ │ │ ├── landoWebroot.jpg │ │ │ └── landoCodeBase.jpg │ │ ├── icon.svg │ │ ├── drupalicon.svg │ │ └── logo.svg │ ├── contact.html │ └── favicon.svg ├── .vitepress │ ├── theme │ │ └── index.mjs │ └── config.mjs ├── team.md ├── guides.md ├── support.md ├── .eslintrc.json ├── v │ └── index.md ├── index.md ├── install.md ├── legacy │ ├── drupal-6.md │ └── drupal-7.md ├── guides │ ├── landoify-d7.md │ └── drupal-multisite.md ├── getting-started.md └── tooling.md ├── examples ├── drupal10 │ ├── .gitignore │ └── README.md ├── drupal11 │ ├── .gitignore │ └── README.md ├── drupal6 │ ├── .gitignore │ └── README.md ├── drupal7 │ ├── .gitignore │ ├── lando.local.yml │ └── README.md ├── drupal8 │ ├── .gitignore │ ├── .lando.local.yml │ └── README.md ├── drupal9 │ ├── .gitignore │ └── README.md ├── drupal-custom │ ├── bob │ │ ├── index.php │ │ └── info.php │ ├── .lando.yml │ ├── config │ │ ├── default.conf │ │ ├── php.ini │ │ └── mysql.cnf │ └── README.md ├── drupal-defaults │ ├── index.php │ ├── info.php │ ├── .lando.yml │ └── README.md ├── drupal-export │ ├── index.php │ ├── info.php │ ├── .gitignore │ ├── .lando.yml │ ├── README.md │ └── mysql-test.sql ├── drupal-import │ ├── index.php │ ├── info.php │ ├── test.sh │ ├── .lando.yml │ ├── big-bad-dump.sql │ ├── README.md │ ├── mysql-test.sql │ └── subdir │ │ └── test.sql ├── drupal-mysql8 │ ├── .gitignore │ └── README.md ├── drupal-nginx │ ├── web │ │ ├── index.php │ │ └── info.php │ ├── .lando.yml │ └── README.md ├── drupal10-mysql8 │ ├── .gitignore │ └── README.md ├── drupal10-nginx │ ├── .gitignore │ └── README.md ├── drupal11-nginx │ ├── .gitignore │ └── README.md ├── drupal-mariadb-mysql │ ├── web │ │ ├── index.php │ │ └── info.php │ ├── .lando.yml │ └── README.md ├── drupal-mariadb │ ├── web │ │ ├── index.php │ │ └── info.php │ ├── .lando.yml │ └── README.md ├── drupal11-mysql84 │ ├── .gitignore │ └── README.md ├── .lando.upstream.yml └── .lando.yml ├── index.js ├── .eslintignore ├── .npmignore ├── .github ├── ISSUE_TEMPLATE │ ├── misc.md │ ├── feature_request.md │ ├── bug_report.md │ ├── documentation.md │ └── security.md ├── FUNDING.yml ├── workflows │ ├── label-add-to-project.yml │ ├── pr-linter.yml │ ├── pr-unit-tests.yml │ ├── pr-docs-tests.yml │ ├── pr-drupal-tests.yml │ └── release.yml ├── dependabot.yml └── PULL_REQUEST_TEMPLATE.md ├── test └── auth.spec.js ├── inits ├── drupal7.js ├── drupal8.js ├── drupal6.js ├── drupal10.js ├── drupal9.js └── drupal11.js ├── .editorconfig ├── .gitattributes ├── lib ├── warnings.js └── utils.js ├── .lando.yml ├── .gitignore ├── .eslintrc.json ├── LICENSE ├── config ├── drupal10 │ ├── php.ini │ ├── mysql8.cnf │ ├── mysql.cnf │ └── default.conf.tpl ├── drupal11 │ ├── php.ini │ ├── mysql8.cnf │ ├── mysql.cnf │ └── default.conf.tpl ├── drupal7 │ ├── php.ini │ ├── mysql8.cnf │ ├── mysql.cnf │ └── default.conf.tpl ├── drupal8 │ ├── php.ini │ ├── mysql8.cnf │ ├── mysql.cnf │ └── default.conf.tpl ├── drupal9 │ ├── php.ini │ ├── mysql8.cnf │ ├── mysql.cnf │ └── default.conf.tpl └── drupal6 │ ├── php.ini │ ├── mysql8.cnf │ ├── mysql.cnf │ └── default.conf.tpl ├── plugin.yml ├── netlify.toml ├── package.json └── README.md /.node-version: -------------------------------------------------------------------------------- 1 | 20 2 | -------------------------------------------------------------------------------- /docs/public/.!77352!favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/drupal10/.gitignore: -------------------------------------------------------------------------------- 1 | drupal10 2 | -------------------------------------------------------------------------------- /examples/drupal11/.gitignore: -------------------------------------------------------------------------------- 1 | drupal11 2 | -------------------------------------------------------------------------------- /examples/drupal6/.gitignore: -------------------------------------------------------------------------------- 1 | drupal6 2 | -------------------------------------------------------------------------------- /examples/drupal7/.gitignore: -------------------------------------------------------------------------------- 1 | drupal7 2 | -------------------------------------------------------------------------------- /examples/drupal8/.gitignore: -------------------------------------------------------------------------------- 1 | drupal8 2 | -------------------------------------------------------------------------------- /examples/drupal9/.gitignore: -------------------------------------------------------------------------------- 1 | drupal9 2 | -------------------------------------------------------------------------------- /examples/drupal-custom/bob/index.php: -------------------------------------------------------------------------------- 1 | HI BOB 2 | -------------------------------------------------------------------------------- /examples/drupal-defaults/index.php: -------------------------------------------------------------------------------- 1 | DEFAULTS 2 | -------------------------------------------------------------------------------- /examples/drupal-export/index.php: -------------------------------------------------------------------------------- 1 | DEFAULTS 2 | -------------------------------------------------------------------------------- /examples/drupal-import/index.php: -------------------------------------------------------------------------------- 1 | DEFAULTS 2 | -------------------------------------------------------------------------------- /examples/drupal-mysql8/.gitignore: -------------------------------------------------------------------------------- 1 | mysql8 2 | -------------------------------------------------------------------------------- /examples/drupal-nginx/web/index.php: -------------------------------------------------------------------------------- 1 | NGINX 2 | -------------------------------------------------------------------------------- /examples/drupal10-mysql8/.gitignore: -------------------------------------------------------------------------------- 1 | mysql8 2 | -------------------------------------------------------------------------------- /examples/drupal10-nginx/.gitignore: -------------------------------------------------------------------------------- 1 | nginx 2 | -------------------------------------------------------------------------------- /examples/drupal11-nginx/.gitignore: -------------------------------------------------------------------------------- 1 | nginx 2 | -------------------------------------------------------------------------------- /examples/drupal-mariadb-mysql/web/index.php: -------------------------------------------------------------------------------- 1 | MySQL 2 | -------------------------------------------------------------------------------- /examples/drupal-mariadb/web/index.php: -------------------------------------------------------------------------------- 1 | MariaDB 2 | -------------------------------------------------------------------------------- /examples/drupal11-mysql84/.gitignore: -------------------------------------------------------------------------------- 1 | drupal11 2 | -------------------------------------------------------------------------------- /examples/drupal-defaults/info.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /examples/drupal-export/info.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /examples/drupal-import/info.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /examples/drupal-nginx/web/info.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /examples/drupal-custom/bob/info.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /examples/drupal-mariadb/web/info.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = () => {}; 4 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | temp 2 | cache 3 | dist 4 | _site 5 | !.vitepress 6 | -------------------------------------------------------------------------------- /examples/drupal-mariadb-mysql/web/info.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /examples/.lando.upstream.yml: -------------------------------------------------------------------------------- 1 | plugins: 2 | "@lando/drupal": ../../.. 3 | -------------------------------------------------------------------------------- /examples/.lando.yml: -------------------------------------------------------------------------------- 1 | name: placeholder 2 | plugins: 3 | "@lando/drupal": .. 4 | -------------------------------------------------------------------------------- /examples/drupal-export/.gitignore: -------------------------------------------------------------------------------- 1 | *.sql 2 | *.gz 3 | *.zip 4 | !mysql-test.sql 5 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .github 2 | .nyc_output 3 | coverage 4 | docs 5 | examples 6 | guides 7 | test 8 | -------------------------------------------------------------------------------- /docs/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/drupal/HEAD/docs/public/favicon.ico -------------------------------------------------------------------------------- /docs/public/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/drupal/HEAD/docs/public/images/icon.png -------------------------------------------------------------------------------- /docs/public/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/drupal/HEAD/docs/public/images/logo.png -------------------------------------------------------------------------------- /examples/drupal7/lando.local.yml: -------------------------------------------------------------------------------- 1 | proxy: 2 | appserver: 3 | - another.lando-drupal7.lndo.site 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/misc.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Misc 3 | about: Create basically every other kind of issue 4 | labels: task 5 | --- 6 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/index.mjs: -------------------------------------------------------------------------------- 1 | import VPLTheme from '@lando/vitepress-theme-default-plus'; 2 | 3 | export default VPLTheme; 4 | -------------------------------------------------------------------------------- /examples/drupal-import/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Just a simple show of our DB tables 4 | mysql -u root drupal10 -e "show tables;" 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature 3 | about: Suggest an idea for this project 4 | labels: feature 5 | --- 6 | -------------------------------------------------------------------------------- /docs/public/images/drupal7-extant/landoInfo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/drupal/HEAD/docs/public/images/drupal7-extant/landoInfo.jpg -------------------------------------------------------------------------------- /docs/public/images/drupal7-extant/landoInit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/drupal/HEAD/docs/public/images/drupal7-extant/landoInit.jpg -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug 3 | about: Create a bug report to help us improve this plugin 4 | labels: bug 5 | --- 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Docs 3 | about: Suggest a documentation change or improvement 4 | labels: docs 5 | --- 6 | -------------------------------------------------------------------------------- /docs/public/images/drupal7-extant/landoAppName.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/drupal/HEAD/docs/public/images/drupal7-extant/landoAppName.jpg -------------------------------------------------------------------------------- /docs/public/images/drupal7-extant/landoStart.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/drupal/HEAD/docs/public/images/drupal7-extant/landoStart.jpg -------------------------------------------------------------------------------- /docs/public/images/drupal7-extant/landoWebroot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/drupal/HEAD/docs/public/images/drupal7-extant/landoWebroot.jpg -------------------------------------------------------------------------------- /docs/public/images/drupal7-extant/landoCodeBase.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/drupal/HEAD/docs/public/images/drupal7-extant/landoCodeBase.jpg -------------------------------------------------------------------------------- /examples/drupal-export/.lando.yml: -------------------------------------------------------------------------------- 1 | name: drupal-exports 2 | recipe: drupal10 3 | 4 | # do not remove this 5 | plugins: 6 | "@lando/drupal": ../.. 7 | -------------------------------------------------------------------------------- /examples/drupal-defaults/.lando.yml: -------------------------------------------------------------------------------- 1 | name: drupal-defaults 2 | recipe: drupal10 3 | 4 | # do not remove this 5 | plugins: 6 | "@lando/drupal": ../.. 7 | -------------------------------------------------------------------------------- /test/auth.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const chai = require('chai'); 4 | chai.should(); 5 | 6 | describe('auth', () => { 7 | it('should have tests'); 8 | }); 9 | -------------------------------------------------------------------------------- /inits/drupal7.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* 4 | * Init Lamp 5 | */ 6 | module.exports = { 7 | name: 'drupal7', 8 | defaults: { 9 | 'php': '7.4', 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /inits/drupal8.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* 4 | * Init Lamp 5 | */ 6 | module.exports = { 7 | name: 'drupal8', 8 | defaults: { 9 | 'php': '7.3', 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [lando, pirog] 4 | patreon: devwithlando 5 | open_collective: devwithlando 6 | custom: https://lando.dev/join 7 | -------------------------------------------------------------------------------- /inits/drupal6.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* 4 | * Init Lamp 5 | */ 6 | module.exports = { 7 | name: 'drupal6', 8 | defaults: { 9 | 'php': '5.6', 10 | 'drush': '8.4.5', 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /examples/drupal-mariadb/.lando.yml: -------------------------------------------------------------------------------- 1 | name: lando-drupal-mariadb 2 | recipe: drupal10 3 | config: 4 | php: '8.3' 5 | composer_version: 2.7.4 6 | webroot: web 7 | database: 'mariadb:11.3' 8 | plugins: 9 | '@lando/drupal': ../.. 10 | -------------------------------------------------------------------------------- /inits/drupal10.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* 4 | * Init Lamp 5 | */ 6 | module.exports = { 7 | name: 'drupal10', 8 | defaults: { 9 | 'php': '8.1', 10 | 'drush': '^11', 11 | 'composer_version': '2-latest', 12 | }, 13 | }; 14 | -------------------------------------------------------------------------------- /inits/drupal9.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* 4 | * Init Lamp 5 | */ 6 | module.exports = { 7 | name: 'drupal9', 8 | defaults: { 9 | 'php': '8.0', 10 | 'drush': '^11', 11 | 'composer_version': '2-latest', 12 | }, 13 | }; 14 | -------------------------------------------------------------------------------- /examples/drupal-mariadb-mysql/.lando.yml: -------------------------------------------------------------------------------- 1 | name: lando-drupal-mariadb-mysql 2 | recipe: drupal10 3 | config: 4 | php: '8.3' 5 | composer_version: 2.7.4 6 | webroot: web 7 | database: 'mariadb:10.3' 8 | plugins: 9 | '@lando/drupal': ../.. 10 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # top-most EditorConfig file 2 | root = true 3 | 4 | # Unix-style newlines with a newline ending every file 5 | [*] 6 | end_of_line = lf 7 | insert_final_newline = true 8 | charset = utf-8 9 | 10 | [*.js] 11 | indent_style = space 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /examples/drupal-nginx/.lando.yml: -------------------------------------------------------------------------------- 1 | name: drupal-nginx 2 | recipe: drupal10 3 | config: 4 | via: nginx 5 | webroot: web 6 | php: 7.4 7 | 8 | tooling: 9 | nginx: 10 | service: appserver_nginx 11 | 12 | # do not remove this 13 | plugins: 14 | "@lando/drupal": ../.. 15 | -------------------------------------------------------------------------------- /examples/drupal-import/.lando.yml: -------------------------------------------------------------------------------- 1 | name: drupal-import 2 | recipe: drupal10 3 | 4 | events: 5 | post-db-import: 6 | - database: /app/test.sh 7 | - database: echo "i-ran" > /tmp/iran.txt 8 | - echo "stuff" 9 | 10 | # do not remove this 11 | plugins: 12 | "@lando/drupal": ../.. 13 | -------------------------------------------------------------------------------- /inits/drupal11.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* 4 | * Init Lamp 5 | */ 6 | module.exports = { 7 | name: 'drupal11', 8 | defaults: { 9 | 'php': '8.3', 10 | 'via': 'apache:2.4', 11 | 'database': 'mysql:8.0', 12 | 'composer_version': '2-latest', 13 | 'drush': '^13', 14 | }, 15 | }; 16 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto 3 | 4 | # Declare files that will always have LF line endings on checkout. 5 | *.js text eol=lf 6 | *.sh text eol=lf 7 | *.conf text eol=lf 8 | *.cnf text eol=lf 9 | *.ini text eol=lf 10 | *.php text eol=lf 11 | *.vcl text eol=lf 12 | -------------------------------------------------------------------------------- /lib/warnings.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // Modules 4 | 5 | exports.drushWarn = version => ({ 6 | title: 'May need site-local drush', 7 | detail: [ 8 | `Lando has detected you are trying to globally install drush ${version}`, 9 | 'This version of drush prefers a site-local installation', 10 | 'We recommend you install drush that way, see:', 11 | ], 12 | url: 'https://www.drush.org/install/', 13 | }); 14 | -------------------------------------------------------------------------------- /examples/drupal-custom/.lando.yml: -------------------------------------------------------------------------------- 1 | name: drupal-custom 2 | recipe: drupal10 3 | config: 4 | php: '8.3' 5 | composer_version: '2.0.7' 6 | via: nginx:1.17 7 | webroot: bob 8 | database: mysql:5.7 9 | xdebug: true 10 | ssl: true 11 | config: 12 | database: config/mysql.cnf 13 | php: config/php.ini 14 | vhosts: config/default.conf 15 | 16 | # do not remove this 17 | plugins: 18 | "@lando/drupal": ../.. 19 | 20 | -------------------------------------------------------------------------------- /docs/public/contact.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /.lando.yml: -------------------------------------------------------------------------------- 1 | name: docs.drupal 2 | proxy: 3 | cli: 4 | - docs.drupal.lndo.site:5173 5 | services: 6 | cli: 7 | api: 4 8 | image: node:20 9 | command: sleep infinity 10 | ports: 11 | - 5173:5173/http 12 | scanner: false 13 | user: node 14 | build: 15 | app: | 16 | npm install 17 | tooling: 18 | node: 19 | service: cli 20 | npm: 21 | service: cli 22 | vitepress: 23 | service: cli 24 | cmd: npx vitepress 25 | -------------------------------------------------------------------------------- /examples/drupal8/.lando.local.yml: -------------------------------------------------------------------------------- 1 | name: lando-drupal8 # this can be removed when we release the new lando 3.17.x cli 2 | excludes: 3 | - core 4 | - vendor 5 | config: 6 | drush: false 7 | events: 8 | post-start: 9 | - appserver: env | grep "PATH" | grep "/app/vendor/bin" 10 | - appserver: /app/vendor/bin/drush status || drush status 11 | services: 12 | appserver: 13 | build: 14 | - composer require -n drush/drush:10.2.1 15 | plugins: 16 | "@lando/drupal": ../../.. 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Common sys files 2 | .*.swp 3 | ._* 4 | .git 5 | .hg 6 | .sign 7 | .lock-wscript 8 | .svn 9 | .wafpickle-* 10 | .DS_Store 11 | .idea/ 12 | *.tar 13 | *.jxp 14 | *.sublime-* 15 | 16 | # Logs 17 | *.log 18 | logs 19 | 20 | # NPM files 21 | node_modules 22 | 23 | # lando config 24 | env.yaml 25 | env.yml 26 | lando.env 27 | 28 | # Build dirs 29 | build 30 | dist 31 | 32 | # coverage reporting 33 | .nyc_output 34 | coverage/ 35 | 36 | # docs 37 | .temp 38 | .cache 39 | _site 40 | dist 41 | cache 42 | temp 43 | config.*.timestamp-*-*.* 44 | 45 | # YARN 46 | yarn.lock 47 | -------------------------------------------------------------------------------- /.github/workflows/label-add-to-project.yml: -------------------------------------------------------------------------------- 1 | name: Add to Contrib Project 2 | 3 | on: 4 | issues: 5 | types: [labeled] 6 | pull_request: 7 | types: [labeled] 8 | 9 | jobs: 10 | add_to_project: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Add issue/PR to GitHub Project 14 | if: github.event.label.name == 'flag' 15 | uses: actions/add-to-project@v1.0.2 16 | with: 17 | project-url: https://github.com/orgs/lando/projects/7 18 | github-token: ${{ secrets.SHADOW_COUNCIL_ESCALATOR }} 19 | labeled: flag 20 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "npm" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | allow: 8 | - dependency-name: "@lando/*" 9 | - package-ecosystem: "github-actions" 10 | directory: "/" 11 | schedule: 12 | interval: "weekly" 13 | groups: 14 | actions: 15 | applies-to: version-updates 16 | update-types: [ "major", "minor", "patch" ] 17 | 18 | ignore: 19 | - dependency-name: "lando/prepare-release-action" 20 | versions: ["99", "99.x.x"] # v99 used for internal testing 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/security.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Security 3 | about: Create a security issue 4 | labels: security 5 | --- 6 | 7 | **DO NOT SUBMIT A SECURITY ISSUE HERE!** 8 | 9 | If you have discovered a security issue with Lando, please contact the Lando Security Team directly at [security@devwithlando.io](mailto:security@devwithlando.io). 10 | 11 | We manage security issues separately in a private repository until the issue has been resolved. Even if you're not sure if it's a security problem, please contact the security team before filing an issue, blogging, or tweeting about it. 12 | 13 | **DO NOT SUBMIT A SECURITY ISSUE HERE!** 14 | -------------------------------------------------------------------------------- /docs/team.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn about the team that made the Drupal plugin. 3 | layout: page 4 | title: Team 5 | --- 6 | 7 | 8 | 9 | 12 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.github/workflows/pr-linter.yml: -------------------------------------------------------------------------------- 1 | name: Lint Code 2 | 3 | on: 4 | pull_request: 5 | 6 | jobs: 7 | lint: 8 | runs-on: ${{ matrix.os }} 9 | strategy: 10 | matrix: 11 | os: 12 | - ubuntu-24.04 13 | node-version: 14 | - '20' 15 | steps: 16 | - name: Checkout code 17 | uses: actions/checkout@v6 18 | - name: Install node ${{ matrix.node-version }} 19 | uses: actions/setup-node@v6 20 | with: 21 | node-version: ${{ matrix.node-version }} 22 | cache: npm 23 | - name: Install NPM dependencies 24 | run: npm clean-install --prefer-offline --frozen-lockfile 25 | - name: Run code linter 26 | run: npm run lint 27 | -------------------------------------------------------------------------------- /docs/guides.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Home helpful guides for the Drupal recipe. 3 | layout: page 4 | title: Guides 5 | sidebar: false 6 | --- 7 | 8 | 15 | 16 | 17 | 18 | 21 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/support.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Contact Us 3 | description: Get help and support for the Lando Drupal Plugin 4 | --- 5 | 6 | # Contact Us 7 | 8 | If you need priority and dedicated support, expediated bug fixes or more features then please contact us below. 9 | 10 |
11 | 12 |

13 | 14 |

15 |

16 | 17 |

18 |

19 | 20 |

21 |

22 | 23 |

24 |
-------------------------------------------------------------------------------- /examples/drupal-import/big-bad-dump.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE categories( 2 | categoryId INT AUTO_INCREMENT PRIMARY KEY, 3 | categoryName VARCHAR(100) NOT NULL 4 | ) ENGINE=INNODB; 5 | 6 | CREATE TABLE products( 7 | productId INT AUTO_INCREMENT PRIMARY KEY, 8 | productName varchar(100) not null, 9 | categoryId INT, 10 | price INT, 11 | CONSTRAINT fk_category 12 | FOREIGN KEY (categoryId) 13 | REFERENCES categories(categoryId) 14 | ) ENGINE=INNODB; 15 | 16 | CREATE TABLE `Some-Such`( 17 | id INT AUTO_INCREMENT PRIMARY KEY, 18 | name VARCHAR(100) NOT NULL 19 | ) ENGINE=INNODB; 20 | 21 | CREATE VIEW expensive AS 22 | SELECT productName, price 23 | FROM products 24 | WHERE price > (SELECT AVG(price) FROM products); 25 | -------------------------------------------------------------------------------- /docs/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "@babel/eslint-parser", 3 | "parserOptions": { 4 | "sourceType": "module", 5 | "ecmaVersion": 8, 6 | "requireConfigFile": false 7 | }, 8 | "extends": [ 9 | "plugin:vue/recommended", 10 | "google" 11 | ], 12 | "root": true, 13 | "rules": { 14 | "linebreak-style": 0, 15 | "arrow-parens": ["error", 16 | "as-needed" 17 | ], 18 | "max-len": ["error", { 19 | "code": 12000, 20 | "ignoreComments": true 21 | }], 22 | "require-jsdoc": ["error", { 23 | "require": { 24 | "FunctionDeclaration": false, 25 | "MethodDefinition": false, 26 | "ClassDeclaration": false, 27 | "ArrowFunctionExpression": false, 28 | "FunctionExpression": false 29 | } 30 | }] 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /docs/public/favicon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/public/images/icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/workflows/pr-unit-tests.yml: -------------------------------------------------------------------------------- 1 | name: Run Unit Tests 2 | 3 | on: 4 | pull_request: 5 | 6 | jobs: 7 | unit-tests: 8 | runs-on: ${{ matrix.os }} 9 | strategy: 10 | fail-fast: false 11 | matrix: 12 | os: 13 | - windows-2022 14 | - ubuntu-24.04 15 | - macos-15 16 | node-version: 17 | - '20' 18 | steps: 19 | - name: Checkout code 20 | uses: actions/checkout@v6 21 | - name: Install node ${{ matrix.node-version }} 22 | uses: actions/setup-node@v6 23 | with: 24 | node-version: ${{ matrix.node-version }} 25 | cache: npm 26 | - name: Install NPM dependencies 27 | run: npm clean-install --prefer-offline --frozen-lockfile 28 | - name: Run unit tests 29 | run: npm run test:unit 30 | -------------------------------------------------------------------------------- /docs/v/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: All Other documentation versions 3 | title: Docuverse 4 | contributors: false 5 | lastUpdated: false 6 | editLink: false 7 | next: false 8 | prev: false 9 | --- 10 | # Docuverse 11 | 12 |
13 |
14 | 15 | 27 | 28 |
29 | 30 |
31 | 32 |
33 | 34 | 40 | -------------------------------------------------------------------------------- /docs/public/images/drupalicon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Drupal Lando Plugin 3 | description: Use Drupal on Lando for local development; powered by Docker and Docker Compose, config PHP version, swap db backends or webserver, use Composer, Drush, Xdebug and custom config files, oh and also import and exports databases. 4 | next: ./getting-started.html 5 | --- 6 | 7 | # Drupal 8 | 9 | Drupal is a free and open source content-management framework written in PHP and distributed under the GNU General Public License. Drupal provides a back-end framework for at least 2.3% of all web sites worldwide – ranging from personal blogs to corporate, political, and government sites. 10 | 11 | #### Features of this plugin: 12 | 13 | * Supports `drupal6`, `drupal7`, `drupal8`, `drupal9`, `drupal10` and `drupal11`. 14 | * Configurable `php` version from `5.3` all the way to `8.4+` 15 | * Configurable `webroot` 16 | * Configurable web server (`apache` or `nginx`) 17 | * Configurable database backend (`mariadb`, `mysql`, `postgres`) 18 | * Configurable `composer` and `drush` 19 | * `xdebug` 20 | -------------------------------------------------------------------------------- /examples/drupal-custom/config/default.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen 443 ssl; 4 | 5 | server_name pirog; 6 | 7 | ssl_certificate /certs/cert.crt; 8 | ssl_certificate_key /certs/cert.key; 9 | ssl_verify_client off; 10 | 11 | ssl_session_cache shared:SSL:1m; 12 | ssl_session_timeout 5m; 13 | 14 | ssl_ciphers HIGH:!aNULL:!MD5; 15 | ssl_prefer_server_ciphers on; 16 | 17 | root "{{LANDO_WEBROOT}}"; 18 | 19 | index index.html index.htm index.php; 20 | 21 | port_in_redirect off; 22 | client_max_body_size 100M; 23 | 24 | location / { 25 | error_page 404 = @drupal; 26 | } 27 | 28 | location @drupal { 29 | rewrite ^(.*)$ /index.php?q=$1 last; 30 | } 31 | 32 | location ~ \.php$ { 33 | fastcgi_pass fpm:9000; 34 | include fastcgi_params; 35 | fastcgi_param HTTP_PROXY ""; 36 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 37 | fastcgi_param PATH_INFO $fastcgi_path_info; 38 | fastcgi_param QUERY_STRING $query_string; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "node": true, 4 | "mocha": true, 5 | "es2021": true 6 | }, 7 | "parser": "@babel/eslint-parser", 8 | "parserOptions": { 9 | "sourceType": "module", 10 | "ecmaVersion": 8, 11 | "requireConfigFile": false 12 | }, 13 | "extends": [ 14 | "eslint:recommended", 15 | "google" 16 | ], 17 | "rules": { 18 | "arrow-parens": ["error", 19 | "as-needed" 20 | ], 21 | "max-len": ["error", { 22 | "code": 140, 23 | "ignoreComments": true 24 | }], 25 | "no-empty": ["error", { 26 | "allowEmptyCatch": true 27 | }], 28 | "no-unused-vars": ["error", { 29 | "vars": "all", 30 | "args": "after-used", 31 | "ignoreRestSiblings": false 32 | }], 33 | 34 | "require-jsdoc": ["error", { 35 | "require": { 36 | "FunctionDeclaration": true, 37 | "MethodDefinition": false, 38 | "ClassDeclaration": false, 39 | "ArrowFunctionExpression": false, 40 | "FunctionExpression": false 41 | } 42 | }] 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /.github/workflows/pr-docs-tests.yml: -------------------------------------------------------------------------------- 1 | name: Run Docs Tests 2 | 3 | on: 4 | pull_request: 5 | 6 | jobs: 7 | docs-tests: 8 | runs-on: ${{ matrix.os }} 9 | strategy: 10 | matrix: 11 | os: 12 | - ubuntu-24.04 13 | node-version: 14 | - '20' 15 | steps: 16 | - name: Checkout code 17 | uses: actions/checkout@v6 18 | - name: Cache version builds 19 | uses: actions/cache@v5 20 | with: 21 | key: lando-mvb-docs 22 | path: docs/.vitepress/cache/@lando/mvb 23 | save-always: true 24 | - name: Install node ${{ matrix.node-version }} 25 | uses: actions/setup-node@v6 26 | with: 27 | node-version: ${{ matrix.node-version }} 28 | cache: npm 29 | - name: Install NPM dependencies 30 | run: npm clean-install --prefer-offline --frozen-lockfile 31 | - name: Run linter 32 | run: npm run lint 33 | - name: Test mvb 34 | run: npm run docs:mvb 35 | - name: Test build 36 | run: npm run docs:build 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Lando Alliance 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /examples/drupal-custom/config/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | 3 | ;;;;;;;;;;;;;;; 4 | ; PHP Globals ; 5 | ;;;;;;;;;;;;;;; 6 | 7 | short_open_tag = Off 8 | output_buffering = 4096 9 | allow_call_time_pass_reference = Off 10 | request_order = "GP" 11 | register_long_arrays = Off 12 | register_argc_argv = Off 13 | magic_quotes_gpc = Off 14 | enable_dl = Off 15 | allow_url_fopen = On 16 | realpath_cache_size = "800K" 17 | realpath_cache_ttl = "86400" 18 | disable_functions = 19 | sendmail_path=/bin/true 20 | ;include_path = ".:/usr/share/pear:/usr/share/php" 21 | 22 | [Date] 23 | date.timezone = "UTC" 24 | 25 | ;;;;;;;;;;;;;;;;;;;;;; 26 | ;; PACKAGE SETTINGS ;; 27 | ;;;;;;;;;;;;;;;;;;;;;; 28 | 29 | ; Xdebug 30 | xdebug.max_nesting_level = 512 31 | xdebug.show_exception_trace = 0 32 | xdebug.collect_params = 0 33 | xdebug.remote_autostart = 1 34 | xdebug.start_with_request = trigger 35 | xdebug.mode = ${XDEBUG_MODE} 36 | 37 | ; Globals 38 | expose_php = on 39 | max_execution_time = 90 40 | max_input_time = 900 41 | max_input_vars = 10000 42 | memory_limit = 513M 43 | upload_max_filesize = 100M 44 | post_max_size = 100M 45 | error_reporting = E_ALL & ~E_DEPRECATED 46 | ignore_repeated_errors = on 47 | html_errors = off 48 | display_errors = on 49 | log_errors = on 50 | -------------------------------------------------------------------------------- /config/drupal10/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | 3 | ; LANDODRUPALPHPINI 4 | ;;;;;;;;;;;;;;; 5 | ; PHP Globals ; 6 | ;;;;;;;;;;;;;;; 7 | 8 | short_open_tag = Off 9 | output_buffering = 4096 10 | allow_call_time_pass_reference = Off 11 | request_order = "GP" 12 | register_long_arrays = Off 13 | register_argc_argv = Off 14 | magic_quotes_gpc = Off 15 | enable_dl = Off 16 | allow_url_fopen = On 17 | realpath_cache_size = "800K" 18 | realpath_cache_ttl = "86400" 19 | disable_functions = 20 | sendmail_path=/bin/true 21 | ;include_path = ".:/usr/share/pear:/usr/share/php" 22 | 23 | [Date] 24 | date.timezone = "UTC" 25 | 26 | ;;;;;;;;;;;;;;;;;;;;;; 27 | ;; PACKAGE SETTINGS ;; 28 | ;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | ; Xdebug 31 | xdebug.max_nesting_level = 512 32 | xdebug.show_exception_trace = 0 33 | xdebug.collect_params = 0 34 | xdebug.remote_autostart = 1 35 | xdebug.start_with_request = trigger 36 | xdebug.mode = ${XDEBUG_MODE} 37 | 38 | ; Globals 39 | expose_php = on 40 | max_execution_time = 91 41 | max_input_time = 901 42 | max_input_vars = 10000 43 | memory_limit = ${PHP_MEMORY_LIMIT} 44 | upload_max_filesize = 100M 45 | post_max_size = 100M 46 | error_reporting = E_ALL & ~E_DEPRECATED 47 | ignore_repeated_errors = on 48 | html_errors = off 49 | display_errors = on 50 | log_errors = on 51 | -------------------------------------------------------------------------------- /config/drupal11/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | 3 | ; LANDODRUPALPHPINI 4 | ;;;;;;;;;;;;;;; 5 | ; PHP Globals ; 6 | ;;;;;;;;;;;;;;; 7 | 8 | short_open_tag = Off 9 | output_buffering = 4096 10 | allow_call_time_pass_reference = Off 11 | request_order = "GP" 12 | register_long_arrays = Off 13 | register_argc_argv = Off 14 | magic_quotes_gpc = Off 15 | enable_dl = Off 16 | allow_url_fopen = On 17 | realpath_cache_size = "800K" 18 | realpath_cache_ttl = "86400" 19 | disable_functions = 20 | sendmail_path=/bin/true 21 | ;include_path = ".:/usr/share/pear:/usr/share/php" 22 | 23 | [Date] 24 | date.timezone = "UTC" 25 | 26 | ;;;;;;;;;;;;;;;;;;;;;; 27 | ;; PACKAGE SETTINGS ;; 28 | ;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | ; Xdebug 31 | xdebug.max_nesting_level = 512 32 | xdebug.show_exception_trace = 0 33 | xdebug.collect_params = 0 34 | xdebug.remote_autostart = 1 35 | xdebug.start_with_request = trigger 36 | xdebug.mode = ${XDEBUG_MODE} 37 | 38 | ; Globals 39 | expose_php = on 40 | max_execution_time = 91 41 | max_input_time = 901 42 | max_input_vars = 10000 43 | memory_limit = ${PHP_MEMORY_LIMIT} 44 | upload_max_filesize = 100M 45 | post_max_size = 100M 46 | error_reporting = E_ALL & ~E_DEPRECATED 47 | ignore_repeated_errors = on 48 | html_errors = off 49 | display_errors = on 50 | log_errors = on 51 | -------------------------------------------------------------------------------- /config/drupal7/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | 3 | ; LANDODRUPALPHPINI 4 | ;;;;;;;;;;;;;;; 5 | ; PHP Globals ; 6 | ;;;;;;;;;;;;;;; 7 | 8 | short_open_tag = Off 9 | output_buffering = 4096 10 | allow_call_time_pass_reference = Off 11 | request_order = "GP" 12 | register_long_arrays = Off 13 | register_argc_argv = Off 14 | magic_quotes_gpc = Off 15 | enable_dl = Off 16 | allow_url_fopen = On 17 | realpath_cache_size = "800K" 18 | realpath_cache_ttl = "86400" 19 | disable_functions = 20 | sendmail_path=/bin/true 21 | ;include_path = ".:/usr/share/pear:/usr/share/php" 22 | 23 | [Date] 24 | date.timezone = "UTC" 25 | 26 | ;;;;;;;;;;;;;;;;;;;;;; 27 | ;; PACKAGE SETTINGS ;; 28 | ;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | ; Xdebug 31 | xdebug.max_nesting_level = 512 32 | xdebug.show_exception_trace = 0 33 | xdebug.collect_params = 0 34 | xdebug.remote_autostart = 1 35 | xdebug.start_with_request = trigger 36 | xdebug.mode = ${XDEBUG_MODE} 37 | 38 | ; Globals 39 | expose_php = on 40 | max_execution_time = 91 41 | max_input_time = 901 42 | max_input_vars = 10000 43 | memory_limit = ${PHP_MEMORY_LIMIT} 44 | upload_max_filesize = 100M 45 | post_max_size = 100M 46 | error_reporting = E_ALL & ~E_DEPRECATED 47 | ignore_repeated_errors = on 48 | html_errors = off 49 | display_errors = on 50 | log_errors = on 51 | -------------------------------------------------------------------------------- /config/drupal8/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | 3 | ; LANDODRUPALPHPINI 4 | ;;;;;;;;;;;;;;; 5 | ; PHP Globals ; 6 | ;;;;;;;;;;;;;;; 7 | 8 | short_open_tag = Off 9 | output_buffering = 4096 10 | allow_call_time_pass_reference = Off 11 | request_order = "GP" 12 | register_long_arrays = Off 13 | register_argc_argv = Off 14 | magic_quotes_gpc = Off 15 | enable_dl = Off 16 | allow_url_fopen = On 17 | realpath_cache_size = "800K" 18 | realpath_cache_ttl = "86400" 19 | disable_functions = 20 | sendmail_path=/bin/true 21 | ;include_path = ".:/usr/share/pear:/usr/share/php" 22 | 23 | [Date] 24 | date.timezone = "UTC" 25 | 26 | ;;;;;;;;;;;;;;;;;;;;;; 27 | ;; PACKAGE SETTINGS ;; 28 | ;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | ; Xdebug 31 | xdebug.max_nesting_level = 512 32 | xdebug.show_exception_trace = 0 33 | xdebug.collect_params = 0 34 | xdebug.remote_autostart = 1 35 | xdebug.start_with_request = trigger 36 | xdebug.mode = ${XDEBUG_MODE} 37 | 38 | ; Globals 39 | expose_php = on 40 | max_execution_time = 91 41 | max_input_time = 901 42 | max_input_vars = 10000 43 | memory_limit = ${PHP_MEMORY_LIMIT} 44 | upload_max_filesize = 100M 45 | post_max_size = 100M 46 | error_reporting = E_ALL & ~E_DEPRECATED 47 | ignore_repeated_errors = on 48 | html_errors = off 49 | display_errors = on 50 | log_errors = on 51 | -------------------------------------------------------------------------------- /config/drupal9/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | 3 | ; LANDODRUPALPHPINI 4 | ;;;;;;;;;;;;;;; 5 | ; PHP Globals ; 6 | ;;;;;;;;;;;;;;; 7 | 8 | short_open_tag = Off 9 | output_buffering = 4096 10 | allow_call_time_pass_reference = Off 11 | request_order = "GP" 12 | register_long_arrays = Off 13 | register_argc_argv = Off 14 | magic_quotes_gpc = Off 15 | enable_dl = Off 16 | allow_url_fopen = On 17 | realpath_cache_size = "800K" 18 | realpath_cache_ttl = "86400" 19 | disable_functions = 20 | sendmail_path=/bin/true 21 | ;include_path = ".:/usr/share/pear:/usr/share/php" 22 | 23 | [Date] 24 | date.timezone = "UTC" 25 | 26 | ;;;;;;;;;;;;;;;;;;;;;; 27 | ;; PACKAGE SETTINGS ;; 28 | ;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | ; Xdebug 31 | xdebug.max_nesting_level = 512 32 | xdebug.show_exception_trace = 0 33 | xdebug.collect_params = 0 34 | xdebug.remote_autostart = 1 35 | xdebug.start_with_request = trigger 36 | xdebug.mode = ${XDEBUG_MODE} 37 | 38 | ; Globals 39 | expose_php = on 40 | max_execution_time = 91 41 | max_input_time = 901 42 | max_input_vars = 10000 43 | memory_limit = ${PHP_MEMORY_LIMIT} 44 | upload_max_filesize = 100M 45 | post_max_size = 100M 46 | error_reporting = E_ALL & ~E_DEPRECATED 47 | ignore_repeated_errors = on 48 | html_errors = off 49 | display_errors = on 50 | log_errors = on 51 | -------------------------------------------------------------------------------- /plugin.yml: -------------------------------------------------------------------------------- 1 | # We don't need this because its in the package.json 2 | # but we set it anyway just to make sure we know what is what 3 | name: "@lando/drupal" 4 | 5 | # Let lando autoscan this plugin for "legacy" plugin stuff needed for v3 6 | legacy: true 7 | 8 | # This is just metadata that something else can use to understand how the docs are organized 9 | docs: 10 | # This is the tag we should use when connecting platform.sh content together eg showing guides on the main 11 | # platform.sh recipe docs 12 | tag: drupal 13 | 14 | # This gets added to the lando/lando docs guides.json 15 | guides: 16 | title: drupal 17 | collapsable: true 18 | # Note that these are "source/destination" pairs the source is relative to the root of this 19 | # repo and the desintation is relative to docs/guides in the main lando repo 20 | # When this gets added to guides.json we map children so its just the destination 21 | children: 22 | "guides/adding-tooling": drupal/adding-tooling 23 | 24 | # This gets added to the lando/lando docs config.js 25 | # Below takes docs/usage.md from this repo and puts it into config/drupal.md in lando/lando 26 | # and then adds drupal to the list of recipes in config.js 27 | config: 28 | recipes: 29 | "drupal": ./docs/usage.md 30 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Bare minimum self-checks 2 | 3 | > [What do you think of a person who only does the bare minimum?](https://getyarn.io/yarn-clip/dcf80710-425e-478b-bde1-c107bd11e849) 4 | 5 | - [ ] I've updated this PR with the latest code from `main` 6 | - [ ] I've done a cursory QA pass of my code locally 7 | - [ ] I've ensured all automated status check and tests pass 8 | - [ ] I've [connected this PR to an issue](https://help.zenhub.com/support/solutions/articles/43000010350-connecting-pull-requests-to-github-issues) 9 | 10 | ### Pieces of flare 11 | 12 | - [ ] I've written a unit or functional test for my code 13 | - [ ] I've updated relevant documentation it my code changes it 14 | - [ ] I've updated this repo's README if my code changes it 15 | - [ ] I've updated this repo's CHANGELOG with my change unless its a trivial change (like updating a typo in the docs) 16 | 17 | ### Finally 18 | 19 | - [ ] I've [requested a review](https://help.github.com/en/articles/requesting-a-pull-request-review) with relevant people 20 | 21 | If you have any issues or need help please join the `#contributors` channel in the [Lando slack](https://www.launchpass.com/devwithlando) and someone will gladly help you out! 22 | 23 | You can also check out the [coder guide](https://docs.lando.dev/contrib/coder.html). 24 | -------------------------------------------------------------------------------- /config/drupal6/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | 3 | ; LANDODRUPALPHPINI 4 | ;;;;;;;;;;;;;;; 5 | ; PHP Globals ; 6 | ;;;;;;;;;;;;;;; 7 | 8 | short_open_tag = Off 9 | output_buffering = 4096 10 | allow_call_time_pass_reference = Off 11 | request_order = "GP" 12 | register_long_arrays = Off 13 | register_argc_argv = Off 14 | magic_quotes_gpc = Off 15 | enable_dl = Off 16 | allow_url_fopen = On 17 | realpath_cache_size = "800K" 18 | realpath_cache_ttl = "86400" 19 | disable_functions = 20 | sendmail_path=/bin/true 21 | ;include_path = ".:/usr/share/pear:/usr/share/php" 22 | 23 | [Date] 24 | date.timezone = "UTC" 25 | 26 | ;;;;;;;;;;;;;;;;;;;;;; 27 | ;; PACKAGE SETTINGS ;; 28 | ;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | ; Xdebug 31 | xdebug.max_nesting_level = 512 32 | xdebug.show_exception_trace = 0 33 | xdebug.collect_params = 0 34 | xdebug.remote_autostart = 1 35 | xdebug.start_with_request = trigger 36 | xdebug.mode = ${XDEBUG_MODE} 37 | 38 | ; Globals 39 | expose_php = on 40 | max_execution_time = 91 41 | max_input_time = 901 42 | max_input_vars = 10000 43 | memory_limit = ${PHP_MEMORY_LIMIT} 44 | upload_max_filesize = 100M 45 | post_max_size = 100M 46 | error_reporting = E_ALL & ~E_DEPRECATED 47 | ignore_repeated_errors = on 48 | html_errors = off 49 | display_errors = on 50 | log_errors = on 51 | 52 | ; Drupal 6 53 | mbstring.http_input = pass 54 | mbstring.http_output = pass 55 | -------------------------------------------------------------------------------- /examples/drupal-nginx/README.md: -------------------------------------------------------------------------------- 1 | # Drupal Nginx Example 2 | 3 | This example exists primarily to test the following documentation: 4 | 5 | * [Drupal Recipe](https://docs.lando.dev/drupal/config.html) 6 | 7 | ## Start up tests 8 | 9 | Run the following commands to get up and running with this example. 10 | 11 | ```bash 12 | # Should start up successfully 13 | lando poweroff 14 | lando start 15 | ``` 16 | 17 | ## Verification commands 18 | 19 | Run the following commands to validate things are rolling as they should. 20 | 21 | ```bash 22 | # Should serve from web folder 23 | lando exec appserver -- curl -L appserver_nginx | grep "NGINX" 24 | 25 | # Should run using nginx if specified 26 | lando exec appserver -- curl -IL appserver_nginx | grep Server | grep nginx 27 | 28 | # Should use nginx 1.29 by default 29 | lando nginx -v 2>&1 | grep "nginx version" | grep "nginx/1.29" 30 | 31 | # Should use the php version specified by the user eg 7.4 32 | lando php -v | grep "PHP 7.4" 33 | 34 | # Should load the correct default nginx config 35 | lando exec appserver_nginx -- cat /opt/bitnami/nginx/conf/vhosts/lando.conf | grep "LANDODRUPALNGINXCONF" 36 | ``` 37 | 38 | ## Destroy tests 39 | 40 | Run the following commands to trash this app like nothing ever happened. 41 | 42 | ```bash 43 | # Should be destroyed with success 44 | lando destroy -y 45 | lando poweroff 46 | ``` 47 | -------------------------------------------------------------------------------- /config/drupal11/mysql8.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # The MySQL database server configuration file for Lando 3 | # 4 | # LANDODRUPALMYSQL8CNF 5 | 6 | [server] 7 | # Character sets and SQL mode 8 | character_set_server = utf8mb4 9 | collation_server = utf8mb4_general_ci 10 | sql_mode = ONLY_FULL_GROUP_BY,TRADITIONAL 11 | 12 | # Basic Tuning. 13 | max_connections = 500 14 | connect_timeout = 5 15 | wait_timeout = 28800 16 | max_allowed_packet = 32M 17 | thread_cache_size = 128 18 | sort_buffer_size = 4M 19 | bulk_insert_buffer_size = 16M 20 | tmp_table_size = 32M 21 | max_heap_table_size = 32M 22 | 23 | # MyISAM. 24 | myisam_recover_options = BACKUP 25 | key_buffer_size = 128M 26 | table_open_cache = 400 27 | myisam_sort_buffer_size = 512M 28 | concurrent_insert = 2 29 | read_buffer_size = 2M 30 | read_rnd_buffer_size = 1M 31 | 32 | # InnoDB. 33 | default_storage_engine = InnoDB 34 | innodb_buffer_pool_size = 384M 35 | innodb_log_buffer_size = 8M 36 | innodb_file_per_table = 1 37 | innodb_open_files = 400 38 | innodb_io_capacity = 512 39 | innodb_thread_concurrency = 0 40 | innodb_read_io_threads = 16 41 | innodb_write_io_threads = 16 42 | innodb_flush_log_at_trx_commit = 0 43 | innodb_max_dirty_pages_pct = 70 44 | innodb_adaptive_hash_index = 0 45 | innodb_use_native_aio = 0 46 | innodb_lock_wait_timeout = 127 47 | 48 | [mysqld-8.4] 49 | mysql_native_password=ON 50 | 51 | [client] 52 | default_character_set=utf8mb4 53 | max_allowed_packet = 64M 54 | 55 | [mysqldump] 56 | quick 57 | quote-names 58 | no-tablespaces 59 | -------------------------------------------------------------------------------- /examples/drupal-import/README.md: -------------------------------------------------------------------------------- 1 | # Drupal Import Example 2 | 3 | This example exists primarily to test the following documentation: 4 | 5 | * [Drupal Recipe](https://docs.lando.dev/drupal/tooling.html#importing-your-database) 6 | 7 | ## Start up tests 8 | 9 | Run the following commands to get up and running with this example. 10 | 11 | ```bash 12 | # Should start up successfully 13 | lando poweroff 14 | lando start 15 | ``` 16 | 17 | ## Verification commands 18 | 19 | Run the following commands to validate things are rolling as they should. 20 | 21 | ```bash 22 | # Should be able to connect to the relevant databases 23 | lando mysql drupal10 -e quit 24 | 25 | # Should be able to import into database by default 26 | lando db-import mysql-test.sql 27 | lando mysql drupal10 -e "show tables;" | grep users 28 | 29 | # Should be able to import into user specified database 30 | lando db-import -h database subdir/test.sql 31 | lando mysql drupal10 -e "show tables;" | grep users 32 | 33 | # Should be able to use db-import events 34 | lando exec database -- cat /tmp/iran.txt 35 | 36 | # Should persist data after a rebuild 37 | lando rebuild -y 38 | lando mysql drupal10 -e "show tables;" | grep users 39 | 40 | # Should be able to import tables with foreign key constraints 41 | lando db-import big-bad-dump.sql 42 | lando db-import big-bad-dump.sql 43 | ``` 44 | 45 | ## Destroy tests 46 | 47 | Run the following commands to trash this app like nothing ever happened. 48 | 49 | ```bash 50 | # Should be destroyed with success 51 | lando destroy -y 52 | lando poweroff 53 | ``` 54 | -------------------------------------------------------------------------------- /docs/install.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Installation 3 | description: How to install the Lando Drupal Plugin. 4 | --- 5 | 6 | # Installation 7 | 8 | If you are using Lando 3 then its *highly likely* you already have this plugin as its included by default in most installation pathways. You can verify this by running: 9 | 10 | ```sh 11 | lando version --component @lando/drupal 12 | ``` 13 | 14 | However if you would like to manually install the plugin, update it to the bleeding edge or install a particular version then use the below. 15 | 16 | ::: code-group 17 | ```sh [lando 3.21+] 18 | lando plugin-add @lando/drupal 19 | ``` 20 | 21 | ```sh [hyperdrive] 22 | # @NOTE: This doesn't actaully work yet 23 | hyperdrive install @lando/drupal 24 | ``` 25 | 26 | ```sh [docker] 27 | # Ensure you have a global plugins directory 28 | mkdir -p ~/.lando/plugins 29 | 30 | # Install plugin 31 | # NOTE: Modify the "npm install @lando/drupal" line to install a particular version eg 32 | # npm install @lando/drupal@0.5.2 33 | docker run --rm -it -v ${HOME}/.lando/plugins:/plugins -w /tmp node:20-alpine sh -c \ 34 | "npm init -y \ 35 | && npm install @lando/drupal --production --flat --no-default-rc --no-lockfile --link-duplicates \ 36 | && npm install --production --cwd /tmp/node_modules/@lando/drupal \ 37 | && mkdir -p /plugins/@lando \ 38 | && mv --force /tmp/node_modules/@lando/drupal /plugins/@lando/drupal" 39 | 40 | # Rebuild the plugin cache 41 | lando --clear 42 | ``` 43 | ::: 44 | 45 | You should be able to verify the plugin is installed by running `lando config --path plugins` and checking for `@lando/drupal`. This command will also show you _where_ the plugin is being loaded from. 46 | -------------------------------------------------------------------------------- /examples/drupal-export/README.md: -------------------------------------------------------------------------------- 1 | # Drupal Export Example 2 | 3 | This example exists primarily to test the following documentation: 4 | 5 | * [Drupal Recipe](https://docs.lando.dev/drupal/tooling.html#importing-your-database) 6 | 7 | ## Start up tests 8 | 9 | Run the following commands to get up and running with this example. 10 | 11 | ```bash 12 | # Should start up successfully 13 | lando poweroff 14 | lando start 15 | ``` 16 | 17 | ## Verification commands 18 | 19 | Run the following commands to validate things are rolling as they should. 20 | 21 | ```bash 22 | # Should be able to connect to the relevant databases 23 | lando mysql drupal10 -e quit 24 | 25 | # Should be able to import into database by default 26 | lando db-import mysql-test.sql 27 | lando mysql drupal10 -e "show tables;" | grep users 28 | 29 | # Should be able to import into user specified database 30 | lando db-import -h database mysql-test.sql 31 | lando mysql drupal10 -e "show tables;" | grep users 32 | 33 | # Should be able to export the contents of the dbs 34 | lando db-export 35 | lando db-export -h database another-one.sql 36 | 37 | # Should export to filename if specified 38 | lando db-export database.dump.sql 39 | lando db-export -h database database2.dump.sql 40 | 41 | # Should export to absolute path if specified 42 | lando db-export /tmp/database.dump.sql 43 | lando exec database -- stat /tmp/database.dump.sql.gz 44 | 45 | # Should dump ungizzeed stdout 46 | lando db-export --stdout > thing.sql 47 | cat thing.sql | grep Dump 48 | ``` 49 | 50 | ## Destroy tests 51 | 52 | Run the following commands to trash this app like nothing ever happened. 53 | 54 | ```bash 55 | # Should be destroyed with success 56 | lando destroy -y 57 | lando poweroff 58 | ``` 59 | -------------------------------------------------------------------------------- /examples/drupal-mariadb/README.md: -------------------------------------------------------------------------------- 1 | # Drupal MariaDB Example 2 | 3 | This example exists primarily to test the following documentation: 4 | 5 | * [Drupal Recipe](https://docs.devwithlando.io/tutorials/drupal.html) 6 | 7 | ## Start up tests 8 | 9 | Run the following commands to get up and running with this example. 10 | 11 | ```bash 12 | # Should poweroff 13 | lando poweroff 14 | 15 | # Should start up successfully 16 | lando start 17 | ``` 18 | 19 | ## Verification commands 20 | 21 | Run the following commands to validate things are rolling as they should. 22 | 23 | ```bash 24 | # Should serve from web folder 25 | lando exec appserver -- curl -L localhost | grep "MariaDB" 26 | 27 | # Should use 8.3 as the default php version 28 | lando php -v | grep "PHP 8.3" 29 | 30 | # Should use composer 2.7.4 31 | lando composer -V | grep 2.7.4 32 | 33 | # Should be running apache 2.4 by default 34 | lando exec appserver -- apachectl -V | grep 2.4 35 | lando exec appserver -- curl -IL localhost | grep Server | grep 2.4 36 | 37 | # Should be running mariadb 11.3.x 38 | lando mariadb -V | grep 11.3. 39 | 40 | # Should not enable xdebug by default 41 | lando php -m | grep xdebug || echo $? | grep 1 42 | 43 | # Should use the default database connection info 44 | lando mariadb -udrupal10 -pdrupal10 drupal10 -e quit 45 | 46 | # Should use the default mariadb config file 47 | lando exec database -- cat /opt/bitnami/mariadb/conf/my_custom.cnf | grep "innodb_lock_wait_timeout = 121" 48 | lando mariadb -e "show variables;" | grep innodb_lock_wait_timeout | grep 121 49 | ``` 50 | 51 | ## Destroy tests 52 | 53 | Run the following commands to trash this app like nothing ever happened. 54 | 55 | ```bash 56 | # Should be destroyed with success 57 | lando destroy -y 58 | lando poweroff 59 | ``` 60 | -------------------------------------------------------------------------------- /examples/drupal-mariadb-mysql/README.md: -------------------------------------------------------------------------------- 1 | # Drupal MariaDB/MySQL Example 2 | 3 | This example exists primarily to test the following documentation: 4 | 5 | * [Drupal Recipe](https://docs.devwithlando.io/tutorials/drupal.html) 6 | 7 | Versions of MariaDB 10.3.x and lower do not have the mariadb command and must use the mysql executable. 8 | 9 | ## Start up tests 10 | 11 | Run the following commands to get up and running with this example. 12 | 13 | ```bash 14 | # Should poweroff 15 | lando poweroff 16 | 17 | # Should start up successfully 18 | lando start 19 | ``` 20 | 21 | ## Verification commands 22 | 23 | Run the following commands to validate things are rolling as they should. 24 | 25 | ```bash 26 | # Should serve from web folder 27 | lando exec appserver -- curl -L localhost | grep "MySQL" 28 | 29 | # Should use 8.3 as the default php version 30 | lando php -v | grep "PHP 8.3" 31 | 32 | # Should use composer 2.7.4 33 | lando composer -V | grep 2.7.4 34 | 35 | # Should be running apache 2.4 by default 36 | lando exec appserver -- apachectl -V | grep 2.4 37 | lando exec appserver -- curl -IL localhost | grep Server | grep 2.4 38 | 39 | # Should be running mariadb 10.3.x 40 | lando mysql -V | grep "MariaDB" | grep 10.3. 41 | 42 | # Should not enable xdebug by default 43 | lando php -m | grep xdebug || echo $? | grep 1 44 | 45 | # Should use the default database connection info 46 | lando mysql -udrupal10 -pdrupal10 drupal10 -e quit 47 | 48 | # Should use the default mariadb config file 49 | lando exec database -- cat /opt/bitnami/mariadb/conf/my_custom.cnf | grep "innodb_lock_wait_timeout = 121" 50 | lando mysql -e "show variables;" | grep innodb_lock_wait_timeout | grep 121 51 | ``` 52 | 53 | ## Destroy tests 54 | 55 | Run the following commands to trash this app like nothing ever happened. 56 | 57 | ```bash 58 | # Should be destroyed with success 59 | lando destroy -y 60 | lando poweroff 61 | ``` 62 | -------------------------------------------------------------------------------- /examples/drupal-defaults/README.md: -------------------------------------------------------------------------------- 1 | # Drupal Defaults Example 2 | 3 | This example exists primarily to test the following documentation: 4 | 5 | * [Drupal Recipe](https://docs.lando.dev/drupal/config.html) 6 | 7 | ## Start up tests 8 | 9 | Run the following commands to get up and running with this example. 10 | 11 | ```bash 12 | # Should start up successfully 13 | lando poweroff 14 | lando start 15 | ``` 16 | 17 | ## Verification commands 18 | 19 | Run the following commands to validate things are rolling as they should. 20 | 21 | ```bash 22 | # Should serve from app root by default 23 | lando exec appserver -- curl -L localhost | grep "DEFAULTS" 24 | 25 | # Should use 8.1 as the default php version 26 | lando php -v | grep "PHP 8.1" 27 | 28 | # Should be running apache 2.4 by default 29 | lando exec appserver -- apachectl -V | grep 2.4 30 | lando exec appserver -- curl -IL localhost | grep Server | grep 2.4 31 | 32 | # Should be running mysql 5.7 by default 33 | lando mysql -V | grep 5.7 34 | 35 | # Should not enable xdebug by default 36 | lando php -m | grep xdebug || echo $? | grep 1 37 | 38 | # Should use the default database connection info 39 | lando mysql drupal10 -e quit 40 | 41 | # Should use composer 2 by default 42 | lando exec appserver -- /bin/sh -c 'NO_COLOR=1 composer -V' | grep "Composer version 2." 43 | 44 | # Should use the correct default config files 45 | lando exec appserver -- cat /usr/local/etc/php/conf.d/zzz-lando-my-custom.ini | grep "; LANDODRUPALPHPINI" 46 | lando exec appserver -- curl -L http://localhost/info.php | grep max_execution_time | grep 91 47 | lando exec database -- cat /opt/bitnami/mysql/conf/my_custom.cnf | grep "LANDODRUPALMYSQLCNF" 48 | lando mysql -u root -e "show variables;" | grep innodb_lock_wait_timeout | grep 121 49 | ``` 50 | 51 | ## Destroy tests 52 | 53 | Run the following commands to trash this app like nothing ever happened. 54 | 55 | ```bash 56 | # Should be destroyed with success 57 | lando destroy -y 58 | lando poweroff 59 | ``` 60 | -------------------------------------------------------------------------------- /examples/drupal-custom/README.md: -------------------------------------------------------------------------------- 1 | # Drupal Custom 8Example 2 | 3 | This example exists primarily to test the following documentation: 4 | 5 | * [Drupal Recipe](https://docs.lando.dev/drupal/config.html) 6 | 7 | ## Start up tests 8 | 9 | Run the following commands to get up and running with this example. 10 | 11 | ```bash 12 | # Should start up successfully 13 | lando poweroff 14 | lando start 15 | ``` 16 | 17 | ## Verification commands 18 | 19 | Run the following commands to validate things are rolling as they should. 20 | 21 | ```bash 22 | # Should serve from bob folder 23 | lando exec appserver -- curl -L appserver_nginx | grep "HI BOB" 24 | 25 | # Should be serving from nginx 1.17 26 | lando exec appserver_nginx -- nginx -v 2>&1 | grep "nginx version" | grep "nginx/1.17" 27 | lando exec appserver -- curl -IL appserver_nginx | grep Server | grep nginx 28 | 29 | # Should use php 8.3 30 | lando php -v | grep "PHP 8.3" 31 | 32 | # Should use composer 2.0.7 33 | lando exec appserver -- /bin/sh -c 'NO_COLOR=1 composer -V' | grep "Composer version 2.0.7" 34 | 35 | # Should serve and be accessible over ssl if specified 36 | lando exec appserver_nginx -- curl https://localhost 37 | lando exec appserver -- curl https://appserver_nginx 38 | 39 | # Should be running mysql 5.7 by default 40 | lando mysql -V | grep 5.7 41 | 42 | # Should be able to connect to the database with the default creds 43 | lando mysql drupal10 -e quit 44 | 45 | # Should have xdebug enabled 46 | lando php -m | grep Xdebug 47 | 48 | # Should be using custom config files 49 | lando exec appserver -- curl -L appserver_nginx/info.php | grep memory_limit | grep 513M 50 | lando exec appserver_nginx -- cat /opt/bitnami/nginx/conf/vhosts/lando.conf | grep server_name | grep pirog 51 | lando mysql -u root -e "show variables;" | grep thread_cache_size | grep 12 52 | ``` 53 | 54 | ## Destroy tests 55 | 56 | Run the following commands to trash this app like nothing ever happened. 57 | 58 | ```bash 59 | # Should be destroyed with success 60 | lando destroy -y 61 | lando poweroff 62 | ``` 63 | -------------------------------------------------------------------------------- /examples/drupal-mysql8/README.md: -------------------------------------------------------------------------------- 1 | # Drupal PHP 8.1 Example 2 | 3 | This example exists primarily to test the following documentation: 4 | 5 | * [Drupal Recipe](https://docs.devwithlando.io/tutorials/drupal.html) 6 | 7 | ## Start up tests 8 | 9 | Run the following commands to get up and running with this example. 10 | 11 | ```bash 12 | # Should poweroff 13 | lando poweroff 14 | 15 | # Initialize an empty drupal recipe 16 | rm -rf mysql8 && mkdir -p mysql8 && cd mysql8 17 | lando init --source cwd --recipe drupal10 --webroot app/public --name lando-drupal-mysql8 --option php='8.1' --option database=mysql:8.0.22 18 | cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml 19 | 20 | # Should start up successfully 21 | cd mysql8 22 | lando start 23 | ``` 24 | 25 | ## Verification commands 26 | 27 | Run the following commands to validate things are rolling as they should. 28 | 29 | ```bash 30 | # Should use 8.1 as the default php version 31 | cd mysql8 32 | lando php -v | grep "PHP 8.1" 33 | 34 | # Should be running apache 2.4 by default 35 | cd mysql8 36 | lando exec appserver -- apachectl -V | grep 2.4 37 | lando exec appserver -- curl -IL localhost | grep Server | grep 2.4 38 | 39 | # Should be running mysql 8.0.x by default 40 | cd mysql8 41 | lando mysql -V | grep 8.0 42 | 43 | # Should not enable xdebug by default 44 | cd mysql8 45 | lando php -m | grep xdebug || echo $? | grep 1 46 | 47 | # Should use the default database connection info 48 | cd mysql8 49 | lando mysql -udrupal10 -pdrupal10 drupal10 -e quit 50 | 51 | # Should have artisan available 52 | cd mysql8 53 | lando artisan env 54 | 55 | # Should use the defauly mysql8 config file 56 | cd mysql8 57 | lando exec database -- cat /opt/bitnami/mysql/conf/my_custom.cnf | grep "LANDODRUPALMYSQL8CNF" 58 | lando mysql -u root -e "show variables;" | grep innodb_lock_wait_timeout | grep 127 59 | ``` 60 | 61 | ## Destroy tests 62 | 63 | Run the following commands to trash this app like nothing ever happened. 64 | 65 | ```bash 66 | # Should be destroyed with success 67 | cd mysql8 68 | lando destroy -y 69 | lando poweroff 70 | ``` 71 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | base = "./" 3 | publish = "docs/.vitepress/dist" 4 | command = "npm run docs:mvb" 5 | 6 | [context.deploy-preview] 7 | command = "npm run docs:build" 8 | 9 | # https://github.com/munter/netlify-plugin-checklinks#readme 10 | [[context.deploy-preview.plugins]] 11 | package = "netlify-plugin-checklinks" 12 | [context.deploy-preview.plugins.inputs] 13 | todoPatterns = [ 14 | "load", 15 | "CHANGELOG.html", 16 | "x.com", 17 | "twitter.com", 18 | "https://www.drupal.org", 19 | "/v/" 20 | ] 21 | skipPatterns = [ ".rss", ".gif", ".jpg" ] 22 | checkExternal = true 23 | 24 | # Sets our asset optimization 25 | [build.processing.css] 26 | bundle = true 27 | minify = true 28 | [build.processing.js] 29 | bundle = true 30 | minify = true 31 | [build.processing.html] 32 | pretty_urls = false 33 | [build.processing.images] 34 | compress = true 35 | 36 | # Caches our images for 1 year 37 | [[headers]] 38 | for = "/images/*" 39 | [headers.values] 40 | Cache-Control = "public, max-age=31536000" 41 | 42 | # pluginz 43 | # https://github.com/netlify/netlify-plugin-lighthouse#readme 44 | [[plugins]] 45 | package = "@netlify/plugin-lighthouse" 46 | [plugins.inputs.audits] 47 | output_path = "reports/lighthouse.html" 48 | 49 | # We need this so preview environments and the base site look ok on their own 50 | [[redirects]] 51 | from = "https://lando-drupal.netlify.app" 52 | to = "https://lando-drupal.netlify.app/plugins/drupal/index.html" 53 | status = 301 54 | force = true 55 | [[redirects]] 56 | from = "https://lando-drupal.netlify.app/*" 57 | to = "https://docs.lando.dev/:splat" 58 | status = 301 59 | [[redirects]] 60 | from = "/" 61 | to = "/plugins/drupal" 62 | status = 200 63 | [[redirects]] 64 | from = "/plugins/drupal/*" 65 | to = "/:splat" 66 | status = 200 67 | [[redirects]] 68 | from = "/legacy-versions.html" 69 | to = "/plugins/drupal/legacy/drupal-8.html" 70 | status = 302 71 | [[redirects]] 72 | from = "/plugins/drupal/drupal-multisite.html" 73 | to = "/plugins/drupal/guides/drupal-multisite.html" 74 | status = 302 75 | -------------------------------------------------------------------------------- /examples/drupal6/README.md: -------------------------------------------------------------------------------- 1 | # Drupal 6 Example 2 | 3 | This example exists primarily to test the following documentation: 4 | 5 | * [Drupal 6 Recipe](https://docs.devwithlando.io/tutorials/drupal6.html) 6 | 7 | ## Start up tests 8 | 9 | Run the following commands to get up and running with this example. 10 | 11 | ```bash 12 | # Should poweroff 13 | lando poweroff 14 | 15 | # Should initialize the latest D6 codebase 16 | rm -rf drupal6 && mkdir -p drupal6 && cd drupal6 17 | lando init --source remote --remote-url https://ftp.drupal.org/files/projects/drupal-6.38.tar.gz --remote-options="--strip-components 1" --recipe drupal6 --webroot . --name lando-drupal6 --option "composer_version=2.2-latest" 18 | 19 | # Should start up successfully 20 | cd drupal6 21 | cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml 22 | lando start 23 | ``` 24 | 25 | ## Verification commands 26 | 27 | Run the following commands to validate things are rolling as they should. 28 | 29 | ```bash 30 | # Should return the drupal installation page by default 31 | cd drupal6 32 | lando exec appserver -- curl -L localhost | grep "Choose language" 33 | 34 | # Should use 5.6 as the default php version 35 | cd drupal6 36 | lando php -v | grep "PHP 5.6" 37 | 38 | # Should be running apache 2.4 by default 39 | cd drupal6 40 | lando exec appserver -- apachectl -V | grep 2.4 41 | lando exec appserver -- curl -IL localhost | grep Server | grep 2.4 42 | 43 | # Should be running mysql 5.7 by default 44 | cd drupal6 45 | lando mysql -V | grep 5.7 46 | 47 | # Should not enable xdebug by default 48 | cd drupal6 49 | lando php -m | grep xdebug || echo $? | grep 1 50 | 51 | # Should use the default database connection info 52 | cd drupal6 53 | lando mysql -udrupal6 -pdrupal6 drupal6 -e quit 54 | 55 | # Should use drush 8.4.5 by default 56 | cd drupal6 57 | lando drush version | tee >(cat 1>&2) | grep 8.4.5 58 | 59 | # Should be able to install drupal 60 | cd drupal6 61 | lando drush si --db-url=mysql://drupal6:drupal6@database/drupal6 -y 62 | ``` 63 | 64 | ## Destroy tests 65 | 66 | Run the following commands to trash this app like nothing ever happened. 67 | 68 | ```bash 69 | # Should be destroyed with success 70 | cd drupal6 71 | lando destroy -y 72 | lando poweroff 73 | ``` 74 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@lando/drupal", 3 | "description": "A Lando plugin that provides a tight integration with Drupal.", 4 | "version": "1.13.0", 5 | "author": "Mike Pirog @pirog", 6 | "license": "MIT", 7 | "repository": "lando/drupal", 8 | "bugs": "https://github.com/lando/drupal/issues/new/choose", 9 | "homepage": "https://github.com/lando/drupal", 10 | "keywords": [ 11 | "lando", 12 | "lando-plugin", 13 | "lando-recipe", 14 | "drupal" 15 | ], 16 | "engines": { 17 | "node": ">=20.0.0" 18 | }, 19 | "lando": {}, 20 | "main": "index.js", 21 | "nyc": { 22 | "include": [ 23 | "lib/**/*.js", 24 | "recipes/**/*.js", 25 | "services/**/*.js", 26 | "types/**/*.js" 27 | ], 28 | "exclude": [ 29 | "test/**" 30 | ], 31 | "cache": true, 32 | "all": true 33 | }, 34 | "scripts": { 35 | "coverage": "nyc report --reporter=text-lcov | coveralls", 36 | "docs:build": "LANDO_MVB_VERSION=$(git describe --tags --always --abbrev=1 --match=\"v[0-9].*\") vitepress build docs", 37 | "docs:dev": "LANDO_MVB_VERSION=$(git describe --tags --always --abbrev=1 --match=\"v[0-9].*\") vitepress dev docs", 38 | "docs:mvb": "npx mvb docs", 39 | "docs:preview": "vitepress preview docs", 40 | "lint": "eslint . --ext .js --ext .mjs ", 41 | "test:unit": "nyc --reporter=html --reporter=text mocha --timeout 5000 test/**/*.spec.js", 42 | "test:leia": "leia \"examples/**/README.md\" -c 'Destroy tests' --stdin", 43 | "test": "npm run lint && npm run test:unit" 44 | }, 45 | "dependencies": { 46 | "@lando/mariadb": "^1.8.0", 47 | "@lando/mssql": "^1.4.3", 48 | "@lando/mysql": "^1.6.0", 49 | "@lando/php": "^1.8.0", 50 | "@lando/postgres": "^1.6.0", 51 | "lodash": "^4.17.21", 52 | "semver": "^7.7.2" 53 | }, 54 | "devDependencies": { 55 | "@babel/eslint-parser": "^7.16.0", 56 | "@lando/leia": "^1.0.0-beta.3", 57 | "@lando/vitepress-theme-default-plus": "^1.1.1", 58 | "chai": "^4.3.4", 59 | "command-line-test": "^1.0.10", 60 | "eslint": "^7.32.0", 61 | "eslint-config-google": "^0.9.1", 62 | "eslint-plugin-vue": "^8.0.3", 63 | "js-yaml": "^4.1.0", 64 | "mocha": "^9.1.2", 65 | "nyc": "^15.1.0", 66 | "vitepress": "^1.3.4" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /.github/workflows/pr-drupal-tests.yml: -------------------------------------------------------------------------------- 1 | name: Drupal Tests 2 | 3 | on: 4 | pull_request: 5 | workflow_dispatch: 6 | 7 | jobs: 8 | leia-tests: 9 | runs-on: ${{ matrix.os }} 10 | env: 11 | TERM: xterm 12 | strategy: 13 | fail-fast: false 14 | matrix: 15 | leia-test: 16 | - examples/drupal-custom 17 | - examples/drupal-defaults 18 | - examples/drupal-export 19 | - examples/drupal-import 20 | - examples/drupal-mariadb 21 | - examples/drupal-mariadb-mysql 22 | - examples/drupal-mysql8 23 | - examples/drupal-nginx 24 | - examples/drupal6 25 | - examples/drupal7 26 | - examples/drupal8 27 | - examples/drupal9 28 | - examples/drupal10 29 | - examples/drupal10-mysql8 30 | - examples/drupal10-nginx 31 | - examples/drupal11 32 | - examples/drupal11-mysql84 33 | - examples/drupal11-nginx 34 | lando-version: 35 | - 3-edge 36 | - 3-stable 37 | os: 38 | - ubuntu-24.04 39 | node-version: 40 | - '20' 41 | steps: 42 | - name: Checkout code 43 | uses: actions/checkout@v6 44 | - name: Install node ${{ matrix.node-version }} 45 | uses: actions/setup-node@v6 46 | with: 47 | node-version: ${{ matrix.node-version }} 48 | registry-url: https://registry.npmjs.org 49 | - name: Install NPM dependencies 50 | run: npm clean-install --production 51 | - name: Bundle Deps 52 | uses: lando/prepare-release-action@v3 53 | with: 54 | lando-plugin: true 55 | version: dev 56 | sync: false 57 | - name: Setup lando ${{ matrix.lando-version }} 58 | uses: lando/setup-lando@v3 59 | with: 60 | lando-version: ${{ matrix.lando-version }} 61 | config: | 62 | setup.skipCommonPlugins=true 63 | setup.plugins.@lando/drupal=/home/runner/work/drupal/drupal 64 | telemetry: false 65 | - name: Run Leia Tests 66 | uses: lando/run-leia-action@v2 67 | with: 68 | leia-test: "./${{ matrix.leia-test }}/README.md" 69 | cleanup-header: "Destroy tests" 70 | shell: bash 71 | stdin: true 72 | -------------------------------------------------------------------------------- /docs/.vitepress/config.mjs: -------------------------------------------------------------------------------- 1 | import {createRequire} from 'module'; 2 | 3 | import {defineConfig} from '@lando/vitepress-theme-default-plus/config'; 4 | 5 | const require = createRequire(import.meta.url); 6 | 7 | const {name, version} = require('../../package.json'); 8 | const landoPlugin = name.replace('@lando/', ''); 9 | 10 | export default defineConfig({ 11 | title: 'Lando Drupal Plugin', 12 | description: 'The offical Lando plugin for Drupal.', 13 | landoDocs: 3, 14 | landoPlugin, 15 | version, 16 | head: [ 17 | ['meta', {name: 'viewport', content: 'width=device-width, initial-scale=1'}], 18 | ['link', {rel: 'icon', href: '/drupal/favicon.ico', size: 'any'}], 19 | ['link', {rel: 'icon', href: '/drupal/favicon.svg', type: 'image/svg+xml'}], 20 | ], 21 | themeConfig: { 22 | multiVersionBuild: { 23 | satisfies: '>=1.10.0', 24 | }, 25 | sidebar: sidebar(), 26 | }, 27 | }); 28 | 29 | function sidebar() { 30 | return [ 31 | { 32 | text: 'Introduction', 33 | collapsed: false, 34 | items: [ 35 | {text: 'Introduction', link: '/'}, 36 | {text: 'Installation', link: '/install'}, 37 | {text: 'Getting Started', link: '/getting-started'}, 38 | {text: 'Configuration', link: '/config'}, 39 | {text: 'Tooling', link: '/tooling'}, 40 | ], 41 | }, 42 | { 43 | text: 'Legacy Versions', 44 | collapsed: true, 45 | items: [ 46 | {text: 'Drupal 8', link: '/legacy/drupal-8'}, 47 | {text: 'Drupal 7', link: '/legacy/drupal-7'}, 48 | {text: 'Drupal 6', link: '/legacy/drupal-6'}, 49 | ], 50 | }, 51 | { 52 | text: 'Contribution', 53 | collapsed: false, 54 | items: [ 55 | {text: 'Development', link: '/development'}, 56 | {text: 'Team', link: '/team'}, 57 | ], 58 | }, 59 | { 60 | text: 'Help & Support', 61 | collapsed: false, 62 | items: [ 63 | {text: 'GitHub', link: 'https://github.com/lando/drupal/issues/new/choose'}, 64 | {text: 'Slack', link: 'https://www.launchpass.com/devwithlando'}, 65 | {text: 'Contact Us', link: '/support'}, 66 | {text: 'Examples', link: 'https://github.com/lando/drupal/tree/main/examples'}, 67 | ], 68 | }, 69 | {text: 'Guides', link: '/guides', activeMatch: '/guides'}, 70 | ]; 71 | }; 72 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Publish to NPM 2 | 3 | on: 4 | release: 5 | types: 6 | - created 7 | 8 | jobs: 9 | deploy: 10 | runs-on: ${{ matrix.os }} 11 | env: 12 | TERM: xterm 13 | strategy: 14 | matrix: 15 | os: 16 | - ubuntu-24.04 17 | node-version: 18 | - '20' 19 | steps: 20 | - name: Checkout code 21 | uses: actions/checkout@v6 22 | - name: Install node ${{ matrix.node-version }} 23 | uses: actions/setup-node@v6 24 | with: 25 | node-version: ${{ matrix.node-version }} 26 | registry-url: https://registry.npmjs.org 27 | cache: npm 28 | - name: Install dependencies 29 | run: npm clean-install --prefer-offline --frozen-lockfile 30 | 31 | - name: Lint code 32 | run: npm run lint 33 | - name: Run unit tests 34 | run: npm run test:unit 35 | 36 | - name: Prepare release 37 | uses: lando/prepare-release-action@v3 38 | with: 39 | lando-plugin: true 40 | sync-email: rtfm47@lando.dev 41 | sync-token: ${{ secrets.RTFM47_COAXIUM_INJECTOR }} 42 | sync-username: rtfm-47 43 | 44 | - name: Publish to npm 45 | run: | 46 | VERSION=$(node -p "require('./package.json').version") 47 | PACKAGE=$(node -p "require('./package.json').name") 48 | 49 | if [ "${{ github.event.release.prerelease }}" == "false" ]; then 50 | npm publish --access public --dry-run 51 | npm publish --access public 52 | npm dist-tag add "$PACKAGE@$VERSION" edge 53 | 54 | echo "::notice title=Published $VERSION to $PACKAGE::This is a stable release published to the default 'latest' npm tag" 55 | echo "::notice title=Updated latest tag to $VERSION::The stable tag now points to $VERSION" 56 | echo "::notice title=Updated edge tag to $VERSION::The edge tag now points to $VERSION" 57 | else 58 | npm publish --access public --tag edge --dry-run 59 | npm publish --access public --tag edge 60 | 61 | echo "::notice title=Published $VERSION to $PACKAGE::This is a prerelease published to the 'edge' npm tag" 62 | echo "::notice title=Updated edge tag to $VERSION::The edge tag now points to $VERSION" 63 | fi 64 | env: 65 | NODE_AUTH_TOKEN: ${{secrets.NPM_DEPLOY_TOKEN}} 66 | -------------------------------------------------------------------------------- /examples/drupal10-mysql8/README.md: -------------------------------------------------------------------------------- 1 | # Drupal 10 w/MySQL 8 Example 2 | 3 | This example exists primarily to test the following documentation: 4 | 5 | * [Drupal 10 Recipe](https://docs.lando.dev/config/drupal10.html) 6 | 7 | ## Start up tests 8 | 9 | Run the following commands to get up and running with this example. 10 | 11 | ```bash 12 | # Should poweroff 13 | lando poweroff 14 | 15 | # Should initialize the latest Drupal 10 codebase 16 | rm -rf mysql8 && mkdir -p mysql8 && cd mysql8 17 | lando init --source remote --remote-url https://ftp.drupal.org/files/projects/drupal-10.0.x-dev.tar.gz --remote-options="--strip-components 1" --recipe drupal10 --webroot . --name lando-drupal10-mysql8 --option database=mysql:8.0.22 18 | 19 | # Should start up successfully 20 | cd mysql8 21 | cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml 22 | lando start 23 | ``` 24 | 25 | ## Verification commands 26 | 27 | Run the following commands to validate things are rolling as they should. 28 | 29 | ```bash 30 | # Should return the drupal installation page by default 31 | cd mysql8 32 | lando exec appserver -- curl -L localhost | grep "Drupal 10" 33 | 34 | # Should use 8.1 as the default php version 35 | cd mysql8 36 | lando php -v | grep "PHP 8.1" 37 | 38 | # Should be running apache 2.4 by default 39 | cd mysql8 40 | lando exec appserver -- apachectl -V | grep 2.4 41 | lando exec appserver -- curl -IL localhost | grep Server | grep 2.4 42 | 43 | # Should be running mysql 8.0.x by default 44 | cd mysql8 45 | lando mysql -V | grep 8.0 46 | 47 | # Should be running sqlite 3.40 by default 48 | cd mysql8 49 | lando php -r "print_r(SQLite3::version());" | grep versionString | grep 3.40 50 | 51 | # Should not enable xdebug by default 52 | cd mysql8 53 | lando php -m | grep xdebug || echo $? | grep 1 54 | 55 | # Should use the default database connection info 56 | cd mysql8 57 | lando mysql -udrupal10 -pdrupal10 drupal10 -e quit 58 | 59 | # Should use site-local drush if installed 60 | cd mysql8 61 | lando composer require drush/drush 62 | lando exec appserver -- which drush | grep "/app/vendor/bin/drush" 63 | 64 | # Should be able to install drupal 65 | cd mysql8 66 | lando drush si --db-url=mysql://drupal10:drupal10@database/drupal10 -y 67 | ``` 68 | 69 | ## Destroy tests 70 | 71 | Run the following commands to trash this app like nothing ever happened. 72 | 73 | ```bash 74 | # Should be destroyed with success 75 | cd mysql8 76 | lando destroy -y 77 | lando poweroff 78 | ``` 79 | -------------------------------------------------------------------------------- /lib/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // Modules 4 | const _ = require('lodash'); 5 | const path = require('path'); 6 | 7 | /* 8 | * Helper to get a phar download and setupcommand 9 | * @TODO: clean this mess up 10 | */ 11 | exports.getPhar = (url, src, dest, check = 'true') => { 12 | // Arrayify the check if needed 13 | if (_.isString(check)) check = [check]; 14 | // Phar install command 15 | const pharInstall = [ 16 | ['curl', url, '-LsS', '-o', src], 17 | ['chmod', '+x', src], 18 | ['mv', src, dest], 19 | check, 20 | ]; 21 | // Return 22 | return _.map(pharInstall, cmd => cmd.join(' ')).join(' && '); 23 | }; 24 | 25 | /* 26 | * Helper to get DRUSH phar url 27 | */ 28 | const getDrushUrl = version => `https://github.com/drush-ops/drush/releases/download/${version}/drush.phar`; 29 | 30 | /* 31 | * Helper to get the phar build command 32 | */ 33 | exports.getDrush = (version, status) => exports.getPhar( 34 | getDrushUrl(version), 35 | '/tmp/drush.phar', 36 | '/usr/local/bin/drush', 37 | status, 38 | ); 39 | 40 | /* 41 | * Helper to get a phar download and setupcommand 42 | * @TODO: clean this mess up 43 | */ 44 | exports.getPhar = (url, src, dest, check = 'true') => { 45 | // Arrayify the check if needed 46 | if (_.isString(check)) check = [check]; 47 | // Phar install command 48 | const pharInstall = [ 49 | ['curl', url, '-LsS', '-o', src], 50 | ['chmod', '+x', src], 51 | ['mv', src, dest], 52 | check, 53 | ]; 54 | // Return 55 | return _.map(pharInstall, cmd => cmd.join(' ')).join(' && '); 56 | }; 57 | 58 | /* 59 | * Helper to get service config 60 | */ 61 | exports.getServiceConfig = (options, types = ['php', 'server', 'vhosts']) => { 62 | const config = {}; 63 | _.forEach(types, type => { 64 | if (_.has(options, `config.${type}`)) { 65 | config[type] = options.config[type]; 66 | } else if (!_.has(options, `config.${type}`) && _.has(options, `defaultFiles.${type}`)) { 67 | if (_.has(options, 'confDest')) { 68 | config[type] = path.join(options.confDest, options.defaultFiles[type]); 69 | } 70 | } 71 | }); 72 | return config; 73 | }; 74 | 75 | /* 76 | * Parse config into raw materials for our factory 77 | */ 78 | exports.parseConfig = (recipe, app) => _.merge({}, _.get(app, 'config.config', {}), { 79 | _app: app, 80 | app: app.name, 81 | confDest: path.join(app._config.userConfRoot, 'config', recipe), 82 | home: app._config.home, 83 | project: app.project, 84 | recipe, 85 | root: app.root, 86 | userConfRoot: app._config.userConfRoot, 87 | }); 88 | -------------------------------------------------------------------------------- /examples/drupal9/README.md: -------------------------------------------------------------------------------- 1 | # Drupal 9 Example 2 | 3 | This example exists primarily to test the following documentation: 4 | 5 | * [Drupal 9 Recipe](https://docs.devwithlando.io/tutorials/drupal9.html) 6 | 7 | ## Start up tests 8 | 9 | Run the following commands to get up and running with this example. 10 | 11 | ```bash 12 | # Should poweroff 13 | lando poweroff 14 | 15 | # Should initialize the latest Drupal 9 codebase 16 | rm -rf drupal9 && mkdir -p drupal9 && cd drupal9 17 | lando init --source remote --remote-url https://ftp.drupal.org/files/projects/drupal-9.5.x-dev.tar.gz --remote-options="--strip-components 1" --recipe drupal9 --webroot . --name lando-drupal9 18 | 19 | # Should start up successfully 20 | cd drupal9 21 | cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml 22 | lando start 23 | ``` 24 | 25 | ## Verification commands 26 | 27 | Run the following commands to validate things are rolling as they should. 28 | 29 | ```bash 30 | # Should return the drupal installation page by default 31 | cd drupal9 32 | lando exec appserver -- curl -L localhost | grep "Drupal 9" 33 | 34 | # Should use 8.0 as the default php version 35 | cd drupal9 36 | lando php -v | grep "PHP 8.0" 37 | 38 | # Should be running apache 2.4 by default 39 | cd drupal9 40 | lando exec appserver -- apachectl -V | grep 2.4 41 | lando exec appserver -- curl -IL localhost | grep Server | grep 2.4 42 | 43 | # Should be running mysql 5.7 by default 44 | cd drupal9 45 | lando mysql -V | grep 5.7 46 | 47 | # Should be running sqlite 3.34 by default 48 | cd drupal9 49 | lando php -r "print_r(SQLite3::version());" | grep versionString | grep 3.34 50 | 51 | # Should not enable xdebug by default 52 | cd drupal9 53 | lando php -m | grep xdebug || echo $? | grep 1 54 | 55 | # Should use the default database connection info 56 | cd drupal9 57 | lando mysql -udrupal9 -pdrupal9 drupal9 -e quit 58 | 59 | # Should use a composer version above 2.3.6 60 | cd drupal9 61 | lando composer --version | cut -d " " -f 3 | head -n 1 | awk -v min=2.3.6 -F. '($1 > 2) || ($1 == 2 && $2 > 3) || ($1 == 2 && $2 == 3 && $3 > 6)' 62 | 63 | # Should use site-local drush if installed 64 | cd drupal9 65 | lando composer require drush/drush 66 | lando exec appserver -- which drush | grep "/app/vendor/bin/drush" 67 | 68 | # Should be able to install drupal 69 | cd drupal9 70 | lando drush si --db-url=mysql://drupal9:drupal9@database/drupal9 -y 71 | ``` 72 | 73 | ## Destroy tests 74 | 75 | Run the following commands to trash this app like nothing ever happened. 76 | 77 | ```bash 78 | # Should be destroyed with success 79 | cd drupal9 80 | lando destroy -y 81 | lando poweroff 82 | ``` 83 | -------------------------------------------------------------------------------- /examples/drupal10-nginx/README.md: -------------------------------------------------------------------------------- 1 | # Drupal 10 w/nginx Example 2 | 3 | This example exists primarily to test the following documentation: 4 | 5 | * [Drupal 10 Recipe](https://docs.lando.dev/config/drupal10.html) 6 | 7 | ## Start up tests 8 | 9 | Run the following commands to get up and running with this example. 10 | 11 | ```bash 12 | # Should poweroff 13 | lando poweroff 14 | 15 | # Should initialize the latest Drupal 10 codebase 16 | rm -rf nginx && mkdir -p nginx && cd nginx 17 | lando init --source remote --remote-url https://ftp.drupal.org/files/projects/drupal-10.0.x-dev.tar.gz --remote-options="--strip-components 1" --recipe drupal10 --webroot . --name lando-drupal10-nginx --option via=nginx 18 | 19 | # Should start up successfully 20 | cd nginx 21 | cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml 22 | lando start 23 | ``` 24 | 25 | ## Verification commands 26 | 27 | Run the following commands to validate things are rolling as they should. 28 | 29 | ```bash 30 | # Should return the drupal installation page by default 31 | cd nginx 32 | lando exec appserver -- curl -L appserver_nginx | grep "Drupal 10" 33 | 34 | # Should use 8.1 as the default php version 35 | cd nginx 36 | lando php -v | grep "PHP 8.1" 37 | 38 | # Should be running nginx 1.29 by default 39 | cd nginx 40 | lando exec appserver_nginx -- nginx -v 2>&1 | grep 1.29 41 | lando exec appserver -- curl -IL appserver_nginx | grep Server | grep nginx 42 | 43 | # Should be running mysql 5.7 by default 44 | cd nginx 45 | lando mysql -V | grep 5.7 46 | 47 | # Should be running sqlite 3.40 by default 48 | cd nginx 49 | lando php -r "print_r(SQLite3::version());" | grep versionString | grep 3.40 50 | 51 | # Should not enable xdebug by default 52 | cd nginx 53 | lando php -m | grep xdebug || echo $? | grep 1 54 | 55 | # Should use the default database connection info 56 | cd nginx 57 | lando mysql -udrupal10 -pdrupal10 drupal10 -e quit 58 | 59 | # Should use site-local drush if installed 60 | cd nginx 61 | lando composer require drush/drush 62 | lando exec appserver -- which drush | grep "/app/vendor/bin/drush" 63 | 64 | # Should be able to install drupal 65 | cd nginx 66 | lando drush si --db-url=mysql://drupal10:drupal10@database/drupal10 -y 67 | 68 | # Should be able to access jsonapi 69 | cd nginx 70 | lando drush en jsonapi -y 71 | lando exec appserver -- curl lando-drupal10-nginx.lndo.site/jsonapi | grep "action--action" 72 | ``` 73 | 74 | ## Destroy tests 75 | 76 | Run the following commands to trash this app like nothing ever happened. 77 | 78 | ```bash 79 | # Should be destroyed with success 80 | cd nginx 81 | lando destroy -y 82 | lando poweroff 83 | ``` 84 | -------------------------------------------------------------------------------- /docs/public/images/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/drupal11-nginx/README.md: -------------------------------------------------------------------------------- 1 | # Drupal 11 w/nginx Example 2 | 3 | This example exists primarily to test the following documentation: 4 | 5 | * [Drupal 11 Recipe](https://docs.lando.dev/config/drupal10.html) 6 | 7 | ## Start up tests 8 | 9 | Run the following commands to get up and running with this example. 10 | 11 | ```bash 12 | # Should poweroff 13 | lando poweroff 14 | 15 | # Should initialize the latest Drupal 11 codebase 16 | rm -rf nginx && mkdir -p nginx && cd nginx 17 | lando init --source remote --remote-url https://ftp.drupal.org/files/projects/drupal-11.0.x-dev.tar.gz --remote-options="--strip-components 1" --recipe drupal11 --webroot . --name lando-drupal11-nginx --option via=nginx 18 | 19 | # Should start up successfully 20 | cd nginx 21 | cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml 22 | lando start 23 | ``` 24 | 25 | ## Verification commands 26 | 27 | Run the following commands to validate things are rolling as they should. 28 | 29 | ```bash 30 | # Should return the drupal installation page by default 31 | cd nginx 32 | lando exec appserver -- curl -L appserver_nginx | grep "Drupal 11" 33 | 34 | # Should use 8.3 as the default php version 35 | cd nginx 36 | lando php -v | grep "PHP 8.3" 37 | 38 | # Should be running nginx 1.29 by default 39 | cd nginx 40 | lando exec appserver_nginx -- nginx -v 2>&1 | grep 1.29 41 | lando exec appserver -- curl -IL appserver_nginx | grep Server | grep nginx 42 | 43 | # Should be running mysql 8.0.x by default 44 | cd nginx 45 | lando mysql -V | grep 8.0 46 | 47 | # Should be running sqlite 3.45 by default 48 | cd nginx 49 | lando php -r "print_r(SQLite3::version());" | grep versionString | tee >(cat 1>&2) | grep 3.45 50 | 51 | # Should not enable xdebug by default 52 | cd nginx 53 | lando php -m | grep xdebug || echo $? | grep 1 54 | 55 | # Should use the default database connection info 56 | cd nginx 57 | lando mysql -udrupal11 -pdrupal11 drupal11 -e quit 58 | 59 | # Should use site-local drush if installed 60 | cd nginx 61 | lando composer require drush/drush 62 | lando exec appserver -- which drush | grep "/app/vendor/bin/drush" 63 | 64 | # Should be able to install drupal 65 | cd nginx 66 | lando drush si --db-url=mysql://drupal11:drupal11@database/drupal11 -y 67 | 68 | # Should be able to enable and access jsonapi 69 | cd nginx 70 | lando drush en jsonapi -y 71 | lando exec appserver -- curl lando-drupal11-nginx.lndo.site/jsonapi | grep "action--action" 72 | ``` 73 | 74 | ## Destroy tests 75 | 76 | Run the following commands to trash this app like nothing ever happened. 77 | 78 | ```bash 79 | # Should be destroyed with success 80 | cd nginx 81 | lando destroy -y 82 | lando poweroff 83 | ``` 84 | -------------------------------------------------------------------------------- /docs/legacy/drupal-6.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Lando docs for Drupal 6 (legacy version). 3 | --- 4 | 5 | # Drupal 6 6 | 7 | ## Quickstart 8 | 9 | ```bash:no-line-numbers 10 | # Initialize a drupal6 recipe using the latest Drupal 6 version 11 | mkdir my-first-drupal6-app \ 12 | && cd my-first-drupal6-app \ 13 | && lando init \ 14 | --source remote \ 15 | --remote-url https://ftp.drupal.org/files/projects/drupal-6.38.tar.gz \ 16 | --remote-options="--strip-components 1" \ 17 | --recipe drupal6 \ 18 | --webroot . \ 19 | --name my-first-drupal6-app 20 | 21 | # Start it up 22 | lando start 23 | 24 | # Install drupal 25 | lando drush si --db-url=mysql://drupal6:drupal6@database/drupal6 -y 26 | 27 | # List information about this app. 28 | lando info 29 | ``` 30 | 31 | ## Default Configuration 32 | 33 | ```yaml 34 | recipe: drupal6 35 | config: 36 | php: '5.6' 37 | composer_version: '2.0.7' 38 | via: apache:2.4 39 | webroot: . 40 | database: mysql:5.7 41 | drush: ^8 42 | xdebug: false 43 | ``` 44 | 45 | ## Using Drush 46 | 47 | By default, our Drupal 6 recipe will globally install the [latest version of Drush 8](http://docs.drush.org/en/8.x/install/) or the [latest version of Drush 7](http://docs.drush.org/en/7.x/install/) if you are using php 5.3. This means that you should be able to use `lando drush` out of the box. 48 | 49 | That said you can configure this recipe to use any version of Drush to which there is a resolvable package available via `composer`. That means that the following are all valid. 50 | 51 | **Use the latest version of Drush** 52 | 53 | ```yaml 54 | recipe: drupal6 55 | config: 56 | drush: "*" 57 | ``` 58 | 59 | **Use the latest version of Drush 7** 60 | 61 | ```yaml 62 | recipe: drupal6 63 | config: 64 | drush: ^7 65 | ``` 66 | 67 | **Use a specific version of Drush 8** 68 | 69 | ```yaml 70 | recipe: drupal6 71 | config: 72 | drush: 8.1.15 73 | ``` 74 | 75 | ## Configuring your root directory 76 | 77 | If you are using a webroot besides `.`, you will need to remember to `cd` into that directory and run `lando drush` from there. This is because many site-specific `drush` commands will only run correctly if you run `drush` from a directory that also contains a Drupal site. 78 | 79 | If you are annoyed by having to `cd` into that directory every time you run a `drush` command, you can get around it by [overriding](https://docs.lando.dev/landofile/tooling.html#overriding) the `drush` tooling command in your [Landofile](https://docs.lando.dev/landofile/) so that Drush always runs from your `webroot`. 80 | 81 | **Note that hard coding the `root` like this may have unforeseen and bad consequences for some `drush` commands such as `drush scr`.** 82 | 83 | ```yaml 84 | tooling: 85 | drush: 86 | service: appserver 87 | cmd: drush --root=/app/PATH/TO/WEBROOT 88 | ``` 89 | -------------------------------------------------------------------------------- /examples/drupal10/README.md: -------------------------------------------------------------------------------- 1 | # Drupal 10 Example 2 | 3 | This example exists primarily to test the following documentation: 4 | 5 | * [Drupal 10 Recipe](https://docs.lando.dev/config/drupal10.html) 6 | 7 | ## Start up tests 8 | 9 | Run the following commands to get up and running with this example. 10 | 11 | ```bash 12 | # Should poweroff 13 | lando poweroff 14 | 15 | # Should initialize the latest Drupal 10 codebase 16 | rm -rf drupal10 && mkdir -p drupal10 && cd drupal10 17 | lando init --source remote --remote-url https://ftp.drupal.org/files/projects/drupal-10.0.x-dev.tar.gz --remote-options="--strip-components 1" --recipe drupal10 --webroot . --name lando-drupal10 18 | 19 | # Should start up successfully 20 | cd drupal10 21 | cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml 22 | lando start 23 | ``` 24 | 25 | ## Verification commands 26 | 27 | Run the following commands to validate things are rolling as they should. 28 | 29 | ```bash 30 | # Should return the drupal installation page by default 31 | cd drupal10 32 | lando exec appserver -- curl -L localhost | grep "Drupal 10" 33 | 34 | # Should use 8.1 as the default php version 35 | cd drupal10 36 | lando php -v | grep "PHP 8.1" 37 | 38 | # Should be running apache 2.4 by default 39 | cd drupal10 40 | lando exec appserver -- apachectl -V | grep 2.4 41 | lando exec appserver -- curl -IL localhost | grep Server | grep 2.4 42 | 43 | # Should be running mysql 5.7 by default 44 | cd drupal10 45 | lando mysql -V | grep 5.7 46 | 47 | # Should be running sqlite 3.40 by default 48 | cd drupal10 49 | lando php -r "print_r(SQLite3::version());" | grep versionString | grep 3.40 50 | 51 | # Should not enable xdebug by default 52 | cd drupal10 53 | lando php -m | grep xdebug || echo $? | grep 1 54 | 55 | # Should use the default database connection info 56 | cd drupal10 57 | lando mysql -udrupal10 -pdrupal10 drupal10 -e quit 58 | 59 | # Should use a composer version above 2.3.6 60 | cd drupal10 61 | lando composer --version | cut -d " " -f 3 | head -n 1 | awk -v min=2.3.6 -F. '($1 > 2) || ($1 == 2 && $2 > 3) || ($1 == 2 && $2 == 3 && $3 > 6)' 62 | 63 | # Should use site-local drush if installed 64 | cd drupal10 65 | lando composer require drush/drush 66 | lando exec appserver -- which drush | grep "/app/vendor/bin/drush" 67 | 68 | # Should be able to install drupal 69 | cd drupal10 70 | lando drush si --db-url=mysql://drupal10:drupal10@database/drupal10 -y 71 | 72 | # Should be able to enable and access jsonapi 73 | cd drupal10 74 | lando drush en jsonapi -y 75 | lando exec appserver -- curl localhost/jsonapi | grep "action--action" 76 | ``` 77 | 78 | ## Destroy tests 79 | 80 | Run the following commands to trash this app like nothing ever happened. 81 | 82 | ```bash 83 | # Should be destroyed with success 84 | cd drupal10 85 | lando destroy -y 86 | lando poweroff 87 | ``` 88 | -------------------------------------------------------------------------------- /examples/drupal8/README.md: -------------------------------------------------------------------------------- 1 | # Drupal 8 Example 2 | 3 | This example exists primarily to test the following documentation: 4 | 5 | * [Drupal 8 Recipe](https://docs.devwithlando.io/tutorials/drupal8.html) 6 | 7 | ## Start up tests 8 | 9 | Run the following commands to get up and running with this example. 10 | 11 | ```bash 12 | # Should poweroff 13 | lando poweroff 14 | 15 | # Should initialize the latest Drupal 8 codebase 16 | rm -rf drupal8 && mkdir -p drupal8 && cd drupal8 17 | lando init --source remote --remote-url https://ftp.drupal.org/files/projects/drupal-8.9.20.tar.gz --remote-options="--strip-components 1" --recipe drupal8 --webroot . --name lando-drupal8 --option database=mysql:8.0 --option composer_version=2.1.14 18 | 19 | # Should copy in the .lando.upstream.yml 20 | cd drupal8 21 | cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml 22 | 23 | # Should start up successfully 24 | cd drupal8 25 | lando start 26 | ``` 27 | 28 | ## Verification commands 29 | 30 | Run the following commands to validate things are rolling as they should. 31 | 32 | ```bash 33 | # Should return the drupal installation page by default 34 | cd drupal8 35 | lando exec appserver -- curl -L localhost | grep "Drupal 8" 36 | 37 | # Should use 7.3 as the default php version 38 | cd drupal8 39 | lando php -v | grep "PHP 7.3" 40 | 41 | # Should be running apache 2.4 by default 42 | cd drupal8 43 | lando exec appserver -- apachectl -V | grep 2.4 44 | lando exec appserver -- curl -IL localhost | grep Server | grep 2.4 45 | 46 | # Should be running mysql 8.0 47 | cd drupal8 48 | lando mysql -V | grep 8.0 49 | 50 | # Should be using the mysql_native_password authentication plugin by default 51 | cd drupal8 52 | lando mysql -e "SELECT user,plugin FROM mysql.user;" | grep drupal8 | grep mysql_native_password 53 | 54 | # Should not enable xdebug by default 55 | cd drupal8 56 | lando php -m | grep xdebug || echo $? | grep 1 57 | 58 | # Should use the default database connection info 59 | cd drupal8 60 | lando mysql -udrupal8 -pdrupal8 drupal8 -e quit 61 | 62 | # Should use drush 8.5.0 63 | cd drupal8 64 | lando drush version | tee >(cat 1>&2) | grep 8.5.0 65 | 66 | # Should be able to install drupal 67 | cd drupal8 68 | lando drush site:install --db-url=mysql://drupal8:drupal8@database/drupal8 -y 69 | 70 | # Should install drupal console 71 | # cd drupal8 72 | # chmod -Rv 755 sites/default 73 | # lando composer require drupal/console:~1.0 --prefer-dist --optimize-autoloader 74 | true 75 | 76 | # Should have drupal console 77 | # cd drupal8 78 | # lando drupal -V 79 | true 80 | 81 | # Should be able to handoff to sitelocal drush without issue 82 | cd drupal8 83 | chmod -Rv 755 sites/default 84 | lando composer require drush/drush:10.2.2 85 | lando drush version | grep 10.2.2 86 | ``` 87 | 88 | ## Destroy tests 89 | 90 | Run the following commands to trash this app like nothing ever happened. 91 | 92 | ```bash 93 | # Should be destroyed with success 94 | cd drupal8 95 | lando destroy -y 96 | lando poweroff 97 | ``` 98 | -------------------------------------------------------------------------------- /examples/drupal11/README.md: -------------------------------------------------------------------------------- 1 | # Drupal 11 Example 2 | 3 | This example exists primarily to test the following documentation: 4 | 5 | * [Drupal 11 Recipe](https://docs.lando.dev/plugins/drupal) 6 | 7 | ## Start up tests 8 | 9 | Run the following commands to get up and running with this example. 10 | 11 | ```bash 12 | # Should poweroff 13 | lando poweroff 14 | 15 | # Should initialize the latest Drupal 11 codebase 16 | rm -rf drupal11 && mkdir -p drupal11 && cd drupal11 17 | lando init --source remote --remote-url https://ftp.drupal.org/files/projects/drupal-11.2.x-dev.tar.gz --remote-options="--strip-components 1" --recipe drupal11 --webroot . --name lando-drupal11 18 | 19 | # Should start up successfully 20 | cd drupal11 21 | cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml 22 | lando start 23 | ``` 24 | 25 | ## Verification commands 26 | 27 | Run the following commands to validate things are rolling as they should. 28 | 29 | ```bash 30 | # Should include recipe defaults in the landofile 31 | cd drupal11 32 | cat .lando.yml | tee >(cat 1>&2) | grep 'php: "8.3"' 33 | cat .lando.yml | grep "drush: ^13" 34 | cat .lando.yml | grep "composer_version: 2-latest" 35 | 36 | # Should return the drupal installation page by default 37 | cd drupal11 38 | lando exec appserver -- curl -L localhost | grep "Drupal 11" 39 | 40 | # Should use 8.3 as the default php version 41 | cd drupal11 42 | lando php -v | grep "PHP 8.3" 43 | 44 | # Should be running apache 2.4 by default 45 | cd drupal11 46 | lando exec appserver -- apachectl -V | grep 2.4 47 | lando exec appserver -- curl -IL localhost | grep Server | grep 2.4 48 | 49 | # Should be running mysql 8.0.x by default 50 | cd drupal11 51 | lando mysql -V | grep 8.0 52 | 53 | # Should be running sqlite 3.45 by default 54 | cd drupal11 55 | lando php -r "print_r(SQLite3::version());" | grep versionString | tee >(cat 1>&2) | grep 3.45 56 | 57 | # Should not enable xdebug by default 58 | cd drupal11 59 | lando php -m | grep xdebug || echo $? | grep 1 60 | 61 | # Should use the default database connection info 62 | cd drupal11 63 | lando mysql -udrupal11 -pdrupal11 drupal11 -e quit 64 | 65 | # Should use a composer version above 2.7.0 66 | cd drupal11 67 | lando composer --version | cut -d " " -f 3 | head -n 1 | awk -v min=2.7.0 -F. '($1 > 2) || ($1 == 2 && $2 > 7) || ($1 == 2 && $2 == 7 && $3 > 0)' 68 | 69 | # Should use site-local drush if installed 70 | cd drupal11 71 | lando composer require drush/drush 72 | lando exec appserver -- which drush | grep "/app/vendor/bin/drush" 73 | 74 | # Should be able to install drupal 75 | cd drupal11 76 | lando drush si --db-url=mysql://drupal11:drupal11@database/drupal11 -y 77 | 78 | # Should be able to enable and access jsonapi 79 | cd drupal11 80 | lando drush en jsonapi -y 81 | lando exec appserver -- curl localhost/jsonapi | grep "action--action" 82 | 83 | # Should have webroot set in the landofile 84 | cd drupal11 85 | cat .lando.yml | grep "webroot: ." 86 | ``` 87 | 88 | ## Destroy tests 89 | 90 | Run the following commands to trash this app like nothing ever happened. 91 | 92 | ```bash 93 | # Should be destroyed with success 94 | cd drupal11 95 | lando destroy -y 96 | lando poweroff 97 | ``` 98 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Drupal Lando Plugin 2 | 3 | This is the _official_ [Lando](https://lando.dev) plugin for [Drupal](https://www.drupal.org/). When installed it... 4 | 5 | * Allows users to run `drupal` cms 6 | * Allows users to configure `php` version from `5.3` all the way to `8.4+` 7 | * Allows users to configure `webroot` 8 | * Allows users to configure web server to (`apache` or `nginx`) 9 | * Allows users to configure database backend to (`mariadb`, `mysql`, or `postgres`) 10 | * Allows users to configure `composer` 11 | * Allows users to run `drush` commands 12 | * Allows users to configure `xdebug` 13 | 14 | Of course, once a user is running their Drupal project with Lando they can take advantage of [all the other awesome development features](https://docs.lando.dev) Lando provides. 15 | 16 | ## Basic Usage 17 | 18 | Add a `drupal11` recipe to your Landofile 19 | 20 | ```yaml 21 | name: Drupal 11 22 | recipe: drupal11 23 | config: 24 | php: 8.3 25 | via: apache:2.4 26 | database: mysql:8.0 27 | ``` 28 | 29 | For more info you should check out the [docs](https://docs.lando.dev/drupal): 30 | 31 | * [Getting Started](https://docs.lando.dev/drupal/getting-started.html) 32 | * [Configuration](https://docs.lando.dev/drupal/config.html) 33 | * [Tooling](https://docs.lando.dev/drupal/tooling.html) 34 | * [Examples](https://github.com/lando/drupal/tree/main/examples) 35 | * [Development](https://docs.lando.dev/drupal/development.html) 36 | 37 | ## Installation 38 | 39 | ```bash 40 | # With npm 41 | npm install @lando/drupal 42 | ``` 43 | 44 | ## Issues, Questions and Support 45 | 46 | If you have a question or would like some community support we recommend you [join us on Slack](https://launchpass.com/devwithlando). 47 | 48 | If you'd like to report a bug or submit a feature request then please [use the issue queue](https://github.com/lando/drupal/issues/new/choose) in this repo. 49 | 50 | ## Changelog 51 | 52 | We try to log all changes big and small in both [THE CHANGELOG](https://github.com/lando/drupal/blob/main/CHANGELOG.md) and the [release notes](https://github.com/lando/drupal/releases). 53 | 54 | 55 | ## Development 56 | 57 | * Requires [Node 20+](https://nodejs.org/dist/latest-v20.x/) 58 | 59 | ```bash 60 | git clone https://github.com/lando/drupal.git && cd drupal 61 | npm install 62 | ``` 63 | 64 | ## Testing 65 | 66 | ```bash 67 | # Lint the code 68 | npm run lint 69 | 70 | # Run unit tests 71 | npm test 72 | ``` 73 | 74 | ## Releasing 75 | 76 | ```bash 77 | npm release 78 | ``` 79 | 80 | 81 | ## Maintainers 82 | 83 | * [@pirog](https://github.com/pirog) 84 | * [@reynoldsalec](https://github.com/reynoldsalec) 85 | * [@AaronFeledy](https://github.com/AaronFeledy) 86 | 87 | ## Contributors 88 | 89 | 90 | 91 | 92 | 93 | Made with [contributors-img](https://contrib.rocks). 94 | 95 | ## Other Resources 96 | 97 | * [LICENSE](/LICENSE) 98 | * [TERMS OF USE](https://docs.lando.dev/terms) 99 | * [PRIVACY POLICY](https://docs.lando.dev/privacy) 100 | * [CODE OF CONDUCT](https://docs.lando.dev/coc) 101 | 102 | -------------------------------------------------------------------------------- /docs/guides/landoify-d7.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Drupal 7 Landoize an Extant App 3 | description: Use Lando as local development environment for an existing Drupal 7 app. 4 | guide: true 5 | authors: 6 | - name: Geoff St. Pierre 7 | pic: https://www.gravatar.com/avatar/e103c2a2a8f8caf5848b38b80422cdd9 8 | link: https://twitter.com/serundeputy 9 | updated: 10 | timestamp: 1613073690000 11 | mailchimp: 12 | action: https://dev.us12.list-manage.com/subscribe/post?u=59874b4d6910fa65e724a4648&id=613837077f 13 | title: Want more Drupal guide content? 14 | byline: Signup and we will send you a weekly blog digest of similar content to keep you satiated. 15 | button: Sign me up! 16 | --- 17 | 18 | # Drupal 7 Landoize an Extant App 19 | 20 | If you and your team have an existing Drupal 7 application that you would like to use Lando for local development you just need to add a `.lando.yml` configuration file 21 | to the project and commit it to git. 22 | 23 | First in a terminal move to the directory that contains your Drupal 7 project: 24 | 25 | ```bash 26 | cd PATH/TO/YOUR/DRUPAL7/APP 27 | ``` 28 | 29 | ## Lando Init 30 | 31 | 32 | Then use the `lando init` command to build your `.lando.yml` file: 33 | 34 | ```bash 35 | lando init 36 | ``` 37 | 38 | Lando will ask you `From where should we get your app's codebase?` select `current working directory`. 39 | 40 | 41 | 42 | Then Lando will ask you `What recipe do you want to use?` select `drupal7`. 43 | 44 | 45 | 46 | Then Lando needs to know what directory has the Drupal code it asks `Where is your webroot relative to the init destination?` If your 47 | code is in the current directory you can just hit enter. 48 | 49 | 50 | 51 | 52 | ::: tip Nested Web Root 53 | If you are using a nested web root then you should 54 | specify the path to the Drupal code here like: `web` 55 | ::: 56 | 57 | Then Lando prompts for the app name: ` What do you want to call this app?` you can type anything you like, i.e. MyApp. 58 | 59 | 60 | 61 | The `lando init` command will create the `.lando.yml` config file for you. If you chose the `drupal7` recipe your config file should look like this: 62 | 63 | ```yaml 64 | name: myapp 65 | recipe: drupal7 66 | config: 67 | webroot: . 68 | ``` 69 | 70 | ## Lando Start 71 | 72 | 73 | Now you are ready to start your app. 74 | 75 | ```bash 76 | lando start 77 | ``` 78 | 79 | This will build out the containers necessary for your Drupal 7 app. You'll end up with a screen like this once the app is started: 80 | 81 | 82 | 83 | Now you can copy any one of the resulting URLs and paste it into a browser to visit your Drupal 7 app running in Lando! 84 | 85 | ## Pro Tips 86 | 87 | If you issue additional terminal commands or clear the screen you can get the URLs and other info about your app anytime by using the `lando info` command: 88 | 89 | ```bash 90 | lando info 91 | ``` 92 | 93 | The info command will give you lots of useful information about your app: 94 | 95 | 96 | -------------------------------------------------------------------------------- /examples/drupal7/README.md: -------------------------------------------------------------------------------- 1 | # Drupal 7 Example 2 | 3 | This example exists primarily to test the following documentation: 4 | 5 | * [Drupal 7 Recipe](https://docs.devwithlando.io/tutorials/drupal7.html) 6 | 7 | ## Start up tests 8 | 9 | Run the following commands to get up and running with this example. 10 | 11 | ```bash 12 | # Should poweroff 13 | lando poweroff 14 | 15 | # Should initialize the latest Drupal 7 codebase 16 | rm -rf drupal7 && mkdir -p drupal7 && cd drupal7 17 | lando init --source remote --remote-url https://ftp.drupal.org/files/projects/drupal-7.71.tar.gz --remote-options="--strip-components 1" --recipe drupal7 --webroot . --name lando-drupal7 --option drush="^8" 18 | 19 | # Should start up successfully 20 | cd drupal7 21 | cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml 22 | cp -f ../lando.local.yml .lando.local.yml && cat .lando.local.yml 23 | lando start 24 | ``` 25 | 26 | ## Verification commands 27 | 28 | Run the following commands to validate things are rolling as they should. 29 | 30 | ```bash 31 | # Should return the drupal installation page by default 32 | cd drupal7 33 | lando exec appserver -- curl -L localhost | grep "Drupal 7" 34 | 35 | # Should use 7.4 as the default php version 36 | cd drupal7 37 | lando php -v | grep "PHP 7.4" 38 | 39 | # Should be running apache 2.4 by default 40 | cd drupal7 41 | lando exec appserver -- apachectl -V | grep 2.4 42 | lando exec appserver -- curl -IL localhost | grep Server | grep 2.4 43 | 44 | # Should be running mysql 5.7 by default 45 | cd drupal7 46 | lando mysql -V | grep 5.7 47 | 48 | # Should be using the mysql_native_password authentication plugin by default 49 | cd drupal7 50 | lando mysql -e "SELECT user,plugin FROM mysql.user;" | grep drupal7 | grep mysql_native_password 51 | 52 | # Should not enable xdebug by default 53 | cd drupal7 54 | lando php -m | grep xdebug || echo $? | grep 1 55 | 56 | # Should use the default database connection info 57 | cd drupal7 58 | lando mysql -udrupal7 -pdrupal7 drupal7 -e quit 59 | 60 | # Should use drush 8.5.x by default 61 | cd drupal7 62 | lando drush version | grep 8.5 63 | 64 | # Should be able to install drupal 65 | cd drupal7 66 | lando drush si --db-url=mysql://drupal7:drupal7@database/drupal7 -y 67 | 68 | # Should have infinite memory for drush 69 | cd drupal7 70 | lando drush eval "phpinfo();" | grep memory_limit | grep -e "-1" 71 | 72 | # Should have SIMPLETEST envvars set correctly 73 | cd drupal7 74 | lando exec appserver -- env | grep SIMPLETEST_BASE_URL | grep "https://appserver" 75 | lando exec appserver -- env | grep SIMPLETEST_DB | grep "mysql://drupal7:drupal7@database/drupal7" 76 | 77 | # Should have proxy urls present in lando info 78 | cd drupal7 79 | lando info | grep "lando-drupal7.lndo.site" 80 | lando info | grep "another.lando-drupal7.lndo.site" 81 | 82 | # Should be able to pipe data directly into lando drush sql-cli 83 | cd drupal7 84 | lando db-export --stdout > dump.sql 85 | lando destroy -y 86 | lando start 87 | lando drush sql-cli < dump.sql 88 | lando mysql drupal7 -e "show tables;" | grep user 89 | ``` 90 | 91 | ## Destroy tests 92 | 93 | Run the following commands to trash this app like nothing ever happened. 94 | 95 | ```bash 96 | # Should be destroyed with success 97 | cd drupal7 98 | lando destroy -y 99 | lando poweroff 100 | ``` 101 | -------------------------------------------------------------------------------- /config/drupal6/mysql8.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # The MySQL database server configuration file for Lando 3 | # 4 | # LANDODRUPALMYSQL8CNF 5 | 6 | [mysqld] 7 | # 8 | # * Basic Settings 9 | # 10 | # Data is stored in a volume on the db container /sql 11 | default-storage-engine = innodb 12 | 13 | # 14 | # * Fine Tuning 15 | # 16 | key_buffer_size = 384M 17 | max_allowed_packet = 32M 18 | thread_stack = 400K 19 | thread_cache_size = 8 20 | # This replaces the startup script and checks MyISAM tables if needed 21 | # the first time they are touched 22 | #max_connections = 100 23 | #table_cache = 64 24 | #thread_concurrency = 10 25 | read_rnd_buffer_size = 8M 26 | myisam_sort_buffer_size = 64M 27 | table_open_cache = 512 28 | sort_buffer_size = 2M 29 | read_buffer_size = 2M 30 | 31 | # 32 | # * Logging and Replication 33 | # 34 | # Both location gets rotated by the cronjob. 35 | # Be aware that this log type is a performance killer. 36 | # As of 5.1 you can enable the log at runtime! 37 | #general_log_file = /src/.lando/log/mysql.log 38 | #general_log = 1 39 | # 40 | # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. 41 | # 42 | # Here you can see queries with especially long duration 43 | #log_slow_queries = /var/log/mysql/mysql-slow.log 44 | #long_query_time = 2 45 | #log-queries-not-using-indexes 46 | # 47 | # The following can be used as easy to replay backup logs or for replication. 48 | # note: if you are setting up a replication slave, see README.Debian about 49 | # other settings you may need to change. 50 | #server-id = 1 51 | #log_bin = /src/.lando/log/mysql-bin.log 52 | expire_logs_days = 10 53 | max_binlog_size = 101M 54 | #binlog_do_db = include_database_name 55 | #binlog_ignore_db = include_database_name 56 | # 57 | # * InnoDB 58 | # 59 | # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. 60 | # Read the manual for more InnoDB related options. There are many! 61 | # 62 | # Uncomment the following if you are using InnoDB tables 63 | #innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend 64 | #innodb_log_group_home_dir = C:\mysql\data/ 65 | # You can set .._buffer_pool_size up to 50 - 80 % 66 | # of RAM but beware of setting memory usage too high 67 | #innodb_buffer_pool_size = 384M 68 | #innodb_additional_mem_pool_size = 20M 69 | # Set .._log_file_size to 25 % of buffer pool size 70 | innodb_log_file_size = 100M 71 | #innodb_log_buffer_size = 8M 72 | innodb_flush_log_at_trx_commit = 0 73 | #innodb_lock_wait_timeout = 50 74 | innodb_buffer_pool_size = 384M 75 | innodb_log_buffer_size = 4M 76 | innodb_file_per_table = 1 77 | innodb_open_files = 256 78 | innodb_io_capacity = 512 79 | innodb_flush_method = O_DIRECT 80 | innodb_thread_concurrency = 8 81 | innodb_lock_wait_timeout = 127 82 | # 83 | # * Security Features 84 | # 85 | # Read the manual, too, if you want chroot! 86 | # chroot = /var/lib/mysql/ 87 | # 88 | # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". 89 | # 90 | # ssl-ca=/etc/mysql/cacert.pem 91 | # ssl-cert=/etc/mysql/server-cert.pem 92 | # ssl-key=/etc/mysql/server-key.pem 93 | 94 | [mysqldump] 95 | quick 96 | quote-names 97 | max_allowed_packet = 32M 98 | 99 | [mysql] 100 | #no-auto-rehash # faster start of mysql but no tab completion 101 | 102 | [isamchk] 103 | key_buffer_size = 384M 104 | sort_buffer_size = 256M 105 | read_buffer = 2M 106 | write_buffer = 2M 107 | -------------------------------------------------------------------------------- /config/drupal7/mysql8.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # The MySQL database server configuration file for Lando 3 | # 4 | # LANDODRUPALMYSQL8CNF 5 | 6 | [mysqld] 7 | # 8 | # * Basic Settings 9 | # 10 | # Data is stored in a volume on the db container /sql 11 | default-storage-engine = innodb 12 | 13 | # 14 | # * Fine Tuning 15 | # 16 | key_buffer_size = 384M 17 | max_allowed_packet = 32M 18 | thread_stack = 400K 19 | thread_cache_size = 8 20 | # This replaces the startup script and checks MyISAM tables if needed 21 | # the first time they are touched 22 | #max_connections = 100 23 | #table_cache = 64 24 | #thread_concurrency = 10 25 | read_rnd_buffer_size = 8M 26 | myisam_sort_buffer_size = 64M 27 | table_open_cache = 512 28 | sort_buffer_size = 2M 29 | read_buffer_size = 2M 30 | 31 | # 32 | # * Logging and Replication 33 | # 34 | # Both location gets rotated by the cronjob. 35 | # Be aware that this log type is a performance killer. 36 | # As of 5.1 you can enable the log at runtime! 37 | #general_log_file = /src/.lando/log/mysql.log 38 | #general_log = 1 39 | # 40 | # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. 41 | # 42 | # Here you can see queries with especially long duration 43 | #log_slow_queries = /var/log/mysql/mysql-slow.log 44 | #long_query_time = 2 45 | #log-queries-not-using-indexes 46 | # 47 | # The following can be used as easy to replay backup logs or for replication. 48 | # note: if you are setting up a replication slave, see README.Debian about 49 | # other settings you may need to change. 50 | #server-id = 1 51 | #log_bin = /src/.lando/log/mysql-bin.log 52 | expire_logs_days = 10 53 | max_binlog_size = 101M 54 | #binlog_do_db = include_database_name 55 | #binlog_ignore_db = include_database_name 56 | # 57 | # * InnoDB 58 | # 59 | # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. 60 | # Read the manual for more InnoDB related options. There are many! 61 | # 62 | # Uncomment the following if you are using InnoDB tables 63 | #innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend 64 | #innodb_log_group_home_dir = C:\mysql\data/ 65 | # You can set .._buffer_pool_size up to 50 - 80 % 66 | # of RAM but beware of setting memory usage too high 67 | #innodb_buffer_pool_size = 384M 68 | #innodb_additional_mem_pool_size = 20M 69 | # Set .._log_file_size to 25 % of buffer pool size 70 | innodb_log_file_size = 100M 71 | #innodb_log_buffer_size = 8M 72 | innodb_flush_log_at_trx_commit = 0 73 | #innodb_lock_wait_timeout = 50 74 | innodb_buffer_pool_size = 384M 75 | innodb_log_buffer_size = 4M 76 | innodb_file_per_table = 1 77 | innodb_open_files = 256 78 | innodb_io_capacity = 512 79 | innodb_flush_method = O_DIRECT 80 | innodb_thread_concurrency = 8 81 | innodb_lock_wait_timeout = 127 82 | # 83 | # * Security Features 84 | # 85 | # Read the manual, too, if you want chroot! 86 | # chroot = /var/lib/mysql/ 87 | # 88 | # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". 89 | # 90 | # ssl-ca=/etc/mysql/cacert.pem 91 | # ssl-cert=/etc/mysql/server-cert.pem 92 | # ssl-key=/etc/mysql/server-key.pem 93 | 94 | [mysqldump] 95 | quick 96 | quote-names 97 | max_allowed_packet = 32M 98 | 99 | [mysql] 100 | #no-auto-rehash # faster start of mysql but no tab completion 101 | 102 | [isamchk] 103 | key_buffer_size = 384M 104 | sort_buffer_size = 256M 105 | read_buffer = 2M 106 | write_buffer = 2M 107 | -------------------------------------------------------------------------------- /config/drupal8/mysql8.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # The MySQL database server configuration file for Lando 3 | # 4 | # LANDODRUPALMYSQL8CNF 5 | 6 | [mysqld] 7 | # 8 | # * Basic Settings 9 | # 10 | # Data is stored in a volume on the db container /sql 11 | default-storage-engine = innodb 12 | 13 | # 14 | # * Fine Tuning 15 | # 16 | key_buffer_size = 384M 17 | max_allowed_packet = 32M 18 | thread_stack = 400K 19 | thread_cache_size = 8 20 | # This replaces the startup script and checks MyISAM tables if needed 21 | # the first time they are touched 22 | #max_connections = 100 23 | #table_cache = 64 24 | #thread_concurrency = 10 25 | read_rnd_buffer_size = 8M 26 | myisam_sort_buffer_size = 64M 27 | table_open_cache = 512 28 | sort_buffer_size = 2M 29 | read_buffer_size = 2M 30 | 31 | # 32 | # * Logging and Replication 33 | # 34 | # Both location gets rotated by the cronjob. 35 | # Be aware that this log type is a performance killer. 36 | # As of 5.1 you can enable the log at runtime! 37 | #general_log_file = /src/.lando/log/mysql.log 38 | #general_log = 1 39 | # 40 | # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. 41 | # 42 | # Here you can see queries with especially long duration 43 | #log_slow_queries = /var/log/mysql/mysql-slow.log 44 | #long_query_time = 2 45 | #log-queries-not-using-indexes 46 | # 47 | # The following can be used as easy to replay backup logs or for replication. 48 | # note: if you are setting up a replication slave, see README.Debian about 49 | # other settings you may need to change. 50 | #server-id = 1 51 | #log_bin = /src/.lando/log/mysql-bin.log 52 | expire_logs_days = 10 53 | max_binlog_size = 101M 54 | #binlog_do_db = include_database_name 55 | #binlog_ignore_db = include_database_name 56 | # 57 | # * InnoDB 58 | # 59 | # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. 60 | # Read the manual for more InnoDB related options. There are many! 61 | # 62 | # Uncomment the following if you are using InnoDB tables 63 | #innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend 64 | #innodb_log_group_home_dir = C:\mysql\data/ 65 | # You can set .._buffer_pool_size up to 50 - 80 % 66 | # of RAM but beware of setting memory usage too high 67 | #innodb_buffer_pool_size = 384M 68 | #innodb_additional_mem_pool_size = 20M 69 | # Set .._log_file_size to 25 % of buffer pool size 70 | innodb_log_file_size = 100M 71 | #innodb_log_buffer_size = 8M 72 | innodb_flush_log_at_trx_commit = 0 73 | #innodb_lock_wait_timeout = 50 74 | innodb_buffer_pool_size = 384M 75 | innodb_log_buffer_size = 4M 76 | innodb_file_per_table = 1 77 | innodb_open_files = 256 78 | innodb_io_capacity = 512 79 | innodb_flush_method = O_DIRECT 80 | innodb_thread_concurrency = 8 81 | innodb_lock_wait_timeout = 127 82 | # 83 | # * Security Features 84 | # 85 | # Read the manual, too, if you want chroot! 86 | # chroot = /var/lib/mysql/ 87 | # 88 | # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". 89 | # 90 | # ssl-ca=/etc/mysql/cacert.pem 91 | # ssl-cert=/etc/mysql/server-cert.pem 92 | # ssl-key=/etc/mysql/server-key.pem 93 | 94 | [mysqldump] 95 | quick 96 | quote-names 97 | max_allowed_packet = 32M 98 | 99 | [mysql] 100 | #no-auto-rehash # faster start of mysql but no tab completion 101 | 102 | [isamchk] 103 | key_buffer_size = 384M 104 | sort_buffer_size = 256M 105 | read_buffer = 2M 106 | write_buffer = 2M 107 | -------------------------------------------------------------------------------- /config/drupal9/mysql8.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # The MySQL database server configuration file for Lando 3 | # 4 | # LANDODRUPALMYSQL8CNF 5 | 6 | [mysqld] 7 | # 8 | # * Basic Settings 9 | # 10 | # Data is stored in a volume on the db container /sql 11 | default-storage-engine = innodb 12 | 13 | # 14 | # * Fine Tuning 15 | # 16 | key_buffer_size = 384M 17 | max_allowed_packet = 32M 18 | thread_stack = 400K 19 | thread_cache_size = 8 20 | # This replaces the startup script and checks MyISAM tables if needed 21 | # the first time they are touched 22 | #max_connections = 100 23 | #table_cache = 64 24 | #thread_concurrency = 10 25 | read_rnd_buffer_size = 8M 26 | myisam_sort_buffer_size = 64M 27 | table_open_cache = 512 28 | sort_buffer_size = 2M 29 | read_buffer_size = 2M 30 | 31 | # 32 | # * Logging and Replication 33 | # 34 | # Both location gets rotated by the cronjob. 35 | # Be aware that this log type is a performance killer. 36 | # As of 5.1 you can enable the log at runtime! 37 | #general_log_file = /src/.lando/log/mysql.log 38 | #general_log = 1 39 | # 40 | # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. 41 | # 42 | # Here you can see queries with especially long duration 43 | #log_slow_queries = /var/log/mysql/mysql-slow.log 44 | #long_query_time = 2 45 | #log-queries-not-using-indexes 46 | # 47 | # The following can be used as easy to replay backup logs or for replication. 48 | # note: if you are setting up a replication slave, see README.Debian about 49 | # other settings you may need to change. 50 | #server-id = 1 51 | #log_bin = /src/.lando/log/mysql-bin.log 52 | expire_logs_days = 10 53 | max_binlog_size = 101M 54 | #binlog_do_db = include_database_name 55 | #binlog_ignore_db = include_database_name 56 | # 57 | # * InnoDB 58 | # 59 | # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. 60 | # Read the manual for more InnoDB related options. There are many! 61 | # 62 | # Uncomment the following if you are using InnoDB tables 63 | #innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend 64 | #innodb_log_group_home_dir = C:\mysql\data/ 65 | # You can set .._buffer_pool_size up to 50 - 80 % 66 | # of RAM but beware of setting memory usage too high 67 | #innodb_buffer_pool_size = 384M 68 | #innodb_additional_mem_pool_size = 20M 69 | # Set .._log_file_size to 25 % of buffer pool size 70 | innodb_log_file_size = 100M 71 | #innodb_log_buffer_size = 8M 72 | innodb_flush_log_at_trx_commit = 0 73 | #innodb_lock_wait_timeout = 50 74 | innodb_buffer_pool_size = 384M 75 | innodb_log_buffer_size = 4M 76 | innodb_file_per_table = 1 77 | innodb_open_files = 256 78 | innodb_io_capacity = 512 79 | innodb_flush_method = O_DIRECT 80 | innodb_thread_concurrency = 8 81 | innodb_lock_wait_timeout = 127 82 | # 83 | # * Security Features 84 | # 85 | # Read the manual, too, if you want chroot! 86 | # chroot = /var/lib/mysql/ 87 | # 88 | # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". 89 | # 90 | # ssl-ca=/etc/mysql/cacert.pem 91 | # ssl-cert=/etc/mysql/server-cert.pem 92 | # ssl-key=/etc/mysql/server-key.pem 93 | 94 | [mysqldump] 95 | quick 96 | quote-names 97 | max_allowed_packet = 32M 98 | 99 | [mysql] 100 | #no-auto-rehash # faster start of mysql but no tab completion 101 | 102 | [isamchk] 103 | key_buffer_size = 384M 104 | sort_buffer_size = 256M 105 | read_buffer = 2M 106 | write_buffer = 2M 107 | -------------------------------------------------------------------------------- /config/drupal10/mysql8.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # The MySQL database server configuration file for Lando 3 | # 4 | # LANDODRUPALMYSQL8CNF 5 | 6 | [mysqld] 7 | # 8 | # * Basic Settings 9 | # 10 | # Data is stored in a volume on the db container /sql 11 | default-storage-engine = innodb 12 | 13 | # 14 | # * Fine Tuning 15 | # 16 | key_buffer_size = 384M 17 | max_allowed_packet = 32M 18 | thread_stack = 400K 19 | thread_cache_size = 8 20 | # This replaces the startup script and checks MyISAM tables if needed 21 | # the first time they are touched 22 | #max_connections = 100 23 | #table_cache = 64 24 | #thread_concurrency = 10 25 | read_rnd_buffer_size = 8M 26 | myisam_sort_buffer_size = 64M 27 | table_open_cache = 512 28 | sort_buffer_size = 2M 29 | read_buffer_size = 2M 30 | 31 | # 32 | # * Logging and Replication 33 | # 34 | # Both location gets rotated by the cronjob. 35 | # Be aware that this log type is a performance killer. 36 | # As of 5.1 you can enable the log at runtime! 37 | #general_log_file = /src/.lando/log/mysql.log 38 | #general_log = 1 39 | # 40 | # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. 41 | # 42 | # Here you can see queries with especially long duration 43 | #log_slow_queries = /var/log/mysql/mysql-slow.log 44 | #long_query_time = 2 45 | #log-queries-not-using-indexes 46 | # 47 | # The following can be used as easy to replay backup logs or for replication. 48 | # note: if you are setting up a replication slave, see README.Debian about 49 | # other settings you may need to change. 50 | #server-id = 1 51 | #log_bin = /src/.lando/log/mysql-bin.log 52 | expire_logs_days = 10 53 | max_binlog_size = 101M 54 | #binlog_do_db = include_database_name 55 | #binlog_ignore_db = include_database_name 56 | # 57 | # * InnoDB 58 | # 59 | # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. 60 | # Read the manual for more InnoDB related options. There are many! 61 | # 62 | # Uncomment the following if you are using InnoDB tables 63 | #innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend 64 | #innodb_log_group_home_dir = C:\mysql\data/ 65 | # You can set .._buffer_pool_size up to 50 - 80 % 66 | # of RAM but beware of setting memory usage too high 67 | #innodb_buffer_pool_size = 384M 68 | #innodb_additional_mem_pool_size = 20M 69 | # Set .._log_file_size to 25 % of buffer pool size 70 | innodb_log_file_size = 100M 71 | #innodb_log_buffer_size = 8M 72 | innodb_flush_log_at_trx_commit = 0 73 | #innodb_lock_wait_timeout = 50 74 | innodb_buffer_pool_size = 384M 75 | innodb_log_buffer_size = 4M 76 | innodb_file_per_table = 1 77 | innodb_open_files = 256 78 | innodb_io_capacity = 512 79 | innodb_flush_method = O_DIRECT 80 | innodb_thread_concurrency = 8 81 | innodb_lock_wait_timeout = 127 82 | # 83 | # * Security Features 84 | # 85 | # Read the manual, too, if you want chroot! 86 | # chroot = /var/lib/mysql/ 87 | # 88 | # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". 89 | # 90 | # ssl-ca=/etc/mysql/cacert.pem 91 | # ssl-cert=/etc/mysql/server-cert.pem 92 | # ssl-key=/etc/mysql/server-key.pem 93 | 94 | [mysqldump] 95 | quick 96 | quote-names 97 | max_allowed_packet = 32M 98 | 99 | [mysql] 100 | #no-auto-rehash # faster start of mysql but no tab completion 101 | 102 | [isamchk] 103 | key_buffer_size = 384M 104 | sort_buffer_size = 256M 105 | read_buffer = 2M 106 | write_buffer = 2M 107 | -------------------------------------------------------------------------------- /examples/drupal-export/mysql-test.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.15 Distrib 10.0.23-MariaDB, for Linux (x86_64) 2 | -- 3 | -- Host: 35.188.169.91 Database: db 4 | -- ------------------------------------------------------ 5 | -- Server version 10.0.23-MariaDB-log 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!40101 SET NAMES utf8mb4 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Table structure for table `users` 20 | -- 21 | 22 | DROP TABLE IF EXISTS `users`; 23 | /*!40101 SET @saved_cs_client = @@character_set_client */; 24 | /*!40101 SET character_set_client = utf8 */; 25 | CREATE TABLE `users` ( 26 | `uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Primary Key: Unique user ID.', 27 | `name` varchar(60) NOT NULL DEFAULT '' COMMENT 'Unique user name.', 28 | `pass` varchar(128) NOT NULL DEFAULT '' COMMENT 'User’s password (hashed).', 29 | `mail` varchar(254) DEFAULT '' COMMENT 'User’s e-mail address.', 30 | `theme` varchar(255) NOT NULL DEFAULT '' COMMENT 'User’s default theme.', 31 | `signature` varchar(255) NOT NULL DEFAULT '' COMMENT 'User’s signature.', 32 | `signature_format` varchar(255) DEFAULT NULL COMMENT 'The filter_format.format of the signature.', 33 | `created` int(11) NOT NULL DEFAULT '0' COMMENT 'Timestamp for when user was created.', 34 | `access` int(11) NOT NULL DEFAULT '0' COMMENT 'Timestamp for previous time user accessed the site.', 35 | `login` int(11) NOT NULL DEFAULT '0' COMMENT 'Timestamp for user’s last login.', 36 | `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Whether the user is active(1) or blocked(0).', 37 | `timezone` varchar(32) DEFAULT NULL COMMENT 'User’s time zone.', 38 | `language` varchar(12) NOT NULL DEFAULT '' COMMENT 'User’s default language.', 39 | `picture` int(11) NOT NULL DEFAULT '0' COMMENT 'Foreign key: file_managed.fid of user’s picture.', 40 | `init` varchar(254) DEFAULT '' COMMENT 'E-mail address used for initial account creation.', 41 | `data` longblob COMMENT 'A serialized array of name value pairs that are related to the user. Any form values posted during user edit are stored and are loaded into the $user object during user_load(). Use of this field is discouraged and it will likely disappear in a future...', 42 | PRIMARY KEY (`uid`), 43 | UNIQUE KEY `name` (`name`), 44 | KEY `access` (`access`), 45 | KEY `created` (`created`), 46 | KEY `mail` (`mail`), 47 | KEY `picture` (`picture`) 48 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Stores user data.'; 49 | /*!40101 SET character_set_client = @saved_cs_client */; 50 | 51 | -- 52 | -- Dumping data for table `users` 53 | -- 54 | 55 | LOCK TABLES `users` WRITE; 56 | /*!40000 ALTER TABLE `users` DISABLE KEYS */; 57 | INSERT INTO `users` VALUES (0,'','','','','',NULL,0,0,0,0,NULL,'',0,'',NULL),(1,'admin','$S$DIMFPUEvPzoXpUjtKsvg56/8v.49muwz6.2VC1RzbaN138YZD3hN','mike@thinktandem.io','','',NULL,1485742602,1501816349,1501816349,1,'America/Chicago','',0,'mike@thinktandem.io','b:0;'); 58 | /*!40000 ALTER TABLE `users` ENABLE KEYS */; 59 | UNLOCK TABLES; 60 | -------------------------------------------------------------------------------- /examples/drupal-import/mysql-test.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.15 Distrib 10.0.23-MariaDB, for Linux (x86_64) 2 | -- 3 | -- Host: 35.188.169.91 Database: db 4 | -- ------------------------------------------------------ 5 | -- Server version 10.0.23-MariaDB-log 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!40101 SET NAMES utf8mb4 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Table structure for table `users` 20 | -- 21 | 22 | DROP TABLE IF EXISTS `users`; 23 | /*!40101 SET @saved_cs_client = @@character_set_client */; 24 | /*!40101 SET character_set_client = utf8 */; 25 | CREATE TABLE `users` ( 26 | `uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Primary Key: Unique user ID.', 27 | `name` varchar(60) NOT NULL DEFAULT '' COMMENT 'Unique user name.', 28 | `pass` varchar(128) NOT NULL DEFAULT '' COMMENT 'User’s password (hashed).', 29 | `mail` varchar(254) DEFAULT '' COMMENT 'User’s e-mail address.', 30 | `theme` varchar(255) NOT NULL DEFAULT '' COMMENT 'User’s default theme.', 31 | `signature` varchar(255) NOT NULL DEFAULT '' COMMENT 'User’s signature.', 32 | `signature_format` varchar(255) DEFAULT NULL COMMENT 'The filter_format.format of the signature.', 33 | `created` int(11) NOT NULL DEFAULT '0' COMMENT 'Timestamp for when user was created.', 34 | `access` int(11) NOT NULL DEFAULT '0' COMMENT 'Timestamp for previous time user accessed the site.', 35 | `login` int(11) NOT NULL DEFAULT '0' COMMENT 'Timestamp for user’s last login.', 36 | `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Whether the user is active(1) or blocked(0).', 37 | `timezone` varchar(32) DEFAULT NULL COMMENT 'User’s time zone.', 38 | `language` varchar(12) NOT NULL DEFAULT '' COMMENT 'User’s default language.', 39 | `picture` int(11) NOT NULL DEFAULT '0' COMMENT 'Foreign key: file_managed.fid of user’s picture.', 40 | `init` varchar(254) DEFAULT '' COMMENT 'E-mail address used for initial account creation.', 41 | `data` longblob COMMENT 'A serialized array of name value pairs that are related to the user. Any form values posted during user edit are stored and are loaded into the $user object during user_load(). Use of this field is discouraged and it will likely disappear in a future...', 42 | PRIMARY KEY (`uid`), 43 | UNIQUE KEY `name` (`name`), 44 | KEY `access` (`access`), 45 | KEY `created` (`created`), 46 | KEY `mail` (`mail`), 47 | KEY `picture` (`picture`) 48 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Stores user data.'; 49 | /*!40101 SET character_set_client = @saved_cs_client */; 50 | 51 | -- 52 | -- Dumping data for table `users` 53 | -- 54 | 55 | LOCK TABLES `users` WRITE; 56 | /*!40000 ALTER TABLE `users` DISABLE KEYS */; 57 | INSERT INTO `users` VALUES (0,'','','','','',NULL,0,0,0,0,NULL,'',0,'',NULL),(1,'admin','$S$DIMFPUEvPzoXpUjtKsvg56/8v.49muwz6.2VC1RzbaN138YZD3hN','mike@thinktandem.io','','',NULL,1485742602,1501816349,1501816349,1,'America/Chicago','',0,'mike@thinktandem.io','b:0;'); 58 | /*!40000 ALTER TABLE `users` ENABLE KEYS */; 59 | UNLOCK TABLES; 60 | -------------------------------------------------------------------------------- /examples/drupal-import/subdir/test.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.15 Distrib 10.0.23-MariaDB, for Linux (x86_64) 2 | -- 3 | -- Host: 35.188.169.91 Database: db 4 | -- ------------------------------------------------------ 5 | -- Server version 10.0.23-MariaDB-log 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!40101 SET NAMES utf8mb4 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Table structure for table `users` 20 | -- 21 | 22 | DROP TABLE IF EXISTS `users`; 23 | /*!40101 SET @saved_cs_client = @@character_set_client */; 24 | /*!40101 SET character_set_client = utf8 */; 25 | CREATE TABLE `users` ( 26 | `uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Primary Key: Unique user ID.', 27 | `name` varchar(60) NOT NULL DEFAULT '' COMMENT 'Unique user name.', 28 | `pass` varchar(128) NOT NULL DEFAULT '' COMMENT 'User’s password (hashed).', 29 | `mail` varchar(254) DEFAULT '' COMMENT 'User’s e-mail address.', 30 | `theme` varchar(255) NOT NULL DEFAULT '' COMMENT 'User’s default theme.', 31 | `signature` varchar(255) NOT NULL DEFAULT '' COMMENT 'User’s signature.', 32 | `signature_format` varchar(255) DEFAULT NULL COMMENT 'The filter_format.format of the signature.', 33 | `created` int(11) NOT NULL DEFAULT '0' COMMENT 'Timestamp for when user was created.', 34 | `access` int(11) NOT NULL DEFAULT '0' COMMENT 'Timestamp for previous time user accessed the site.', 35 | `login` int(11) NOT NULL DEFAULT '0' COMMENT 'Timestamp for user’s last login.', 36 | `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Whether the user is active(1) or blocked(0).', 37 | `timezone` varchar(32) DEFAULT NULL COMMENT 'User’s time zone.', 38 | `language` varchar(12) NOT NULL DEFAULT '' COMMENT 'User’s default language.', 39 | `picture` int(11) NOT NULL DEFAULT '0' COMMENT 'Foreign key: file_managed.fid of user’s picture.', 40 | `init` varchar(254) DEFAULT '' COMMENT 'E-mail address used for initial account creation.', 41 | `data` longblob COMMENT 'A serialized array of name value pairs that are related to the user. Any form values posted during user edit are stored and are loaded into the $user object during user_load(). Use of this field is discouraged and it will likely disappear in a future...', 42 | PRIMARY KEY (`uid`), 43 | UNIQUE KEY `name` (`name`), 44 | KEY `access` (`access`), 45 | KEY `created` (`created`), 46 | KEY `mail` (`mail`), 47 | KEY `picture` (`picture`) 48 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Stores user data.'; 49 | /*!40101 SET character_set_client = @saved_cs_client */; 50 | 51 | -- 52 | -- Dumping data for table `users` 53 | -- 54 | 55 | LOCK TABLES `users` WRITE; 56 | /*!40000 ALTER TABLE `users` DISABLE KEYS */; 57 | INSERT INTO `users` VALUES (0,'','','','','',NULL,0,0,0,0,NULL,'',0,'',NULL),(1,'admin','$S$DIMFPUEvPzoXpUjtKsvg56/8v.49muwz6.2VC1RzbaN138YZD3hN','mike@thinktandem.io','','',NULL,1485742602,1501816349,1501816349,1,'America/Chicago','',0,'mike@thinktandem.io','b:0;'); 58 | /*!40000 ALTER TABLE `users` ENABLE KEYS */; 59 | UNLOCK TABLES; 60 | -------------------------------------------------------------------------------- /examples/drupal-custom/config/mysql.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # The MySQL database server configuration file for Lando 3 | # 4 | 5 | [mysqld] 6 | # 7 | # * Basic Settings 8 | # 9 | # Data is stored in a volume on the db container /sql 10 | default-storage-engine = innodb 11 | 12 | # 13 | # * Fine Tuning 14 | # 15 | key_buffer_size = 38M 16 | max_allowed_packet = 32M 17 | thread_stack = 400K 18 | thread_cache_size = 12 19 | # This replaces the startup script and checks MyISAM tables if needed 20 | # the first time they are touched 21 | #max_connections = 100 22 | #table_cache = 64 23 | #thread_concurrency = 10 24 | read_rnd_buffer_size = 8M 25 | myisam_sort_buffer_size = 64M 26 | table_open_cache = 512 27 | sort_buffer_size = 2M 28 | read_buffer_size = 2M 29 | 30 | # 31 | # * Query Cache Configuration 32 | # 33 | query_cache_limit = 1M 34 | query_cache_size = 64M 35 | # 36 | # * Logging and Replication 37 | # 38 | # Both location gets rotated by the cronjob. 39 | # Be aware that this log type is a performance killer. 40 | # As of 5.1 you can enable the log at runtime! 41 | #general_log_file = /src/.lando/log/mysql.log 42 | #general_log = 1 43 | # 44 | # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. 45 | # 46 | # Here you can see queries with especially long duration 47 | #log_slow_queries = /var/log/mysql/mysql-slow.log 48 | #long_query_time = 2 49 | #log-queries-not-using-indexes 50 | # 51 | # The following can be used as easy to replay backup logs or for replication. 52 | # note: if you are setting up a replication slave, see README.Debian about 53 | # other settings you may need to change. 54 | #server-id = 1 55 | #log_bin = /src/.lando/log/mysql-bin.log 56 | expire_logs_days = 10 57 | max_binlog_size = 100M 58 | #binlog_do_db = include_database_name 59 | #binlog_ignore_db = include_database_name 60 | # 61 | # * InnoDB 62 | # 63 | # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. 64 | # Read the manual for more InnoDB related options. There are many! 65 | # 66 | # Uncomment the following if you are using InnoDB tables 67 | #innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend 68 | #innodb_log_group_home_dir = C:\mysql\data/ 69 | # You can set .._buffer_pool_size up to 50 - 80 % 70 | # of RAM but beware of setting memory usage too high 71 | #innodb_buffer_pool_size = 384M 72 | #innodb_additional_mem_pool_size = 20M 73 | # Set .._log_file_size to 25 % of buffer pool size 74 | innodb_log_file_size = 100M 75 | #innodb_log_buffer_size = 8M 76 | innodb_flush_log_at_trx_commit = 0 77 | #innodb_lock_wait_timeout = 50 78 | innodb_buffer_pool_size = 384M 79 | innodb_log_buffer_size = 4M 80 | innodb_file_per_table = 1 81 | innodb_open_files = 256 82 | innodb_io_capacity = 512 83 | innodb_flush_method = O_DIRECT 84 | innodb_thread_concurrency = 8 85 | innodb_lock_wait_timeout = 120 86 | # 87 | # * Security Features 88 | # 89 | # Read the manual, too, if you want chroot! 90 | # chroot = /var/lib/mysql/ 91 | # 92 | # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". 93 | # 94 | # ssl-ca=/etc/mysql/cacert.pem 95 | # ssl-cert=/etc/mysql/server-cert.pem 96 | # ssl-key=/etc/mysql/server-key.pem 97 | 98 | [mysqldump] 99 | quick 100 | quote-names 101 | max_allowed_packet = 32M 102 | 103 | [mysql] 104 | #no-auto-rehash # faster start of mysql but no tab completion 105 | 106 | [isamchk] 107 | key_buffer_size = 384M 108 | sort_buffer_size = 256M 109 | read_buffer = 2M 110 | write_buffer = 2M 111 | -------------------------------------------------------------------------------- /config/drupal10/mysql.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # The MySQL database server configuration file for Lando 3 | # 4 | # LANDODRUPALMYSQLCNF 5 | 6 | [mysqld] 7 | # 8 | # * Basic Settings 9 | # 10 | # Data is stored in a volume on the db container /sql 11 | default-storage-engine = innodb 12 | 13 | # 14 | # * Fine Tuning 15 | # 16 | key_buffer_size = 384M 17 | max_allowed_packet = 32M 18 | thread_stack = 400K 19 | thread_cache_size = 8 20 | # This replaces the startup script and checks MyISAM tables if needed 21 | # the first time they are touched 22 | #max_connections = 100 23 | #table_cache = 64 24 | #thread_concurrency = 10 25 | read_rnd_buffer_size = 8M 26 | myisam_sort_buffer_size = 64M 27 | table_open_cache = 512 28 | sort_buffer_size = 2M 29 | read_buffer_size = 2M 30 | 31 | # 32 | # * Query Cache Configuration 33 | # 34 | query_cache_limit = 1M 35 | query_cache_size = 64M 36 | # 37 | # * Logging and Replication 38 | # 39 | # Both location gets rotated by the cronjob. 40 | # Be aware that this log type is a performance killer. 41 | # As of 5.1 you can enable the log at runtime! 42 | #general_log_file = /src/.lando/log/mysql.log 43 | #general_log = 1 44 | # 45 | # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. 46 | # 47 | # Here you can see queries with especially long duration 48 | #log_slow_queries = /var/log/mysql/mysql-slow.log 49 | #long_query_time = 2 50 | #log-queries-not-using-indexes 51 | # 52 | # The following can be used as easy to replay backup logs or for replication. 53 | # note: if you are setting up a replication slave, see README.Debian about 54 | # other settings you may need to change. 55 | #server-id = 1 56 | #log_bin = /src/.lando/log/mysql-bin.log 57 | expire_logs_days = 10 58 | max_binlog_size = 100M 59 | #binlog_do_db = include_database_name 60 | #binlog_ignore_db = include_database_name 61 | # 62 | # * InnoDB 63 | # 64 | # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. 65 | # Read the manual for more InnoDB related options. There are many! 66 | # 67 | # Uncomment the following if you are using InnoDB tables 68 | #innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend 69 | #innodb_log_group_home_dir = C:\mysql\data/ 70 | # You can set .._buffer_pool_size up to 50 - 80 % 71 | # of RAM but beware of setting memory usage too high 72 | #innodb_buffer_pool_size = 384M 73 | #innodb_additional_mem_pool_size = 20M 74 | # Set .._log_file_size to 25 % of buffer pool size 75 | innodb_log_file_size = 101M 76 | #innodb_log_buffer_size = 8M 77 | innodb_flush_log_at_trx_commit = 0 78 | #innodb_lock_wait_timeout = 50 79 | innodb_buffer_pool_size = 384M 80 | innodb_log_buffer_size = 4M 81 | innodb_file_per_table = 1 82 | innodb_open_files = 256 83 | innodb_io_capacity = 512 84 | innodb_flush_method = O_DIRECT 85 | innodb_thread_concurrency = 8 86 | innodb_lock_wait_timeout = 121 87 | # 88 | # * Security Features 89 | # 90 | # Read the manual, too, if you want chroot! 91 | # chroot = /var/lib/mysql/ 92 | # 93 | # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". 94 | # 95 | # ssl-ca=/etc/mysql/cacert.pem 96 | # ssl-cert=/etc/mysql/server-cert.pem 97 | # ssl-key=/etc/mysql/server-key.pem 98 | 99 | [mysqldump] 100 | quick 101 | quote-names 102 | max_allowed_packet = 32M 103 | 104 | [mysql] 105 | #no-auto-rehash # faster start of mysql but no tab completion 106 | 107 | [isamchk] 108 | key_buffer_size = 384M 109 | sort_buffer_size = 256M 110 | read_buffer = 2M 111 | write_buffer = 2M 112 | -------------------------------------------------------------------------------- /config/drupal11/mysql.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # The MySQL database server configuration file for Lando 3 | # 4 | # LANDODRUPALMYSQLCNF 5 | 6 | [mysqld] 7 | # 8 | # * Basic Settings 9 | # 10 | # Data is stored in a volume on the db container /sql 11 | default-storage-engine = innodb 12 | 13 | # 14 | # * Fine Tuning 15 | # 16 | key_buffer_size = 384M 17 | max_allowed_packet = 32M 18 | thread_stack = 400K 19 | thread_cache_size = 8 20 | # This replaces the startup script and checks MyISAM tables if needed 21 | # the first time they are touched 22 | #max_connections = 100 23 | #table_cache = 64 24 | #thread_concurrency = 10 25 | read_rnd_buffer_size = 8M 26 | myisam_sort_buffer_size = 64M 27 | table_open_cache = 512 28 | sort_buffer_size = 2M 29 | read_buffer_size = 2M 30 | 31 | # 32 | # * Query Cache Configuration 33 | # 34 | query_cache_limit = 1M 35 | query_cache_size = 64M 36 | # 37 | # * Logging and Replication 38 | # 39 | # Both location gets rotated by the cronjob. 40 | # Be aware that this log type is a performance killer. 41 | # As of 5.1 you can enable the log at runtime! 42 | #general_log_file = /src/.lando/log/mysql.log 43 | #general_log = 1 44 | # 45 | # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. 46 | # 47 | # Here you can see queries with especially long duration 48 | #log_slow_queries = /var/log/mysql/mysql-slow.log 49 | #long_query_time = 2 50 | #log-queries-not-using-indexes 51 | # 52 | # The following can be used as easy to replay backup logs or for replication. 53 | # note: if you are setting up a replication slave, see README.Debian about 54 | # other settings you may need to change. 55 | #server-id = 1 56 | #log_bin = /src/.lando/log/mysql-bin.log 57 | expire_logs_days = 10 58 | max_binlog_size = 100M 59 | #binlog_do_db = include_database_name 60 | #binlog_ignore_db = include_database_name 61 | # 62 | # * InnoDB 63 | # 64 | # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. 65 | # Read the manual for more InnoDB related options. There are many! 66 | # 67 | # Uncomment the following if you are using InnoDB tables 68 | #innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend 69 | #innodb_log_group_home_dir = C:\mysql\data/ 70 | # You can set .._buffer_pool_size up to 50 - 80 % 71 | # of RAM but beware of setting memory usage too high 72 | #innodb_buffer_pool_size = 384M 73 | #innodb_additional_mem_pool_size = 20M 74 | # Set .._log_file_size to 25 % of buffer pool size 75 | innodb_log_file_size = 101M 76 | #innodb_log_buffer_size = 8M 77 | innodb_flush_log_at_trx_commit = 0 78 | #innodb_lock_wait_timeout = 50 79 | innodb_buffer_pool_size = 384M 80 | innodb_log_buffer_size = 4M 81 | innodb_file_per_table = 1 82 | innodb_open_files = 256 83 | innodb_io_capacity = 512 84 | innodb_flush_method = O_DIRECT 85 | innodb_thread_concurrency = 8 86 | innodb_lock_wait_timeout = 121 87 | # 88 | # * Security Features 89 | # 90 | # Read the manual, too, if you want chroot! 91 | # chroot = /var/lib/mysql/ 92 | # 93 | # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". 94 | # 95 | # ssl-ca=/etc/mysql/cacert.pem 96 | # ssl-cert=/etc/mysql/server-cert.pem 97 | # ssl-key=/etc/mysql/server-key.pem 98 | 99 | [mysqldump] 100 | quick 101 | quote-names 102 | max_allowed_packet = 32M 103 | 104 | [mysql] 105 | #no-auto-rehash # faster start of mysql but no tab completion 106 | 107 | [isamchk] 108 | key_buffer_size = 384M 109 | sort_buffer_size = 256M 110 | read_buffer = 2M 111 | write_buffer = 2M 112 | -------------------------------------------------------------------------------- /config/drupal6/mysql.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # The MySQL database server configuration file for Lando 3 | # 4 | # LANDODRUPALMYSQLCNF 5 | 6 | [mysqld] 7 | # 8 | # * Basic Settings 9 | # 10 | # Data is stored in a volume on the db container /sql 11 | # default-storage-engine = innodb 12 | 13 | # 14 | # * Fine Tuning 15 | # 16 | key_buffer_size = 384M 17 | max_allowed_packet = 32M 18 | thread_stack = 400K 19 | thread_cache_size = 8 20 | # This replaces the startup script and checks MyISAM tables if needed 21 | # the first time they are touched 22 | #max_connections = 100 23 | #table_cache = 64 24 | #thread_concurrency = 10 25 | read_rnd_buffer_size = 8M 26 | myisam_sort_buffer_size = 64M 27 | table_open_cache = 512 28 | sort_buffer_size = 2M 29 | read_buffer_size = 2M 30 | 31 | # 32 | # * Query Cache Configuration 33 | # 34 | query_cache_limit = 1M 35 | query_cache_size = 64M 36 | # 37 | # * Logging and Replication 38 | # 39 | # Both location gets rotated by the cronjob. 40 | # Be aware that this log type is a performance killer. 41 | # As of 5.1 you can enable the log at runtime! 42 | #general_log_file = /src/.lando/log/mysql.log 43 | #general_log = 1 44 | # 45 | # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. 46 | # 47 | # Here you can see queries with especially long duration 48 | #log_slow_queries = /var/log/mysql/mysql-slow.log 49 | #long_query_time = 2 50 | #log-queries-not-using-indexes 51 | # 52 | # The following can be used as easy to replay backup logs or for replication. 53 | # note: if you are setting up a replication slave, see README.Debian about 54 | # other settings you may need to change. 55 | #server-id = 1 56 | #log_bin = /src/.lando/log/mysql-bin.log 57 | expire_logs_days = 10 58 | max_binlog_size = 100M 59 | #binlog_do_db = include_database_name 60 | #binlog_ignore_db = include_database_name 61 | # 62 | # * InnoDB 63 | # 64 | # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. 65 | # Read the manual for more InnoDB related options. There are many! 66 | # 67 | # Uncomment the following if you are using InnoDB tables 68 | #innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend 69 | #innodb_log_group_home_dir = C:\mysql\data/ 70 | # You can set .._buffer_pool_size up to 50 - 80 % 71 | # of RAM but beware of setting memory usage too high 72 | #innodb_buffer_pool_size = 384M 73 | #innodb_additional_mem_pool_size = 20M 74 | # Set .._log_file_size to 25 % of buffer pool size 75 | innodb_log_file_size = 101M 76 | #innodb_log_buffer_size = 8M 77 | innodb_flush_log_at_trx_commit = 0 78 | #innodb_lock_wait_timeout = 50 79 | innodb_buffer_pool_size = 384M 80 | innodb_log_buffer_size = 4M 81 | innodb_file_per_table = 1 82 | innodb_open_files = 256 83 | innodb_io_capacity = 512 84 | innodb_flush_method = O_DIRECT 85 | innodb_thread_concurrency = 8 86 | innodb_lock_wait_timeout = 121 87 | # 88 | # * Security Features 89 | # 90 | # Read the manual, too, if you want chroot! 91 | # chroot = /var/lib/mysql/ 92 | # 93 | # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". 94 | # 95 | # ssl-ca=/etc/mysql/cacert.pem 96 | # ssl-cert=/etc/mysql/server-cert.pem 97 | # ssl-key=/etc/mysql/server-key.pem 98 | 99 | [mysqldump] 100 | quick 101 | quote-names 102 | max_allowed_packet = 32M 103 | 104 | [mysql] 105 | #no-auto-rehash # faster start of mysql but no tab completion 106 | 107 | [isamchk] 108 | key_buffer_size = 384M 109 | sort_buffer_size = 256M 110 | read_buffer = 2M 111 | write_buffer = 2M 112 | -------------------------------------------------------------------------------- /config/drupal7/mysql.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # The MySQL database server configuration file for Lando 3 | # 4 | # LANDODRUPALMYSQLCNF 5 | 6 | [mysqld] 7 | # 8 | # * Basic Settings 9 | # 10 | # Data is stored in a volume on the db container /sql 11 | # default-storage-engine = innodb 12 | 13 | # 14 | # * Fine Tuning 15 | # 16 | key_buffer_size = 384M 17 | max_allowed_packet = 32M 18 | thread_stack = 400K 19 | thread_cache_size = 8 20 | # This replaces the startup script and checks MyISAM tables if needed 21 | # the first time they are touched 22 | #max_connections = 100 23 | #table_cache = 64 24 | #thread_concurrency = 10 25 | read_rnd_buffer_size = 8M 26 | myisam_sort_buffer_size = 64M 27 | table_open_cache = 512 28 | sort_buffer_size = 2M 29 | read_buffer_size = 2M 30 | 31 | # 32 | # * Query Cache Configuration 33 | # 34 | query_cache_limit = 1M 35 | query_cache_size = 64M 36 | # 37 | # * Logging and Replication 38 | # 39 | # Both location gets rotated by the cronjob. 40 | # Be aware that this log type is a performance killer. 41 | # As of 5.1 you can enable the log at runtime! 42 | #general_log_file = /src/.lando/log/mysql.log 43 | #general_log = 1 44 | # 45 | # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. 46 | # 47 | # Here you can see queries with especially long duration 48 | #log_slow_queries = /var/log/mysql/mysql-slow.log 49 | #long_query_time = 2 50 | #log-queries-not-using-indexes 51 | # 52 | # The following can be used as easy to replay backup logs or for replication. 53 | # note: if you are setting up a replication slave, see README.Debian about 54 | # other settings you may need to change. 55 | #server-id = 1 56 | #log_bin = /src/.lando/log/mysql-bin.log 57 | expire_logs_days = 10 58 | max_binlog_size = 100M 59 | #binlog_do_db = include_database_name 60 | #binlog_ignore_db = include_database_name 61 | # 62 | # * InnoDB 63 | # 64 | # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. 65 | # Read the manual for more InnoDB related options. There are many! 66 | # 67 | # Uncomment the following if you are using InnoDB tables 68 | #innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend 69 | #innodb_log_group_home_dir = C:\mysql\data/ 70 | # You can set .._buffer_pool_size up to 50 - 80 % 71 | # of RAM but beware of setting memory usage too high 72 | #innodb_buffer_pool_size = 384M 73 | #innodb_additional_mem_pool_size = 20M 74 | # Set .._log_file_size to 25 % of buffer pool size 75 | innodb_log_file_size = 101M 76 | #innodb_log_buffer_size = 8M 77 | innodb_flush_log_at_trx_commit = 0 78 | #innodb_lock_wait_timeout = 50 79 | innodb_buffer_pool_size = 384M 80 | innodb_log_buffer_size = 4M 81 | innodb_file_per_table = 1 82 | innodb_open_files = 256 83 | innodb_io_capacity = 512 84 | innodb_flush_method = O_DIRECT 85 | innodb_thread_concurrency = 8 86 | innodb_lock_wait_timeout = 121 87 | # 88 | # * Security Features 89 | # 90 | # Read the manual, too, if you want chroot! 91 | # chroot = /var/lib/mysql/ 92 | # 93 | # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". 94 | # 95 | # ssl-ca=/etc/mysql/cacert.pem 96 | # ssl-cert=/etc/mysql/server-cert.pem 97 | # ssl-key=/etc/mysql/server-key.pem 98 | 99 | [mysqldump] 100 | quick 101 | quote-names 102 | max_allowed_packet = 32M 103 | 104 | [mysql] 105 | #no-auto-rehash # faster start of mysql but no tab completion 106 | 107 | [isamchk] 108 | key_buffer_size = 384M 109 | sort_buffer_size = 256M 110 | read_buffer = 2M 111 | write_buffer = 2M 112 | -------------------------------------------------------------------------------- /config/drupal8/mysql.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # The MySQL database server configuration file for Lando 3 | # 4 | # LANDODRUPALMYSQLCNF 5 | 6 | [mysqld] 7 | # 8 | # * Basic Settings 9 | # 10 | # Data is stored in a volume on the db container /sql 11 | # default-storage-engine = innodb 12 | 13 | # 14 | # * Fine Tuning 15 | # 16 | key_buffer_size = 384M 17 | max_allowed_packet = 32M 18 | thread_stack = 400K 19 | thread_cache_size = 8 20 | # This replaces the startup script and checks MyISAM tables if needed 21 | # the first time they are touched 22 | #max_connections = 100 23 | #table_cache = 64 24 | #thread_concurrency = 10 25 | read_rnd_buffer_size = 8M 26 | myisam_sort_buffer_size = 64M 27 | table_open_cache = 512 28 | sort_buffer_size = 2M 29 | read_buffer_size = 2M 30 | 31 | # 32 | # * Query Cache Configuration 33 | # 34 | query_cache_limit = 1M 35 | query_cache_size = 64M 36 | # 37 | # * Logging and Replication 38 | # 39 | # Both location gets rotated by the cronjob. 40 | # Be aware that this log type is a performance killer. 41 | # As of 5.1 you can enable the log at runtime! 42 | #general_log_file = /src/.lando/log/mysql.log 43 | #general_log = 1 44 | # 45 | # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. 46 | # 47 | # Here you can see queries with especially long duration 48 | #log_slow_queries = /var/log/mysql/mysql-slow.log 49 | #long_query_time = 2 50 | #log-queries-not-using-indexes 51 | # 52 | # The following can be used as easy to replay backup logs or for replication. 53 | # note: if you are setting up a replication slave, see README.Debian about 54 | # other settings you may need to change. 55 | #server-id = 1 56 | #log_bin = /src/.lando/log/mysql-bin.log 57 | expire_logs_days = 10 58 | max_binlog_size = 100M 59 | #binlog_do_db = include_database_name 60 | #binlog_ignore_db = include_database_name 61 | # 62 | # * InnoDB 63 | # 64 | # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. 65 | # Read the manual for more InnoDB related options. There are many! 66 | # 67 | # Uncomment the following if you are using InnoDB tables 68 | #innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend 69 | #innodb_log_group_home_dir = C:\mysql\data/ 70 | # You can set .._buffer_pool_size up to 50 - 80 % 71 | # of RAM but beware of setting memory usage too high 72 | #innodb_buffer_pool_size = 384M 73 | #innodb_additional_mem_pool_size = 20M 74 | # Set .._log_file_size to 25 % of buffer pool size 75 | innodb_log_file_size = 101M 76 | #innodb_log_buffer_size = 8M 77 | innodb_flush_log_at_trx_commit = 0 78 | #innodb_lock_wait_timeout = 50 79 | innodb_buffer_pool_size = 384M 80 | innodb_log_buffer_size = 4M 81 | innodb_file_per_table = 1 82 | innodb_open_files = 256 83 | innodb_io_capacity = 512 84 | innodb_flush_method = O_DIRECT 85 | innodb_thread_concurrency = 8 86 | innodb_lock_wait_timeout = 121 87 | # 88 | # * Security Features 89 | # 90 | # Read the manual, too, if you want chroot! 91 | # chroot = /var/lib/mysql/ 92 | # 93 | # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". 94 | # 95 | # ssl-ca=/etc/mysql/cacert.pem 96 | # ssl-cert=/etc/mysql/server-cert.pem 97 | # ssl-key=/etc/mysql/server-key.pem 98 | 99 | [mysqldump] 100 | quick 101 | quote-names 102 | max_allowed_packet = 32M 103 | 104 | [mysql] 105 | #no-auto-rehash # faster start of mysql but no tab completion 106 | 107 | [isamchk] 108 | key_buffer_size = 384M 109 | sort_buffer_size = 256M 110 | read_buffer = 2M 111 | write_buffer = 2M 112 | -------------------------------------------------------------------------------- /config/drupal9/mysql.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # The MySQL database server configuration file for Lando 3 | # 4 | # LANDODRUPALMYSQLCNF 5 | 6 | [mysqld] 7 | # 8 | # * Basic Settings 9 | # 10 | # Data is stored in a volume on the db container /sql 11 | default-storage-engine = innodb 12 | 13 | # 14 | # * Fine Tuning 15 | # 16 | key_buffer_size = 384M 17 | max_allowed_packet = 32M 18 | thread_stack = 400K 19 | thread_cache_size = 8 20 | # This replaces the startup script and checks MyISAM tables if needed 21 | # the first time they are touched 22 | #max_connections = 100 23 | #table_cache = 64 24 | #thread_concurrency = 10 25 | read_rnd_buffer_size = 8M 26 | myisam_sort_buffer_size = 64M 27 | table_open_cache = 512 28 | sort_buffer_size = 2M 29 | read_buffer_size = 2M 30 | 31 | # 32 | # * Query Cache Configuration 33 | # 34 | query_cache_limit = 1M 35 | query_cache_size = 64M 36 | # 37 | # * Logging and Replication 38 | # 39 | # Both location gets rotated by the cronjob. 40 | # Be aware that this log type is a performance killer. 41 | # As of 5.1 you can enable the log at runtime! 42 | #general_log_file = /src/.lando/log/mysql.log 43 | #general_log = 1 44 | # 45 | # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. 46 | # 47 | # Here you can see queries with especially long duration 48 | #log_slow_queries = /var/log/mysql/mysql-slow.log 49 | #long_query_time = 2 50 | #log-queries-not-using-indexes 51 | # 52 | # The following can be used as easy to replay backup logs or for replication. 53 | # note: if you are setting up a replication slave, see README.Debian about 54 | # other settings you may need to change. 55 | #server-id = 1 56 | #log_bin = /src/.lando/log/mysql-bin.log 57 | expire_logs_days = 10 58 | max_binlog_size = 100M 59 | #binlog_do_db = include_database_name 60 | #binlog_ignore_db = include_database_name 61 | # 62 | # * InnoDB 63 | # 64 | # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. 65 | # Read the manual for more InnoDB related options. There are many! 66 | # 67 | # Uncomment the following if you are using InnoDB tables 68 | #innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend 69 | #innodb_log_group_home_dir = C:\mysql\data/ 70 | # You can set .._buffer_pool_size up to 50 - 80 % 71 | # of RAM but beware of setting memory usage too high 72 | #innodb_buffer_pool_size = 384M 73 | #innodb_additional_mem_pool_size = 20M 74 | # Set .._log_file_size to 25 % of buffer pool size 75 | innodb_log_file_size = 101M 76 | #innodb_log_buffer_size = 8M 77 | innodb_flush_log_at_trx_commit = 0 78 | #innodb_lock_wait_timeout = 50 79 | innodb_buffer_pool_size = 384M 80 | innodb_log_buffer_size = 4M 81 | innodb_file_per_table = 1 82 | innodb_open_files = 256 83 | innodb_io_capacity = 512 84 | innodb_flush_method = O_DIRECT 85 | innodb_thread_concurrency = 8 86 | innodb_lock_wait_timeout = 121 87 | # 88 | # * Security Features 89 | # 90 | # Read the manual, too, if you want chroot! 91 | # chroot = /var/lib/mysql/ 92 | # 93 | # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". 94 | # 95 | # ssl-ca=/etc/mysql/cacert.pem 96 | # ssl-cert=/etc/mysql/server-cert.pem 97 | # ssl-key=/etc/mysql/server-key.pem 98 | 99 | [mysqldump] 100 | quick 101 | quote-names 102 | max_allowed_packet = 32M 103 | 104 | [mysql] 105 | #no-auto-rehash # faster start of mysql but no tab completion 106 | 107 | [isamchk] 108 | key_buffer_size = 384M 109 | sort_buffer_size = 256M 110 | read_buffer = 2M 111 | write_buffer = 2M 112 | -------------------------------------------------------------------------------- /config/drupal6/default.conf.tpl: -------------------------------------------------------------------------------- 1 | # LANDODRUPALNGINXCONF 2 | 3 | server { 4 | listen 80 default_server; 5 | listen 443 ssl; 6 | 7 | server_name localhost; 8 | 9 | ssl_certificate /certs/cert.crt; 10 | ssl_certificate_key /certs/cert.key; 11 | ssl_verify_client off; 12 | 13 | ssl_session_cache shared:SSL:1m; 14 | ssl_session_timeout 5m; 15 | 16 | ssl_ciphers HIGH:!aNULL:!MD5; 17 | ssl_prefer_server_ciphers on; 18 | 19 | port_in_redirect off; 20 | client_max_body_size 100M; 21 | 22 | root "{{LANDO_WEBROOT}}"; 23 | 24 | location = /favicon.ico { 25 | log_not_found off; 26 | access_log off; 27 | } 28 | 29 | location = /robots.txt { 30 | allow all; 31 | log_not_found off; 32 | access_log off; 33 | } 34 | 35 | # Very rarely should these ever be accessed outside of your lan 36 | location ~* \.(txt|log)$ { 37 | allow 192.168.0.0/16; 38 | deny all; 39 | } 40 | 41 | location ~ \..*/.*\.php$ { 42 | return 403; 43 | } 44 | 45 | location ~ ^/sites/.*/private/ { 46 | return 403; 47 | } 48 | 49 | # Allow "Well-Known URIs" as per RFC 5785 50 | location ~* ^/.well-known/ { 51 | allow all; 52 | } 53 | 54 | # Block access to "hidden" files and directories whose names begin with a 55 | # period. This includes directories used by version control systems such 56 | # as Subversion or Git to store control files. 57 | location ~ (^|/)\. { 58 | return 403; 59 | } 60 | 61 | location / { 62 | # try_files $uri @rewrite; # For Drupal <= 6 63 | try_files $uri /index.php?$query_string; # For Drupal >= 7 64 | } 65 | 66 | location @rewrite { 67 | rewrite ^/(.*)$ /index.php?q=$1; 68 | } 69 | 70 | # Don't allow direct access to PHP files in the vendor directory. 71 | location ~ /vendor/.*\.php$ { 72 | deny all; 73 | return 404; 74 | } 75 | 76 | # In Drupal 8, we must also match new paths where the '.php' appears in 77 | # the middle, such as update.php/selection. The rule we use is strict, 78 | # and only allows this pattern with the update.php front controller. 79 | # This allows legacy path aliases in the form of 80 | # blog/index.php/legacy-path to continue to route to Drupal nodes. If 81 | # you do not have any paths like that, then you might prefer to use a 82 | # laxer rule, such as: 83 | # location ~ \.php(/|$) { 84 | # The laxer rule will continue to work if Drupal uses this new URL 85 | # pattern with front controllers other than update.php in a future 86 | # release. 87 | location ~ '\.php$|^/update.php' { 88 | fastcgi_split_path_info ^(.+?\.php)(|/.*)$; 89 | # Security note: If you're running a version of PHP older than the 90 | # latest 5.3, you should have "cgi.fix_pathinfo = 0;" in php.ini. 91 | # See http://serverfault.com/q/627903/94922 for details. 92 | include fastcgi_params; 93 | # Block httpoxy attacks. See https://httpoxy.org/. 94 | fastcgi_param HTTP_PROXY ""; 95 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 96 | fastcgi_param PATH_INFO $fastcgi_path_info; 97 | fastcgi_param QUERY_STRING $query_string; 98 | fastcgi_intercept_errors on; 99 | # PHP 5 socket location. 100 | #fastcgi_pass unix:/var/run/php5-fpm.sock; 101 | # PHP 7 socket location. 102 | #fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; 103 | #lando 104 | fastcgi_pass fpm:9000; 105 | } 106 | 107 | # Fighting with Styles? This little gem is amazing. 108 | # location ~ ^/sites/.*/files/imagecache/ { # For Drupal <= 6 109 | location ~ ^(/[a-z\-]+)?/sites/.*/files/styles/ { # For Drupal >= 7 110 | try_files $uri @rewrite; 111 | } 112 | 113 | # Handle private files through Drupal. Private file's path can come 114 | # with a language prefix. 115 | location ~ ^(/[a-z\-]+)?/system/files/ { # For Drupal >= 7 116 | try_files $uri /index.php?$query_string; 117 | } 118 | 119 | location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 120 | expires max; 121 | log_not_found off; 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /config/drupal7/default.conf.tpl: -------------------------------------------------------------------------------- 1 | # LANDODRUPALNGINXCONF 2 | 3 | server { 4 | listen 80 default_server; 5 | listen 443 ssl; 6 | 7 | server_name localhost; 8 | 9 | ssl_certificate /certs/cert.crt; 10 | ssl_certificate_key /certs/cert.key; 11 | ssl_verify_client off; 12 | 13 | ssl_session_cache shared:SSL:1m; 14 | ssl_session_timeout 5m; 15 | 16 | ssl_ciphers HIGH:!aNULL:!MD5; 17 | ssl_prefer_server_ciphers on; 18 | 19 | port_in_redirect off; 20 | client_max_body_size 100M; 21 | 22 | root "{{LANDO_WEBROOT}}"; 23 | 24 | location = /favicon.ico { 25 | log_not_found off; 26 | access_log off; 27 | } 28 | 29 | location = /robots.txt { 30 | allow all; 31 | log_not_found off; 32 | access_log off; 33 | } 34 | 35 | # Very rarely should these ever be accessed outside of your lan 36 | location ~* \.(txt|log)$ { 37 | allow 192.168.0.0/16; 38 | deny all; 39 | } 40 | 41 | location ~ \..*/.*\.php$ { 42 | return 403; 43 | } 44 | 45 | location ~ ^/sites/.*/private/ { 46 | return 403; 47 | } 48 | 49 | # Allow "Well-Known URIs" as per RFC 5785 50 | location ~* ^/.well-known/ { 51 | allow all; 52 | } 53 | 54 | # Block access to "hidden" files and directories whose names begin with a 55 | # period. This includes directories used by version control systems such 56 | # as Subversion or Git to store control files. 57 | location ~ (^|/)\. { 58 | return 403; 59 | } 60 | 61 | location / { 62 | # try_files $uri @rewrite; # For Drupal <= 6 63 | try_files $uri /index.php?$query_string; # For Drupal >= 7 64 | } 65 | 66 | location @rewrite { 67 | rewrite ^/(.*)$ /index.php?q=$1; 68 | } 69 | 70 | # Don't allow direct access to PHP files in the vendor directory. 71 | location ~ /vendor/.*\.php$ { 72 | deny all; 73 | return 404; 74 | } 75 | 76 | # In Drupal 8, we must also match new paths where the '.php' appears in 77 | # the middle, such as update.php/selection. The rule we use is strict, 78 | # and only allows this pattern with the update.php front controller. 79 | # This allows legacy path aliases in the form of 80 | # blog/index.php/legacy-path to continue to route to Drupal nodes. If 81 | # you do not have any paths like that, then you might prefer to use a 82 | # laxer rule, such as: 83 | # location ~ \.php(/|$) { 84 | # The laxer rule will continue to work if Drupal uses this new URL 85 | # pattern with front controllers other than update.php in a future 86 | # release. 87 | location ~ '\.php$|^/update.php' { 88 | fastcgi_split_path_info ^(.+?\.php)(|/.*)$; 89 | # Security note: If you're running a version of PHP older than the 90 | # latest 5.3, you should have "cgi.fix_pathinfo = 0;" in php.ini. 91 | # See http://serverfault.com/q/627903/94922 for details. 92 | include fastcgi_params; 93 | # Block httpoxy attacks. See https://httpoxy.org/. 94 | fastcgi_param HTTP_PROXY ""; 95 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 96 | fastcgi_param PATH_INFO $fastcgi_path_info; 97 | fastcgi_param QUERY_STRING $query_string; 98 | fastcgi_intercept_errors on; 99 | # PHP 5 socket location. 100 | #fastcgi_pass unix:/var/run/php5-fpm.sock; 101 | # PHP 7 socket location. 102 | #fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; 103 | #lando 104 | fastcgi_pass fpm:9000; 105 | } 106 | 107 | # Fighting with Styles? This little gem is amazing. 108 | # location ~ ^/sites/.*/files/imagecache/ { # For Drupal <= 6 109 | location ~ ^(/[a-z\-]+)?/sites/.*/files/styles/ { # For Drupal >= 7 110 | try_files $uri @rewrite; 111 | } 112 | 113 | # Handle private files through Drupal. Private file's path can come 114 | # with a language prefix. 115 | location ~ ^(/[a-z\-]+)?/system/files/ { # For Drupal >= 7 116 | try_files $uri /index.php?$query_string; 117 | } 118 | 119 | location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 120 | expires max; 121 | log_not_found off; 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /config/drupal8/default.conf.tpl: -------------------------------------------------------------------------------- 1 | # LANDODRUPALNGINXCONF 2 | 3 | server { 4 | listen 80 default_server; 5 | listen 443 ssl; 6 | 7 | server_name localhost; 8 | 9 | ssl_certificate /certs/cert.crt; 10 | ssl_certificate_key /certs/cert.key; 11 | ssl_verify_client off; 12 | 13 | ssl_session_cache shared:SSL:1m; 14 | ssl_session_timeout 5m; 15 | 16 | ssl_ciphers HIGH:!aNULL:!MD5; 17 | ssl_prefer_server_ciphers on; 18 | 19 | port_in_redirect off; 20 | client_max_body_size 100M; 21 | 22 | root "{{LANDO_WEBROOT}}"; 23 | 24 | location = /favicon.ico { 25 | log_not_found off; 26 | access_log off; 27 | } 28 | 29 | location = /robots.txt { 30 | allow all; 31 | log_not_found off; 32 | access_log off; 33 | } 34 | 35 | # Very rarely should these ever be accessed outside of your lan 36 | location ~* \.(txt|log)$ { 37 | allow 192.168.0.0/16; 38 | deny all; 39 | } 40 | 41 | location ~ \..*/.*\.php$ { 42 | return 403; 43 | } 44 | 45 | location ~ ^/sites/.*/private/ { 46 | return 403; 47 | } 48 | 49 | # Allow "Well-Known URIs" as per RFC 5785 50 | location ~* ^/.well-known/ { 51 | allow all; 52 | } 53 | 54 | # Block access to "hidden" files and directories whose names begin with a 55 | # period. This includes directories used by version control systems such 56 | # as Subversion or Git to store control files. 57 | location ~ (^|/)\. { 58 | return 403; 59 | } 60 | 61 | location / { 62 | # try_files $uri @rewrite; # For Drupal <= 6 63 | try_files $uri /index.php?$query_string; # For Drupal >= 7 64 | } 65 | 66 | location @rewrite { 67 | rewrite ^/(.*)$ /index.php?q=$1; 68 | } 69 | 70 | # Don't allow direct access to PHP files in the vendor directory. 71 | location ~ /vendor/.*\.php$ { 72 | deny all; 73 | return 404; 74 | } 75 | 76 | # In Drupal 8, we must also match new paths where the '.php' appears in 77 | # the middle, such as update.php/selection. The rule we use is strict, 78 | # and only allows this pattern with the update.php front controller. 79 | # This allows legacy path aliases in the form of 80 | # blog/index.php/legacy-path to continue to route to Drupal nodes. If 81 | # you do not have any paths like that, then you might prefer to use a 82 | # laxer rule, such as: 83 | # location ~ \.php(/|$) { 84 | # The laxer rule will continue to work if Drupal uses this new URL 85 | # pattern with front controllers other than update.php in a future 86 | # release. 87 | location ~ '\.php$|^/update.php' { 88 | fastcgi_split_path_info ^(.+?\.php)(|/.*)$; 89 | # Security note: If you're running a version of PHP older than the 90 | # latest 5.3, you should have "cgi.fix_pathinfo = 0;" in php.ini. 91 | # See http://serverfault.com/q/627903/94922 for details. 92 | include fastcgi_params; 93 | # Block httpoxy attacks. See https://httpoxy.org/. 94 | fastcgi_param HTTP_PROXY ""; 95 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 96 | fastcgi_param PATH_INFO $fastcgi_path_info; 97 | fastcgi_param QUERY_STRING $query_string; 98 | fastcgi_intercept_errors on; 99 | # PHP 5 socket location. 100 | #fastcgi_pass unix:/var/run/php5-fpm.sock; 101 | # PHP 7 socket location. 102 | #fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; 103 | #lando 104 | fastcgi_pass fpm:9000; 105 | } 106 | 107 | # Fighting with Styles? This little gem is amazing. 108 | # location ~ ^/sites/.*/files/imagecache/ { # For Drupal <= 6 109 | location ~ ^(/[a-z\-]+)?/sites/.*/files/styles/ { # For Drupal >= 7 110 | try_files $uri @rewrite; 111 | } 112 | 113 | # Handle private files through Drupal. Private file's path can come 114 | # with a language prefix. 115 | location ~ ^(/[a-z\-]+)?/system/files/ { # For Drupal >= 7 116 | try_files $uri /index.php?$query_string; 117 | } 118 | 119 | location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 120 | expires max; 121 | log_not_found off; 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /config/drupal9/default.conf.tpl: -------------------------------------------------------------------------------- 1 | # LANDODRUPALNGINXCONF 2 | 3 | server { 4 | listen 80 default_server; 5 | listen 443 ssl; 6 | 7 | server_name localhost; 8 | 9 | ssl_certificate /certs/cert.crt; 10 | ssl_certificate_key /certs/cert.key; 11 | ssl_verify_client off; 12 | 13 | ssl_session_cache shared:SSL:1m; 14 | ssl_session_timeout 5m; 15 | 16 | ssl_ciphers HIGH:!aNULL:!MD5; 17 | ssl_prefer_server_ciphers on; 18 | 19 | port_in_redirect off; 20 | client_max_body_size 100M; 21 | 22 | root "{{LANDO_WEBROOT}}"; 23 | 24 | location = /favicon.ico { 25 | log_not_found off; 26 | access_log off; 27 | } 28 | 29 | location = /robots.txt { 30 | allow all; 31 | log_not_found off; 32 | access_log off; 33 | } 34 | 35 | # Very rarely should these ever be accessed outside of your lan 36 | location ~* \.(txt|log)$ { 37 | allow 192.168.0.0/16; 38 | deny all; 39 | } 40 | 41 | location ~ \..*/.*\.php$ { 42 | return 403; 43 | } 44 | 45 | location ~ ^/sites/.*/private/ { 46 | return 403; 47 | } 48 | 49 | # Allow "Well-Known URIs" as per RFC 5785 50 | location ~* ^/.well-known/ { 51 | allow all; 52 | } 53 | 54 | # Block access to "hidden" files and directories whose names begin with a 55 | # period. This includes directories used by version control systems such 56 | # as Subversion or Git to store control files. 57 | location ~ (^|/)\. { 58 | return 403; 59 | } 60 | 61 | location / { 62 | # try_files $uri @rewrite; # For Drupal <= 6 63 | try_files $uri /index.php?$query_string; # For Drupal >= 7 64 | } 65 | 66 | location @rewrite { 67 | rewrite ^/(.*)$ /index.php?q=$1; 68 | } 69 | 70 | # Don't allow direct access to PHP files in the vendor directory. 71 | location ~ /vendor/.*\.php$ { 72 | deny all; 73 | return 404; 74 | } 75 | 76 | # In Drupal 9, we must also match new paths where the '.php' appears in 77 | # the middle, such as update.php/selection. The rule we use is strict, 78 | # and only allows this pattern with the update.php front controller. 79 | # This allows legacy path aliases in the form of 80 | # blog/index.php/legacy-path to continue to route to Drupal nodes. If 81 | # you do not have any paths like that, then you might prefer to use a 82 | # laxer rule, such as: 83 | # location ~ \.php(/|$) { 84 | # The laxer rule will continue to work if Drupal uses this new URL 85 | # pattern with front controllers other than update.php in a future 86 | # release. 87 | location ~ '\.php$|^/update.php' { 88 | fastcgi_split_path_info ^(.+?\.php)(|/.*)$; 89 | # Security note: If you're running a version of PHP older than the 90 | # latest 5.3, you should have "cgi.fix_pathinfo = 0;" in php.ini. 91 | # See http://serverfault.com/q/627903/94922 for details. 92 | include fastcgi_params; 93 | # Block httpoxy attacks. See https://httpoxy.org/. 94 | fastcgi_param HTTP_PROXY ""; 95 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 96 | fastcgi_param PATH_INFO $fastcgi_path_info; 97 | fastcgi_param QUERY_STRING $query_string; 98 | fastcgi_intercept_errors on; 99 | # PHP 5 socket location. 100 | #fastcgi_pass unix:/var/run/php5-fpm.sock; 101 | # PHP 7 socket location. 102 | #fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; 103 | #lando 104 | fastcgi_pass fpm:9000; 105 | } 106 | 107 | # Fighting with Styles? This little gem is amazing. 108 | # location ~ ^/sites/.*/files/imagecache/ { # For Drupal <= 6 109 | location ~ ^(/[a-z\-]+)?/sites/.*/files/styles/ { # For Drupal >= 7 110 | try_files $uri @rewrite; 111 | } 112 | 113 | # Handle private files through Drupal. Private file's path can come 114 | # with a language prefix. 115 | location ~ ^(/[a-z\-]+)?/system/files/ { # For Drupal >= 7 116 | try_files $uri /index.php?$query_string; 117 | } 118 | 119 | location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 120 | expires max; 121 | log_not_found off; 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /config/drupal10/default.conf.tpl: -------------------------------------------------------------------------------- 1 | # LANDODRUPALNGINXCONF 2 | 3 | server { 4 | listen 80 default_server; 5 | listen 443 ssl; 6 | server_name localhost; 7 | ssl_certificate /certs/cert.crt; 8 | ssl_certificate_key /certs/cert.key; 9 | ssl_verify_client off; 10 | ssl_session_cache shared:SSL:1m; 11 | ssl_session_timeout 5m; 12 | ssl_ciphers HIGH:!aNULL:!MD5; 13 | ssl_prefer_server_ciphers on; 14 | port_in_redirect off; 15 | client_max_body_size 100M; 16 | root "{{LANDO_WEBROOT}}"; 17 | location = /favicon.ico { 18 | log_not_found off; 19 | access_log off; 20 | } 21 | 22 | location = /robots.txt { 23 | allow all; 24 | log_not_found off; 25 | access_log off; 26 | } 27 | 28 | # Very rarely should these ever be accessed outside of your lan 29 | location ~* \.(txt|log)$ { 30 | allow 192.168.0.0/16; 31 | deny all; 32 | } 33 | 34 | location ~ \..*/.*\.php$ { 35 | return 403; 36 | } 37 | 38 | location ~ ^/sites/.*/private/ { 39 | return 403; 40 | } 41 | 42 | # Allow "Well-Known URIs" as per RFC 5785 43 | location ~* ^/.well-known/ { 44 | allow all; 45 | } 46 | 47 | # Block access to "hidden" files and directories whose names begin with a 48 | # period. This includes directories used by version control systems such 49 | # as Subversion or Git to store control files. 50 | location ~ (^|/)\. { 51 | return 403; 52 | } 53 | 54 | location / { 55 | # try_files $uri @rewrite; # For Drupal <= 6 56 | try_files $uri /index.php?$query_string; # For Drupal >= 7 57 | } 58 | 59 | location @rewrite { 60 | #rewrite ^/(.*)$ /index.php?q=$1; # For Drupal <= 6 61 | rewrite ^ /index.php; # For Drupal >= 7 62 | } 63 | 64 | # Don't allow direct access to PHP files in the vendor directory. 65 | location ~ /vendor/.*\.php$ { 66 | deny all; 67 | return 404; 68 | } 69 | 70 | # In Drupal 10, we must also match new paths where the '.php' appears in 71 | # the middle, such as update.php/selection. The rule we use is strict, 72 | # and only allows this pattern with the update.php front controller. 73 | # This allows legacy path aliases in the form of 74 | # blog/index.php/legacy-path to continue to route to Drupal nodes. If 75 | # you do not have any paths like that, then you might prefer to use a 76 | # laxer rule, such as: 77 | # location ~ \.php(/|$) { 78 | # The laxer rule will continue to work if Drupal uses this new URL 79 | # pattern with front controllers other than update.php in a future 80 | # release. 81 | location ~ '\.php$|^/update.php' { 82 | fastcgi_split_path_info ^(.+?\.php)(|/.*)$; 83 | # Security note: If you're running a version of PHP older than the 84 | # latest 5.3, you should have "cgi.fix_pathinfo = 0;" in php.ini. 85 | # See http://serverfault.com/q/627903/94922 for details. 86 | include fastcgi_params; 87 | # Block httpoxy attacks. See https://httpoxy.org/. 88 | fastcgi_param HTTP_PROXY ""; 89 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 90 | fastcgi_param PATH_INFO $fastcgi_path_info; 91 | fastcgi_param QUERY_STRING $query_string; 92 | fastcgi_intercept_errors on; 93 | # PHP 5 socket location. 94 | #fastcgi_pass unix:/var/run/php5-fpm.sock; 95 | # PHP 7 socket location. 96 | #fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; 97 | #lando 98 | fastcgi_pass fpm:9000; 99 | } 100 | # Fighting with Styles? This little gem is amazing. 101 | # location ~ ^/sites/.*/files/imagecache/ { # For Drupal <= 6 102 | location ~ ^(/[a-z\-]+)?/sites/.*/files/(css|js|styles)/ { # For Drupal >= 7 103 | try_files $uri @rewrite; 104 | } 105 | # Handle private files through Drupal. Private file's path can come 106 | # with a language prefix. 107 | location ~ ^(/[a-z\-]+)?/system/files/ { # For Drupal >= 7 108 | try_files $uri /index.php?$query_string; 109 | } 110 | 111 | location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 112 | expires max; 113 | log_not_found off; 114 | } 115 | 116 | } 117 | -------------------------------------------------------------------------------- /config/drupal11/default.conf.tpl: -------------------------------------------------------------------------------- 1 | # LANDODRUPALNGINXCONF 2 | 3 | server { 4 | listen 80 default_server; 5 | listen 443 ssl; 6 | server_name localhost; 7 | ssl_certificate /certs/cert.crt; 8 | ssl_certificate_key /certs/cert.key; 9 | ssl_verify_client off; 10 | ssl_session_cache shared:SSL:1m; 11 | ssl_session_timeout 5m; 12 | ssl_ciphers HIGH:!aNULL:!MD5; 13 | ssl_prefer_server_ciphers on; 14 | port_in_redirect off; 15 | client_max_body_size 100M; 16 | root "{{LANDO_WEBROOT}}"; 17 | location = /favicon.ico { 18 | log_not_found off; 19 | access_log off; 20 | } 21 | 22 | location = /robots.txt { 23 | allow all; 24 | log_not_found off; 25 | access_log off; 26 | } 27 | 28 | # Very rarely should these ever be accessed outside of your lan 29 | location ~* \.(txt|log)$ { 30 | allow 192.168.0.0/16; 31 | deny all; 32 | } 33 | 34 | location ~ \..*/.*\.php$ { 35 | return 403; 36 | } 37 | 38 | location ~ ^/sites/.*/private/ { 39 | return 403; 40 | } 41 | 42 | # Allow "Well-Known URIs" as per RFC 5785 43 | location ~* ^/.well-known/ { 44 | allow all; 45 | } 46 | 47 | # Block access to "hidden" files and directories whose names begin with a 48 | # period. This includes directories used by version control systems such 49 | # as Subversion or Git to store control files. 50 | location ~ (^|/)\. { 51 | return 403; 52 | } 53 | 54 | location / { 55 | # try_files $uri @rewrite; # For Drupal <= 6 56 | try_files $uri /index.php?$query_string; # For Drupal >= 7 57 | } 58 | 59 | location @rewrite { 60 | #rewrite ^/(.*)$ /index.php?q=$1; # For Drupal <= 6 61 | rewrite ^ /index.php; # For Drupal >= 7 62 | } 63 | 64 | # Don't allow direct access to PHP files in the vendor directory. 65 | location ~ /vendor/.*\.php$ { 66 | deny all; 67 | return 404; 68 | } 69 | 70 | # In Drupal 11, we must also match new paths where the '.php' appears in 71 | # the middle, such as update.php/selection. The rule we use is strict, 72 | # and only allows this pattern with the update.php front controller. 73 | # This allows legacy path aliases in the form of 74 | # blog/index.php/legacy-path to continue to route to Drupal nodes. If 75 | # you do not have any paths like that, then you might prefer to use a 76 | # laxer rule, such as: 77 | # location ~ \.php(/|$) { 78 | # The laxer rule will continue to work if Drupal uses this new URL 79 | # pattern with front controllers other than update.php in a future 80 | # release. 81 | location ~ '\.php$|^/update.php' { 82 | fastcgi_split_path_info ^(.+?\.php)(|/.*)$; 83 | # Security note: If you're running a version of PHP older than the 84 | # latest 5.3, you should have "cgi.fix_pathinfo = 0;" in php.ini. 85 | # See http://serverfault.com/q/627903/94922 for details. 86 | include fastcgi_params; 87 | # Block httpoxy attacks. See https://httpoxy.org/. 88 | fastcgi_param HTTP_PROXY ""; 89 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 90 | fastcgi_param PATH_INFO $fastcgi_path_info; 91 | fastcgi_param QUERY_STRING $query_string; 92 | fastcgi_intercept_errors on; 93 | # PHP 5 socket location. 94 | #fastcgi_pass unix:/var/run/php5-fpm.sock; 95 | # PHP 7 socket location. 96 | #fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; 97 | #lando 98 | fastcgi_pass fpm:9000; 99 | } 100 | # Fighting with Styles? This little gem is amazing. 101 | # location ~ ^/sites/.*/files/imagecache/ { # For Drupal <= 6 102 | location ~ ^(/[a-z\-]+)?/sites/.*/files/(css|js|styles)/ { # For Drupal >= 7 103 | try_files $uri @rewrite; 104 | } 105 | # Handle private files through Drupal. Private file's path can come 106 | # with a language prefix. 107 | location ~ ^(/[a-z\-]+)?/system/files/ { # For Drupal >= 7 108 | try_files $uri /index.php?$query_string; 109 | } 110 | 111 | location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 112 | expires max; 113 | log_not_found off; 114 | } 115 | 116 | } 117 | -------------------------------------------------------------------------------- /examples/drupal11-mysql84/README.md: -------------------------------------------------------------------------------- 1 | # Drupal 11 with MySQL 8.4 Example 2 | 3 | This example exists primarily to test the following documentation against MySQL 8.4: 4 | 5 | * [Drupal 11 Recipe](https://docs.lando.dev/plugins/drupal) 6 | 7 | ## Start up tests 8 | 9 | Run the following commands to get up and running with this example. 10 | 11 | ```bash 12 | # Should poweroff 13 | lando poweroff 14 | 15 | # Should initialize the latest Drupal 11 codebase 16 | rm -rf drupal11 && mkdir -p drupal11 && cd drupal11 17 | lando init --source remote --remote-url https://ftp.drupal.org/files/projects/drupal-11.2.x-dev.tar.gz --remote-options="--strip-components 1" --recipe drupal11 --webroot . --name lando-drupal11 --option database=mysql:8.4 18 | 19 | # Should start up successfully 20 | cd drupal11 21 | cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml 22 | lando start 23 | ``` 24 | 25 | ## Verification commands 26 | 27 | Run the following commands to validate things are rolling as they should. 28 | 29 | ```bash 30 | # Should include recipe defaults in the landofile 31 | cd drupal11 32 | cat .lando.yml | tee >(cat 1>&2) | grep 'php: "8.3"' 33 | cat .lando.yml | grep "drush: ^13" 34 | cat .lando.yml | grep "composer_version: 2-latest" 35 | 36 | # Should be running mysql 8.4.x 37 | cd drupal11 38 | lando mysql -V | tee >(cat 1>&2) | grep '8.4.' 39 | 40 | # Should return the drupal installation page by default 41 | cd drupal11 42 | lando exec appserver -- curl -L localhost | grep "Drupal 11" 43 | 44 | # Should use 8.3 as the default php version 45 | cd drupal11 46 | lando php -v | grep "PHP 8.3" 47 | 48 | # Should be running apache 2.4 by default 49 | cd drupal11 50 | lando exec appserver -- apachectl -V | grep '2.4' 51 | lando exec appserver -- curl -IL localhost | grep Server | grep '2.4' 52 | 53 | # Should be running sqlite 3.45 by default 54 | cd drupal11 55 | lando php -r "print_r(SQLite3::version());" | grep versionString | tee >(cat 1>&2) | grep 3.45 56 | 57 | # Should not enable xdebug by default 58 | cd drupal11 59 | lando php -m | grep xdebug || echo $? | grep 1 60 | 61 | # Should use the default database connection info 62 | cd drupal11 63 | lando mysql -udrupal11 -pdrupal11 drupal11 -e quit 64 | 65 | # Should use a composer version above 2.7.0 66 | cd drupal11 67 | lando composer --version | cut -d " " -f 3 | head -n 1 | awk -v min=2.7.0 -F. '($1 > 2) || ($1 == 2 && $2 > 7) || ($1 == 2 && $2 == 7 && $3 > 0)' 68 | 69 | # Should use site-local drush if installed 70 | cd drupal11 71 | lando composer require drush/drush --no-interaction 72 | lando exec appserver -- which drush | grep "/app/vendor/bin/drush" 73 | 74 | # Should be able to install drupal 75 | cd drupal11 76 | lando drush site:install --db-url=mysql://drupal11:drupal11@database/drupal11 -y 77 | 78 | # Should be able to enable and access jsonapi 79 | cd drupal11 80 | lando drush en jsonapi -y 81 | lando exec appserver -- curl localhost/jsonapi | grep "action--action" 82 | 83 | # Should be able to dump the database with drush 84 | cd drupal11 85 | lando drush sql-dump --result-file=drupal11.sql --extra-dump="--no-tablespaces" 86 | lando mysql -udrupal11 -pdrupal11 drupal11 -e "SELECT COUNT(*) FROM users;" | grep -A 2 COUNT | tee >(cat 1>&2) | grep 2 87 | 88 | # Should be able to drop and restore the database with drush 89 | cd drupal11 90 | lando drush sql-drop -y 91 | lando drush sql-cli < drupal11.sql 92 | lando mysql -udrupal11 -pdrupal11 drupal11 -e "SELECT COUNT(*) FROM users;" | grep -A 2 COUNT | tee >(cat 1>&2) | grep 2 93 | 94 | # Should be able to export the database with Lando 95 | cd drupal11 96 | rm -f drupal11.sql 97 | lando db-export drupal11.sql 98 | 99 | # Should be able to import the database with Lando 100 | cd drupal11 101 | lando db-import drupal11.sql.gz 102 | lando mysql -udrupal11 -pdrupal11 drupal11 -e "SELECT COUNT(*) FROM users;" | grep -A 2 COUNT | tee >(cat 1>&2) | grep 2 103 | 104 | # Should be able to drop database tables 105 | cd drupal11 106 | lando drush sql-drop -y 107 | 108 | # Should be able to pipe in file through appserver 109 | cd drupal11 110 | lando exec appserver -- 'zcat drupal11.sql.gz | mysql -h database -udrupal11 -pdrupal11 drupal11' 111 | lando mysql -udrupal11 -pdrupal11 drupal11 -e "SELECT COUNT(*) FROM users;" | grep -A 2 COUNT | tee >(cat 1>&2) | grep 2 112 | 113 | # Should bootstrap Drupal successfully 114 | cd drupal11 115 | lando drush status | grep "Drupal bootstrap" | tee >(cat 1>&2) | grep "Successful" 116 | ``` 117 | 118 | ## Destroy tests 119 | 120 | Run the following commands to trash this app like nothing ever happened. 121 | 122 | ```bash 123 | # Should be destroyed with success 124 | cd drupal11 125 | lando destroy -y 126 | lando poweroff 127 | ``` 128 | -------------------------------------------------------------------------------- /docs/getting-started.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to get started with the Lando Drupal recipe. 3 | --- 4 | 5 | # Getting Started 6 | 7 | ## Requirements 8 | 9 | Before you get started with this recipe we assume that you have: 10 | 11 | 1. [Installed Lando](https://docs.lando.dev/getting-started/installation.html) and gotten familiar with [its basics](https://docs.lando.dev/cli/) 12 | 2. [Initialized](https://docs.lando.dev/cli/init.html) a [Landofile](https://docs.lando.dev/landofile/) for your codebase for use with this recipe 13 | 3. Read about the various [services](https://docs.lando.dev/services/lando-3.html), [tooling](https://docs.lando.dev/landofile/tooling.html), [events](https://docs.lando.dev/landofile/events.html) and [routing](https://docs.lando.dev/landofile/proxy.html) Lando offers. 14 | 15 | ## Quick Start 16 | 17 | Try out the relevant commands below to spin up a new Landoified vanilla Drupal site. 18 | 19 | ::: code-group 20 | ```bash:no-line-numbers [DRUPAL 11] 21 | # Initialize a drupal11 recipe 22 | mkdir my-first-drupal11-app \ 23 | && cd my-first-drupal11-app \ 24 | && lando init \ 25 | --source cwd \ 26 | --recipe drupal11 \ 27 | --webroot web \ 28 | --name my-first-drupal11-app 29 | 30 | # Start the environment 31 | lando start 32 | 33 | # Create latest drupal11 project via composer 34 | lando composer create-project drupal/recommended-project:11.x tmp && cp -r tmp/. . && rm -rf tmp 35 | 36 | # Composer can timeout on install for some machines, if that happens, run the following command and then re-run the previous lando composer command: 37 | # lando composer config --global process-timeout 2000 38 | 39 | # Install a site local drush 40 | lando composer require drush/drush 41 | 42 | # Install drupal 43 | lando drush site:install --db-url=mysql://drupal11:drupal11@database/drupal11 -y 44 | 45 | # List information about this app 46 | lando info 47 | ``` 48 | 49 | ```bash:no-line-numbers [DRUPAL CMS] 50 | # Initialize a drupal11 recipe 51 | mkdir my-drupalcms-app \ 52 | && cd my-drupalcms-app \ 53 | && lando init \ 54 | --source cwd \ 55 | --recipe drupal11 \ 56 | --webroot web \ 57 | --name my-drupalcms-app 58 | 59 | # Start the environment 60 | lando start 61 | 62 | # Create latest Drupal CMS project via composer 63 | lando composer create-project drupal/cms tmp && cp -r tmp/. . && rm -rf tmp 64 | 65 | # Install drupal 66 | lando drush site:install recipes/drupal_cms_starter --db-url=mysql://drupal11:drupal11@database/drupal11 -y 67 | 68 | # List information about this app 69 | lando info 70 | ``` 71 | 72 | ```bash:no-line-numbers [DRUPAL 10] 73 | # Initialize a drupal10 recipe 74 | mkdir my-first-drupal10-app \ 75 | && cd my-first-drupal10-app \ 76 | && lando init \ 77 | --source cwd \ 78 | --recipe drupal10 \ 79 | --webroot web \ 80 | --name my-first-drupal10-app 81 | 82 | # Start it up 83 | lando start 84 | 85 | # Create latest drupal10 project via composer 86 | lando composer create-project drupal/recommended-project:10.x tmp && cp -r tmp/. . && rm -rf tmp 87 | 88 | # Composer can timeout on install for some machines, if that happens, run the following command and then re-run the previous lando composer command: 89 | # lando composer config --global process-timeout 2000 90 | 91 | # Install a site local drush 92 | lando composer require drush/drush 93 | 94 | # Install drupal 95 | lando drush site:install --db-url=mysql://drupal10:drupal10@database/drupal10 -y 96 | 97 | # List information about this app 98 | lando info 99 | ``` 100 | 101 | ```bash:no-line-numbers [DRUPAL 9] 102 | # Initialize a drupal9 recipe 103 | mkdir my-first-drupal9-app \ 104 | && cd my-first-drupal9-app \ 105 | && lando init \ 106 | --source cwd \ 107 | --recipe drupal9 \ 108 | --webroot web \ 109 | --name my-first-drupal9-app 110 | 111 | # Start it up 112 | lando start 113 | 114 | # Create latest drupal9 project via composer 115 | lando composer create-project drupal/recommended-project:9.x tmp && cp -r tmp/. . && rm -rf tmp 116 | 117 | # Composer can timeout on install for some machines, if that happens, run the following command and then re-run the previous lando composer command: 118 | # lando composer config --global process-timeout 2000 119 | 120 | # Install a site local drush 121 | lando composer require drush/drush 122 | 123 | # Install drupal 124 | lando drush site:install --db-url=mysql://drupal9:drupal9@database/drupal9 -y 125 | 126 | # List information about this app 127 | lando info 128 | ``` 129 | ::: 130 | 131 | Or Landoify an existing Drupal site: 132 | 133 | ```bash:no-line-numbers 134 | cd /path/to/my/repo 135 | lando init --source cwd --recipe drupal9 136 | ``` 137 | 138 | If you are interested in EOL Drupal versions then check out our legacy docs: 139 | 140 | - [Drupal 8](./legacy/drupal-8). 141 | - [Drupal 7](./legacy/drupal-7). 142 | - [Drupal 6](./legacy/drupal-6). 143 | -------------------------------------------------------------------------------- /docs/guides/drupal-multisite.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Running Drupal Multisite on Lando 3 | description: How to run multisite Drupal installs on Lando. 4 | guide: true 5 | authors: 6 | - name: Brook Heaton 7 | pic: https://avatars.githubusercontent.com/u/19474864 8 | link: https://github.com/brooke-heaton 9 | updated: 10 | timestamp: 1613073690000 11 | mailchimp: 12 | action: https://dev.us12.list-manage.com/subscribe/post?u=59874b4d6910fa65e724a4648&id=613837077f 13 | title: Want more Drupal guide content? 14 | byline: Signup and we will send you a weekly blog digest of similar content to keep you satiated. 15 | button: Sign me up! 16 | --- 17 | 18 | # Running Drupal Multisite on Lando 19 | 20 | [Drupal multisite](https://www.drupal.org/docs/multisite-drupal) is a feature of Drupal that allows you to run multiple Drupal installs off of a common codebase. 21 | It's common in universities and other settings where you might want to share themes and modules between a collection of many websites. 22 | 23 | ## Configuring Lando 24 | 25 | To run Drupal multisite you need to do several things: 26 | 27 | 1. Your `.lando.yml` will need proxies for each multisite in the appserver array 28 | 2. The `settings.local.php` file within your subsite directory (ex: `docroot/sites/site1/`) needs settings to connect to the appropriate Lando-hosted database. 29 | 3. You need Drush aliases pointing to your local. If you use Drupal console, you'll need to specify your uri (ex: `drupal --uri=http://site1.lndo.site cr all`). 30 | 31 | ## 1. Configure .lando.yml 32 | 33 | Create proxies for each multisite in the appserver array in your `.lando.yml` file. Ex: 34 | 35 | ```yaml 36 | proxy: 37 | appserver: 38 | - site1.lndo.site 39 | - site2.lndo.s 40 | services: 41 | site1: 42 | type: mysql:5.7 43 | portforward: 33068 44 | config: 45 | confd: lando/mysql/conf.d 46 | site2: 47 | type: mysql:5.7 48 | portforward: 33069 49 | config: 50 | confd: .lando/mysql/conf.d 51 | ``` 52 | 53 | ## 2. Configure each subsite's settings.local.php 54 | 55 | Configure each subsite to include the default Lando config to connect to the database, along with specifying the appserver name you defined in `.lando.yml`. For example, in `docroot/sites/site1/settings/settings.local.php` you would include... 56 | 57 | ```php 58 | /** 59 | * Database configuration. 60 | */ 61 | $databases['default'] = array ( 62 | 'default' => array ( 63 | 'driver' => 'mysql', 64 | 'database' => 'database', 65 | 'username' => 'mysql', 66 | 'password' => 'password', 67 | 'prefix' => '', 68 | 'port' => 3306, 69 | ) 70 | ); 71 | // The only thing to add from the out-of-the-box Lando db is the special host for each subsite 72 | $databases['default']['default']['host'] = 'site1'; 73 | ``` 74 | 75 | ::: warning If you're on Acquia... 76 | You must specify $_Server['PWD']=DRUPAL_ROOT if you use Drush 9 on Acquia (this may apply to some other hosts as well). Update your main `sites/default/settings.php` to tell our local Drupal to use the `/settings/settings.local.php` within each subsite: 77 | 78 | ```php 79 | if (!key_exists('AH_SITE_ENVIRONMENT', $_ENV)) { 80 | $environment_settings = __DIR__ . '/settings/settings.local.php'; 81 | if (file_exists($environment_settings)) { 82 | include $environment_settings; 83 | } 84 | } 85 | // Temporary fix because drush9 blocks superglobals 86 | $_SERVER['PWD']=DRUPAL_ROOT; 87 | ``` 88 | ::: 89 | 90 | ## 3. Define Drush aliases for each subsite 91 | 92 | Finally you'll need some Drush aliases so Drush can find your subsite installs. Here `docroot` is where our Drupal root is. For example, in `site_root/drush/sites/site-aliases/site1.site.yml` we would define... 93 | 94 | ```yaml 95 | local: 96 | uri: 'https://site1.lndo.site' 97 | paths: 98 | - files: /path_to_your_local_site/site_root/docroot' 99 | dev: 100 | host: 'site1dev.ssh.prod.acquia-sites.com' 101 | user: 'site1.dev' 102 | root: '/var/www/html/site1.dev/docroot' 103 | uri: 'site1dev.prod.acquia-sites.com' 104 | ac-site: 'site1' 105 | ac-env: 'dev' 106 | ac-realm: 'prod' 107 | paths: 108 | drush-script: 'drush8' 109 | test: 110 | root: '/var/www/html/site1.test/docroot' 111 | ac-site: 'site1' 112 | ac-env: 'test' 113 | ac-realm: 'prod' 114 | uri: 'site1stg.prod.acquia-sites.com' 115 | host: 'site1stg.ssh.prod.acquia-sites.com' 116 | user: 'site1.test' 117 | paths: 118 | drush-script: 'drush8' 119 | prod: 120 | root: '/var/www/html/site1.prod/docroot' 121 | ac-site: 'site1' 122 | ac-env: 'prod' 123 | ac-realm: 'prod' 124 | uri: 'site1.prod.acquia-sites.com' 125 | host: 'site1.ssh.prod.acquia-sites.com' 126 | user: 'site1.prod' 127 | paths: 128 | drush-script: 'drush8' 129 | ``` 130 | 131 | I'm using drush8 against the cloud here by specifying that in the drush-script, since I've had issues trying to use drush9 and have no defined drush9 aliases, but that's purely a concern of working with Acquia Cloud. 132 | 133 | -------------------------------------------------------------------------------- /docs/tooling.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Tooling 3 | description: Learn about Lando Drupal tooling commands like composer, php, drush, etc 4 | --- 5 | 6 | # Tooling 7 | 8 | By default each Lando Drupal recipe will also ship with helpful dev utilities. 9 | 10 | This means you can use things like `drush`, `composer` and `php` via Lando. This helps avoid mucking up your actual computer because you dont have to manage `php` versions, global `composer` dependencies and other less than savory things. 11 | 12 | ```bash 13 | lando composer Runs composer commands 14 | lando db-export [file] Exports database from a service into a file 15 | lando db-import Imports a dump file into database service 16 | lando drush Runs drush commands 17 | lando mysql Drops into a MySQL shell on a database service 18 | lando php Runs php commands 19 | ``` 20 | 21 | :::warning Make sure you install Drush 22 | If you are running `Drupal 8.4+` then you will need [a site-local install of Drush](https://www.drush.org/latest/install/). Check out [Using Drush](#using-drush) below for more info. 23 | ::: 24 | 25 | **Usage examples** 26 | 27 | ```bash 28 | # Doing a drush site install 29 | lando drush si --db-url=mysql://drupal9:drupal9@database/drupal9 -y 30 | 31 | # Run composer tests 32 | lando composer test 33 | 34 | # Drop into a mysql shell 35 | lando mysql 36 | 37 | # Check the app's installed php extensions 38 | lando php -m 39 | ``` 40 | 41 | You can also run `lando` from inside your app directory for a complete list of commands which is always advisable as your list of commands may not 100% be the same as the above. For example if you set `database: postgres` you will get `lando psql` instead of `lando mysql`. 42 | 43 | 44 | ## Using Drush 45 | 46 | As of Drupal 8.4+ it is preferred you use [a site-local install of Drush](https://www.drush.org/latest/install/). For that reason Lando **will not** globall install a version of Drush for Drupal 9 sites. 47 | 48 | You can site-local install drush by requiring it in your projects `composer.json` file. 49 | 50 | ```bash 51 | lando composer require drush/drush 52 | ``` 53 | 54 | Once you do, Lando will be able to use `drush` normally. 55 | 56 | #### Build steps 57 | 58 | Once `drush` is listed in your `composer.json` it is also recommended to configure a [build step](https://docs.lando.dev/services/lando-3.html#build-steps) to automatically install Drush before your app starts up. This ensures `drush` is available after `lando start` and during any other build steps or events. 59 | 60 | **Automatically composer install before my app starts** 61 | 62 | ```yaml 63 | recipe: drupal9 64 | services: 65 | appserver: 66 | build: 67 | - composer install 68 | ``` 69 | 70 | If you find that Lando is not using your `drush` as expected, which can happen if you've modified `composer` to install in a different directory than its normal `vendor` you can take advantage of Lando's [tooling overrides](https://docs.lando.dev/landofile/tooling.html#overriding) and specify an absolute path to your Drush. 71 | 72 | ```yaml 73 | tooling: 74 | drush: 75 | cmd: /path/to/my/drush 76 | ``` 77 | 78 | #### Default URL Setup 79 | 80 | You may see `http://default` show up in many `drush` commands you run. 81 | 82 | ```bash 83 | lando drush uli 84 | // http://default/user/reset/1/1548025070/Px6PbLyJ_2laXqoDe6OukHXaX-cXExo4ErfrKbkqsE4/login 85 | ``` 86 | 87 | This happens because it is actually a difficult problem for Lando to 100% know the canonical URL or service that is serving your application. However you can set up your environment so that commands like `lando drush uli` return the proper URL. 88 | 89 | ```yaml 90 | tooling: 91 | drush: 92 | service: appserver 93 | env: 94 | DRUSH_OPTIONS_URI: "https://mysite.lndo.site" 95 | ``` 96 | 97 | ## Using xdebug 98 | 99 | This is just a passthrough option to the [xdebug setting](https://docs.lando.dev/plugins/php/config.html#using-xdebug) that exists on all our [php services](https://docs.lando.dev/plugins/php/index.html). The `tl;dr` is `xdebug: true` enables and configures the php xdebug extension and `xdebug: false` disables it. 100 | 101 | ```yaml 102 | recipe: drupal9 103 | config: 104 | xdebug: true|false 105 | ``` 106 | 107 | However, for more information we recommend you consult the [php service documentation](https://docs.lando.dev/plugins/php/index.html). 108 | 109 | 110 | ## Importing Your Database 111 | 112 | Once you've started up your Drupal 9 site you will need to pull in your database and files before you can really start to dev all the dev. Pulling your files is as easy as downloading an archive and extracting it to the correct location. Importing a database can be done using our helpful `lando db-import` command. 113 | 114 | ```bash 115 | # Grab your database dump 116 | curl -fsSL -o database.sql.gz "https://url.to.my.db/database.sql.gz" 117 | 118 | # Import the database 119 | # NOTE: db-import can handle uncompressed, gzipped or zipped files 120 | # Due to restrictions in how Docker handles file sharing your database 121 | # dump MUST exist somewhere inside of your app directory. 122 | lando db-import database.sql.gz 123 | ``` 124 | 125 | You can learn more about the `db-import` command [over here](https://docs.lando.dev/guides/db-import.html) 126 | -------------------------------------------------------------------------------- /docs/legacy/drupal-7.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Lando docs for Drupal 7 (legacy version). 3 | --- 4 | 5 | # Drupal 7 6 | 7 | ## Quickstart 8 | 9 | ```bash:no-line-numbers 10 | # Initialize a drupal7 recipe using the latest Drupal 8 version 11 | mkdir my-first-drupal7-app \ 12 | && cd my-first-drupal7-app \ 13 | && lando init \ 14 | --source remote \ 15 | --remote-url https://ftp.drupal.org/files/projects/drupal-7.71.tar.gz \ 16 | --remote-options="--strip-components 1" \ 17 | --recipe drupal7 \ 18 | --webroot . \ 19 | --name my-first-drupal7-app 20 | 21 | # Start it up 22 | lando start 23 | 24 | # Install drupal 25 | lando drush si --db-url=mysql://drupal7:drupal7@database/drupal7 -y 26 | 27 | # List information about this app. 28 | lando info 29 | ``` 30 | 31 | ## Default Configuration 32 | 33 | ```yaml 34 | recipe: drupal7 35 | config: 36 | php: '7.2' 37 | composer_version: '2.0.7' 38 | via: apache:2.4 39 | webroot: . 40 | database: mysql:5.7 41 | drush: ^8 42 | xdebug: false 43 | ``` 44 | 45 | 46 | ## Using Drush 47 | 48 | By default, our Drupal 7 recipe will globally install the [latest version of Drush 8](http://docs.drush.org/en/8.x/install/) or the [latest version of Drush 7](http://docs.drush.org/en/7.x/install/) if you are using php 5.3. This means that you should be able to use `lando drush` out of the box. 49 | 50 | That said you can configure this recipe to use any version of Drush to which there is a resolvable package available via `composer`. That means that the following are all valid. 51 | 52 | ### Use the latest version of Drush 53 | 54 | ```yaml 55 | recipe: drupal7 56 | config: 57 | drush: "*" 58 | ``` 59 | 60 | ### Use the latest version of Drush 7 61 | 62 | ```yaml 63 | recipe: drupal7 64 | config: 65 | drush: ^7 66 | ``` 67 | 68 | ### Use a specific version of Drush 8 69 | 70 | ```yaml 71 | recipe: drupal7 72 | config: 73 | drush: 8.1.15 74 | ``` 75 | 76 | ### Using a site-local Drush 77 | 78 | While Lando will globally install Drush for you it is increasingly common and in some cases a straight-up best practice to [install a site-local Drush](https://www.drush.org/latest/install/) by requiring it in your projects `composer.json` file. 79 | 80 | Because of how Lando's [php service](https://docs.lando.dev/plugins/php) sets up its [`PATH`](https://docs.lando.dev/plugins/php/caveats.html) this means that if you have indeed installed Drush on your own via `composer` Lando will use yours over its own. 81 | 82 | Said more explicitly: **if you've required `drush` via `composer` in your application then this recipe will use your `drush` and not the one you've specified in this recipes config.** 83 | 84 | If you are using a site-local Drush, it is also recommended to configure a [build step](https://docs.lando.dev/services/lando-3.html#build-steps) to automatically install Drush before your app starts up. This can prevent weird version mismatches and other issues if you are using Drush in other Lando automation like [events](https://docs.lando.dev/landofile/events.html). 85 | 86 | **Automatically composer install before my app starts** 87 | 88 | ```yaml 89 | recipe: drupal7 90 | services: 91 | appserver: 92 | build: 93 | - composer install 94 | ``` 95 | 96 | If you find that Lando is not using your `drush` as expected, which can happen if you've modified `composer` to install in a different directory than its normal `vendor` you can take advantage of Lando's [tooling overrides](https://docs.lando.dev/landofile/tooling.html#overriding) and specify an absolute path to your Drush. 97 | 98 | ```yaml 99 | tooling: 100 | drush: 101 | cmd: /path/to/my/drush 102 | ``` 103 | 104 | ### Default URL Setup 105 | 106 | You may see `http://default` show up in many `drush` commands you run. 107 | 108 | ```bash 109 | lando drush uli 110 | // http://default/user/reset/1/1548025070/Px6PbLyJ_2laXqoDe6OukHXaX-cXExo4ErfrKbkqsE4/login 111 | ``` 112 | 113 | This happens because it is actually a difficult problem for Lando to 100% know the canonical URL or service that is serving your application. However, you can set up your environment so that commands like `lando drush uli` return the proper URL. 114 | 115 | Create or edit the relevant `settings.php` file and add these lines. Note that you may need to specify a port depending on your Lando installation. You can run `lando info` to see if your URLs use explicit ports or not. 116 | 117 | ```php 118 | $base_url = "http://mysite.lndo.site:PORT_IF_NEEDED" 119 | ``` 120 | 121 | ### Aliases 122 | 123 | You can also use `drush` aliases with a command like `lando drush @sitealias cc all` by following the instructions below. 124 | 125 | Make sure the alias file exists within the drush folder in your app. An example could be the files structure below: 126 | 127 | ```bash 128 | |-- app 129 | |-- drush 130 | |-- yoursite.aliases.drushrc.php 131 | ``` 132 | 133 | For info on how to set up your alias, please refer to the following [link](https://www.drupal.org/node/1401522) or see this [example](https://github.com/drush-ops/drush/blob/8.x/examples/example.aliases.drushrc.php). 134 | 135 | Then configure the following [build step](https://docs.lando.dev/services/lando-3.html#build-steps) in your [Landofile](https://docs.lando.dev/landofile/) and `lando rebuild`. 136 | 137 | ```yml 138 | services: 139 | appserver: 140 | build: 141 | - mkdir -p ~/.drush/site-aliases 142 | - ln -sf /app/drush/yoursite.aliases.drushrc.php ~/.drush/site-aliases/yoursite.drushrc.php 143 | ``` 144 | 145 | ### Configuring your root directory 146 | 147 | If you are using a webroot besides `.`, you will need to remember to `cd` into that directory and run `lando drush` from there. This is because many site-specific `drush` commands will only run correctly if you run `drush` from a directory that also contains a Drupal site. 148 | 149 | If you are annoyed by having to `cd` into that directory every time you run a `drush` command, you can get around it by [overriding](https://docs.lando.dev/landofile/tooling.html#overriding) the `drush` tooling command in your [Landofile](https://docs.lando.dev/landofile/) so that Drush always runs from your `webroot`. 150 | 151 | **Note that hard coding the `root` like this may have unforeseen and bad consequences for some `drush` commands such as `drush scr`.** 152 | 153 | ```yaml 154 | tooling: 155 | drush: 156 | service: appserver 157 | cmd: drush --root=/app/PATH/TO/WEBROOT 158 | ``` 159 | --------------------------------------------------------------------------------