joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[4.3] Add a CLI installation for Joomla

Open Hackwar opened this issue 2 years ago • 79 comments

This PR adds a method to install Joomla via command line to simplify API tests and installations with one-click-setups. The new installation method can be triggered by running php installation/joomla.php install in the root of the Joomla folder. The different options are documented by running php installation/joomla.php help install.

All options can be given either by option directly on the command line or when running the install command interactively. If a default value is given for an option and that option is not defined, that default value is taken.

Summary of Changes

This adds a new CLI entry file, similar to cli/joomla.php to the installation with all necessary steps to run the installation. The code uses as much of the current installation as possible and validates the options from the setup.xml file.

joomla-cli-options

Testing Instructions

  1. Run php installation/joomla.php install in your installation and check that afterwards Joomla is properly installed.
  2. Run php installation/joomla.php install with all necessary CLI options

If you are using a dev version (checked out the GIT version) the installation folder is preserved, otherwise the folder is deleted.

Documentation Changes Required

The CLI installation needs to be documented. The initial documentation is done in installation/INSTALL

Acknowledgement

I'd like to thank Mittwald for supporting this improvement.

Hackwar avatar Jul 25 '22 11:07 Hackwar

excited to try this. would it not make more sense for it to be in the cli folder?

brianteeman avatar Jul 25 '22 11:07 brianteeman

Unfortunately the application in the /cli folder does only work when Joomla is already installed. Since the installer should also be removed when the installation is done, it needs to be part of the /installation folder.

Hackwar avatar Jul 25 '22 12:07 Hackwar

Unfortunately the application in the /cli folder does only work when Joomla is already installed. Since the installer should also be removed when the installation is done, it needs to be part of the /installation folder.

Fair enough

brianteeman avatar Jul 25 '22 12:07 brianteeman

Please use the same terminology and field order as in the regular web site install

image

Especially as the error messages are based on the web install terminology

image

brianteeman avatar Jul 25 '22 15:07 brianteeman

Passwords should not be displayed in plain text to prevent over-the -shoulder attacks image

brianteeman avatar Jul 25 '22 15:07 brianteeman

Create and fill database...OK

==>

Creating and populating database...OK

Its a statement of what is happening and not a question.

Same for the others

brianteeman avatar Jul 25 '22 15:07 brianteeman

Please add some sort of installation complete message. Otherwise no one would know if the installer has bombed out or completed

image

brianteeman avatar Jul 25 '22 15:07 brianteeman

other than these cosmetic issues it appears to work

brianteeman avatar Jul 25 '22 15:07 brianteeman

there isn't a prebuild for 4.3 branch yet ?

alikon avatar Jul 25 '22 16:07 alikon

Please add some sort of installation complete message. Otherwise no one would know if the installer has bombed out or completed

image

It actually contains a success message and your installation did indeed fail. Good question why. Looking into it.

Hackwar avatar Jul 25 '22 19:07 Hackwar

It actually contains a success message and your installation did indeed fail. Good question why. Looking into it.

The files in the folder installation were removed but not the folder. (There is an existing issue on that I believe?) BUT there should have been some sort of message

brianteeman avatar Jul 25 '22 19:07 brianteeman

The files in the folder installation were removed but not the folders. (There is an existing issue on that I believe?)

I am not aware of any existing issue.

richard67 avatar Jul 25 '22 20:07 richard67

The files in the folder installation were removed but not the folders. (There is an existing issue on that I believe?)

I am not aware of any existing issue.

#37909

brianteeman avatar Jul 25 '22 20:07 brianteeman

Ah that one.

richard67 avatar Jul 25 '22 21:07 richard67

Please use the same terminology and field order as in the regular web site install

image

Especially as the error messages are based on the web install terminology

image

I reordered the fields. Unfortunately we need different text for the CLI options than for the web installer. Since the CLI is always in english, the current solution is acceptable for me.

Hackwar avatar Jul 26 '22 20:07 Hackwar

Passwords should not be displayed in plain text to prevent over-the -shoulder attacks image

The symfony console package does not allow to hide this input in any way.

Hackwar avatar Jul 26 '22 20:07 Hackwar

Create and fill database...OK

==>

Creating and populating database...OK

Its a statement of what is happening and not a question.

Same for the others

Done

Hackwar avatar Jul 26 '22 20:07 Hackwar

there isn't a prebuild for 4.3 branch yet ?

Not yet, but I will create a PR to fix that. I don't want to do this in this PR.

Hackwar avatar Jul 26 '22 20:07 Hackwar

The language you are using is not correct!!

brianteeman avatar Jul 26 '22 20:07 brianteeman

there isn't a prebuild for 4.3 branch yet ?

Not yet, but I will create a PR to fix that. I don't want to do this in this PR.

Done #38331, #38332

Hackwar avatar Jul 26 '22 20:07 Hackwar

Passwords should not be displayed in plain text to prevent over-the -shoulder attacks image

The symfony console package does not allow to hide this input in any way.

of course it does - just look at the cli for creating a user

brianteeman avatar Jul 26 '22 20:07 brianteeman

I reordered the fields.

why? What is the reasoning. A lot of thought went into the ordering.

brianteeman avatar Jul 26 '22 20:07 brianteeman

I have tested this item :red_circle: unsuccessfully on 6ca4269b432d587420ecd4c65d1824825e565048


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38325.

brianteeman avatar Jul 26 '22 20:07 brianteeman

I reordered the fields.

why? What is the reasoning. A lot of thought went into the ordering.

You asked for it... I reordered the fields the way they are displayed in CLI, not in the web installer.

Hackwar avatar Jul 26 '22 20:07 Hackwar

Passwords should not be displayed in plain text to prevent over-the -shoulder attacks image

The symfony console package does not allow to hide this input in any way.

of course it does - just look at the cli for creating a user

mea culpa. You are right. Going to fix that tomorrow.

Hackwar avatar Jul 26 '22 20:07 Hackwar

I mis read that as being - no I wont change the order as I have reordered them here.

But please change the language strings as suggested - what you have done is wrong

brianteeman avatar Jul 26 '22 20:07 brianteeman

from a 1st look database not on localhost doesn't work image

alikon avatar Jul 27 '22 10:07 alikon

on a 2nd look the db_password can be empty in the web installer

alikon avatar Jul 27 '22 15:07 alikon

Passwords should not be displayed in plain text to prevent over-the -shoulder attacks image

Fixed.

Hackwar avatar Jul 28 '22 08:07 Hackwar

from a 1st look database not on localhost doesn't work image

fixed.

Hackwar avatar Jul 28 '22 08:07 Hackwar