29 Commits

Author SHA1 Message Date
Aparup Banerjee
4cf0c17d18 MDL-39664 fixed up is_array test (reverting the whole line basically prior to MDL-39664 changes) 2013-05-14 15:02:24 +08:00
Aparup Banerjee
c713414319 MDL-39664 added http redirect limitation to 5. rephrased certificate use in message log. 2013-05-14 13:23:14 +08:00
Aparup Banerjee
6053036976 MDL-39664 mdeploy follows redirects now. 2013-05-14 13:14:28 +08:00
Aparup Banerjee
cb97a97794 MDL-39664 allowed mdeploy to follow redirection (http 302) and added some extra logging info 2013-05-14 11:56:05 +08:00
Petr Škoda
c2140b5d95 MDL-39356 add ca certificate bundles for cURL
This is necessary because PHP in Windows does not have any certificates and some *nix systems have outdated or missing ca bundles too.

The order is:
1/ dataroot/moodleorgca.crt always wins - needs to be added manually by admin
2/ php.ini setting "curl.cainfo" is next
3/ on Windows libdir/cacert.pem is used because it does not have any default cert bundles
4/ system default is the last - the previous value, ok for properly configured *nix systems
2013-04-28 20:58:58 +02:00
David Mudrák
e91670edc0 MDL-38493 Improve documentation of mdeploy.php 2013-03-28 11:54:05 +01:00
David Mudrák
203b432159 MDL-38493 Make mdeploy.php able to install new plugin
The patch implements the second mode of the mdeploy.php script. If
--install option is passed, the given package is downloaded, verified
and deployed to the requested location.
2013-03-28 11:54:05 +01:00
David Mudrák
5230f6a720 MDL-38456 Allow colons in paths passed to mdeploy.php utility
The input_manager now accepts colons (:) in TYPE_PATH options, but only
in cases where the colon is used as a part of Windows drive labels, as
in C:\apache.
2013-03-13 12:08:38 +01:00
David Mudrák
8663b090c0 MDL-36963 Do not attempt to remove the root folder of a plugin during the update deployment
There is no need to move the root folder of a plugin during the update
deployment. We just need to operate with its contents. So the web server
process can have the write access for the plugin folder only.
2012-12-06 11:03:35 +08:00
David Mudrák
75879a9e74 MDL-36963 Improve mdeploy worker::remove_directory() method
The additional parameter allows to use this method without actual
removing the root of the path. That is, it is now possible to remove
the content of a folder only.
2012-12-06 11:03:35 +08:00
David Mudrák
b68bbc5ae1 MDL-36963 Improve mdeploy worker::move_directory() method
The additional parameter allows to use this method without actual
removing the root of the source location. That is, it is now possible to
move the content of a folder only.

Also, a small refactoring happened here as we will need a variant of
this method that does not throw exception if the target already exists.
2012-12-06 11:03:35 +08:00
David Mudrák
42c6731c9f MDL-36950 Make mdeploy.php accept proxy related settings 2012-11-30 16:11:52 +01:00
David Mudrák
333048e06b MDL-36903 Add a link to Moodle documentation from mdeploy error pages 2012-11-30 16:09:58 +01:00
David Mudrák
e428b5e0ae MDL-36903 Make mdeploy.php use the custom CA certificate if it exists 2012-11-30 16:09:58 +01:00
David Mudrák
0daa642894 MDL-35238 Inform the admin if the update can not be deployed due to write permissions 2012-11-09 00:20:18 +01:00
David Mudrák
80e9ba96c7 MDL-35238 Improve exceptions handling 2012-11-08 22:33:08 +01:00
David Mudrák
8ffa8d7e48 MDL-35238 Be more verbose if the tilde character is used in TYPE_PATH script options
The tilde character is not generally supported in Moodle. Previously it
was just removed silently and it was difficult to realize what was going
on.
2012-11-08 22:33:07 +01:00
David Mudrák
ec8e1cbce6 MDL-35238 Add simple logging of mdeploy.php execution 2012-11-08 22:33:07 +01:00
David Mudrák
b10b1e728d MDL-35238 Remove the ZIP file after successful decompression 2012-11-08 22:33:07 +01:00
David Mudrák
6b75106a75 MDL-35238 Compare the ZIP package content hash with the expected value
The expected value is returned as a part of available update info
(requires API version 1.1).
2012-11-08 22:33:07 +01:00
David Mudrák
23137c4ac4 MDL-35238 Unzip the downloaded package and redirect to the upgrade page 2012-11-08 22:33:07 +01:00
David Mudrák
4f71de4161 MDL-35238 Backup existing plugin version before replacing it
This is here to save eventual local contributions to the plugin before
we replace the whole directory in the next step.
2012-11-08 22:33:07 +01:00
David Mudrák
4c72f55516 MDL-35238 Fetch the package and store it in a temporary location 2012-11-08 22:33:07 +01:00
David Mudrák
af29dade97 MDL-35238 Reorganise the worker::execute() flow 2012-11-08 22:33:07 +01:00
David Mudrák
3daedb5c5a MDL-35238 Implement deployment authorization
The caller of the mdeploy.php utility is expected to create a file in
the data directory. The name of such file and the passphrase in it are
then sent to mdeploy.php as a part of the request. The submitted and
stored values are then compared.
2012-11-08 22:33:07 +01:00
David Mudrák
c57f18ad06 MDL-35238 Implement HTTP authorization based on passphrase matching 2012-11-08 22:33:06 +01:00
David Mudrák
11c3c579a1 MDL-35238 Fix getting input option value 2012-11-08 22:33:06 +01:00
David Mudrák
c99910bb3a MDL-35238 Print help on the script usage in CLI mode 2012-11-08 22:33:05 +01:00
David Mudrák
89af176511 MDL-35238 Introduce a first version of the mdeploy.php script
This is supposed to serve as a standalone script that accepts parameters
via CLI or HTTP. As no Moodle library can be reliably included, we have
to implement our own input handling, output handling and processing the
actual update/install task.

PHPUnit is used to test the functionality. Although (again), the testing
must not be included as a part of standard Moodle PHPUnit environment
but explicitly.
2012-11-08 22:33:05 +01:00