diff --git a/config/config.sample.php b/config/config.sample.php index 873af8b037b..743d86b12fc 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -1768,6 +1768,15 @@ $CONFIG = [ */ 'tempdirectory' => '/tmp/nextcloudtemp', +/** + * Override where Nextcloud stores update files while updating. Useful in situations + * where the default `datadirectory` is on network disk like NFS, or is otherwise + * restricted. Defaults to the value of `datadirectory` if unset. + * + * The Web server user must have write access to this directory. + */ +'updatedirectory' => '', + /** * Hashing */ diff --git a/lib/private/Repair/MoveUpdaterStepFile.php b/lib/private/Repair/MoveUpdaterStepFile.php index bc7430d7a7f..020510804d7 100644 --- a/lib/private/Repair/MoveUpdaterStepFile.php +++ b/lib/private/Repair/MoveUpdaterStepFile.php @@ -43,14 +43,14 @@ class MoveUpdaterStepFile implements IRepairStep { } public function run(IOutput $output) { - $dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data'); + $updateDir = $this->config->getSystemValue('updatedirectory') ?? $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data'); $instanceId = $this->config->getSystemValue('instanceid', null); if (!is_string($instanceId) || empty($instanceId)) { return; } - $updaterFolderPath = $dataDir . '/updater-' . $instanceId; + $updaterFolderPath = $updateDir . '/updater-' . $instanceId; $stepFile = $updaterFolderPath . '/.step'; if (file_exists($stepFile)) { $output->info('.step file exists');