From c1699d9f5d2dc9abb2d8bd845b11e12b2ee4c61a Mon Sep 17 00:00:00 2001 From: Git'Fellow Date: Thu, 25 Aug 2022 12:32:54 +0200 Subject: [PATCH 1/3] Introduce $updateDir to move updates outside $dataDir To be merged after https://github.com/nextcloud/updater/pull/420 Signed-off-by: Git'Fellow --- lib/private/Repair/MoveUpdaterStepFile.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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'); From 09af5acb007ba197bb77d31864bab57ddad773f7 Mon Sep 17 00:00:00 2001 From: Git'Fellow Date: Thu, 25 Aug 2022 12:42:22 +0200 Subject: [PATCH 2/3] Document updatedirectory option Signed-off-by: Git'Fellow --- config/config.sample.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config/config.sample.php b/config/config.sample.php index 05fba5777eb..c17799240ce 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -1754,6 +1754,15 @@ $CONFIG = [ */ 'tempdirectory' => '/tmp/nextcloudtemp', +/** + * Override where Nextcloud stores update files while updating. Useful in situations + * where the defult `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 */ From 771431c8796a58f351f927fc1f3cf1f9e794aac6 Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Thu, 25 Aug 2022 20:57:07 +0200 Subject: [PATCH 3/3] Fix small typo Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- config/config.sample.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.sample.php b/config/config.sample.php index c17799240ce..9748b700bb8 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -1756,7 +1756,7 @@ $CONFIG = [ /** * Override where Nextcloud stores update files while updating. Useful in situations - * where the defult `datadirectory` is on network disk like NFS, or is otherwise + * 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.