diff --git a/apps/settings/composer/composer/autoload_classmap.php b/apps/settings/composer/composer/autoload_classmap.php index 77bcc65036a45..f4d29d724f7ee 100644 --- a/apps/settings/composer/composer/autoload_classmap.php +++ b/apps/settings/composer/composer/autoload_classmap.php @@ -75,14 +75,22 @@ 'OCA\\Settings\\Settings\\Personal\\ServerDevNotice' => $baseDir . '/../lib/Settings/Personal/ServerDevNotice.php', 'OCA\\Settings\\SetupChecks\\CheckUserCertificates' => $baseDir . '/../lib/SetupChecks/CheckUserCertificates.php', 'OCA\\Settings\\SetupChecks\\DefaultPhoneRegionSet' => $baseDir . '/../lib/SetupChecks/DefaultPhoneRegionSet.php', + 'OCA\\Settings\\SetupChecks\\EmailTestSuccessful' => $baseDir . '/../lib/SetupChecks/EmailTestSuccessful.php', + 'OCA\\Settings\\SetupChecks\\FileLocking' => $baseDir . '/../lib/SetupChecks/FileLocking.php', 'OCA\\Settings\\SetupChecks\\InternetConnectivity' => $baseDir . '/../lib/SetupChecks/InternetConnectivity.php', 'OCA\\Settings\\SetupChecks\\LegacySSEKeyFormat' => $baseDir . '/../lib/SetupChecks/LegacySSEKeyFormat.php', + 'OCA\\Settings\\SetupChecks\\MemcacheConfigured' => $baseDir . '/../lib/SetupChecks/MemcacheConfigured.php', 'OCA\\Settings\\SetupChecks\\PhpDefaultCharset' => $baseDir . '/../lib/SetupChecks/PhpDefaultCharset.php', + 'OCA\\Settings\\SetupChecks\\PhpFreetypeSupport' => $baseDir . '/../lib/SetupChecks/PhpFreetypeSupport.php', + 'OCA\\Settings\\SetupChecks\\PhpGetEnv' => $baseDir . '/../lib/SetupChecks/PhpGetEnv.php', 'OCA\\Settings\\SetupChecks\\PhpModules' => $baseDir . '/../lib/SetupChecks/PhpModules.php', 'OCA\\Settings\\SetupChecks\\PhpOutdated' => $baseDir . '/../lib/SetupChecks/PhpOutdated.php', 'OCA\\Settings\\SetupChecks\\PhpOutputBuffering' => $baseDir . '/../lib/SetupChecks/PhpOutputBuffering.php', + 'OCA\\Settings\\SetupChecks\\RandomnessSecure' => $baseDir . '/../lib/SetupChecks/RandomnessSecure.php', 'OCA\\Settings\\SetupChecks\\ReadOnlyConfig' => $baseDir . '/../lib/SetupChecks/ReadOnlyConfig.php', 'OCA\\Settings\\SetupChecks\\SupportedDatabase' => $baseDir . '/../lib/SetupChecks/SupportedDatabase.php', + 'OCA\\Settings\\SetupChecks\\SystemIs64bit' => $baseDir . '/../lib/SetupChecks/SystemIs64bit.php', + 'OCA\\Settings\\SetupChecks\\TransactionIsolation' => $baseDir . '/../lib/SetupChecks/TransactionIsolation.php', 'OCA\\Settings\\UserMigration\\AccountMigrator' => $baseDir . '/../lib/UserMigration/AccountMigrator.php', 'OCA\\Settings\\UserMigration\\AccountMigratorException' => $baseDir . '/../lib/UserMigration/AccountMigratorException.php', 'OCA\\Settings\\WellKnown\\ChangePasswordHandler' => $baseDir . '/../lib/WellKnown/ChangePasswordHandler.php', diff --git a/apps/settings/composer/composer/autoload_static.php b/apps/settings/composer/composer/autoload_static.php index ea3e43da4bb33..f8595eb7c684d 100644 --- a/apps/settings/composer/composer/autoload_static.php +++ b/apps/settings/composer/composer/autoload_static.php @@ -90,14 +90,22 @@ class ComposerStaticInitSettings 'OCA\\Settings\\Settings\\Personal\\ServerDevNotice' => __DIR__ . '/..' . '/../lib/Settings/Personal/ServerDevNotice.php', 'OCA\\Settings\\SetupChecks\\CheckUserCertificates' => __DIR__ . '/..' . '/../lib/SetupChecks/CheckUserCertificates.php', 'OCA\\Settings\\SetupChecks\\DefaultPhoneRegionSet' => __DIR__ . '/..' . '/../lib/SetupChecks/DefaultPhoneRegionSet.php', + 'OCA\\Settings\\SetupChecks\\EmailTestSuccessful' => __DIR__ . '/..' . '/../lib/SetupChecks/EmailTestSuccessful.php', + 'OCA\\Settings\\SetupChecks\\FileLocking' => __DIR__ . '/..' . '/../lib/SetupChecks/FileLocking.php', 'OCA\\Settings\\SetupChecks\\InternetConnectivity' => __DIR__ . '/..' . '/../lib/SetupChecks/InternetConnectivity.php', 'OCA\\Settings\\SetupChecks\\LegacySSEKeyFormat' => __DIR__ . '/..' . '/../lib/SetupChecks/LegacySSEKeyFormat.php', + 'OCA\\Settings\\SetupChecks\\MemcacheConfigured' => __DIR__ . '/..' . '/../lib/SetupChecks/MemcacheConfigured.php', 'OCA\\Settings\\SetupChecks\\PhpDefaultCharset' => __DIR__ . '/..' . '/../lib/SetupChecks/PhpDefaultCharset.php', + 'OCA\\Settings\\SetupChecks\\PhpFreetypeSupport' => __DIR__ . '/..' . '/../lib/SetupChecks/PhpFreetypeSupport.php', + 'OCA\\Settings\\SetupChecks\\PhpGetEnv' => __DIR__ . '/..' . '/../lib/SetupChecks/PhpGetEnv.php', 'OCA\\Settings\\SetupChecks\\PhpModules' => __DIR__ . '/..' . '/../lib/SetupChecks/PhpModules.php', 'OCA\\Settings\\SetupChecks\\PhpOutdated' => __DIR__ . '/..' . '/../lib/SetupChecks/PhpOutdated.php', 'OCA\\Settings\\SetupChecks\\PhpOutputBuffering' => __DIR__ . '/..' . '/../lib/SetupChecks/PhpOutputBuffering.php', + 'OCA\\Settings\\SetupChecks\\RandomnessSecure' => __DIR__ . '/..' . '/../lib/SetupChecks/RandomnessSecure.php', 'OCA\\Settings\\SetupChecks\\ReadOnlyConfig' => __DIR__ . '/..' . '/../lib/SetupChecks/ReadOnlyConfig.php', 'OCA\\Settings\\SetupChecks\\SupportedDatabase' => __DIR__ . '/..' . '/../lib/SetupChecks/SupportedDatabase.php', + 'OCA\\Settings\\SetupChecks\\SystemIs64bit' => __DIR__ . '/..' . '/../lib/SetupChecks/SystemIs64bit.php', + 'OCA\\Settings\\SetupChecks\\TransactionIsolation' => __DIR__ . '/..' . '/../lib/SetupChecks/TransactionIsolation.php', 'OCA\\Settings\\UserMigration\\AccountMigrator' => __DIR__ . '/..' . '/../lib/UserMigration/AccountMigrator.php', 'OCA\\Settings\\UserMigration\\AccountMigratorException' => __DIR__ . '/..' . '/../lib/UserMigration/AccountMigratorException.php', 'OCA\\Settings\\WellKnown\\ChangePasswordHandler' => __DIR__ . '/..' . '/../lib/WellKnown/ChangePasswordHandler.php', diff --git a/apps/settings/lib/AppInfo/Application.php b/apps/settings/lib/AppInfo/Application.php index a8660a033b803..d2539864708e8 100644 --- a/apps/settings/lib/AppInfo/Application.php +++ b/apps/settings/lib/AppInfo/Application.php @@ -50,14 +50,22 @@ use OCA\Settings\Search\UserSearch; use OCA\Settings\SetupChecks\CheckUserCertificates; use OCA\Settings\SetupChecks\DefaultPhoneRegionSet; +use OCA\Settings\SetupChecks\EmailTestSuccessful; +use OCA\Settings\SetupChecks\FileLocking; use OCA\Settings\SetupChecks\InternetConnectivity; use OCA\Settings\SetupChecks\LegacySSEKeyFormat; +use OCA\Settings\SetupChecks\MemcacheConfigured; use OCA\Settings\SetupChecks\PhpDefaultCharset; +use OCA\Settings\SetupChecks\PhpFreetypeSupport; +use OCA\Settings\SetupChecks\PhpGetEnv; use OCA\Settings\SetupChecks\PhpModules; use OCA\Settings\SetupChecks\PhpOutdated; use OCA\Settings\SetupChecks\PhpOutputBuffering; +use OCA\Settings\SetupChecks\RandomnessSecure; use OCA\Settings\SetupChecks\ReadOnlyConfig; use OCA\Settings\SetupChecks\SupportedDatabase; +use OCA\Settings\SetupChecks\SystemIs64bit; +use OCA\Settings\SetupChecks\TransactionIsolation; use OCA\Settings\UserMigration\AccountMigrator; use OCA\Settings\WellKnown\ChangePasswordHandler; use OCA\Settings\WellKnown\SecurityTxtHandler; @@ -149,14 +157,22 @@ public function register(IRegistrationContext $context): void { }); $context->registerSetupCheck(CheckUserCertificates::class); $context->registerSetupCheck(DefaultPhoneRegionSet::class); + $context->registerSetupCheck(EmailTestSuccessful::class); + $context->registerSetupCheck(FileLocking::class); $context->registerSetupCheck(InternetConnectivity::class); $context->registerSetupCheck(LegacySSEKeyFormat::class); + $context->registerSetupCheck(MemcacheConfigured::class); $context->registerSetupCheck(PhpDefaultCharset::class); $context->registerSetupCheck(PhpModules::class); + $context->registerSetupCheck(PhpFreetypeSupport::class); + $context->registerSetupCheck(PhpGetEnv::class); $context->registerSetupCheck(PhpOutdated::class); $context->registerSetupCheck(PhpOutputBuffering::class); + $context->registerSetupCheck(RandomnessSecure::class); $context->registerSetupCheck(ReadOnlyConfig::class); $context->registerSetupCheck(SupportedDatabase::class); + $context->registerSetupCheck(SystemIs64bit::class); + $context->registerSetupCheck(TransactionIsolation::class); $context->registerUserMigrator(AccountMigrator::class); } diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php index 9d59051e2a838..04efb6b47a7cb 100644 --- a/apps/settings/lib/Controller/CheckSetupController.php +++ b/apps/settings/lib/Controller/CheckSetupController.php @@ -47,8 +47,6 @@ use bantu\IniGetWrapper\IniGetWrapper; use DirectoryIterator; -use Doctrine\DBAL\Exception; -use Doctrine\DBAL\TransactionIsolationLevel; use GuzzleHttp\Exception\ClientException; use OC; use OC\AppFramework\Http; @@ -58,8 +56,6 @@ use OC\DB\MissingPrimaryKeyInformation; use OC\DB\SchemaWrapper; use OC\IntegrityCheck\Checker; -use OC\Lock\NoopLockingProvider; -use OC\Lock\DBLockingProvider; use OC\MemoryInfo; use OCP\App\IAppManager; use OCP\AppFramework\Controller; @@ -84,7 +80,6 @@ use OCP\Lock\ILockingProvider; use OCP\Notification\IManager; use OCP\Security\Bruteforce\IThrottler; -use OCP\Security\ISecureRandom; use OCP\SetupCheck\ISetupCheckManager; use Psr\Log\LoggerInterface; @@ -112,8 +107,6 @@ class CheckSetupController extends Controller { private $dateTimeFormatter; /** @var MemoryInfo */ private $memoryInfo; - /** @var ISecureRandom */ - private $secureRandom; /** @var IniGetWrapper */ private $iniGetWrapper; /** @var IDBConnection */ @@ -131,27 +124,26 @@ class CheckSetupController extends Controller { private ISetupCheckManager $setupCheckManager; public function __construct($AppName, - IRequest $request, - IConfig $config, - IClientService $clientService, - IURLGenerator $urlGenerator, - IL10N $l10n, - Checker $checker, - LoggerInterface $logger, - IEventDispatcher $dispatcher, - Connection $db, - ILockingProvider $lockingProvider, - IDateTimeFormatter $dateTimeFormatter, - MemoryInfo $memoryInfo, - ISecureRandom $secureRandom, - IniGetWrapper $iniGetWrapper, - IDBConnection $connection, - IThrottler $throttler, - ITempManager $tempManager, - IManager $manager, - IAppManager $appManager, - IServerContainer $serverContainer, - ISetupCheckManager $setupCheckManager, + IRequest $request, + IConfig $config, + IClientService $clientService, + IURLGenerator $urlGenerator, + IL10N $l10n, + Checker $checker, + LoggerInterface $logger, + IEventDispatcher $dispatcher, + Connection $db, + ILockingProvider $lockingProvider, + IDateTimeFormatter $dateTimeFormatter, + MemoryInfo $memoryInfo, + IniGetWrapper $iniGetWrapper, + IDBConnection $connection, + IThrottler $throttler, + ITempManager $tempManager, + IManager $manager, + IAppManager $appManager, + IServerContainer $serverContainer, + ISetupCheckManager $setupCheckManager, ) { parent::__construct($AppName, $request); $this->config = $config; @@ -166,7 +158,6 @@ public function __construct($AppName, $this->lockingProvider = $lockingProvider; $this->dateTimeFormatter = $dateTimeFormatter; $this->memoryInfo = $memoryInfo; - $this->secureRandom = $secureRandom; $this->iniGetWrapper = $iniGetWrapper; $this->connection = $connection; $this->tempManager = $tempManager; @@ -198,28 +189,6 @@ private function isFairUseOfFreePushService(): bool { return $this->manager->isFairUseOfFreePushService(); } - /** - * Checks whether a local memcache is installed or not - * @return bool - */ - private function isMemcacheConfigured() { - return $this->config->getSystemValue('memcache.local', null) !== null; - } - - /** - * Whether PHP can generate "secure" pseudorandom integers - * - * @return bool - */ - private function isRandomnessSecure() { - try { - $this->secureRandom->generate(1); - } catch (\Exception $ex) { - return false; - } - return true; - } - /** * Public for the sake of unit-testing * @@ -485,14 +454,6 @@ protected function getOpcacheSetupRecommendations(): array { return $recommendations; } - /** - * Check if the required FreeType functions are present - * @return bool - */ - protected function hasFreeTypeSupport() { - return function_exists('imagettfbbox') && function_exists('imagettftext'); - } - protected function hasMissingIndexes(): array { $indexInfo = new MissingIndexInformation(); @@ -564,50 +525,6 @@ protected function isSqliteUsed() { return str_contains($this->config->getSystemValue('dbtype'), 'sqlite'); } - protected function isReadOnlyConfig(): bool { - return \OC_Helper::isReadOnlyConfigEnabled(); - } - - protected function wasEmailTestSuccessful(): bool { - // Handle the case that the configuration was set before the check was introduced or it was only set via command line and not from the UI - if ($this->config->getAppValue('core', 'emailTestSuccessful', '') === '' && $this->config->getSystemValue('mail_domain', '') === '') { - return false; - } - - // The mail test was unsuccessful or the config was changed using the UI without verifying with a testmail, hence return false - if ($this->config->getAppValue('core', 'emailTestSuccessful', '') === '0') { - return false; - } - - return true; - } - - protected function hasValidTransactionIsolationLevel(): bool { - try { - if ($this->connection->getDatabaseProvider() === IDBConnection::PLATFORM_SQLITE) { - return true; - } - - return $this->db->getTransactionIsolation() === TransactionIsolationLevel::READ_COMMITTED; - } catch (Exception $e) { - // ignore - } - - return true; - } - - protected function hasFileinfoInstalled(): bool { - return \OC_Util::fileInfoLoaded(); - } - - protected function hasWorkingFileLocking(): bool { - return !($this->lockingProvider instanceof NoopLockingProvider); - } - - protected function hasDBFileLocking(): bool { - return ($this->lockingProvider instanceof DBLockingProvider); - } - protected function getSuggestedOverwriteCliURL(): string { $currentOverwriteCliUrl = $this->config->getSystemValue('overwrite.cli.url', ''); $suggestedOverwriteCliUrl = $this->request->getServerProtocol() . '://' . $this->request->getInsecureServerHost() . \OC::$WEBROOT; @@ -715,14 +632,6 @@ protected function areWebauthnExtensionsEnabled(): bool { return true; } - protected function is64bit(): bool { - if (PHP_INT_SIZE < 8) { - return false; - } else { - return true; - } - } - protected function isMysqlUsedWithoutUTF8MB4(): bool { return ($this->config->getSystemValue('dbtype', 'sqlite') === 'mysql') && ($this->config->getSystemValue('mysql.utf8mb4', false) === false); } @@ -817,23 +726,12 @@ protected function imageMagickLacksSVGSupport(): bool { public function check() { return new DataResponse( [ - 'isGetenvServerWorking' => !empty(getenv('PATH')), - 'isReadOnlyConfig' => $this->isReadOnlyConfig(), - 'hasValidTransactionIsolationLevel' => $this->hasValidTransactionIsolationLevel(), - 'wasEmailTestSuccessful' => $this->wasEmailTestSuccessful(), - 'hasFileinfoInstalled' => $this->hasFileinfoInstalled(), - 'hasWorkingFileLocking' => $this->hasWorkingFileLocking(), - 'hasDBFileLocking' => $this->hasDBFileLocking(), 'suggestedOverwriteCliURL' => $this->getSuggestedOverwriteCliURL(), 'cronInfo' => $this->getLastCronInfo(), 'cronErrors' => $this->getCronErrors(), 'isFairUseOfFreePushService' => $this->isFairUseOfFreePushService(), 'isBruteforceThrottled' => $this->throttler->getAttempts($this->request->getRemoteAddress()) !== 0, 'bruteforceRemoteAddress' => $this->request->getRemoteAddress(), - 'isMemcacheConfigured' => $this->isMemcacheConfigured(), - 'memcacheDocs' => $this->urlGenerator->linkToDocs('admin-performance'), - 'isRandomnessSecure' => $this->isRandomnessSecure(), - 'securityDocs' => $this->urlGenerator->linkToDocs('admin-security'), 'isUsedTlsLibOutdated' => $this->isUsedTlsLibOutdated(), 'forwardedForHeadersWorking' => $this->forwardedForHeadersWorking(), 'reverseProxyDocs' => $this->urlGenerator->linkToDocs('admin-reverse-proxy'), @@ -842,7 +740,6 @@ public function check() { 'codeIntegrityCheckerDocumentation' => $this->urlGenerator->linkToDocs('admin-code-integrity'), 'OpcacheSetupRecommendations' => $this->getOpcacheSetupRecommendations(), 'isSettimelimitAvailable' => $this->isSettimelimitAvailable(), - 'hasFreeTypeSupport' => $this->hasFreeTypeSupport(), 'missingPrimaryKeys' => $this->hasMissingPrimaryKeys(), 'missingIndexes' => $this->hasMissingIndexes(), 'missingColumns' => $this->hasMissingColumns(), @@ -852,7 +749,6 @@ public function check() { 'appDirsWithDifferentOwner' => $this->getAppDirsWithDifferentOwner(), 'isImagickEnabled' => $this->isImagickEnabled(), 'areWebauthnExtensionsEnabled' => $this->areWebauthnExtensionsEnabled(), - 'is64bit' => $this->is64bit(), 'pendingBigIntConversionColumns' => $this->hasBigIntConversionPendingColumns(), 'isMysqlUsedWithoutUTF8MB4' => $this->isMysqlUsedWithoutUTF8MB4(), 'isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed' => $this->isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed(), diff --git a/apps/settings/lib/SetupChecks/EmailTestSuccessful.php b/apps/settings/lib/SetupChecks/EmailTestSuccessful.php new file mode 100644 index 0000000000000..cced7866fc73d --- /dev/null +++ b/apps/settings/lib/SetupChecks/EmailTestSuccessful.php @@ -0,0 +1,76 @@ + + * + * @author Côme Chilliet + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Settings\SetupChecks; + +use OCP\IConfig; +use OCP\IL10N; +use OCP\IURLGenerator; +use OCP\SetupCheck\ISetupCheck; +use OCP\SetupCheck\SetupResult; + +class EmailTestSuccessful implements ISetupCheck { + public function __construct( + private IL10N $l10n, + private IConfig $config, + private IURLGenerator $urlGenerator, + ) { + } + + public function getName(): string { + return $this->l10n->t('Email test'); + } + + public function getCategory(): string { + return 'config'; + } + + protected function wasEmailTestSuccessful(): bool { + // Handle the case that the configuration was set before the check was introduced or it was only set via command line and not from the UI + if ($this->config->getAppValue('core', 'emailTestSuccessful', '') === '' && $this->config->getSystemValue('mail_domain', '') === '') { + return false; + } + + // The mail test was unsuccessful or the config was changed using the UI without verifying with a testmail, hence return false + if ($this->config->getAppValue('core', 'emailTestSuccessful', '') === '0') { + return false; + } + + return true; + } + + public function run(): SetupResult { + if ($this->wasEmailTestSuccessful()) { + return SetupResult::success($this->l10n->t('Email test was successfully sent')); + } else { + // If setup check could link to settings pages, this one should link to OC.generateUrl('/settings/admin') + return SetupResult::info( + $this->l10n->t('You have not set or verified your email server configuration, yet. Please head over to the "Basic settings" in order to set them. Afterwards, use the "Send email" button below the form to verify your settings.'), + $this->urlGenerator->linkToDocs('admin-email') + ); + } + } +} diff --git a/apps/settings/lib/SetupChecks/FileLocking.php b/apps/settings/lib/SetupChecks/FileLocking.php new file mode 100644 index 0000000000000..8012751ab9ffd --- /dev/null +++ b/apps/settings/lib/SetupChecks/FileLocking.php @@ -0,0 +1,78 @@ + + * + * @author Côme Chilliet + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Settings\SetupChecks; + +use OC\Lock\DBLockingProvider; +use OC\Lock\NoopLockingProvider; +use OCP\IL10N; +use OCP\IURLGenerator; +use OCP\Lock\ILockingProvider; +use OCP\SetupCheck\ISetupCheck; +use OCP\SetupCheck\SetupResult; + +class FileLocking implements ISetupCheck { + public function __construct( + private IL10N $l10n, + private IURLGenerator $urlGenerator, + private ILockingProvider $lockingProvider, + ) { + } + + public function getName(): string { + return $this->l10n->t('File locking'); + } + + public function getCategory(): string { + return 'system'; + } + + protected function hasWorkingFileLocking(): bool { + return !($this->lockingProvider instanceof NoopLockingProvider); + } + + protected function hasDBFileLocking(): bool { + return ($this->lockingProvider instanceof DBLockingProvider); + } + + public function run(): SetupResult { + if (!$this->hasWorkingFileLocking()) { + return SetupResult::warning( + $this->l10n->t('Transactional file locking is disabled, this might lead to issues with race conditions. Enable "filelocking.enabled" in config.php to avoid these problems.'), + $this->urlGenerator->linkToDocs('admin-transactional-locking') + ); + } + + if ($this->hasDBFileLocking()) { + return SetupResult::info( + $this->l10n->t('The database is used for transactional file locking. To enhance performance, please configure memcache, if available.'), + $this->urlGenerator->linkToDocs('admin-transactional-locking') + ); + } + + return SetupResult::success(); + } +} diff --git a/apps/settings/lib/SetupChecks/MemcacheConfigured.php b/apps/settings/lib/SetupChecks/MemcacheConfigured.php new file mode 100644 index 0000000000000..2cde18a25df1c --- /dev/null +++ b/apps/settings/lib/SetupChecks/MemcacheConfigured.php @@ -0,0 +1,60 @@ + + * + * @author Côme Chilliet + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ +namespace OCA\Settings\SetupChecks; + +use OCP\IConfig; +use OCP\IL10N; +use OCP\IURLGenerator; +use OCP\SetupCheck\ISetupCheck; +use OCP\SetupCheck\SetupResult; + +class MemcacheConfigured implements ISetupCheck { + public function __construct( + private IL10N $l10n, + private IConfig $config, + private IURLGenerator $urlGenerator, + ) { + } + + public function getName(): string { + return $this->l10n->t('Memcache'); + } + + public function getCategory(): string { + return 'system'; + } + + public function run(): SetupResult { + if ($this->config->getSystemValue('memcache.local', null) !== null) { + return SetupResult::success($this->l10n->t('Configured')); + } else { + return SetupResult::info( + $this->l10n->t('No memory cache has been configured. To enhance performance, please configure a memcache, if available.'), + $this->urlGenerator->linkToDocs('admin-performance') + ); + } + } +} diff --git a/apps/settings/lib/SetupChecks/PhpFreetypeSupport.php b/apps/settings/lib/SetupChecks/PhpFreetypeSupport.php new file mode 100644 index 0000000000000..3c67c3ddb6ef2 --- /dev/null +++ b/apps/settings/lib/SetupChecks/PhpFreetypeSupport.php @@ -0,0 +1,63 @@ + + * + * @author Côme Chilliet + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Settings\SetupChecks; + +use OCP\IL10N; +use OCP\SetupCheck\ISetupCheck; +use OCP\SetupCheck\SetupResult; + +class PhpFreetypeSupport implements ISetupCheck { + public function __construct( + private IL10N $l10n, + ) { + } + + public function getName(): string { + return $this->l10n->t('Freetype'); + } + + public function getCategory(): string { + return 'php'; + } + + /** + * Check if the required FreeType functions are present + */ + protected function hasFreeTypeSupport(): bool { + return function_exists('imagettfbbox') && function_exists('imagettftext'); + } + + public function run(): SetupResult { + if ($this->hasFreeTypeSupport()) { + return SetupResult::success($this->l10n->t('Supported')); + } else { + return SetupResult::info( + $this->l10n->t('Your PHP does not have FreeType support, resulting in breakage of profile pictures and the settings interface.'), + ); + } + } +} diff --git a/apps/settings/lib/SetupChecks/PhpGetEnv.php b/apps/settings/lib/SetupChecks/PhpGetEnv.php new file mode 100644 index 0000000000000..50f1554098983 --- /dev/null +++ b/apps/settings/lib/SetupChecks/PhpGetEnv.php @@ -0,0 +1,55 @@ + + * + * @author Daniel Kesselberg + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ +namespace OCA\Settings\SetupChecks; + +use OCP\IL10N; +use OCP\IURLGenerator; +use OCP\SetupCheck\ISetupCheck; +use OCP\SetupCheck\SetupResult; + +class PhpGetEnv implements ISetupCheck { + public function __construct( + private IL10N $l10n, + private IURLGenerator $urlGenerator, + ) { + } + + public function getName(): string { + return $this->l10n->t('PHP getenv'); + } + + public function getCategory(): string { + return 'php'; + } + + public function run(): SetupResult { + if (!empty(getenv('PATH'))) { + return SetupResult::success(); + } else { + return SetupResult::warning($this->l10n->t('PHP does not seem to be setup properly to query system environment variables. The test with getenv("PATH") only returns an empty response.'), $this->urlGenerator->linkToDocs('admin-php-fpm')); + } + } +} diff --git a/apps/settings/lib/SetupChecks/RandomnessSecure.php b/apps/settings/lib/SetupChecks/RandomnessSecure.php new file mode 100644 index 0000000000000..c30d4f2f79ac0 --- /dev/null +++ b/apps/settings/lib/SetupChecks/RandomnessSecure.php @@ -0,0 +1,63 @@ + + * + * @author Côme Chilliet + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ +namespace OCA\Settings\SetupChecks; + +use OCP\IConfig; +use OCP\IL10N; +use OCP\IURLGenerator; +use OCP\Security\ISecureRandom; +use OCP\SetupCheck\ISetupCheck; +use OCP\SetupCheck\SetupResult; + +class RandomnessSecure implements ISetupCheck { + public function __construct( + private IL10N $l10n, + private IConfig $config, + private IURLGenerator $urlGenerator, + private ISecureRandom $secureRandom, + ) { + } + + public function getName(): string { + return $this->l10n->t('Random generator'); + } + + public function getCategory(): string { + return 'security'; + } + + public function run(): SetupResult { + try { + $this->secureRandom->generate(1); + } catch (\Exception $ex) { + return SetupResult::error( + $this->l10n->t('No suitable source for randomness found by PHP which is highly discouraged for security reasons.'), + $this->urlGenerator->linkToDocs('admin-security') + ); + } + return SetupResult::success($this->l10n->t('Secure')); + } +} diff --git a/apps/settings/lib/SetupChecks/SystemIs64bit.php b/apps/settings/lib/SetupChecks/SystemIs64bit.php new file mode 100644 index 0000000000000..e4c21af238723 --- /dev/null +++ b/apps/settings/lib/SetupChecks/SystemIs64bit.php @@ -0,0 +1,67 @@ + + * + * @author Côme Chilliet + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Settings\SetupChecks; + +use OCP\IL10N; +use OCP\IURLGenerator; +use OCP\SetupCheck\ISetupCheck; +use OCP\SetupCheck\SetupResult; + +class SystemIs64bit implements ISetupCheck { + public function __construct( + private IL10N $l10n, + private IURLGenerator $urlGenerator, + ) { + } + + public function getName(): string { + return $this->l10n->t('Architecture'); + } + + public function getCategory(): string { + return 'system'; + } + + protected function is64bit(): bool { + if (PHP_INT_SIZE < 8) { + return false; + } else { + return true; + } + } + + public function run(): SetupResult { + if ($this->is64bit()) { + return SetupResult::success($this->l10n->t('64-bit')); + } else { + return SetupResult::warning( + $this->l10n->t('It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit!'), + $this->urlGenerator->linkToDocs('admin-system-requirements') + ); + } + } +} diff --git a/apps/settings/lib/SetupChecks/TransactionIsolation.php b/apps/settings/lib/SetupChecks/TransactionIsolation.php new file mode 100644 index 0000000000000..3b7be7da3e1ff --- /dev/null +++ b/apps/settings/lib/SetupChecks/TransactionIsolation.php @@ -0,0 +1,75 @@ + + * + * @author Côme Chilliet + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Settings\SetupChecks; + +use Doctrine\DBAL\Exception; +use Doctrine\DBAL\TransactionIsolationLevel; +use OC\DB\Connection; +use OCP\IDBConnection; +use OCP\IL10N; +use OCP\IURLGenerator; +use OCP\SetupCheck\ISetupCheck; +use OCP\SetupCheck\SetupResult; + +class TransactionIsolation implements ISetupCheck { + public function __construct( + private IL10N $l10n, + private IURLGenerator $urlGenerator, + private IDBConnection $connection, + private Connection $db, + ) { + } + + public function getName(): string { + return $this->l10n->t('Database transaction isolation level'); + } + + public function getCategory(): string { + return 'database'; + } + + public function run(): SetupResult { + try { + if ($this->connection->getDatabaseProvider() === IDBConnection::PLATFORM_SQLITE) { + return SetupResult::success(); + } + + if ($this->db->getTransactionIsolation() === TransactionIsolationLevel::READ_COMMITTED) { + return SetupResult::success('Read committed'); + } else { + return SetupResult::error( + $this->l10n->t('Your database does not run with "READ COMMITTED" transaction isolation level. This can cause problems when multiple actions are executed in parallel.'), + $this->urlGenerator->linkToDocs('admin-db-transaction') + ); + } + } catch (Exception $e) { + return SetupResult::warning( + $this->l10n->t('Was not able to get transaction isolation level: %s', $e->getMessage()) + ); + } + } +} diff --git a/apps/settings/tests/Controller/CheckSetupControllerTest.php b/apps/settings/tests/Controller/CheckSetupControllerTest.php index f3759644a38b1..e8087fbd2d1dc 100644 --- a/apps/settings/tests/Controller/CheckSetupControllerTest.php +++ b/apps/settings/tests/Controller/CheckSetupControllerTest.php @@ -40,7 +40,6 @@ use OC\DB\Connection; use OC\IntegrityCheck\Checker; use OC\MemoryInfo; -use OC\Security\SecureRandom; use OCA\Settings\Controller\CheckSetupController; use OCP\App\IAppManager; use OCP\AppFramework\Http; @@ -100,8 +99,6 @@ class CheckSetupControllerTest extends TestCase { private $dateTimeFormatter; /** @var MemoryInfo|MockObject */ private $memoryInfo; - /** @var SecureRandom|\PHPUnit\Framework\MockObject\MockObject */ - private $secureRandom; /** @var IniGetWrapper|\PHPUnit\Framework\MockObject\MockObject */ private $iniGetWrapper; /** @var IDBConnection|\PHPUnit\Framework\MockObject\MockObject */ @@ -154,7 +151,6 @@ protected function setUp(): void { $this->memoryInfo = $this->getMockBuilder(MemoryInfo::class) ->setMethods(['isMemoryLimitSufficient',]) ->getMock(); - $this->secureRandom = $this->getMockBuilder(SecureRandom::class)->getMock(); $this->iniGetWrapper = $this->getMockBuilder(IniGetWrapper::class)->getMock(); $this->connection = $this->getMockBuilder(IDBConnection::class) ->disableOriginalConstructor()->getMock(); @@ -178,7 +174,6 @@ protected function setUp(): void { $this->lockingProvider, $this->dateTimeFormatter, $this->memoryInfo, - $this->secureRandom, $this->iniGetWrapper, $this->connection, $this->throttler, @@ -189,18 +184,11 @@ protected function setUp(): void { $this->setupCheckManager, ]) ->setMethods([ - 'isReadOnlyConfig', - 'wasEmailTestSuccessful', - 'hasValidTransactionIsolationLevel', - 'hasFileinfoInstalled', - 'hasWorkingFileLocking', - 'hasDBFileLocking', 'getLastCronInfo', 'getSuggestedOverwriteCliURL', 'getCurlVersion', 'isPhpOutdated', 'getOpcacheSetupRecommendations', - 'hasFreeTypeSupport', 'hasMissingIndexes', 'hasMissingPrimaryKeys', 'isSqliteUsed', @@ -208,7 +196,6 @@ protected function setUp(): void { 'getAppDirsWithDifferentOwner', 'isImagickEnabled', 'areWebauthnExtensionsEnabled', - 'is64bit', 'hasBigIntConversionPendingColumns', 'isMysqlUsedWithoutUTF8MB4', 'isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed', @@ -228,34 +215,6 @@ public function removeTestDirectories() { $this->dirsToRemove = []; } - public function testIsMemcacheConfiguredFalse() { - $this->config->expects($this->once()) - ->method('getSystemValue') - ->with('memcache.local', null) - ->willReturn(null); - - $this->assertFalse( - self::invokePrivate( - $this->checkSetupController, - 'isMemcacheConfigured' - ) - ); - } - - public function testIsMemcacheConfiguredTrue() { - $this->config->expects($this->once()) - ->method('getSystemValue') - ->with('memcache.local', null) - ->willReturn('SomeProvider'); - - $this->assertTrue( - self::invokePrivate( - $this->checkSetupController, - 'isMemcacheConfigured' - ) - ); - } - /** * @dataProvider dataForwardedForHeadersWorking * @@ -367,9 +326,6 @@ public function testCheck() { ->expects($this->once()) ->method('getOpcacheSetupRecommendations') ->willReturn(['recommendation1', 'recommendation2']); - $this->checkSetupController - ->method('hasFreeTypeSupport') - ->willReturn(false); $this->checkSetupController ->method('hasMissingIndexes') ->willReturn([]); @@ -379,30 +335,6 @@ public function testCheck() { $this->checkSetupController ->method('isSqliteUsed') ->willReturn(false); - $this->checkSetupController - ->expects($this->once()) - ->method('isReadOnlyConfig') - ->willReturn(false); - $this->checkSetupController - ->expects($this->once()) - ->method('wasEmailTestSuccessful') - ->willReturn(false); - $this->checkSetupController - ->expects($this->once()) - ->method('hasValidTransactionIsolationLevel') - ->willReturn(true); - $this->checkSetupController - ->expects($this->once()) - ->method('hasFileinfoInstalled') - ->willReturn(true); - $this->checkSetupController - ->expects($this->once()) - ->method('hasWorkingFileLocking') - ->willReturn(true); - $this->checkSetupController - ->expects($this->once()) - ->method('hasDBFileLocking') - ->willReturn(true); $this->checkSetupController ->expects($this->once()) ->method('getSuggestedOverwriteCliURL') @@ -438,11 +370,6 @@ public function testCheck() { ->method('areWebauthnExtensionsEnabled') ->willReturn(false); - $this->checkSetupController - ->expects($this->once()) - ->method('is64bit') - ->willReturn(false); - $this->checkSetupController ->expects($this->once()) ->method('hasBigIntConversionPendingColumns') @@ -494,13 +421,6 @@ public function testCheck() { $expected = new DataResponse( [ - 'isGetenvServerWorking' => true, - 'isReadOnlyConfig' => false, - 'wasEmailTestSuccessful' => false, - 'hasValidTransactionIsolationLevel' => true, - 'hasFileinfoInstalled' => true, - 'hasWorkingFileLocking' => true, - 'hasDBFileLocking' => true, 'suggestedOverwriteCliURL' => '', 'cronInfo' => [ 'diffInSeconds' => 123, @@ -508,10 +428,6 @@ public function testCheck() { 'backgroundJobsUrl' => 'https://example.org', ], 'cronErrors' => [], - 'isMemcacheConfigured' => true, - 'memcacheDocs' => 'http://docs.example.org/server/go.php?to=admin-performance', - 'isRandomnessSecure' => self::invokePrivate($this->checkSetupController, 'isRandomnessSecure'), - 'securityDocs' => 'https://docs.example.org/server/8.1/admin_manual/configuration_server/hardening.html', 'isUsedTlsLibOutdated' => '', 'forwardedForHeadersWorking' => false, 'reverseProxyDocs' => 'reverse-proxy-doc-link', @@ -520,7 +436,6 @@ public function testCheck() { 'codeIntegrityCheckerDocumentation' => 'http://docs.example.org/server/go.php?to=admin-code-integrity', 'OpcacheSetupRecommendations' => ['recommendation1', 'recommendation2'], 'isSettimelimitAvailable' => true, - 'hasFreeTypeSupport' => false, 'isSqliteUsed' => false, 'databaseConversionDocumentation' => 'http://docs.example.org/server/go.php?to=admin-db-conversion', 'missingIndexes' => [], @@ -530,7 +445,6 @@ public function testCheck() { 'appDirsWithDifferentOwner' => [], 'isImagickEnabled' => false, 'areWebauthnExtensionsEnabled' => false, - 'is64bit' => false, 'pendingBigIntConversionColumns' => [], 'isMysqlUsedWithoutUTF8MB4' => false, 'isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed' => true, @@ -562,7 +476,6 @@ public function testGetCurlVersion() { $this->lockingProvider, $this->dateTimeFormatter, $this->memoryInfo, - $this->secureRandom, $this->iniGetWrapper, $this->connection, $this->throttler, @@ -1291,7 +1204,6 @@ public function testIsMysqlUsedWithoutUTF8MB4(string $db, bool $useUTF8MB4, bool $this->lockingProvider, $this->dateTimeFormatter, $this->memoryInfo, - $this->secureRandom, $this->iniGetWrapper, $this->connection, $this->throttler, @@ -1347,7 +1259,6 @@ public function testIsEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed(string $m $this->lockingProvider, $this->dateTimeFormatter, $this->memoryInfo, - $this->secureRandom, $this->iniGetWrapper, $this->connection, $this->throttler, diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index dd77c8603c435..f5ac857536521 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -180,41 +180,6 @@ var afterCall = function(data, statusText, xhr) { var messages = []; if (xhr.status === 200 && data) { - if (!data.isGetenvServerWorking) { - messages.push({ - msg: t('core', 'PHP does not seem to be setup properly to query system environment variables. The test with getenv("PATH") only returns an empty response.') + ' ' + - t('core', 'Please check the {linkstart}installation documentation ↗{linkend} for PHP configuration notes and the PHP configuration of your server, especially when using php-fpm.') - .replace('{linkstart}', '') - .replace('{linkend}', ''), - type: OC.SetupChecks.MESSAGE_TYPE_WARNING - }); - } - if (data.isReadOnlyConfig) { - messages.push({ - msg: t('core', 'The read-only config has been enabled. This prevents setting some configurations via the web-interface. Furthermore, the file needs to be made writable manually for every update.'), - type: OC.SetupChecks.MESSAGE_TYPE_INFO - }); - } - if (!data.wasEmailTestSuccessful) { - messages.push({ - msg: t('core', 'You have not set or verified your email server configuration, yet. Please head over to the {mailSettingsStart}Basic settings{mailSettingsEnd} in order to set them. Afterwards, use the "Send email" button below the form to verify your settings.',) - .replace('{mailSettingsStart}', '') - .replace('{mailSettingsEnd}', ''), - type: OC.SetupChecks.MESSAGE_TYPE_INFO - }); - } - if (!data.hasValidTransactionIsolationLevel) { - messages.push({ - msg: t('core', 'Your database does not run with "READ COMMITTED" transaction isolation level. This can cause problems when multiple actions are executed in parallel.'), - type: OC.SetupChecks.MESSAGE_TYPE_ERROR - }); - } - if(!data.hasFileinfoInstalled) { - messages.push({ - msg: t('core', 'The PHP module "fileinfo" is missing. It is strongly recommended to enable this module to get the best results with MIME type detection.'), - type: OC.SetupChecks.MESSAGE_TYPE_INFO - }); - } if (data.isBruteforceThrottled) { messages.push({ msg: t('core', 'Your remote address was identified as "{remoteAddress}" and is bruteforce throttled at the moment slowing down the performance of various requests. If the remote address is not your address this can be an indication that a proxy is not configured correctly. Further information can be found in the {linkstart}documentation ↗{linkend}.', { remoteAddress: data.bruteforceRemoteAddress }) @@ -223,22 +188,6 @@ type: OC.SetupChecks.MESSAGE_TYPE_ERROR }); } - if(!data.hasWorkingFileLocking) { - messages.push({ - msg: t('core', 'Transactional file locking is disabled, this might lead to issues with race conditions. Enable "filelocking.enabled" in config.php to avoid these problems. See the {linkstart}documentation ↗{linkend} for more information.') - .replace('{linkstart}', '') - .replace('{linkend}', ''), - type: OC.SetupChecks.MESSAGE_TYPE_WARNING - }); - } - if(data.hasDBFileLocking) { - messages.push({ - msg: t('core', 'The database is used for transactional file locking. To enhance performance, please configure memcache, if available. See the {linkstart}documentation ↗{linkend} for more information.') - .replace('{linkstart}', '') - .replace('{linkend}', ''), - type: OC.SetupChecks.MESSAGE_TYPE_INFO - }); - } if (data.suggestedOverwriteCliURL !== '') { messages.push({ msg: t('core', 'Please make sure to set the "overwrite.cli.url" option in your config.php file to the URL that your users mainly use to access this Nextcloud. Suggestion: "{suggestedOverwriteCliURL}". Otherwise there might be problems with the URL generation via cron. (It is possible though that the suggested URL is not the URL that your users mainly use to access this Nextcloud. Best is to double check this in any case.)', {suggestedOverwriteCliURL: data.suggestedOverwriteCliURL}), @@ -275,22 +224,6 @@ type: OC.SetupChecks.MESSAGE_TYPE_ERROR }); } - if(!data.isMemcacheConfigured) { - messages.push({ - msg: t('core', 'No memory cache has been configured. To enhance performance, please configure a memcache, if available. Further information can be found in the {linkstart}documentation ↗{linkend}.') - .replace('{linkstart}', '') - .replace('{linkend}', ''), - type: OC.SetupChecks.MESSAGE_TYPE_INFO - }); - } - if(!data.isRandomnessSecure) { - messages.push({ - msg: t('core', 'No suitable source for randomness found by PHP which is highly discouraged for security reasons. Further information can be found in the {linkstart}documentation ↗{linkend}.') - .replace('{linkstart}', '') - .replace('{linkend}', ''), - type: OC.SetupChecks.MESSAGE_TYPE_ERROR - }); - } if(data.isUsedTlsLibOutdated) { messages.push({ msg: data.isUsedTlsLibOutdated, @@ -341,12 +274,6 @@ type: OC.SetupChecks.MESSAGE_TYPE_WARNING }); } - if (!data.hasFreeTypeSupport) { - messages.push({ - msg: t('core', 'Your PHP does not have FreeType support, resulting in breakage of profile pictures and the settings interface.'), - type: OC.SetupChecks.MESSAGE_TYPE_INFO - }) - } if (data.missingIndexes.length > 0) { var listOfMissingIndexes = ""; data.missingIndexes.forEach(function(element){ @@ -401,17 +328,6 @@ type: OC.SetupChecks.MESSAGE_TYPE_INFO }) } - if (!data.is64bit) { - messages.push({ - msg: t( - 'core', - 'It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit! For further details read {linkstart}the documentation page ↗{linkend} about this.' - .replace('{linkstart}', '') - .replace('{linkend}', ''), - ), - type: OC.SetupChecks.MESSAGE_TYPE_WARNING - }) - } if (data.imageMagickLacksSVGSupport) { messages.push({ msg: t('core', 'Module php-imagick in this instance has no SVG support. For better compatibility it is recommended to install it.'), diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js index dc257f9e69af2..246574653a905 100644 --- a/core/js/tests/specs/setupchecksSpec.js +++ b/core/js/tests/specs/setupchecksSpec.js @@ -223,23 +223,13 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json' }, JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', - isRandomnessSecure: true, isFairUseOfFreePushService: true, - memcacheDocs: 'https://docs.nextcloud.com/server/go.php?to=admin-performance', forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], isSettimelimitAvailable: true, - hasFreeTypeSupport: true, missingIndexes: [], missingPrimaryKeys: [], missingColumns: [], @@ -251,7 +241,6 @@ describe('OC.SetupChecks tests', function() { appDirsWithDifferentOwner: [], isImagickEnabled: true, areWebauthnExtensionsEnabled: true, - is64bit: true, pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, @@ -271,10 +260,6 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([ - { - msg: 'No memory cache has been configured. To enhance performance, please configure a memcache, if available. Further information can be found in the documentation ↗.', - type: OC.SetupChecks.MESSAGE_TYPE_INFO - }, { msg: 'This server has no working internet connection: Multiple endpoints could not be reached. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. Establish a connection from this server to the internet to enjoy all features.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING @@ -293,23 +278,13 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json' }, JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', - isRandomnessSecure: true, isFairUseOfFreePushService: true, - memcacheDocs: 'https://docs.nextcloud.com/server/go.php?to=admin-performance', forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], isSettimelimitAvailable: true, - hasFreeTypeSupport: true, missingIndexes: [], missingPrimaryKeys: [], missingColumns: [], @@ -321,7 +296,6 @@ describe('OC.SetupChecks tests', function() { appDirsWithDifferentOwner: [], isImagickEnabled: true, areWebauthnExtensionsEnabled: true, - is64bit: true, pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, @@ -341,10 +315,6 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([ - { - msg: 'No memory cache has been configured. To enhance performance, please configure a memcache, if available. Further information can be found in the documentation ↗.', - type: OC.SetupChecks.MESSAGE_TYPE_INFO - }, { msg: 'This server has no working internet connection: Multiple endpoints could not be reached. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. Establish a connection from this server to the internet to enjoy all features.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING @@ -363,23 +333,13 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', - isRandomnessSecure: true, isFairUseOfFreePushService: true, - isMemcacheConfigured: true, forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], isSettimelimitAvailable: true, - hasFreeTypeSupport: true, missingIndexes: [], missingPrimaryKeys: [], missingColumns: [], @@ -391,7 +351,6 @@ describe('OC.SetupChecks tests', function() { appDirsWithDifferentOwner: [], isImagickEnabled: true, areWebauthnExtensionsEnabled: true, - is64bit: true, pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, @@ -420,71 +379,6 @@ describe('OC.SetupChecks tests', function() { }); }); - it('should return an error if /dev/urandom is not accessible', function(done) { - var async = OC.SetupChecks.checkSetup(); - - suite.server.requests[0].respond( - 200, - { - 'Content-Type': 'application/json', - }, - JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, - suggestedOverwriteCliURL: '', - isRandomnessSecure: false, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', - isFairUseOfFreePushService: true, - isMemcacheConfigured: true, - forwardedForHeadersWorking: true, - isCorrectMemcachedPHPModuleInstalled: true, - hasPassedCodeIntegrityCheck: true, - OpcacheSetupRecommendations: [], - isSettimelimitAvailable: true, - hasFreeTypeSupport: true, - missingIndexes: [], - missingPrimaryKeys: [], - missingColumns: [], - cronErrors: [], - cronInfo: { - diffInSeconds: 0 - }, - isMemoryLimitSufficient: true, - appDirsWithDifferentOwner: [], - isImagickEnabled: true, - areWebauthnExtensionsEnabled: true, - is64bit: true, - pendingBigIntConversionColumns: [], - 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: 'No suitable source for randomness found by PHP which is highly discouraged for security reasons. Further information can be found in the documentation ↗.', - type: OC.SetupChecks.MESSAGE_TYPE_ERROR - }]); - done(); - }); - }); - it('should return an error if the wrong memcache PHP module is installed', function(done) { var async = OC.SetupChecks.checkSetup(); @@ -494,24 +388,13 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', - isRandomnessSecure: true, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', isFairUseOfFreePushService: true, - isMemcacheConfigured: true, forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: false, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], isSettimelimitAvailable: true, - hasFreeTypeSupport: true, missingIndexes: [], missingPrimaryKeys: [], missingColumns: [], @@ -523,7 +406,6 @@ describe('OC.SetupChecks tests', function() { appDirsWithDifferentOwner: [], isImagickEnabled: true, areWebauthnExtensionsEnabled: true, - is64bit: true, pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, @@ -550,201 +432,6 @@ describe('OC.SetupChecks tests', function() { }); }); - it('should return an info if the mail server config was not set or verified, yet', function(done) { - var async = OC.SetupChecks.checkSetup(); - - suite.server.requests[0].respond( - 200, - { - 'Content-Type': 'application/json' - }, - JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: false, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, - suggestedOverwriteCliURL: '', - isRandomnessSecure: true, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', - isFairUseOfFreePushService: true, - isMemcacheConfigured: true, - forwardedForHeadersWorking: true, - isCorrectMemcachedPHPModuleInstalled: true, - hasPassedCodeIntegrityCheck: true, - OpcacheSetupRecommendations: [], - isSettimelimitAvailable: true, - hasFreeTypeSupport: true, - missingIndexes: [], - missingPrimaryKeys: [], - missingColumns: [], - cronErrors: [], - cronInfo: { - diffInSeconds: 0 - }, - isMemoryLimitSufficient: true, - appDirsWithDifferentOwner: [], - isImagickEnabled: true, - areWebauthnExtensionsEnabled: true, - is64bit: true, - pendingBigIntConversionColumns: [], - 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: 'You have not set or verified your email server configuration, yet. Please head over to the Basic settings in order to set them. Afterwards, use the "Send email" button below the form to verify your settings.', - type: OC.SetupChecks.MESSAGE_TYPE_INFO - }]); - done(); - }); - }); - - it('should return an info if transactional file locking is not set up', function(done) { - var async = OC.SetupChecks.checkSetup(); - - suite.server.requests[0].respond( - 200, - { - 'Content-Type': 'application/json' - }, - JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: false, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, - suggestedOverwriteCliURL: '', - isRandomnessSecure: true, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', - isFairUseOfFreePushService: true, - isMemcacheConfigured: true, - forwardedForHeadersWorking: true, - isCorrectMemcachedPHPModuleInstalled: true, - hasPassedCodeIntegrityCheck: true, - OpcacheSetupRecommendations: [], - isSettimelimitAvailable: true, - hasFreeTypeSupport: true, - missingIndexes: [], - missingPrimaryKeys: [], - missingColumns: [], - cronErrors: [], - cronInfo: { - diffInSeconds: 0 - }, - isMemoryLimitSufficient: true, - appDirsWithDifferentOwner: [], - isImagickEnabled: true, - areWebauthnExtensionsEnabled: true, - is64bit: true, - pendingBigIntConversionColumns: [], - 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: 'Transactional file locking is disabled, this might lead to issues with race conditions. Enable "filelocking.enabled" in config.php to avoid these problems. See the documentation ↗ for more information.', - type: OC.SetupChecks.MESSAGE_TYPE_WARNING - }]); - done(); - }); - }); - - it('should return an info if database file locking is used', function(done) { - var async = OC.SetupChecks.checkSetup(); - - suite.server.requests[0].respond( - 200, - { - 'Content-Type': 'application/json' - }, - JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: true, - hasValidTransactionIsolationLevel: true, - suggestedOverwriteCliURL: '', - isRandomnessSecure: true, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', - isFairUseOfFreePushService: true, - isMemcacheConfigured: true, - forwardedForHeadersWorking: true, - isCorrectMemcachedPHPModuleInstalled: true, - hasPassedCodeIntegrityCheck: true, - OpcacheSetupRecommendations: [], - isSettimelimitAvailable: true, - hasFreeTypeSupport: true, - missingIndexes: [], - missingPrimaryKeys: [], - missingColumns: [], - cronErrors: [], - cronInfo: { - diffInSeconds: 0 - }, - isMemoryLimitSufficient: true, - appDirsWithDifferentOwner: [], - isImagickEnabled: true, - areWebauthnExtensionsEnabled: true, - is64bit: true, - pendingBigIntConversionColumns: [], - 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 database is used for transactional file locking. To enhance performance, please configure memcache, if available. See the documentation ↗ for more information.', - type: OC.SetupChecks.MESSAGE_TYPE_INFO - }]); - done(); - }); - }); - it('should return a warning if there are app directories with wrong permissions', function(done) { var async = OC.SetupChecks.checkSetup(); @@ -754,24 +441,13 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', - isRandomnessSecure: true, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', isFairUseOfFreePushService: true, - isMemcacheConfigured: true, forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], isSettimelimitAvailable: true, - hasFreeTypeSupport: true, missingIndexes: [], missingPrimaryKeys: [], missingColumns: [], @@ -785,7 +461,6 @@ describe('OC.SetupChecks tests', function() { ], isImagickEnabled: true, areWebauthnExtensionsEnabled: true, - is64bit: true, pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, @@ -821,24 +496,14 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', - isRandomnessSecure: true, isFairUseOfFreePushService: true, - isMemcacheConfigured: true, forwardedForHeadersWorking: false, reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], isSettimelimitAvailable: true, - hasFreeTypeSupport: true, missingIndexes: [], missingPrimaryKeys: [], missingColumns: [], @@ -850,7 +515,6 @@ describe('OC.SetupChecks tests', function() { appDirsWithDifferentOwner: [], isImagickEnabled: true, areWebauthnExtensionsEnabled: true, - is64bit: true, pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, @@ -886,26 +550,16 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', - isRandomnessSecure: true, isFairUseOfFreePushService: true, isBruteforceThrottled: true, bruteforceRemoteAddress: '::1', - isMemcacheConfigured: true, forwardedForHeadersWorking: true, reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], isSettimelimitAvailable: true, - hasFreeTypeSupport: true, missingIndexes: [], missingPrimaryKeys: [], missingColumns: [], @@ -917,7 +571,6 @@ describe('OC.SetupChecks tests', function() { appDirsWithDifferentOwner: [], isImagickEnabled: true, areWebauthnExtensionsEnabled: true, - is64bit: true, pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, @@ -953,24 +606,14 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', - isRandomnessSecure: true, isFairUseOfFreePushService: true, - isMemcacheConfigured: true, forwardedForHeadersWorking: true, reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], isSettimelimitAvailable: false, - hasFreeTypeSupport: true, missingIndexes: [], missingPrimaryKeys: [], missingColumns: [], @@ -982,7 +625,6 @@ describe('OC.SetupChecks tests', function() { appDirsWithDifferentOwner: [], isImagickEnabled: true, areWebauthnExtensionsEnabled: true, - is64bit: true, pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, @@ -1018,24 +660,14 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', - isRandomnessSecure: true, isFairUseOfFreePushService: true, - isMemcacheConfigured: true, forwardedForHeadersWorking: true, reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], isSettimelimitAvailable: true, - hasFreeTypeSupport: true, missingIndexes: [], missingPrimaryKeys: [], missingColumns: [], @@ -1047,7 +679,6 @@ describe('OC.SetupChecks tests', function() { appDirsWithDifferentOwner: [], isImagickEnabled: true, areWebauthnExtensionsEnabled: true, - is64bit: true, pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, @@ -1103,24 +734,13 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', - isRandomnessSecure: true, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', isFairUseOfFreePushService: true, - isMemcacheConfigured: true, forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], isSettimelimitAvailable: true, - hasFreeTypeSupport: true, missingIndexes: [], missingPrimaryKeys: [], missingColumns: [], @@ -1132,7 +752,6 @@ describe('OC.SetupChecks tests', function() { appDirsWithDifferentOwner: [], isImagickEnabled: true, areWebauthnExtensionsEnabled: true, - is64bit: true, pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, @@ -1175,24 +794,13 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json' }, JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', - isRandomnessSecure: true, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', isFairUseOfFreePushService: true, - isMemcacheConfigured: true, forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: ['recommendation1', 'recommendation2'], isSettimelimitAvailable: true, - hasFreeTypeSupport: true, missingIndexes: [], missingPrimaryKeys: [], missingColumns: [], @@ -1204,7 +812,6 @@ describe('OC.SetupChecks tests', function() { appDirsWithDifferentOwner: [], isImagickEnabled: true, areWebauthnExtensionsEnabled: true, - is64bit: true, pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, @@ -1231,71 +838,6 @@ describe('OC.SetupChecks tests', function() { }); }); - it('should return an info if server has no FreeType support', function(done) { - var async = OC.SetupChecks.checkSetup(); - - suite.server.requests[0].respond( - 200, - { - 'Content-Type': 'application/json' - }, - JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, - suggestedOverwriteCliURL: '', - isRandomnessSecure: true, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', - isFairUseOfFreePushService: true, - isMemcacheConfigured: true, - forwardedForHeadersWorking: true, - isCorrectMemcachedPHPModuleInstalled: true, - hasPassedCodeIntegrityCheck: true, - OpcacheSetupRecommendations: [], - isSettimelimitAvailable: true, - hasFreeTypeSupport: false, - missingIndexes: [], - missingPrimaryKeys: [], - missingColumns: [], - cronErrors: [], - cronInfo: { - diffInSeconds: 0 - }, - isMemoryLimitSufficient: true, - appDirsWithDifferentOwner: [], - isImagickEnabled: true, - areWebauthnExtensionsEnabled: true, - is64bit: true, - pendingBigIntConversionColumns: [], - 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: 'Your PHP does not have FreeType support, resulting in breakage of profile pictures and the settings interface.', - type: OC.SetupChecks.MESSAGE_TYPE_INFO - }]); - done(); - }); - }); - it('should return an error if the php version is no longer supported', function(done) { var async = OC.SetupChecks.checkSetup(); @@ -1305,24 +847,13 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', - isRandomnessSecure: true, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', isFairUseOfFreePushService: true, - isMemcacheConfigured: true, forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], isSettimelimitAvailable: true, - hasFreeTypeSupport: true, missingIndexes: [], missingPrimaryKeys: [], missingColumns: [], @@ -1334,7 +865,6 @@ describe('OC.SetupChecks tests', function() { appDirsWithDifferentOwner: [], isImagickEnabled: true, areWebauthnExtensionsEnabled: true, - is64bit: true, pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: true, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, @@ -1374,24 +904,13 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', - isRandomnessSecure: true, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', isFairUseOfFreePushService: true, - isMemcacheConfigured: true, forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], isSettimelimitAvailable: true, - hasFreeTypeSupport: true, missingIndexes: [], missingPrimaryKeys: [], missingColumns: [], @@ -1403,7 +922,6 @@ describe('OC.SetupChecks tests', function() { appDirsWithDifferentOwner: [], isImagickEnabled: true, areWebauthnExtensionsEnabled: true, - is64bit: true, pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, @@ -1440,24 +958,13 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', - isRandomnessSecure: true, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', isFairUseOfFreePushService: true, - isMemcacheConfigured: true, forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], isSettimelimitAvailable: true, - hasFreeTypeSupport: true, missingIndexes: [], missingPrimaryKeys: [], missingColumns: [], @@ -1469,7 +976,6 @@ describe('OC.SetupChecks tests', function() { appDirsWithDifferentOwner: [], isImagickEnabled: true, areWebauthnExtensionsEnabled: true, - is64bit: true, pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, @@ -1503,24 +1009,13 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', - isRandomnessSecure: true, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', isFairUseOfFreePushService: true, - isMemcacheConfigured: true, forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], isSettimelimitAvailable: true, - hasFreeTypeSupport: true, missingIndexes: [], missingPrimaryKeys: [], missingColumns: [], @@ -1532,7 +1027,6 @@ describe('OC.SetupChecks tests', function() { appDirsWithDifferentOwner: [], isImagickEnabled: true, areWebauthnExtensionsEnabled: true, - is64bit: true, pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: false, @@ -1569,24 +1063,13 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', - isRandomnessSecure: true, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', isFairUseOfFreePushService: true, - isMemcacheConfigured: true, forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], isSettimelimitAvailable: true, - hasFreeTypeSupport: true, missingIndexes: [], missingPrimaryKeys: [], missingColumns: [], @@ -1598,7 +1081,6 @@ describe('OC.SetupChecks tests', function() { appDirsWithDifferentOwner: [], isImagickEnabled: false, areWebauthnExtensionsEnabled: true, - is64bit: true, pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, @@ -1635,24 +1117,13 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', - isRandomnessSecure: true, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', isFairUseOfFreePushService: true, - isMemcacheConfigured: true, forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], isSettimelimitAvailable: true, - hasFreeTypeSupport: true, missingIndexes: [], missingPrimaryKeys: [], missingColumns: [], @@ -1664,7 +1135,6 @@ describe('OC.SetupChecks tests', function() { appDirsWithDifferentOwner: [], isImagickEnabled: true, areWebauthnExtensionsEnabled: false, - is64bit: true, pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, @@ -1691,71 +1161,6 @@ describe('OC.SetupChecks tests', function() { }); }); - it('should return an error for 32bit instances', function(done) { - var async = OC.SetupChecks.checkSetup(); - - suite.server.requests[0].respond( - 200, - { - 'Content-Type': 'application/json', - }, - JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, - suggestedOverwriteCliURL: '', - isRandomnessSecure: true, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', - isFairUseOfFreePushService: true, - isMemcacheConfigured: true, - forwardedForHeadersWorking: true, - isCorrectMemcachedPHPModuleInstalled: true, - hasPassedCodeIntegrityCheck: true, - OpcacheSetupRecommendations: [], - isSettimelimitAvailable: true, - hasFreeTypeSupport: true, - missingIndexes: [], - missingPrimaryKeys: [], - missingColumns: [], - cronErrors: [], - cronInfo: { - diffInSeconds: 0 - }, - isMemoryLimitSufficient: true, - appDirsWithDifferentOwner: [], - isImagickEnabled: true, - areWebauthnExtensionsEnabled: true, - is64bit: false, - pendingBigIntConversionColumns: [], - 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: 'It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit! For further details read the documentation page ↗ about this.', - type: OC.SetupChecks.MESSAGE_TYPE_WARNING - }]); - done(); - }); - }); - it('should return an info if there is no default phone region', function(done) { var async = OC.SetupChecks.checkSetup(); @@ -1765,24 +1170,13 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', - isRandomnessSecure: true, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', isFairUseOfFreePushService: true, - isMemcacheConfigured: true, forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], isSettimelimitAvailable: true, - hasFreeTypeSupport: true, missingIndexes: [], missingPrimaryKeys: [], missingColumns: [], @@ -1794,7 +1188,6 @@ describe('OC.SetupChecks tests', function() { appDirsWithDifferentOwner: [], isImagickEnabled: true, areWebauthnExtensionsEnabled: true, - is64bit: true, pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, @@ -1837,24 +1230,13 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasFileinfoInstalled: true, - isGetenvServerWorking: true, - isReadOnlyConfig: false, - wasEmailTestSuccessful: true, - hasWorkingFileLocking: true, - hasDBFileLocking: false, - hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', - isRandomnessSecure: true, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', isFairUseOfFreePushService: true, - isMemcacheConfigured: true, forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], isSettimelimitAvailable: true, - hasFreeTypeSupport: true, missingIndexes: [], missingPrimaryKeys: [], missingColumns: [], @@ -1866,7 +1248,6 @@ describe('OC.SetupChecks tests', function() { appDirsWithDifferentOwner: [], isImagickEnabled: true, areWebauthnExtensionsEnabled: true, - is64bit: true, pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true,