diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php index 4d0070130e399..437767a23daf5 100644 --- a/apps/settings/lib/Controller/CheckSetupController.php +++ b/apps/settings/lib/Controller/CheckSetupController.php @@ -202,16 +202,6 @@ private function isTemporaryDirectoryWritable(): bool { return false; } - protected function areWebauthnExtensionsEnabled(): bool { - if (!extension_loaded('bcmath')) { - return false; - } - if (!extension_loaded('gmp')) { - return false; - } - return true; - } - protected function isMysqlUsedWithoutUTF8MB4(): bool { return ($this->config->getSystemValue('dbtype', 'sqlite') === 'mysql') && ($this->config->getSystemValue('mysql.utf8mb4', false) === false); } @@ -261,7 +251,6 @@ public function check() { [ 'isFairUseOfFreePushService' => $this->isFairUseOfFreePushService(), 'reverseProxyDocs' => $this->urlGenerator->linkToDocs('admin-reverse-proxy'), - 'areWebauthnExtensionsEnabled' => $this->areWebauthnExtensionsEnabled(), 'isMysqlUsedWithoutUTF8MB4' => $this->isMysqlUsedWithoutUTF8MB4(), 'isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed' => $this->isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed(), 'reverseProxyGeneratedURL' => $this->urlGenerator->getAbsoluteURL('index.php'), diff --git a/apps/settings/lib/SetupChecks/PhpModules.php b/apps/settings/lib/SetupChecks/PhpModules.php index 03235ff6380fc..55133120f5d94 100644 --- a/apps/settings/lib/SetupChecks/PhpModules.php +++ b/apps/settings/lib/SetupChecks/PhpModules.php @@ -70,6 +70,18 @@ public function getCategory(): string { return 'php'; } + protected function getRecommendedModuleDescription(string $module): string { + return match($module) { + 'bz2' => $this->l10n->t('required for extraction of apps compressed as bz2'), + 'intl' => $this->l10n->t('increases language translation performance and fixes sorting of non-ASCII characters'), + 'sodium' => $this->l10n->t('for Argon2 for password hashing'), + 'bcmath' => $this->l10n->t('for WebAuthn passwordless login'), + 'gmp' => $this->l10n->t('for WebAuthn passwordless login, and SFTP storage'), + 'exif' => $this->l10n->t('for image rotation in pictures app'), + default => '', + }; + } + public function run(): SetupResult { $missingRecommendedModules = $this->getMissingModules(self::RECOMMENDED_MODULES); $missingRequiredModules = $this->getMissingModules(self::REQUIRED_MODULES); @@ -79,8 +91,15 @@ public function run(): SetupResult { $this->urlGenerator->linkToDocs('admin-php-modules') ); } elseif (!empty($missingRecommendedModules)) { + $moduleList = implode( + "\n", + array_map( + fn (string $module) => '- '.$module.' '.$this->getRecommendedModuleDescription($module), + $missingRecommendedModules + ) + ); return SetupResult::info( - $this->l10n->t('This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them: %s.', implode(', ', $missingRecommendedModules)), + $this->l10n->t("This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them:\n%s", $moduleList), $this->urlGenerator->linkToDocs('admin-php-modules') ); } else { diff --git a/apps/settings/tests/Controller/CheckSetupControllerTest.php b/apps/settings/tests/Controller/CheckSetupControllerTest.php index f135e075279cd..bad15a721919f 100644 --- a/apps/settings/tests/Controller/CheckSetupControllerTest.php +++ b/apps/settings/tests/Controller/CheckSetupControllerTest.php @@ -118,7 +118,6 @@ protected function setUp(): void { 'getCurlVersion', 'isPhpOutdated', 'isPHPMailerUsed', - 'areWebauthnExtensionsEnabled', 'isMysqlUsedWithoutUTF8MB4', 'isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed', ])->getMock(); @@ -143,11 +142,6 @@ public function testCheck() { $this->request->expects($this->never()) ->method('getHeader'); - $this->checkSetupController - ->expects($this->once()) - ->method('areWebauthnExtensionsEnabled') - ->willReturn(false); - $this->checkSetupController ->expects($this->once()) ->method('isMysqlUsedWithoutUTF8MB4') @@ -192,7 +186,6 @@ public function testCheck() { $expected = new DataResponse( [ 'reverseProxyDocs' => 'reverse-proxy-doc-link', - 'areWebauthnExtensionsEnabled' => false, 'isMysqlUsedWithoutUTF8MB4' => false, 'isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed' => true, 'reverseProxyGeneratedURL' => 'https://server/index.php', diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index 678cb02bfa271..0be5ceafd36ea 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -188,15 +188,6 @@ type: OC.SetupChecks.MESSAGE_TYPE_ERROR }); } - if (!data.areWebauthnExtensionsEnabled) { - messages.push({ - msg: t( - 'core', - 'The PHP modules "gmp" and/or "bcmath" are not enabled. If you use WebAuthn passwordless authentication, these modules are required.' - ), - type: OC.SetupChecks.MESSAGE_TYPE_INFO - }) - } if (data.isMysqlUsedWithoutUTF8MB4) { messages.push({ diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js index 857156f143720..68325123efbd7 100644 --- a/core/js/tests/specs/setupchecksSpec.js +++ b/core/js/tests/specs/setupchecksSpec.js @@ -224,7 +224,6 @@ describe('OC.SetupChecks tests', function() { }, JSON.stringify({ isFairUseOfFreePushService: true, - areWebauthnExtensionsEnabled: true, isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', @@ -262,7 +261,6 @@ describe('OC.SetupChecks tests', function() { }, JSON.stringify({ isFairUseOfFreePushService: true, - areWebauthnExtensionsEnabled: true, isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', @@ -300,7 +298,6 @@ describe('OC.SetupChecks tests', function() { }, JSON.stringify({ isFairUseOfFreePushService: true, - areWebauthnExtensionsEnabled: true, isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', @@ -339,7 +336,6 @@ describe('OC.SetupChecks tests', function() { JSON.stringify({ isFairUseOfFreePushService: true, reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', - areWebauthnExtensionsEnabled: true, isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', @@ -407,7 +403,6 @@ describe('OC.SetupChecks tests', function() { }, JSON.stringify({ isFairUseOfFreePushService: true, - areWebauthnExtensionsEnabled: true, isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', @@ -450,7 +445,6 @@ describe('OC.SetupChecks tests', function() { }, JSON.stringify({ isFairUseOfFreePushService: true, - areWebauthnExtensionsEnabled: true, isMysqlUsedWithoutUTF8MB4: true, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', @@ -490,7 +484,6 @@ describe('OC.SetupChecks tests', function() { }, JSON.stringify({ isFairUseOfFreePushService: true, - areWebauthnExtensionsEnabled: true, isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', @@ -527,7 +520,6 @@ describe('OC.SetupChecks tests', function() { }, JSON.stringify({ isFairUseOfFreePushService: true, - areWebauthnExtensionsEnabled: true, isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', @@ -561,7 +553,6 @@ describe('OC.SetupChecks tests', function() { }, JSON.stringify({ isFairUseOfFreePushService: true, - areWebauthnExtensionsEnabled: true, isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: false, reverseProxyGeneratedURL: 'https://server', @@ -587,42 +578,6 @@ describe('OC.SetupChecks tests', function() { }); }); - it('should return an error if gmp or bcmath are not enabled', function(done) { - var async = OC.SetupChecks.checkSetup(); - - suite.server.requests[0].respond( - 200, - { - 'Content-Type': 'application/json', - }, - JSON.stringify({ - isFairUseOfFreePushService: true, - areWebauthnExtensionsEnabled: false, - isMysqlUsedWithoutUTF8MB4: false, - isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, - reverseProxyGeneratedURL: 'https://server', - temporaryDirectoryWritable: true, - generic: { - network: { - "Internet connectivity": { - severity: "success", - description: null, - linkToDoc: null - } - }, - }, - }) - ); - - async.done(function( data, s, x ){ - expect(data).toEqual([{ - msg: 'The PHP modules "gmp" and/or "bcmath" are not enabled. If you use WebAuthn passwordless authentication, these modules are required.', - type: OC.SetupChecks.MESSAGE_TYPE_INFO - }]); - done(); - }); - }); - it('should return an info if there is no default phone region', function(done) { var async = OC.SetupChecks.checkSetup(); @@ -633,7 +588,6 @@ describe('OC.SetupChecks tests', function() { }, JSON.stringify({ isFairUseOfFreePushService: true, - areWebauthnExtensionsEnabled: true, isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', @@ -676,7 +630,6 @@ describe('OC.SetupChecks tests', function() { }, JSON.stringify({ isFairUseOfFreePushService: true, - areWebauthnExtensionsEnabled: true, isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server',