mirror of
https://github.com/nextcloud/server.git
synced 2026-06-13 18:50:47 -04:00
Merge pull request #27492 from cyclops8456/feature/24301-remove-can-install-on-occ-maintenance-install
Remove the CAN_INSTALL file when occ maintenance:install is complete
This commit is contained in:
commit
06a572ff55
3 changed files with 23 additions and 5 deletions
|
|
@ -107,6 +107,9 @@ class Install extends Command {
|
|||
$this->printErrors($output, $errors);
|
||||
return 1;
|
||||
}
|
||||
if ($setupHelper->shouldRemoveCanInstallFile()) {
|
||||
$output->writeln('<warn>Could not remove CAN_INSTALL from the config folder. Please remove this file manually.</warn>');
|
||||
}
|
||||
$output->writeln("Nextcloud was successfully installed");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class SetupController {
|
|||
$post['dbpass'] = $post['dbpassword'];
|
||||
}
|
||||
|
||||
if (!is_file(\OC::$configDir.'/CAN_INSTALL')) {
|
||||
if (!$this->setupHelper->canInstallFileExists()) {
|
||||
$this->displaySetupForbidden();
|
||||
return;
|
||||
}
|
||||
|
|
@ -107,10 +107,8 @@ class SetupController {
|
|||
}
|
||||
\OC::$server->getIntegrityCodeChecker()->runInstanceVerification();
|
||||
|
||||
if (\OC_Util::getChannel() !== 'git' && is_file(\OC::$configDir.'/CAN_INSTALL')) {
|
||||
if (!unlink(\OC::$configDir.'/CAN_INSTALL')) {
|
||||
\OC_Template::printGuestPage('', 'installation_incomplete');
|
||||
}
|
||||
if ($this->setupHelper->shouldRemoveCanInstallFile()) {
|
||||
\OC_Template::printGuestPage('', 'installation_incomplete');
|
||||
}
|
||||
|
||||
header('Location: ' . \OC::$server->getURLGenerator()->getAbsoluteURL('index.php/core/apps/recommended'));
|
||||
|
|
|
|||
|
|
@ -419,6 +419,9 @@ class Setup {
|
|||
|
||||
//and we are done
|
||||
$config->setSystemValue('installed', true);
|
||||
if (self::shouldRemoveCanInstallFile()) {
|
||||
unlink(\OC::$configDir.'/CAN_INSTALL');
|
||||
}
|
||||
|
||||
$bootstrapCoordinator = \OC::$server->query(\OC\AppFramework\Bootstrap\Coordinator::class);
|
||||
$bootstrapCoordinator->runInitialRegistration();
|
||||
|
|
@ -596,4 +599,18 @@ class Setup {
|
|||
'channel' => (string)$OC_Channel,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function shouldRemoveCanInstallFile() {
|
||||
return \OC_Util::getChannel() !== 'git' && is_file(\OC::$configDir.'/CAN_INSTALL');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function canInstallFileExists() {
|
||||
return is_file(\OC::$configDir.'/CAN_INSTALL');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue