Skip to content

Commit

Permalink
Merge pull request #33692 from nextcloud/update-dir
Browse files Browse the repository at this point in the history
Document and use the new updateDirectory if set
  • Loading branch information
blizzz authored Sep 2, 2022
2 parents 6132b6a + 771431c commit 16e696c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -1768,6 +1768,15 @@
*/
'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
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/private/Repair/MoveUpdaterStepFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ public function getName() {
}

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');
Expand Down

0 comments on commit 16e696c

Please sign in to comment.