Add password option to Drupal\Core\Command\InstallCommand

Created on 30 June 2024, 2 months ago
Updated 22 August 2024, 17 days ago

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 🐛 quick-start installation stops responding Active , 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

Feature request
Status

RTBC

Version

11.0 🔥

Component
Install 

Last updated 2 days ago

No maintainer
Created by

🇫🇮Finland sokru

Live updates comments and jobs are added and updated live.
  • Needs framework manager review

    It is used to alert the framework manager core committer(s) that an issue significantly impacts (or has the potential to impact) multiple subsystems or represents a significant change or addition in architecture or public APIs, and their signoff is needed (see the governance policy draft for more information). If an issue significantly impacts only one subsystem, use Needs subsystem maintainer review instead, and make sure the issue component is set to the correct subsystem.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @sokru
  • Pipeline finished with Failed
    2 months ago
    Total: 175s
    #212327
  • Pipeline finished with Failed
    2 months ago
    Total: 171s
    #212331
  • Pipeline finished with Success
    2 months ago
    Total: 603s
    #212338
  • Status changed to Needs review 2 months ago
  • Status changed to Needs work about 1 month ago
  • 🇫🇷France andypost

    Needs work for test and I left nitpick improvement

  • Pipeline finished with Success
    about 1 month ago
    Total: 551s
    #238048
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 78s
    #238315
  • Pipeline finished with Success
    about 1 month ago
    Total: 470s
    #238317
  • Status changed to Needs review about 1 month ago
  • 🇫🇮Finland sokru

    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.

  • 🇮🇳India Prashant.c Dharamshala

    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.

  • 🇫🇮Finland sokru

    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.

  • Pipeline finished with Success
    about 1 month ago
    Total: 491s
    #238402
  • 🇮🇳India Prashant.c Dharamshala

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

  • 🇮🇳India Prashant.c Dharamshala

    @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.

  • Status changed to RTBC about 1 month ago
  • 🇫🇷France andypost

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

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

  • Status changed to Needs work 27 days ago
  • 🇳🇿New Zealand quietone New Zealand

    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.

  • Pipeline finished with Success
    27 days ago
    Total: 610s
    #251182
  • Status changed to Needs review 25 days ago
  • 🇫🇮Finland sokru

    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.

  • Status changed to RTBC 25 days ago
  • 🇺🇸United States smustgrave

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

  • 🇳🇿New Zealand quietone New Zealand
  • 🇳🇿New Zealand quietone New Zealand

    Add 'to' to title

Production build 0.71.5 2024