2013-09-13 20:10:04 +04:00
|
|
|
<?php
|
2021-04-26 13:44:37 +03:00
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2013-09-13 20:10:04 +04:00
|
|
|
/**
|
2016-07-21 18:07:57 +03:00
|
|
|
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
|
|
|
*
|
2015-03-26 13:44:34 +03:00
|
|
|
* @author Bart Visscher <bartv@thisnet.nl>
|
2016-05-26 20:56:05 +03:00
|
|
|
* @author Björn Schießle <bjoern@schiessle.org>
|
2015-03-26 13:44:34 +03:00
|
|
|
* @author Christian Kampka <christian@kampka.net>
|
2019-12-03 21:57:53 +03:00
|
|
|
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
|
|
|
* @author Daniel Kesselberg <mail@danielkesselberg.de>
|
|
|
|
* @author Denis Mosolov <denismosolov@gmail.com>
|
2016-07-21 18:07:57 +03:00
|
|
|
* @author Joas Schilling <coding@schilljs.com>
|
2020-08-24 15:54:25 +03:00
|
|
|
* @author Johannes Riedel <joeried@users.noreply.github.com>
|
2019-12-03 21:57:53 +03:00
|
|
|
* @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
|
2017-11-06 17:56:42 +03:00
|
|
|
* @author Jörn Friedrich Dreyer <jfd@butonic.de>
|
2019-12-03 21:57:53 +03:00
|
|
|
* @author Julius Härtl <jus@bitgrid.net>
|
2016-05-26 20:56:05 +03:00
|
|
|
* @author Lukas Reschke <lukas@statuscode.ch>
|
2019-12-03 21:57:53 +03:00
|
|
|
* @author michag86 <micha_g@arcor.de>
|
2020-12-16 16:54:15 +03:00
|
|
|
* @author MichaIng <micha@dietpi.com>
|
2015-03-26 13:44:34 +03:00
|
|
|
* @author Morris Jobke <hey@morrisjobke.de>
|
2019-12-03 21:57:53 +03:00
|
|
|
* @author Patrik Kernstock <info@pkern.at>
|
2016-07-21 19:13:36 +03:00
|
|
|
* @author Robin Appelman <robin@icewind.nl>
|
2016-01-12 17:02:16 +03:00
|
|
|
* @author Robin McCorkell <robin@mccorkell.me.uk>
|
2016-07-21 18:07:57 +03:00
|
|
|
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
2019-12-03 21:57:53 +03:00
|
|
|
* @author Ruben Homs <ruben@homs.codes>
|
2017-11-06 17:56:42 +03:00
|
|
|
* @author sualko <klaus@jsxc.org>
|
2015-03-26 13:44:34 +03:00
|
|
|
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
2017-11-06 17:56:42 +03:00
|
|
|
* @author Thomas Pulzer <t.pulzer@kniel.de>
|
2016-01-12 17:02:16 +03:00
|
|
|
* @author Victor Dubiniuk <dubiniuk@owncloud.com>
|
2020-12-16 16:54:15 +03:00
|
|
|
* @author Vincent Petry <vincent@nextcloud.com>
|
2015-03-26 13:44:34 +03:00
|
|
|
*
|
|
|
|
* @license AGPL-3.0
|
|
|
|
*
|
|
|
|
* This code is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License, version 3,
|
|
|
|
* as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3,
|
2019-12-03 21:57:53 +03:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
2015-03-26 13:44:34 +03:00
|
|
|
*
|
2013-09-13 20:10:04 +04:00
|
|
|
*/
|
2014-06-10 13:47:27 +04:00
|
|
|
|
2020-08-17 18:16:50 +03:00
|
|
|
/** @var Symfony\Component\Console\Application $application */
|
2020-11-24 01:10:48 +03:00
|
|
|
|
2021-02-01 16:56:56 +03:00
|
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
|
2016-09-21 01:47:45 +03:00
|
|
|
$application->add(new \Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand());
|
2013-09-13 20:10:04 +04:00
|
|
|
$application->add(new OC\Core\Command\Status);
|
2017-03-18 01:37:48 +03:00
|
|
|
$application->add(new OC\Core\Command\Check(\OC::$server->getSystemConfig()));
|
2018-02-07 18:03:21 +03:00
|
|
|
$application->add(new OC\Core\Command\App\CheckCode());
|
2015-04-01 15:18:56 +03:00
|
|
|
$application->add(new OC\Core\Command\L10n\CreateJs());
|
Add code integrity check
This PR implements the base foundation of the code signing and integrity check. In this PR implemented is the signing and verification logic, as well as commands to sign single apps or the core repository.
Furthermore, there is a basic implementation to display problems with the code integrity on the update screen.
Code signing basically happens the following way:
- There is a ownCloud Root Certificate authority stored `resources/codesigning/root.crt` (in this PR I also ship the private key which we obviously need to change before a release :wink:). This certificate is not intended to be used for signing directly and only is used to sign new certificates.
- Using the `integrity:sign-core` and `integrity:sign-app` commands developers can sign either the core release or a single app. The core release needs to be signed with a certificate that has a CN of `core`, apps need to be signed with a certificate that either has a CN of `core` (shipped apps!) or the AppID.
- The command generates a signature.json file of the following format:
```json
{
"hashes": {
"/filename.php": "2401fed2eea6f2c1027c482a633e8e25cd46701f811e2d2c10dc213fd95fa60e350bccbbebdccc73a042b1a2799f673fbabadc783284cc288e4f1a1eacb74e3d",
"/lib/base.php": "55548cc16b457cd74241990cc9d3b72b6335f2e5f45eee95171da024087d114fcbc2effc3d5818a6d5d55f2ae960ab39fd0414d0c542b72a3b9e08eb21206dd9"
},
"certificate": "-----BEGIN CERTIFICATE-----MIIBvTCCASagAwIBAgIUPvawyqJwCwYazcv7iz16TWxfeUMwDQYJKoZIhvcNAQEF\nBQAwIzEhMB8GA1UECgwYb3duQ2xvdWQgQ29kZSBTaWduaW5nIENBMB4XDTE1MTAx\nNDEzMTcxMFoXDTE2MTAxNDEzMTcxMFowEzERMA8GA1UEAwwIY29udGFjdHMwgZ8w\nDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANoQesGdCW0L2L+a2xITYipixkScrIpB\nkX5Snu3fs45MscDb61xByjBSlFgR4QI6McoCipPw4SUr28EaExVvgPSvqUjYLGps\nfiv0Cvgquzbx/X3mUcdk9LcFo1uWGtrTfkuXSKX41PnJGTr6RQWGIBd1V52q1qbC\nJKkfzyeMeuQfAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAvF/KIhRMQ3tYTmgHWsiM\nwDMgIDb7iaHF0fS+/Nvo4PzoTO/trev6tMyjLbJ7hgdCpz/1sNzE11Cibf6V6dsz\njCE9invP368Xv0bTRObRqeSNsGogGl5ceAvR0c9BG+NRIKHcly3At3gLkS2791bC\niG+UxI/MNcWV0uJg9S63LF8=\n-----END CERTIFICATE-----",
"signature": "U29tZVNpZ25lZERhdGFFeGFtcGxl"
}
```
`hashes` is an array of all files in the folder with their corresponding SHA512 hashes (this is actually quite cheap to calculate), the `certificate` is the certificate used for signing. It has to be issued by the ownCloud Root Authority and it's CN needs to be permitted to perform the required action. The `signature` is then a signature of the `hashes` which can be verified using the `certificate`.
Steps to do in other PRs, this is already a quite huge one:
- Add nag screen in case the code check fails to ensure that administrators are aware of this.
- Add code verification also to OCC upgrade and unify display code more.
- Add enforced code verification to apps shipped from the appstore with a level of "official"
- Add enfocrced code verification to apps shipped from the appstore that were already signed in a previous release
- Add some developer documentation on how devs can request their own certificate
- Check when installing ownCloud
- Add support for CRLs to allow revoking certificates
**Note:** The upgrade checks are only run when the instance has a defined release channel of `stable` (defined in `version.php`). If you want to test this, you need to change the channel thus and then generate the core signature:
```
➜ master git:(add-integrity-checker) ✗ ./occ integrity:sign-core --privateKey=resources/codesigning/core.key --certificate=resources/codesigning/core.crt
Successfully signed "core"
```
Then increase the version and you should see something like the following:
![2015-11-04_12-02-57](https://cloud.githubusercontent.com/assets/878997/10936336/6adb1d14-82ec-11e5-8f06-9a74801c9abf.png)
As you can see a failed code check will not prevent the further update. It will instead just be a notice to the admin. In a next step we will add some nag screen.
For packaging stable releases this requires the following additional steps as a last action before zipping:
1. Run `./occ integrity:sign-core` once
2. Run `./occ integrity:sign-app` _for each_ app. However, this can be simply automated using a simple foreach on the apps folder.
2015-11-03 22:26:06 +03:00
|
|
|
$application->add(new \OC\Core\Command\Integrity\SignApp(
|
|
|
|
\OC::$server->getIntegrityCodeChecker(),
|
2016-01-15 16:14:32 +03:00
|
|
|
new \OC\IntegrityCheck\Helpers\FileAccessHelper(),
|
|
|
|
\OC::$server->getURLGenerator()
|
Add code integrity check
This PR implements the base foundation of the code signing and integrity check. In this PR implemented is the signing and verification logic, as well as commands to sign single apps or the core repository.
Furthermore, there is a basic implementation to display problems with the code integrity on the update screen.
Code signing basically happens the following way:
- There is a ownCloud Root Certificate authority stored `resources/codesigning/root.crt` (in this PR I also ship the private key which we obviously need to change before a release :wink:). This certificate is not intended to be used for signing directly and only is used to sign new certificates.
- Using the `integrity:sign-core` and `integrity:sign-app` commands developers can sign either the core release or a single app. The core release needs to be signed with a certificate that has a CN of `core`, apps need to be signed with a certificate that either has a CN of `core` (shipped apps!) or the AppID.
- The command generates a signature.json file of the following format:
```json
{
"hashes": {
"/filename.php": "2401fed2eea6f2c1027c482a633e8e25cd46701f811e2d2c10dc213fd95fa60e350bccbbebdccc73a042b1a2799f673fbabadc783284cc288e4f1a1eacb74e3d",
"/lib/base.php": "55548cc16b457cd74241990cc9d3b72b6335f2e5f45eee95171da024087d114fcbc2effc3d5818a6d5d55f2ae960ab39fd0414d0c542b72a3b9e08eb21206dd9"
},
"certificate": "-----BEGIN CERTIFICATE-----MIIBvTCCASagAwIBAgIUPvawyqJwCwYazcv7iz16TWxfeUMwDQYJKoZIhvcNAQEF\nBQAwIzEhMB8GA1UECgwYb3duQ2xvdWQgQ29kZSBTaWduaW5nIENBMB4XDTE1MTAx\nNDEzMTcxMFoXDTE2MTAxNDEzMTcxMFowEzERMA8GA1UEAwwIY29udGFjdHMwgZ8w\nDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANoQesGdCW0L2L+a2xITYipixkScrIpB\nkX5Snu3fs45MscDb61xByjBSlFgR4QI6McoCipPw4SUr28EaExVvgPSvqUjYLGps\nfiv0Cvgquzbx/X3mUcdk9LcFo1uWGtrTfkuXSKX41PnJGTr6RQWGIBd1V52q1qbC\nJKkfzyeMeuQfAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAvF/KIhRMQ3tYTmgHWsiM\nwDMgIDb7iaHF0fS+/Nvo4PzoTO/trev6tMyjLbJ7hgdCpz/1sNzE11Cibf6V6dsz\njCE9invP368Xv0bTRObRqeSNsGogGl5ceAvR0c9BG+NRIKHcly3At3gLkS2791bC\niG+UxI/MNcWV0uJg9S63LF8=\n-----END CERTIFICATE-----",
"signature": "U29tZVNpZ25lZERhdGFFeGFtcGxl"
}
```
`hashes` is an array of all files in the folder with their corresponding SHA512 hashes (this is actually quite cheap to calculate), the `certificate` is the certificate used for signing. It has to be issued by the ownCloud Root Authority and it's CN needs to be permitted to perform the required action. The `signature` is then a signature of the `hashes` which can be verified using the `certificate`.
Steps to do in other PRs, this is already a quite huge one:
- Add nag screen in case the code check fails to ensure that administrators are aware of this.
- Add code verification also to OCC upgrade and unify display code more.
- Add enforced code verification to apps shipped from the appstore with a level of "official"
- Add enfocrced code verification to apps shipped from the appstore that were already signed in a previous release
- Add some developer documentation on how devs can request their own certificate
- Check when installing ownCloud
- Add support for CRLs to allow revoking certificates
**Note:** The upgrade checks are only run when the instance has a defined release channel of `stable` (defined in `version.php`). If you want to test this, you need to change the channel thus and then generate the core signature:
```
➜ master git:(add-integrity-checker) ✗ ./occ integrity:sign-core --privateKey=resources/codesigning/core.key --certificate=resources/codesigning/core.crt
Successfully signed "core"
```
Then increase the version and you should see something like the following:
![2015-11-04_12-02-57](https://cloud.githubusercontent.com/assets/878997/10936336/6adb1d14-82ec-11e5-8f06-9a74801c9abf.png)
As you can see a failed code check will not prevent the further update. It will instead just be a notice to the admin. In a next step we will add some nag screen.
For packaging stable releases this requires the following additional steps as a last action before zipping:
1. Run `./occ integrity:sign-core` once
2. Run `./occ integrity:sign-app` _for each_ app. However, this can be simply automated using a simple foreach on the apps folder.
2015-11-03 22:26:06 +03:00
|
|
|
));
|
|
|
|
$application->add(new \OC\Core\Command\Integrity\SignCore(
|
|
|
|
\OC::$server->getIntegrityCodeChecker(),
|
|
|
|
new \OC\IntegrityCheck\Helpers\FileAccessHelper()
|
|
|
|
));
|
2016-02-05 21:09:27 +03:00
|
|
|
$application->add(new \OC\Core\Command\Integrity\CheckApp(
|
|
|
|
\OC::$server->getIntegrityCodeChecker()
|
|
|
|
));
|
|
|
|
$application->add(new \OC\Core\Command\Integrity\CheckCore(
|
|
|
|
\OC::$server->getIntegrityCodeChecker()
|
|
|
|
));
|
|
|
|
|
2014-06-10 13:47:27 +04:00
|
|
|
|
2015-02-21 22:52:32 +03:00
|
|
|
if (\OC::$server->getConfig()->getSystemValue('installed', false)) {
|
2016-01-14 18:09:34 +03:00
|
|
|
$application->add(new OC\Core\Command\App\Disable(\OC::$server->getAppManager()));
|
2019-01-27 14:28:57 +03:00
|
|
|
$application->add(new OC\Core\Command\App\Enable(\OC::$server->getAppManager(), \OC::$server->getGroupManager()));
|
2017-07-07 09:33:31 +03:00
|
|
|
$application->add(new OC\Core\Command\App\Install());
|
2015-12-08 01:24:28 +03:00
|
|
|
$application->add(new OC\Core\Command\App\GetPath());
|
2016-01-14 18:08:18 +03:00
|
|
|
$application->add(new OC\Core\Command\App\ListApps(\OC::$server->getAppManager()));
|
2018-10-05 22:09:13 +03:00
|
|
|
$application->add(new OC\Core\Command\App\Remove(\OC::$server->getAppManager(), \OC::$server->query(\OC\Installer::class), \OC::$server->getLogger()));
|
2018-09-04 23:26:15 +03:00
|
|
|
$application->add(\OC::$server->query(\OC\Core\Command\App\Update::class));
|
2017-07-07 09:33:31 +03:00
|
|
|
|
2018-09-10 18:02:37 +03:00
|
|
|
$application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Cleanup::class));
|
2018-09-29 19:57:00 +03:00
|
|
|
$application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Enforce::class));
|
2018-09-10 18:02:37 +03:00
|
|
|
$application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Enable::class));
|
|
|
|
$application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Disable::class));
|
2018-05-22 09:52:16 +03:00
|
|
|
$application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\State::class));
|
2015-04-30 16:18:12 +03:00
|
|
|
|
2015-02-28 23:56:40 +03:00
|
|
|
$application->add(new OC\Core\Command\Background\Cron(\OC::$server->getConfig()));
|
|
|
|
$application->add(new OC\Core\Command\Background\WebCron(\OC::$server->getConfig()));
|
|
|
|
$application->add(new OC\Core\Command\Background\Ajax(\OC::$server->getConfig()));
|
2015-04-30 16:18:12 +03:00
|
|
|
|
2019-09-16 19:09:43 +03:00
|
|
|
$application->add(\OC::$server->query(\OC\Core\Command\Broadcast\Test::class));
|
|
|
|
|
2015-06-10 18:06:51 +03:00
|
|
|
$application->add(new OC\Core\Command\Config\App\DeleteConfig(\OC::$server->getConfig()));
|
|
|
|
$application->add(new OC\Core\Command\Config\App\GetConfig(\OC::$server->getConfig()));
|
|
|
|
$application->add(new OC\Core\Command\Config\App\SetConfig(\OC::$server->getConfig()));
|
2015-05-15 14:01:12 +03:00
|
|
|
$application->add(new OC\Core\Command\Config\Import(\OC::$server->getConfig()));
|
2015-04-30 16:57:22 +03:00
|
|
|
$application->add(new OC\Core\Command\Config\ListConfigs(\OC::$server->getSystemConfig(), \OC::$server->getAppConfig()));
|
2015-05-08 18:32:20 +03:00
|
|
|
$application->add(new OC\Core\Command\Config\System\DeleteConfig(\OC::$server->getSystemConfig()));
|
2015-05-08 18:13:46 +03:00
|
|
|
$application->add(new OC\Core\Command\Config\System\GetConfig(\OC::$server->getSystemConfig()));
|
2015-05-08 11:54:40 +03:00
|
|
|
$application->add(new OC\Core\Command\Config\System\SetConfig(\OC::$server->getSystemConfig()));
|
2015-04-30 16:57:22 +03:00
|
|
|
|
2017-03-18 01:37:48 +03:00
|
|
|
$application->add(new OC\Core\Command\Db\ConvertType(\OC::$server->getConfig(), new \OC\DB\ConnectionFactory(\OC::$server->getSystemConfig())));
|
2015-07-30 11:57:16 +03:00
|
|
|
$application->add(new OC\Core\Command\Db\ConvertMysqlToMB4(\OC::$server->getConfig(), \OC::$server->getDatabaseConnection(), \OC::$server->getURLGenerator(), \OC::$server->getLogger()));
|
2021-01-03 17:28:31 +03:00
|
|
|
$application->add(new OC\Core\Command\Db\ConvertFilecacheBigInt(\OC::$server->get(\OC\DB\Connection::class)));
|
|
|
|
$application->add(new OC\Core\Command\Db\AddMissingIndices(\OC::$server->get(\OC\DB\Connection::class), \OC::$server->getEventDispatcher()));
|
|
|
|
$application->add(new OC\Core\Command\Db\AddMissingColumns(\OC::$server->get(\OC\DB\Connection::class), \OC::$server->getEventDispatcher()));
|
|
|
|
$application->add(new OC\Core\Command\Db\AddMissingPrimaryKeys(\OC::$server->get(\OC\DB\Connection::class), \OC::$server->getEventDispatcher()));
|
|
|
|
$application->add(new OC\Core\Command\Db\Migrations\StatusCommand(\OC::$server->get(\OC\DB\Connection::class)));
|
|
|
|
$application->add(new OC\Core\Command\Db\Migrations\MigrateCommand(\OC::$server->get(\OC\DB\Connection::class)));
|
|
|
|
$application->add(new OC\Core\Command\Db\Migrations\GenerateCommand(\OC::$server->get(\OC\DB\Connection::class), \OC::$server->getAppManager()));
|
|
|
|
$application->add(new OC\Core\Command\Db\Migrations\ExecuteCommand(\OC::$server->get(\OC\DB\Connection::class), \OC::$server->getConfig()));
|
2015-04-30 16:18:12 +03:00
|
|
|
|
2015-04-16 18:41:32 +03:00
|
|
|
$application->add(new OC\Core\Command\Encryption\Disable(\OC::$server->getConfig()));
|
2015-05-04 13:36:50 +03:00
|
|
|
$application->add(new OC\Core\Command\Encryption\Enable(\OC::$server->getConfig(), \OC::$server->getEncryptionManager()));
|
2018-10-29 17:36:16 +03:00
|
|
|
$application->add(new OC\Core\Command\Encryption\ListModules(\OC::$server->getEncryptionManager(), \OC::$server->getConfig()));
|
|
|
|
$application->add(new OC\Core\Command\Encryption\SetDefaultModule(\OC::$server->getEncryptionManager(), \OC::$server->getConfig()));
|
2015-05-04 16:31:19 +03:00
|
|
|
$application->add(new OC\Core\Command\Encryption\Status(\OC::$server->getEncryptionManager()));
|
2015-08-24 16:56:04 +03:00
|
|
|
$application->add(new OC\Core\Command\Encryption\EncryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getAppManager(), \OC::$server->getConfig(), new \Symfony\Component\Console\Helper\QuestionHelper()));
|
2015-08-24 13:03:53 +03:00
|
|
|
$application->add(new OC\Core\Command\Encryption\DecryptAll(
|
|
|
|
\OC::$server->getEncryptionManager(),
|
|
|
|
\OC::$server->getAppManager(),
|
|
|
|
\OC::$server->getConfig(),
|
|
|
|
new \OC\Encryption\DecryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getUserManager(), new \OC\Files\View()),
|
|
|
|
new \Symfony\Component\Console\Helper\QuestionHelper())
|
|
|
|
);
|
2015-08-18 01:06:42 +03:00
|
|
|
|
|
|
|
$application->add(new OC\Core\Command\Log\Manage(\OC::$server->getConfig()));
|
2016-07-22 12:44:19 +03:00
|
|
|
$application->add(new OC\Core\Command\Log\File(\OC::$server->getConfig()));
|
2015-04-30 16:18:12 +03:00
|
|
|
|
2015-07-24 13:24:18 +03:00
|
|
|
$view = new \OC\Files\View();
|
|
|
|
$util = new \OC\Encryption\Util(
|
|
|
|
$view,
|
|
|
|
\OC::$server->getUserManager(),
|
|
|
|
\OC::$server->getGroupManager(),
|
|
|
|
\OC::$server->getConfig()
|
|
|
|
);
|
|
|
|
$application->add(new OC\Core\Command\Encryption\ChangeKeyStorageRoot(
|
|
|
|
$view,
|
|
|
|
\OC::$server->getUserManager(),
|
|
|
|
\OC::$server->getConfig(),
|
|
|
|
$util,
|
|
|
|
new \Symfony\Component\Console\Helper\QuestionHelper()
|
|
|
|
)
|
|
|
|
);
|
|
|
|
$application->add(new OC\Core\Command\Encryption\ShowKeyStorageRoot($util));
|
2020-06-22 16:35:52 +03:00
|
|
|
$application->add(new OC\Core\Command\Encryption\MigrateKeyStorage(
|
|
|
|
$view,
|
|
|
|
\OC::$server->getUserManager(),
|
|
|
|
\OC::$server->getConfig(),
|
|
|
|
$util,
|
|
|
|
\OC::$server->getCrypto()
|
|
|
|
)
|
|
|
|
);
|
2015-07-24 13:24:18 +03:00
|
|
|
|
2016-04-18 12:39:00 +03:00
|
|
|
$application->add(new OC\Core\Command\Maintenance\DataFingerprint(\OC::$server->getConfig(), new \OC\AppFramework\Utility\TimeFactory()));
|
2015-09-01 16:12:52 +03:00
|
|
|
$application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateDB(\OC::$server->getMimeTypeDetector(), \OC::$server->getMimeTypeLoader()));
|
|
|
|
$application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateJS(\OC::$server->getMimeTypeDetector()));
|
2015-04-30 16:18:12 +03:00
|
|
|
$application->add(new OC\Core\Command\Maintenance\Mode(\OC::$server->getConfig()));
|
2016-05-12 10:43:26 +03:00
|
|
|
$application->add(new OC\Core\Command\Maintenance\UpdateHtaccess());
|
2017-06-16 12:43:59 +03:00
|
|
|
$application->add(new OC\Core\Command\Maintenance\UpdateTheme(\OC::$server->getMimeTypeDetector(), \OC::$server->getMemCacheFactory()));
|
2015-04-30 16:18:12 +03:00
|
|
|
|
2021-04-22 16:22:50 +03:00
|
|
|
$application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig(), \OC::$server->get(LoggerInterface::class), \OC::$server->query(\OC\Installer::class)));
|
2016-10-20 18:06:10 +03:00
|
|
|
$application->add(new OC\Core\Command\Maintenance\Repair(
|
2021-02-01 16:56:56 +03:00
|
|
|
new \OC\Repair([], \OC::$server->getEventDispatcher(), \OC::$server->get(LoggerInterface::class)),
|
2019-02-02 20:07:48 +03:00
|
|
|
\OC::$server->getConfig(),
|
|
|
|
\OC::$server->getEventDispatcher(),
|
|
|
|
\OC::$server->getAppManager()
|
|
|
|
));
|
2015-04-30 16:18:12 +03:00
|
|
|
|
2020-08-06 22:30:51 +03:00
|
|
|
$application->add(\OC::$server->query(\OC\Core\Command\Preview\Repair::class));
|
2021-02-08 00:48:58 +03:00
|
|
|
$application->add(\OC::$server->query(\OC\Core\Command\Preview\ResetRenderedTexts::class));
|
2020-08-06 22:30:51 +03:00
|
|
|
|
2015-04-30 16:18:12 +03:00
|
|
|
$application->add(new OC\Core\Command\User\Add(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
|
|
|
|
$application->add(new OC\Core\Command\User\Delete(\OC::$server->getUserManager()));
|
2016-04-07 16:39:34 +03:00
|
|
|
$application->add(new OC\Core\Command\User\Disable(\OC::$server->getUserManager()));
|
|
|
|
$application->add(new OC\Core\Command\User\Enable(\OC::$server->getUserManager()));
|
2015-04-30 16:18:12 +03:00
|
|
|
$application->add(new OC\Core\Command\User\LastSeen(\OC::$server->getUserManager()));
|
2020-08-19 10:31:41 +03:00
|
|
|
$application->add(\OC::$server->get(\OC\Core\Command\User\Report::class));
|
2015-04-30 16:18:12 +03:00
|
|
|
$application->add(new OC\Core\Command\User\ResetPassword(\OC::$server->getUserManager()));
|
2016-06-09 15:49:53 +03:00
|
|
|
$application->add(new OC\Core\Command\User\Setting(\OC::$server->getUserManager(), \OC::$server->getConfig(), \OC::$server->getDatabaseConnection()));
|
2019-10-17 11:38:53 +03:00
|
|
|
$application->add(new OC\Core\Command\User\ListCommand(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
|
2016-07-13 14:24:19 +03:00
|
|
|
$application->add(new OC\Core\Command\User\Info(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
|
2020-11-24 01:10:48 +03:00
|
|
|
$application->add(new OC\Core\Command\User\AddAppPassword(\OC::$server->get(\OCP\IUserManager::class), \OC::$server->get(\OC\Authentication\Token\IProvider::class), \OC::$server->get(\OCP\Security\ISecureRandom::class), \OC::$server->get(\OCP\Security\ICrypto::class)));
|
2015-12-24 18:17:23 +03:00
|
|
|
|
2018-07-22 20:29:07 +03:00
|
|
|
$application->add(new OC\Core\Command\Group\Add(\OC::$server->getGroupManager()));
|
|
|
|
$application->add(new OC\Core\Command\Group\Delete(\OC::$server->getGroupManager()));
|
2016-07-14 14:23:54 +03:00
|
|
|
$application->add(new OC\Core\Command\Group\ListCommand(\OC::$server->getGroupManager()));
|
2016-07-13 14:12:57 +03:00
|
|
|
$application->add(new OC\Core\Command\Group\AddUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
|
|
|
|
$application->add(new OC\Core\Command\Group\RemoveUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
|
2021-02-09 16:50:38 +03:00
|
|
|
$application->add(new OC\Core\Command\Group\Info(\OC::$server->get(\OCP\IGroupManager::class)));
|
2016-07-14 14:23:54 +03:00
|
|
|
|
2020-07-05 15:31:19 +03:00
|
|
|
$application->add(new OC\Core\Command\Security\ListCertificates(\OC::$server->getCertificateManager(), \OC::$server->getL10N('core')));
|
|
|
|
$application->add(new OC\Core\Command\Security\ImportCertificate(\OC::$server->getCertificateManager()));
|
|
|
|
$application->add(new OC\Core\Command\Security\RemoveCertificate(\OC::$server->getCertificateManager()));
|
2020-03-17 19:06:52 +03:00
|
|
|
$application->add(new OC\Core\Command\Security\ResetBruteforceAttempts(\OC::$server->getBruteForceThrottler()));
|
2015-02-21 22:52:32 +03:00
|
|
|
} else {
|
2020-08-20 15:31:16 +03:00
|
|
|
$application->add(\OC::$server->get(\OC\Core\Command\Maintenance\Install::class));
|
2015-02-21 22:52:32 +03:00
|
|
|
}
|