Merge pull request #33692 from nextcloud/update-dir

Document and use the new updateDirectory if set
This commit is contained in:
blizzz 2022-09-02 22:19:50 +02:00 committed by GitHub
commit 16e696c9e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -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
*/

View File

@ -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');