Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document and use the new updateDirectory if set #33692

Merged
merged 3 commits into from
Sep 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 9 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -1754,6 +1754,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