Problem/Motivation

When troubleshooting and reviewing issues on different core branches I've following workflow

git checkout 11.x
composer install
php -d memory_limit=256M core/scripts/drupal quick-start standard
# Above command will install Drupal and generate random password. Due to #3271178 this will hang up randomly, so I must do following:
# 1. go to http://127.0.0.1:8888/user/1/edit and change "Email address" domain to valid one and change password to something that is easy to remember/static so the browser password manager can use it.
# 2. ctrl+c on terminal
php -d memory_limit=256M -S localhost:8888 .ht.router.php

I understand this workflow is just a work-a-round for #3271178: Quick start command installation stops responding, but since that issue is going to take time to fix, I'd like to get password option so the workflow could be minified to:

git checkout 11.x
composer install
php -d memory_limit=256M core/scripts/drupal quick-start standard --password=123
# ctrl+c on terminal
php -d memory_limit=256M -S localhost:8888 .ht.router.php

Steps to reproduce

Proposed resolution

Add password option to Drupal\Core\Command\InstallCommand

Remaining tasks

- MR
- Acceptance for idea
- Tests
- RTBC
- Profit

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3458167

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sokru created an issue. See original summary.

sokru’s picture

sokru’s picture

Status: Active » Needs review
smustgrave’s picture

andypost’s picture

Category: Task » Feature request
Parent issue: » #3089277: Provide core CLI commands for the most common features of Drush

Nice idea

andypost’s picture

Status: Needs review » Needs work

Needs work for test and I left nitpick improvement

sokru’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs tests

Added one test to assert the password is echoed correctly on Quick Start command. Otherwise I feel its very hard to test the actual login without converting the relevant tests (QuickStartTest and TestSiteApplicationTest) into browser tests.

Therefore I removed the "Needs tests", but feel free to re-add the tag with more information about desired tests.

prashant.c’s picture

Does this commandphp -d memory_limit=256M core/scripts/drupal quick-start standardnot work with ddev

On a fresh clone on Drupal 11.x, did a ddev ssh, tried the above command, and got the following error for providing the database details in the settings file.

0/17 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]
Installing Drupal

In install.core.inc line 991:
                                                                                                                                                     
  Resolve all issues below to continue the installation. For help configuring your database server, see the <a href="https://www.drupal.org/docs/in  
  stalling-drupal">installation handbook</a>, or contact your hosting provider.<ul><li>The database server version <em class="placeholder">3.40.1</  
  em> is less than the minimum required version <em class="placeholder">3.45</em>.</li></ul>                                                         
                                                                                                                                                     

quick-start [--langcode [LANGCODE]] [--password [PASSWORD]] [--site-name [SITE-NAME]] [--host [HOST]] [--port [PORT]] [-s|--suppress-login] [--] [<install-profile-or-recipe>]

Am I missing or doing something wrong here?
Please suggest.

sokru’s picture

Does this command php -d memory_limit=256M core/scripts/drupal quick-start standard not work with ddev

The attached error message shows (not very clearly) that the SQLite3 version provided by the DDEV is lower than required version.

prashant.c’s picture

@sokru Sorry my bad did not realise this is DDEV specific issue not with this.

andypost’s picture

prashant.c’s picture

@andypost

Finally, the ddev issue was resolved, I was already on the latest ddev version but still, it was taking SQLite as 3.40.

The command I used to refresh the docker container fixed the issue ddev debug refresh. Hope this will help others facing a similar issue.

Tested the password parameter and site installation worked fine along with the password was set as the supplied password.

DDEV command ddev exec -d /var/www/html php core/scripts/drupal quick-start standard --password=123

17/17 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓]
Congratulations, you installed Drupal!
Username: admin
Password: 123
Drupal development server started: <http://127.0.0.1:8888>
This server is not meant for production use.
One time login url: <http://127.0.0.1:8888/user/reset/1/1722427623/LCAA_p8pF2FKW_67nSea0ybqEmIyzpo4l9Z7knbRZUY/login>
Press Ctrl-C to quit the Drupal development server.

                                                                                                                        
 [ERROR] No suitable browser opening command found, open yourself: 'http://127.0.0.1:8888/user/reset/1/1722427623/LCAA_p8pF2FKW_67nSea0ybqEmIyzpo4l9Z7knbRZUY/login?destination=%2F'

For DDEV replace the http://127.0.0.1:8888 with your site domain.

I think good for RTBC.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Created CR https://www.drupal.org/node/3465079

Looks nothing to be done here except final FM review and commiters

quietone’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs documentation updates

This change, if accepted, should also be included on the wiki page, https://www.drupal.org/docs/getting-started/installing-drupal/drupal-qui...

I made a recommendation on the MR, setting to needs work for that.

sokru’s picture

Status: Needs work » Needs review

Added the recommendation to MR. I don't see any draft workflow on wiki page, so I assume updating the documentation should be done only after MR has been merged.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Believe that is the case with documentation pages. Right @quietone?

quietone’s picture

Title: Drupal\Core\Command\InstallCommand should provide a --password option » Add password option Drupal\Core\Command\InstallCommand
quietone’s picture

Title: Add password option Drupal\Core\Command\InstallCommand » Add password option to Drupal\Core\Command\InstallCommand

Add 'to' to title

  • catch committed c5193b30 on 11.x
    Issue #3458167 by sokru, andypost, prashant.c, quietone: Add password...

catch’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs framework manager review

Committed/pushed to 11.x, thanks!

Still needs documentation updates.

sokru’s picture

I gave some thought on documentation page update, but I'd say its better to leave as simple as possible. The documentation page gives the instructions for "--help" flag for quick-start command, and that shows the instructions for all the options, including the password option.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.