diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php
index b4fedecfd4214..6acf044b3a231 100644
--- a/apps/federatedfilesharing/lib/FederatedShareProvider.php
+++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php
@@ -1071,8 +1071,10 @@ public function isLookupServerQueriesEnabled() {
if ($this->gsConfig->isGlobalScaleEnabled()) {
return true;
}
- $result = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'yes');
- return ($result === 'yes');
+ $result = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'no') === 'yes';
+ // TODO: Reenable if lookup server is used again
+ // return $result;
+ return false;
}
@@ -1086,8 +1088,10 @@ public function isLookupServerUploadEnabled() {
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') === 'yes';
+ // TODO: Reenable if lookup server is used again
+ // return $result;
+ return false;
}
/**
diff --git a/apps/federatedfilesharing/src/components/AdminSettings.vue b/apps/federatedfilesharing/src/components/AdminSettings.vue
index 678e47012c2c4..05cb6366403fa 100644
--- a/apps/federatedfilesharing/src/components/AdminSettings.vue
+++ b/apps/federatedfilesharing/src/components/AdminSettings.vue
@@ -50,17 +50,22 @@
{{ t('federatedfilesharing', 'Allow users on this server to receive group shares from other servers') }}
-
- {{ t('federatedfilesharing', 'Search global and public address book for users') }}
-
+
diff --git a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php
index 797d029d6b152..c39bbab4af315 100644
--- a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php
+++ b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php
@@ -849,7 +849,7 @@ public function testIsLookupServerQueriesEnabled($gsEnabled, $isEnabled, $expect
$this->gsConfig->expects($this->once())->method('isGlobalScaleEnabled')
->willReturn($gsEnabled);
$this->config->expects($this->any())->method('getAppValue')
- ->with('files_sharing', 'lookupServerEnabled', 'yes')
+ ->with('files_sharing', 'lookupServerEnabled', 'no')
->willReturn($isEnabled);
$this->assertSame($expected,
@@ -860,10 +860,13 @@ public function testIsLookupServerQueriesEnabled($gsEnabled, $isEnabled, $expect
public function dataTestIsLookupServerQueriesEnabled() {
return [
- [false, 'yes', true],
- [false, 'no', false],
[true, 'yes', true],
[true, 'no', true],
+ // TODO: reenable if we use the lookup server for non-global scale
+ // [false, 'yes', true],
+ // [false, 'no', false],
+ [false, 'no', false],
+ [false, 'yes', false],
];
}
@@ -877,7 +880,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,
@@ -887,10 +890,13 @@ public function testIsLookupServerUploadEnabled($gsEnabled, $isEnabled, $expecte
public function dataTestIsLookupServerUploadEnabled() {
return [
- [false, 'yes', true],
- [false, 'no', false],
[true, 'yes', false],
[true, 'no', false],
+ // TODO: reenable if we use the lookup server again
+ // [false, 'yes', true],
+ // [false, 'no', false],
+ [false, 'yes', false],
+ [false, 'no', false],
];
}
diff --git a/apps/files_sharing/lib/Controller/ShareesAPIController.php b/apps/files_sharing/lib/Controller/ShareesAPIController.php
index 8daa7dc5ab9c7..187aa74f088d8 100644
--- a/apps/files_sharing/lib/Controller/ShareesAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareesAPIController.php
@@ -38,7 +38,6 @@
*/
namespace OCA\Files_Sharing\Controller;
-use OCP\Constants;
use function array_slice;
use function array_values;
use Generator;
@@ -49,6 +48,8 @@
use OCP\Collaboration\Collaborators\ISearch;
use OCP\Collaboration\Collaborators\ISearchResult;
use OCP\Collaboration\Collaborators\SearchResultType;
+use OCP\Constants;
+use OCP\GlobalScale\IConfig as GlobalScaleIConfig;
use OCP\IConfig;
use OCP\IRequest;
use OCP\IURLGenerator;
@@ -216,15 +217,11 @@ public function search(string $search = '', string $itemType = null, int $page =
$this->limit = $perPage;
$this->offset = $perPage * ($page - 1);
- // In global scale mode we always search the loogup server
- if ($this->config->getSystemValueBool('gs.enabled', false)) {
- $lookup = true;
- $this->result['lookupEnabled'] = true;
- } else {
- $this->result['lookupEnabled'] = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'yes') === 'yes';
- }
+ // In global scale mode we always search the lookup server
+ $this->result['lookupEnabled'] = \OCP\Server::get(GlobalScaleIConfig::class)->isGlobalScaleEnabled();
+ // TODO: Reconsider using lookup server for non-global-scale federation
- [$result, $hasMoreResults] = $this->collaboratorSearch->search($search, $shareTypes, $lookup, $this->limit, $this->offset);
+ [$result, $hasMoreResults] = $this->collaboratorSearch->search($search, $shareTypes, $this->result['lookupEnabled'], $this->limit, $this->offset);
// extra treatment for 'exact' subarray, with a single merge expected keys might be lost
if (isset($result['exact'])) {
diff --git a/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php
index 860d5796e56dc..60cb079ea5a75 100644
--- a/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php
+++ b/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php
@@ -35,6 +35,7 @@
use OCP\AppFramework\Http;
use OCP\AppFramework\OCS\OCSBadRequestException;
use OCP\Collaboration\Collaborators\ISearch;
+use OCP\GlobalScale\IConfig as GlobalScaleIConfig;
use OCP\IConfig;
use OCP\IRequest;
use OCP\IURLGenerator;
@@ -240,14 +241,14 @@ public function testSearch(array $getData, string $apiSetting, string $enumSetti
$perPage = $getData['perPage'] ?? 200;
$shareType = $getData['shareType'] ?? null;
+ $globalConfig = $this->createMock(GlobalScaleIConfig::class);
+ $globalConfig->expects(self::once())
+ ->method('isGlobalScaleEnabled')
+ ->willReturn(true);
+ $this->overwriteService(GlobalScaleIConfig::class, $globalConfig);
+
/** @var IConfig|MockObject $config */
$config = $this->createMock(IConfig::class);
- $config->expects($this->exactly(1))
- ->method('getAppValue')
- ->with($this->anything(), $this->anything(), $this->anything())
- ->willReturnMap([
- ['files_sharing', 'lookupServerEnabled', 'yes', 'yes'],
- ]);
$this->shareManager->expects($this->once())
->method('allowGroupSharing')
diff --git a/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php b/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php
index 39d8118abe71d..e629060cdd88e 100644
--- a/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php
+++ b/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php
@@ -115,10 +115,12 @@ public function start(IJobList $jobList): void {
* - max retries are reached (set to 5)
*/
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->retries >= 5;
+ // TODO: Remove global scale condition once lookup server is used for non-global scale federation
+ // return $this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'no') !== 'yes'
+ return !$this->config->getSystemValueBool('gs.enabled', false)
+ || $this->config->getSystemValueBool('has_internet_connection', true) === false
+ || $this->config->getSystemValueString('lookup_server', 'https://lookup.nextcloud.com') === ''
+ || $this->retries >= 5;
}
protected function shouldRun(): bool {
@@ -180,7 +182,7 @@ protected function run($argument): void {
$user->getUID(),
'lookup_server_connector',
'update_retries',
- $this->retries + 1
+ (string)($this->retries + 1),
);
}
}
diff --git a/apps/lookup_server_connector/lib/UpdateLookupServer.php b/apps/lookup_server_connector/lib/UpdateLookupServer.php
index ec528e6effa7f..4e58a67733c29 100644
--- a/apps/lookup_server_connector/lib/UpdateLookupServer.php
+++ b/apps/lookup_server_connector/lib/UpdateLookupServer.php
@@ -82,8 +82,9 @@ public function userUpdated(IUser $user): void {
* @return bool
*/
private function shouldUpdateLookupServer(): bool {
- return $this->config->getSystemValueBool('has_internet_connection', true) === true &&
- $this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'yes') === 'yes' &&
- $this->config->getSystemValueString('lookup_server', 'https://lookup.nextcloud.com') !== '';
+ // TODO: Consider reenable for non-global-scale setups by checking "'files_sharing', 'lookupServerUploadEnabled'" instead of "gs.enabled"
+ return $this->config->getSystemValueBool('gs.enabled', false)
+ && $this->config->getSystemValueBool('has_internet_connection', true)
+ && $this->config->getSystemValueString('lookup_server', 'https://lookup.nextcloud.com') !== '';
}
}
diff --git a/apps/settings/lib/BackgroundJobs/VerifyUserData.php b/apps/settings/lib/BackgroundJobs/VerifyUserData.php
index ec75f4243bec2..30afe1f7edab7 100644
--- a/apps/settings/lib/BackgroundJobs/VerifyUserData.php
+++ b/apps/settings/lib/BackgroundJobs/VerifyUserData.php
@@ -169,9 +169,11 @@ 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->getSystemValue('has_internet_connection', true) === false) {
+ // TODO: Consider to enable for non-global-scale setups by checking 'files_sharing', 'lookupServerUploadEnabled'
+ if (!$this->config->getSystemValueBool('gs.enabled', false)
+ || empty($this->lookupServerUrl)
+ || $this->config->getSystemValue('has_internet_connection', true) === false
+ ) {
return true;
}
diff --git a/dist/federatedfilesharing-vue-settings-admin.js b/dist/federatedfilesharing-vue-settings-admin.js
index 05dd9a6f13847..87e8594d3321b 100644
--- a/dist/federatedfilesharing-vue-settings-admin.js
+++ b/dist/federatedfilesharing-vue-settings-admin.js
@@ -1,3 +1,3 @@
/*! For license information please see federatedfilesharing-vue-settings-admin.js.LICENSE.txt */
-!function(){"use strict";var e,r={98848:function(e,r,n){var o=n(20144),a=n(45994),i=n(31352),s=(n(36144),n(79954)),d=n(20571),u=n.n(d),c=n(13299),l=n.n(c),h=n(64024),v=n(4820),f=n(79753),g=n(10128),p=(n(65509),n(25108));function b(e,r,n,t,o,a,i){try{var s=e[a](i),d=s.value}catch(e){return void n(e)}s.done?r(d):Promise.resolve(d).then(t,o)}function S(e){return function(){var r=this,n=arguments;return new Promise((function(t,o){var a=e.apply(r,n);function i(e){b(a,t,o,i,s,"next",e)}function s(e){b(a,t,o,i,s,"throw",e)}i(void 0)}))}}var m={name:"AdminSettings",components:{NcCheckboxRadioSwitch:u(),NcSettingsSection:l()},data:function(){return{outgoingServer2serverShareEnabled:(0,s.j)("federatedfilesharing","outgoingServer2serverShareEnabled"),incomingServer2serverShareEnabled:(0,s.j)("federatedfilesharing","incomingServer2serverShareEnabled"),outgoingServer2serverGroupShareEnabled:(0,s.j)("federatedfilesharing","outgoingServer2serverGroupShareEnabled"),incomingServer2serverGroupShareEnabled:(0,s.j)("federatedfilesharing","incomingServer2serverGroupShareEnabled"),federatedGroupSharingSupported:(0,s.j)("federatedfilesharing","federatedGroupSharingSupported"),lookupServerEnabled:(0,s.j)("federatedfilesharing","lookupServerEnabled"),lookupServerUploadEnabled:(0,s.j)("federatedfilesharing","lookupServerUploadEnabled"),internalOnly:(0,s.j)("federatedfilesharing","internalOnly"),sharingFederatedDocUrl:(0,s.j)("federatedfilesharing","sharingFederatedDocUrl")}},methods:{update:function(e,r){var n=this;return S(regeneratorRuntime.mark((function o(){var a,i,s,d,u,c;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,g.confirmPassword)();case 2:return a=(0,f.generateOcsUrl)("/apps/provisioning_api/api/v1/config/apps/{appId}/{key}",{appId:"files_sharing",key:e}),i=r?"yes":"no",o.prev=4,o.next=7,v.default.post(a,{value:i});case 7:u=o.sent,c=u.data,n.handleResponse({status:null===(s=c.ocs)||void 0===s||null===(d=s.meta)||void 0===d?void 0:d.status}),o.next=15;break;case 12:o.prev=12,o.t0=o.catch(4),n.handleResponse({errorMessage:t("federatedfilesharing","Unable to update federated files sharing config"),error:o.t0});case 15:case"end":return o.stop()}}),o,null,[[4,12]])})))()},handleResponse:function(e){return S(regeneratorRuntime.mark((function r(){var n,t,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=e.status,t=e.errorMessage,o=e.error,"ok"!==n&&((0,h.x2)(t),p.error(t,o));case 2:case"end":return r.stop()}}),r)})))()}}},y=(0,n(51900).Z)(m,(function(){var e=this,r=e._self._c;return r("NcSettingsSection",{attrs:{title:e.t("federatedfilesharing","Federated Cloud Sharing"),description:e.t("federatedfilesharing","Adjust how people can share between servers. This includes shares between users on this server as well if they are using federated sharing."),"doc-url":e.sharingFederatedDocUrl}},[r("NcCheckboxRadioSwitch",{attrs:{type:"switch",checked:e.outgoingServer2serverShareEnabled},on:{"update:checked":[function(r){e.outgoingServer2serverShareEnabled=r},function(r){return e.update("outgoing_server2server_share_enabled",e.outgoingServer2serverShareEnabled)}]}},[e._v("\n\t\t"+e._s(e.t("federatedfilesharing","Allow users on this server to send shares to other servers (this option also allows WebDAV access to public shares)"))+"\n\t")]),e._v(" "),r("NcCheckboxRadioSwitch",{attrs:{type:"switch",checked:e.incomingServer2serverShareEnabled},on:{"update:checked":[function(r){e.incomingServer2serverShareEnabled=r},function(r){return e.update("incoming_server2server_share_enabled",e.incomingServer2serverShareEnabled)}]}},[e._v("\n\t\t"+e._s(e.t("federatedfilesharing","Allow users on this server to receive shares from other servers"))+"\n\t")]),e._v(" "),e.federatedGroupSharingSupported?r("NcCheckboxRadioSwitch",{attrs:{type:"switch",checked:e.outgoingServer2serverGroupShareEnabled},on:{"update:checked":[function(r){e.outgoingServer2serverGroupShareEnabled=r},function(r){return e.update("outgoing_server2server_group_share_enabled",e.outgoingServer2serverGroupShareEnabled)}]}},[e._v("\n\t\t"+e._s(e.t("federatedfilesharing","Allow users on this server to send shares to groups on other servers"))+"\n\t")]):e._e(),e._v(" "),e.federatedGroupSharingSupported?r("NcCheckboxRadioSwitch",{attrs:{type:"switch",checked:e.incomingServer2serverGroupShareEnabled},on:{"update:checked":[function(r){e.incomingServer2serverGroupShareEnabled=r},function(r){return e.update("incoming_server2server_group_share_enabled",e.incomingServer2serverGroupShareEnabled)}]}},[e._v("\n\t\t"+e._s(e.t("federatedfilesharing","Allow users on this server to receive group shares from other servers"))+"\n\t")]):e._e(),e._v(" "),r("NcCheckboxRadioSwitch",{attrs:{type:"switch",checked:e.lookupServerEnabled},on:{"update:checked":[function(r){e.lookupServerEnabled=r},function(r){return e.update("lookupServerEnabled",e.lookupServerEnabled)}]}},[e._v("\n\t\t"+e._s(e.t("federatedfilesharing","Search global and public address book for users"))+"\n\t")]),e._v(" "),r("NcCheckboxRadioSwitch",{attrs:{type:"switch",checked:e.lookupServerUploadEnabled},on:{"update:checked":[function(r){e.lookupServerUploadEnabled=r},function(r){return e.update("lookupServerUploadEnabled",e.lookupServerUploadEnabled)}]}},[e._v("\n\t\t"+e._s(e.t("federatedfilesharing","Allow users to publish their data to a global and public address book"))+"\n\t")])],1)}),[],!1,null,null,null).exports;n.nc=btoa((0,a.IH)()),o.ZP.mixin({methods:{t:i.Iu}}),(0,s.j)("federatedfilesharing","internalOnly",!1)||(new(o.ZP.extend(y))).$mount("#vue-admin-federated")},81490:function(e){e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTYiIHdpZHRoPSIxNiI+CiAgPHBhdGggZD0iTTE0IDEyLjNMMTIuMyAxNCA4IDkuNyAzLjcgMTQgMiAxMi4zIDYuMyA4IDIgMy43IDMuNyAyIDggNi4zIDEyLjMgMiAxNCAzLjcgOS43IDh6Ii8+Cjwvc3ZnPgo="},90888:function(e){e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTYiIHdpZHRoPSIxNiI+CiAgPHBhdGggZD0iTTE0IDEyLjNMMTIuMyAxNCA4IDkuNyAzLjcgMTQgMiAxMi4zIDYuMyA4IDIgMy43IDMuNyAyIDggNi4zIDEyLjMgMiAxNCAzLjcgOS43IDh6IiBzdHlsZT0iZmlsbC1vcGFjaXR5OjE7ZmlsbDojZmZmZmZmIi8+Cjwvc3ZnPgo="}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var a=n[e]={id:e,loaded:!1,exports:{}};return r[e].call(a.exports,a,a.exports,o),a.loaded=!0,a.exports}o.m=r,e=[],o.O=function(r,n,t,a){if(!n){var i=1/0;for(c=0;c=a)&&Object.keys(o.O).every((function(e){return o.O[e](n[d])}))?n.splice(d--,1):(s=!1,a0&&e[c-1][2]>a;c--)e[c]=e[c-1];e[c]=[n,t,a]},o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,{a:r}),r},o.d=function(e,r){for(var n in r)o.o(r,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},o.j=7220,function(){o.b=document.baseURI||self.location.href;var e={7220:0};o.O.j=function(r){return 0===e[r]};var r=function(r,n){var t,a,i=n[0],s=n[1],d=n[2],u=0;if(i.some((function(r){return 0!==e[r]}))){for(t in s)o.o(s,t)&&(o.m[t]=s[t]);if(d)var c=d(o)}for(r&&r(n);u=a)&&Object.keys(o.O).every((function(e){return o.O[e](n[d])}))?n.splice(d--,1):(s=!1,a0&&e[c-1][2]>a;c--)e[c]=e[c-1];e[c]=[n,t,a]},o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,{a:r}),r},o.d=function(e,r){for(var n in r)o.o(r,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},o.j=7220,function(){o.b=document.baseURI||self.location.href;var e={7220:0};o.O.j=function(r){return 0===e[r]};var r=function(r,n){var t,a,i=n[0],s=n[1],d=n[2],u=0;if(i.some((function(r){return 0!==e[r]}))){for(t in s)o.o(s,t)&&(o.m[t]=s[t]);if(d)var c=d(o)}for(r&&r(n);u 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","\n\n\n\t\n\t\t\n\t\t\t{{ t('federatedfilesharing', 'Allow users on this server to send shares to other servers (this option also allows WebDAV access to public shares)') }}\n\t\t\n\n\t\t\n\t\t\t{{ t('federatedfilesharing', 'Allow users on this server to receive shares from other servers') }}\n\t\t\n\n\t\t\n\t\t\t{{ t('federatedfilesharing', 'Allow users on this server to send shares to groups on other servers') }}\n\t\t\n\n\t\t\n\t\t\t{{ t('federatedfilesharing', 'Allow users on this server to receive group shares from other servers') }}\n\t\t\n\n\t\t\n\t\t\t{{ t('federatedfilesharing', 'Search global and public address book for users') }}\n\t\t\n\n\t\t\n\t\t\t{{ t('federatedfilesharing', 'Allow users to publish their data to a global and public address book') }}\n\t\t\n\t\n\n\n\n","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AdminSettings.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AdminSettings.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./AdminSettings.vue?vue&type=template&id=79b63c82&\"\nimport script from \"./AdminSettings.vue?vue&type=script&lang=js&\"\nexport * from \"./AdminSettings.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('NcSettingsSection',{attrs:{\"title\":_vm.t('federatedfilesharing', 'Federated Cloud Sharing'),\"description\":_vm.t('federatedfilesharing', 'Adjust how people can share between servers. This includes shares between users on this server as well if they are using federated sharing.'),\"doc-url\":_vm.sharingFederatedDocUrl}},[_c('NcCheckboxRadioSwitch',{attrs:{\"type\":\"switch\",\"checked\":_vm.outgoingServer2serverShareEnabled},on:{\"update:checked\":[function($event){_vm.outgoingServer2serverShareEnabled=$event},function($event){return _vm.update('outgoing_server2server_share_enabled', _vm.outgoingServer2serverShareEnabled)}]}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('federatedfilesharing', 'Allow users on this server to send shares to other servers (this option also allows WebDAV access to public shares)'))+\"\\n\\t\")]),_vm._v(\" \"),_c('NcCheckboxRadioSwitch',{attrs:{\"type\":\"switch\",\"checked\":_vm.incomingServer2serverShareEnabled},on:{\"update:checked\":[function($event){_vm.incomingServer2serverShareEnabled=$event},function($event){return _vm.update('incoming_server2server_share_enabled', _vm.incomingServer2serverShareEnabled)}]}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('federatedfilesharing', 'Allow users on this server to receive shares from other servers'))+\"\\n\\t\")]),_vm._v(\" \"),(_vm.federatedGroupSharingSupported)?_c('NcCheckboxRadioSwitch',{attrs:{\"type\":\"switch\",\"checked\":_vm.outgoingServer2serverGroupShareEnabled},on:{\"update:checked\":[function($event){_vm.outgoingServer2serverGroupShareEnabled=$event},function($event){return _vm.update('outgoing_server2server_group_share_enabled', _vm.outgoingServer2serverGroupShareEnabled)}]}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('federatedfilesharing', 'Allow users on this server to send shares to groups on other servers'))+\"\\n\\t\")]):_vm._e(),_vm._v(\" \"),(_vm.federatedGroupSharingSupported)?_c('NcCheckboxRadioSwitch',{attrs:{\"type\":\"switch\",\"checked\":_vm.incomingServer2serverGroupShareEnabled},on:{\"update:checked\":[function($event){_vm.incomingServer2serverGroupShareEnabled=$event},function($event){return _vm.update('incoming_server2server_group_share_enabled', _vm.incomingServer2serverGroupShareEnabled)}]}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('federatedfilesharing', 'Allow users on this server to receive group shares from other servers'))+\"\\n\\t\")]):_vm._e(),_vm._v(\" \"),_c('NcCheckboxRadioSwitch',{attrs:{\"type\":\"switch\",\"checked\":_vm.lookupServerEnabled},on:{\"update:checked\":[function($event){_vm.lookupServerEnabled=$event},function($event){return _vm.update('lookupServerEnabled', _vm.lookupServerEnabled)}]}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('federatedfilesharing', 'Search global and public address book for users'))+\"\\n\\t\")]),_vm._v(\" \"),_c('NcCheckboxRadioSwitch',{attrs:{\"type\":\"switch\",\"checked\":_vm.lookupServerUploadEnabled},on:{\"update:checked\":[function($event){_vm.lookupServerUploadEnabled=$event},function($event){return _vm.update('lookupServerUploadEnabled', _vm.lookupServerUploadEnabled)}]}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('federatedfilesharing', 'Allow users to publish their data to a global and public address book'))+\"\\n\\t\")])],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * @copyright 2022 Carl Schwan \n *\n * @author Carl Schwan \n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nimport Vue from 'vue'\nimport { getRequestToken } from '@nextcloud/auth'\nimport { translate as t } from '@nextcloud/l10n'\nimport '@nextcloud/dialogs/dist/index.css'\nimport { loadState } from '@nextcloud/initial-state'\n\nimport AdminSettings from './components/AdminSettings'\n\n__webpack_nonce__ = btoa(getRequestToken())\n\nVue.mixin({\n\tmethods: {\n\t\tt,\n\t},\n})\n\nconst internalOnly = loadState('federatedfilesharing', 'internalOnly', false)\n\nif (!internalOnly) {\n\tconst AdminSettingsView = Vue.extend(AdminSettings)\n\tnew AdminSettingsView().$mount('#vue-admin-federated')\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = function(module) {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 7220;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t7220: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunknextcloud\"] = self[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [7874], function() { return __webpack_require__(98848); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","name","components","NcCheckboxRadioSwitch","NcSettingsSection","data","outgoingServer2serverShareEnabled","incomingServer2serverShareEnabled","outgoingServer2serverGroupShareEnabled","incomingServer2serverGroupShareEnabled","federatedGroupSharingSupported","lookupServerEnabled","lookupServerUploadEnabled","internalOnly","sharingFederatedDocUrl","methods","update","confirmPassword","url","appId","key","stringValue","axios","value","status","errorMessage","error","handleResponse","showError","console","_vm","this","_c","_self","attrs","t","on","$event","_v","_s","_e","__webpack_nonce__","btoa","getRequestToken","Vue","loadState","AdminSettings","$mount","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","id","loaded","__webpack_modules__","call","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","keys","every","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","g","globalThis","Function","e","window","obj","prop","prototype","hasOwnProperty","Symbol","toStringTag","nmd","paths","children","b","document","baseURI","self","location","href","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","forEach","bind","push","nc","__webpack_exports__"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"federatedfilesharing-vue-settings-admin.js?v=a2639220ede5085bfa87","mappings":";6BAAIA,2fCiFJ,ICjF0L,EDiF1L,CACAC,KAAAA,gBAEAC,WAAAA,CACAC,sBAAAA,IACAC,kBAAAA,KAGAC,KAAAA,WACA,OACAC,mCAAAA,EAAAA,EAAAA,GAAAA,uBAAAA,qCACAC,mCAAAA,EAAAA,EAAAA,GAAAA,uBAAAA,qCACAC,wCAAAA,EAAAA,EAAAA,GAAAA,uBAAAA,0CACAC,wCAAAA,EAAAA,EAAAA,GAAAA,uBAAAA,0CACAC,gCAAAA,EAAAA,EAAAA,GAAAA,uBAAAA,kCACAC,qBAAAA,EAAAA,EAAAA,GAAAA,uBAAAA,uBACAC,2BAAAA,EAAAA,EAAAA,GAAAA,uBAAAA,6BACAC,cAAAA,EAAAA,EAAAA,GAAAA,uBAAAA,gBACAC,wBAAAA,EAAAA,EAAAA,GAA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4B,uBAAK,GAC1FU,EAAmBC,QAAQN,EAAqBO,KAAK,KAAM,IAC3DF,EAAmBG,KAAOR,EAAqBO,KAAK,KAAMF,EAAmBG,KAAKD,KAAKF,OClDvFhE,EAAoBoE,QAAKjE,ECGzB,IAAIkE,EAAsBrE,EAAoBW,OAAER,EAAW,CAAC,OAAO,WAAa,OAAOH,EAAoB,MAAQ,IACnHqE,EAAsBrE,EAAoBW,EAAE0D","sources":["webpack:///nextcloud/webpack/runtime/chunk loaded","webpack:///nextcloud/apps/federatedfilesharing/src/components/AdminSettings.vue","webpack:///nextcloud/apps/federatedfilesharing/src/components/AdminSettings.vue?vue&type=script&lang=js&","webpack://nextcloud/./apps/federatedfilesharing/src/components/AdminSettings.vue?3636","webpack://nextcloud/./apps/federatedfilesharing/src/components/AdminSettings.vue?93f1","webpack:///nextcloud/apps/federatedfilesharing/src/main-admin.js","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/global","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/runtime/nonce","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","\n\n\n\t\n\t\t\n\t\t\t{{ t('federatedfilesharing', 'Allow users on this server to send shares to other servers (this option also allows WebDAV access to public shares)') }}\n\t\t\n\n\t\t\n\t\t\t{{ t('federatedfilesharing', 'Allow users on this server to receive shares from other servers') }}\n\t\t\n\n\t\t\n\t\t\t{{ t('federatedfilesharing', 'Allow users on this server to send shares to groups on other servers') }}\n\t\t\n\n\t\t\n\t\t\t{{ t('federatedfilesharing', 'Allow users on this server to receive group shares from other servers') }}\n\t\t\n\n\t\t\n\t\n\n\n\n","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AdminSettings.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AdminSettings.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./AdminSettings.vue?vue&type=template&id=e3db758a&\"\nimport script from \"./AdminSettings.vue?vue&type=script&lang=js&\"\nexport * from \"./AdminSettings.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('NcSettingsSection',{attrs:{\"title\":_vm.t('federatedfilesharing', 'Federated Cloud Sharing'),\"description\":_vm.t('federatedfilesharing', 'Adjust how people can share between servers. This includes shares between users on this server as well if they are using federated sharing.'),\"doc-url\":_vm.sharingFederatedDocUrl}},[_c('NcCheckboxRadioSwitch',{attrs:{\"type\":\"switch\",\"checked\":_vm.outgoingServer2serverShareEnabled},on:{\"update:checked\":[function($event){_vm.outgoingServer2serverShareEnabled=$event},function($event){return _vm.update('outgoing_server2server_share_enabled', _vm.outgoingServer2serverShareEnabled)}]}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('federatedfilesharing', 'Allow users on this server to send shares to other servers (this option also allows WebDAV access to public shares)'))+\"\\n\\t\")]),_vm._v(\" \"),_c('NcCheckboxRadioSwitch',{attrs:{\"type\":\"switch\",\"checked\":_vm.incomingServer2serverShareEnabled},on:{\"update:checked\":[function($event){_vm.incomingServer2serverShareEnabled=$event},function($event){return _vm.update('incoming_server2server_share_enabled', _vm.incomingServer2serverShareEnabled)}]}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('federatedfilesharing', 'Allow users on this server to receive shares from other servers'))+\"\\n\\t\")]),_vm._v(\" \"),(_vm.federatedGroupSharingSupported)?_c('NcCheckboxRadioSwitch',{attrs:{\"type\":\"switch\",\"checked\":_vm.outgoingServer2serverGroupShareEnabled},on:{\"update:checked\":[function($event){_vm.outgoingServer2serverGroupShareEnabled=$event},function($event){return _vm.update('outgoing_server2server_group_share_enabled', _vm.outgoingServer2serverGroupShareEnabled)}]}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('federatedfilesharing', 'Allow users on this server to send shares to groups on other servers'))+\"\\n\\t\")]):_vm._e(),_vm._v(\" \"),(_vm.federatedGroupSharingSupported)?_c('NcCheckboxRadioSwitch',{attrs:{\"type\":\"switch\",\"checked\":_vm.incomingServer2serverGroupShareEnabled},on:{\"update:checked\":[function($event){_vm.incomingServer2serverGroupShareEnabled=$event},function($event){return _vm.update('incoming_server2server_group_share_enabled', _vm.incomingServer2serverGroupShareEnabled)}]}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('federatedfilesharing', 'Allow users on this server to receive group shares from other servers'))+\"\\n\\t\")]):_vm._e(),_vm._v(\" \"),_c('fieldset',[_c('legend',[_vm._v(_vm._s(_vm.t('federatedfilesharing', 'The lookup server is only available for global scale.')))]),_vm._v(\" \"),_c('NcCheckboxRadioSwitch',{attrs:{\"type\":\"switch\",\"checked\":_vm.lookupServerEnabled,\"disabled\":\"\"},on:{\"update:checked\":[function($event){_vm.lookupServerEnabled=$event},function($event){return _vm.update('lookupServerEnabled', _vm.lookupServerEnabled)}]}},[_vm._v(\"\\n\\t\\t\\t\"+_vm._s(_vm.t('federatedfilesharing', 'Search global and public address book for users'))+\"\\n\\t\\t\")]),_vm._v(\" \"),_c('NcCheckboxRadioSwitch',{attrs:{\"type\":\"switch\",\"checked\":_vm.lookupServerUploadEnabled,\"disabled\":\"\"},on:{\"update:checked\":[function($event){_vm.lookupServerUploadEnabled=$event},function($event){return _vm.update('lookupServerUploadEnabled', _vm.lookupServerUploadEnabled)}]}},[_vm._v(\"\\n\\t\\t\\t\"+_vm._s(_vm.t('federatedfilesharing', 'Allow users to publish their data to a global and public address book'))+\"\\n\\t\\t\")])],1)],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * @copyright 2022 Carl Schwan \n *\n * @author Carl Schwan \n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nimport Vue from 'vue'\nimport { getRequestToken } from '@nextcloud/auth'\nimport { translate as t } from '@nextcloud/l10n'\nimport '@nextcloud/dialogs/dist/index.css'\nimport { loadState } from '@nextcloud/initial-state'\n\nimport AdminSettings from './components/AdminSettings'\n\n__webpack_nonce__ = btoa(getRequestToken())\n\nVue.mixin({\n\tmethods: {\n\t\tt,\n\t},\n})\n\nconst internalOnly = loadState('federatedfilesharing', 'internalOnly', false)\n\nif (!internalOnly) {\n\tconst AdminSettingsView = Vue.extend(AdminSettings)\n\tnew AdminSettingsView().$mount('#vue-admin-federated')\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = function(module) {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 7220;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t7220: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunknextcloud\"] = self[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [7874], function() { return __webpack_require__(57808); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","name","components","NcCheckboxRadioSwitch","NcSettingsSection","data","outgoingServer2serverShareEnabled","incomingServer2serverShareEnabled","outgoingServer2serverGroupShareEnabled","incomingServer2serverGroupShareEnabled","federatedGroupSharingSupported","lookupServerEnabled","lookupServerUploadEnabled","internalOnly","sharingFederatedDocUrl","methods","update","confirmPassword","url","appId","key","stringValue","axios","value","status","errorMessage","error","handleResponse","showError","console","_vm","this","_c","_self","attrs","t","on","$event","_v","_s","_e","__webpack_nonce__","btoa","getRequestToken","Vue","loadState","AdminSettings","$mount","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","id","loaded","__webpack_modules__","call","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","keys","every","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","g","globalThis","Function","e","window","obj","prop","prototype","hasOwnProperty","Symbol","toStringTag","nmd","paths","children","b","document","baseURI","self","location","href","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","forEach","bind","push","nc","__webpack_exports__"],"sourceRoot":""}
\ No newline at end of file
diff --git a/lib/private/Collaboration/Collaborators/LookupPlugin.php b/lib/private/Collaboration/Collaborators/LookupPlugin.php
index a9038a0aa35e8..ebf3e5dea0b36 100644
--- a/lib/private/Collaboration/Collaborators/LookupPlugin.php
+++ b/lib/private/Collaboration/Collaborators/LookupPlugin.php
@@ -63,12 +63,14 @@ public function __construct(IConfig $config,
}
public function search($search, $limit, $offset, ISearchResult $searchResult) {
- $isGlobalScaleEnabled = $this->config->getSystemValue('gs.enabled', false);
- $isLookupServerEnabled = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'yes') === 'yes';
+ $isGlobalScaleEnabled = $this->config->getSystemValueBool('gs.enabled', false);
+ $isLookupServerEnabled = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'no') === 'yes';
$hasInternetConnection = $this->config->getSystemValueBool('has_internet_connection', true);
- // if case of Global Scale we always search the lookup server
- if (!$isGlobalScaleEnabled && (!$isLookupServerEnabled || !$hasInternetConnection)) {
+ // If case of Global Scale we always search the lookup server
+ // TODO: Reconsider using the lookup server for non-global scale
+ // if (!$isGlobalScaleEnabled && (!$isLookupServerEnabled || !$hasInternetConnection || $disableLookupServer)) {
+ if (!$isGlobalScaleEnabled) {
return false;
}
diff --git a/tests/lib/Collaboration/Collaborators/LookupPluginTest.php b/tests/lib/Collaboration/Collaborators/LookupPluginTest.php
index 462497c637bf0..819beb6e8e435 100644
--- a/tests/lib/Collaboration/Collaborators/LookupPluginTest.php
+++ b/tests/lib/Collaboration/Collaborators/LookupPluginTest.php
@@ -87,24 +87,20 @@ protected function setUp(): void {
}
public function testSearchNoLookupServerURI() {
- $this->config->expects($this->once())
+ $this->config->expects($this->atMost(1))
->method('getAppValue')
- ->with('files_sharing', 'lookupServerEnabled', 'yes')
+ ->with('files_sharing', 'lookupServerEnabled', 'no')
->willReturn('yes');
$this->config->expects($this->exactly(2))
- ->method('getSystemValue')
- ->withConsecutive(
- ['gs.enabled', false],
- ['lookup_server', 'https://lookup.nextcloud.com'],
- )->willReturnOnConsecutiveCalls(
- false,
- '',
- );
-
- $this->config->expects($this->once())
->method('getSystemValueBool')
- ->with('has_internet_connection', true)
- ->willReturn(true);
+ ->willReturnMap([
+ ['gs.enabled', false, true],
+ ['has_internet_connection', true, true],
+ ]);
+ $this->config->expects($this->once())
+ ->method('getSystemValue')
+ ->with('lookup_server', 'https://lookup.nextcloud.com')
+ ->willReturn('');
$this->clientService->expects($this->never())
->method('newClient');
@@ -118,17 +114,15 @@ public function testSearchNoLookupServerURI() {
public function testSearchNoInternet() {
$this->config->expects($this->once())
->method('getAppValue')
- ->with('files_sharing', 'lookupServerEnabled', 'yes')
+ ->with('files_sharing', 'lookupServerEnabled', 'no')
->willReturn('yes');
- $this->config->expects($this->once())
- ->method('getSystemValue')
- ->with('gs.enabled', false)
- ->willReturn(false);
- $this->config->expects($this->once())
+ $this->config->expects($this->exactly(2))
->method('getSystemValueBool')
- ->with('has_internet_connection', true)
- ->willReturn(false);
+ ->willReturnMap([
+ ['has_internet_connection', true, false],
+ ['gs.enabled', false, true],
+ ]);
$this->clientService->expects($this->never())
->method('newClient');
@@ -154,22 +148,18 @@ public function testSearch(array $searchParams) {
$this->config->expects($this->once())
->method('getAppValue')
- ->with('files_sharing', 'lookupServerEnabled', 'yes')
+ ->with('files_sharing', 'lookupServerEnabled', 'no')
->willReturn('yes');
- $this->config->expects($this->exactly(2))
- ->method('getSystemValue')
- ->withConsecutive(
- ['gs.enabled', false],
- ['lookup_server', 'https://lookup.nextcloud.com'],
- )->willReturnOnConsecutiveCalls(
- false,
- $searchParams['server'],
- );
-
$this->config->expects($this->once())
+ ->method('getSystemValue')
+ ->with('lookup_server', 'https://lookup.nextcloud.com')
+ ->willReturn($searchParams['server']);
+ $this->config->expects($this->exactly(2))
->method('getSystemValueBool')
- ->with('has_internet_connection', true)
- ->willReturn(true);
+ ->willReturnMap([
+ ['gs.enabled', false, true],
+ ['has_internet_connection', true, true],
+ ]);
$response = $this->createMock(IResponse::class);
$response->expects($this->once())
@@ -214,26 +204,24 @@ public function testSearchEnableDisableLookupServer(array $searchParams, $GSEnab
$this->config->expects($this->once())
->method('getAppValue')
- ->with('files_sharing', 'lookupServerEnabled', 'yes')
+ ->with('files_sharing', 'lookupServerEnabled', 'no')
->willReturn($LookupEnabled ? 'yes' : 'no');
- if ($GSEnabled || $LookupEnabled) {
+
+ $this->config->expects($this->exactly(2))
+ ->method('getSystemValueBool')
+ ->willReturnMap([
+ ['has_internet_connection', true, true],
+ ['gs.enabled', false, $GSEnabled],
+ ]);
+ if ($GSEnabled) {
$searchResult->expects($this->once())
->method('addResultSet')
->with($type, $searchParams['expectedResult'], []);
$this->config->expects($this->once())
- ->method('getSystemValueBool')
- ->with('has_internet_connection', true)
- ->willReturn(true);
- $this->config->expects($this->exactly(2))
->method('getSystemValue')
- ->withConsecutive(
- ['gs.enabled', false],
- ['lookup_server', 'https://lookup.nextcloud.com'],
- )->willReturnOnConsecutiveCalls(
- $GSEnabled,
- $searchParams['server'],
- );
+ ->with('lookup_server', 'https://lookup.nextcloud.com')
+ ->willReturn($searchParams['server']);
$response = $this->createMock(IResponse::class);
$response->expects($this->once())
@@ -254,10 +242,6 @@ public function testSearchEnableDisableLookupServer(array $searchParams, $GSEnab
->willReturn($client);
} else {
$searchResult->expects($this->never())->method('addResultSet');
- $this->config->expects($this->once())
- ->method('getSystemValue')
- ->with('gs.enabled', false)
- ->willReturn($GSEnabled);
}
$moreResults = $this->plugin->search(
$searchParams['search'],
@@ -269,12 +253,13 @@ public function testSearchEnableDisableLookupServer(array $searchParams, $GSEnab
$this->assertFalse($moreResults);
}
-
- public function testSearchLookupServerDisabled() {
- $this->config->expects($this->once())
- ->method('getAppValue')
- ->with('files_sharing', 'lookupServerEnabled', 'yes')
- ->willReturn('no');
+ public function testSearchGSDisabled(): void {
+ $this->config->expects($this->atLeastOnce())
+ ->method('getSystemValueBool')
+ ->willReturnMap([
+ ['has_internet_connection', true, true],
+ ['gs.enabled', false, false],
+ ]);
/** @var ISearchResult|MockObject $searchResult */
$searchResult = $this->createMock(ISearchResult::class);
@@ -393,7 +378,6 @@ public function dataSearchEnableDisableLookupServer() {
'label' => $fedIDs[0],
'value' => [
'shareType' => IShare::TYPE_REMOTE,
- 'globalScale' => false,
'shareWith' => $fedIDs[0]
],
'extra' => ['federationId' => $fedIDs[0]],
@@ -402,7 +386,6 @@ public function dataSearchEnableDisableLookupServer() {
'label' => $fedIDs[1],
'value' => [
'shareType' => IShare::TYPE_REMOTE,
- 'globalScale' => false,
'shareWith' => $fedIDs[1]
],
'extra' => ['federationId' => $fedIDs[1]],
@@ -411,7 +394,6 @@ public function dataSearchEnableDisableLookupServer() {
'label' => $fedIDs[2],
'value' => [
'shareType' => IShare::TYPE_REMOTE,
- 'globalScale' => false,
'shareWith' => $fedIDs[2]
],
'extra' => ['federationId' => $fedIDs[2]],
@@ -486,7 +468,7 @@ public function searchDataProvider() {
'label' => $fedIDs[0],
'value' => [
'shareType' => IShare::TYPE_REMOTE,
- 'globalScale' => false,
+ 'globalScale' => true,
'shareWith' => $fedIDs[0]
],
'extra' => ['federationId' => $fedIDs[0]],
@@ -495,7 +477,7 @@ public function searchDataProvider() {
'label' => $fedIDs[1],
'value' => [
'shareType' => IShare::TYPE_REMOTE,
- 'globalScale' => false,
+ 'globalScale' => true,
'shareWith' => $fedIDs[1]
],
'extra' => ['federationId' => $fedIDs[1]],
@@ -504,7 +486,7 @@ public function searchDataProvider() {
'label' => $fedIDs[2],
'value' => [
'shareType' => IShare::TYPE_REMOTE,
- 'globalScale' => false,
+ 'globalScale' => true,
'shareWith' => $fedIDs[2]
],
'extra' => ['federationId' => $fedIDs[2]],