Skip to content

Commit

Permalink
fix(lookup-server): do not upload data by default
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Mar 10, 2025
1 parent eb59791 commit 778cf5e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/federatedfilesharing/lib/FederatedShareProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ public function isLookupServerUploadEnabled(): bool {
if ($this->gsConfig->isGlobalScaleEnabled()) {
return false;
}
$result = $this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'yes');
$result = $this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'no');
return $result === 'yes';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ public function testIsLookupServerUploadEnabled($gsEnabled, $isEnabled, $expecte
$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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function start(IJobList $jobList): void {
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;
}

Expand Down
2 changes: 1 addition & 1 deletion apps/lookup_server_connector/lib/UpdateLookupServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function userUpdated(IUser $user): void {
*/
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') !== '';
}
}
2 changes: 1 addition & 1 deletion apps/settings/lib/BackgroundJobs/VerifyUserData.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ protected function verifyWebsite(array $argument) {

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;
}
Expand Down

0 comments on commit 778cf5e

Please sign in to comment.