Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Improve market upgrade messages + new switch
Improve market upgrade messages.
Added switch to disable automatic app updates during occ upgrade.
  • Loading branch information
Vincent Petry committed Aug 31, 2017
commit c7cd00d0f893fa520b5d889c890ce00e069fa32d
5 changes: 5 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -1370,6 +1370,11 @@
*/
'upgrade.disable-web' => false,

/**
* Automatic update of market apps, set to "false" to disable.
*/
'upgrade.automatic-app-update' => true,

/**
* Set this ownCloud instance to debugging mode
*
Expand Down
17 changes: 15 additions & 2 deletions lib/private/Repair/Apps.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public function run(IOutput $output) {
$link = $this->defaults->buildDocLinkToKey('admin-marketplace-apps');
$output->info('No internet connection available - no app updates will be taken from the marketplace.');
$output->info("How to update apps in such situation please see $link");
$this->appManager->disableApp('market');
return;
}
$appsToUpgrade = $this->getAppsToUpgrade();
Expand All @@ -124,6 +125,14 @@ public function run(IOutput $output) {

// fix market app state
$shallContactMarketplace = $this->fixMarketAppState($output);

// market might be enabled but admin does not want to automatically update apps through it
// (they might want to manually click through the updates in the web UI so keeping the
// market enabled here is a legitimate use case)
if ($this->config->getSystemValue('upgrade.automatic-app-update', true) !== true) {
$shallContactMarketplace = false;
}

if ($shallContactMarketplace) {
// Check if we can use the marketplace to update apps as needed?
if ($this->appManager->isEnabledForUser('market')) {
Expand Down Expand Up @@ -167,7 +176,8 @@ public function run(IOutput $output) {
}
} else {
// No market available, output error and continue attempt
$output->warning('Market app is unavailable for updating of apps. Enable with: occ app:enable market');
$link = $this->defaults->buildDocLinkToKey('admin-marketplace-apps');
$output->warning("Market app is unavailable for updating of apps. Please update manually, see $link");
}
}

Expand All @@ -178,9 +188,11 @@ public function run(IOutput $output) {
// fail
$output->warning('You have incompatible or missing apps enabled that could not be found or updated via the marketplace.');
$output->warning(
'please install app manually with tarball or disable them with:'
'Please install or update the following apps manually or disable them with:'
. $this->getOccDisableMessage(array_merge($failedIncompatibleApps, $failedMissingApps))
);
$link = $this->defaults->buildDocLinkToKey('admin-marketplace-apps');
$output->warning("For manually updating, see $link");

throw new RepairException('Upgrade is not possible');
} elseif ($hasNotUpdatedCompatibleApps) {
Expand Down Expand Up @@ -314,6 +326,7 @@ private function fixMarketAppState(IOutput $output) {
$output->info("Please note that the market app is not recommended for clustered setups - see $link");
return false;
}

// Then we need to enable the market app to support app updates / downloads during upgrade
$output->info('Enabling market app to assist with update');
$this->appManager->enableApp('market');
Expand Down