diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2022-09-02 22:19:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-02 22:19:50 +0200 |
commit | 16e696c9e864b7a2a860b8f0147aa54c681e7cb8 (patch) | |
tree | 848cf9c8273aca5fb434538778505b75a27be301 | |
parent | 6132b6a4aec0cad2a92478ea913d6b8c6ce43835 (diff) | |
parent | 771431c8796a58f351f927fc1f3cf1f9e794aac6 (diff) | |
download | nextcloud-server-16e696c9e864b7a2a860b8f0147aa54c681e7cb8.tar.gz nextcloud-server-16e696c9e864b7a2a860b8f0147aa54c681e7cb8.zip |
Merge pull request #33692 from nextcloud/update-dir
Document and use the new updateDirectory if set
-rw-r--r-- | config/config.sample.php | 9 | ||||
-rw-r--r-- | lib/private/Repair/MoveUpdaterStepFile.php | 4 |
2 files changed, 11 insertions, 2 deletions
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 @@ -1769,6 +1769,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'); |