fix(lookup-server): do not upload data by default

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
pull/51420/head
Ferdinand Thiessen 2025-03-08 20:54:15 +07:00 committed by backportbot[bot]
parent efc6080813
commit c83233e8cf
5 changed files with 6 additions and 6 deletions

@ -1023,8 +1023,8 @@ class FederatedShareProvider implements IShareProvider {
if ($this->gsConfig->isGlobalScaleEnabled()) {
return false;
}
$result = $this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'yes');
return ($result === 'yes');
$result = $this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'no');
return $result === 'yes';
}
/**

@ -876,7 +876,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
$this->gsConfig->expects($this->once())->method('isGlobalScaleEnabled')
->willReturn($gsEnabled);
$this->config->expects($this->any())->method('getAppValue')
->with('files_sharing', 'lookupServerUploadEnabled', 'yes')
->with('files_sharing', 'lookupServerUploadEnabled', 'no')
->willReturn($isEnabled);
$this->assertSame($expected,

@ -116,7 +116,7 @@ class RetryJob extends Job {
protected function shouldRemoveBackgroundJob(): bool {
return $this->config->getSystemValueBool('has_internet_connection', true) === false ||
$this->config->getSystemValueString('lookup_server', 'https://lookup.nextcloud.com') === '' ||
$this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'yes') !== 'yes' ||
$this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'no') !== 'yes' ||
$this->retries >= 5;
}

@ -83,7 +83,7 @@ class UpdateLookupServer {
*/
private function shouldUpdateLookupServer(): bool {
return $this->config->getSystemValueBool('has_internet_connection', true) === true &&
$this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'yes') === 'yes' &&
$this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'no') === 'yes' &&
$this->config->getSystemValueString('lookup_server', 'https://lookup.nextcloud.com') !== '';
}
}

@ -170,7 +170,7 @@ class VerifyUserData extends Job {
protected function verifyViaLookupServer(array $argument, string $dataType): bool {
if (empty($this->lookupServerUrl) ||
$this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'yes') !== 'yes' ||
$this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'no') !== 'yes' ||
$this->config->getSystemValue('has_internet_connection', true) === false) {
return true;
}