aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-10-24 11:40:03 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-10-24 11:40:03 +0200
commit6b7d4b67d1d48104123a9e3d13d40b952333e67a (patch)
tree7fd6287748314eb19f6e742021eb9358e5b242f3 /apps
parent13a8a1793c3396e2ac0e92c15dd7deb04fd8aa36 (diff)
downloadnextcloud-server-6b7d4b67d1d48104123a9e3d13d40b952333e67a.tar.gz
nextcloud-server-6b7d4b67d1d48104123a9e3d13d40b952333e67a.zip
Improve setup checks naming and improve database version check
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/SetupChecks/NeedsSystemAddressBookSync.php2
-rw-r--r--apps/settings/lib/SetupChecks/CheckUserCertificates.php2
-rw-r--r--apps/settings/lib/SetupChecks/DefaultPhoneRegionSet.php2
-rw-r--r--apps/settings/lib/SetupChecks/LegacySSEKeyFormat.php4
-rw-r--r--apps/settings/lib/SetupChecks/PhpDefaultCharset.php4
-rw-r--r--apps/settings/lib/SetupChecks/PhpOutdated.php2
-rw-r--r--apps/settings/lib/SetupChecks/PhpOutputBuffering.php4
-rw-r--r--apps/settings/lib/SetupChecks/ReadOnlyConfig.php2
-rw-r--r--apps/settings/lib/SetupChecks/SupportedDatabase.php70
-rw-r--r--apps/user_ldap/lib/SetupChecks/LdapInvalidUuids.php4
10 files changed, 45 insertions, 51 deletions
diff --git a/apps/dav/lib/SetupChecks/NeedsSystemAddressBookSync.php b/apps/dav/lib/SetupChecks/NeedsSystemAddressBookSync.php
index 476b37c1602..fbc371dae0e 100644
--- a/apps/dav/lib/SetupChecks/NeedsSystemAddressBookSync.php
+++ b/apps/dav/lib/SetupChecks/NeedsSystemAddressBookSync.php
@@ -40,7 +40,7 @@ class NeedsSystemAddressBookSync implements ISetupCheck {
}
public function getName(): string {
- return $this->l10n->t('Checking for DAV system address book');
+ return $this->l10n->t('DAV system address book');
}
public function getCategory(): string {
diff --git a/apps/settings/lib/SetupChecks/CheckUserCertificates.php b/apps/settings/lib/SetupChecks/CheckUserCertificates.php
index e09ef267e07..8e9c0080a26 100644
--- a/apps/settings/lib/SetupChecks/CheckUserCertificates.php
+++ b/apps/settings/lib/SetupChecks/CheckUserCertificates.php
@@ -46,7 +46,7 @@ class CheckUserCertificates implements ISetupCheck {
}
public function getName(): string {
- return $this->l10n->t('Checking for old user imported certificate');
+ return $this->l10n->t('Old user imported certificates');
}
public function run(): SetupResult {
diff --git a/apps/settings/lib/SetupChecks/DefaultPhoneRegionSet.php b/apps/settings/lib/SetupChecks/DefaultPhoneRegionSet.php
index 8b11ea90fdd..b1cc34f473b 100644
--- a/apps/settings/lib/SetupChecks/DefaultPhoneRegionSet.php
+++ b/apps/settings/lib/SetupChecks/DefaultPhoneRegionSet.php
@@ -38,7 +38,7 @@ class DefaultPhoneRegionSet implements ISetupCheck {
}
public function getName(): string {
- return $this->l10n->t('Checking for default phone region');
+ return $this->l10n->t('Default phone region');
}
public function getCategory(): string {
diff --git a/apps/settings/lib/SetupChecks/LegacySSEKeyFormat.php b/apps/settings/lib/SetupChecks/LegacySSEKeyFormat.php
index 72300ede2b0..a18d9482c03 100644
--- a/apps/settings/lib/SetupChecks/LegacySSEKeyFormat.php
+++ b/apps/settings/lib/SetupChecks/LegacySSEKeyFormat.php
@@ -44,12 +44,12 @@ class LegacySSEKeyFormat implements ISetupCheck {
}
public function getName(): string {
- return $this->l10n->t('Checking for old server-side-encryption being disabled');
+ return $this->l10n->t('Old server-side-encryption');
}
public function run(): SetupResult {
if ($this->config->getSystemValueBool('encryption.legacy_format_support', false) === false) {
- return SetupResult::success();
+ return SetupResult::success($this->l10n->t('Disabled'));
}
return SetupResult::warning($this->l10n->t('The old server-side-encryption format is enabled. We recommend disabling this.'), $this->urlGenerator->linkToDocs('admin-sse-legacy-format'));
}
diff --git a/apps/settings/lib/SetupChecks/PhpDefaultCharset.php b/apps/settings/lib/SetupChecks/PhpDefaultCharset.php
index 3f7a8c58e52..7b6ab54d9b3 100644
--- a/apps/settings/lib/SetupChecks/PhpDefaultCharset.php
+++ b/apps/settings/lib/SetupChecks/PhpDefaultCharset.php
@@ -36,7 +36,7 @@ class PhpDefaultCharset implements ISetupCheck {
}
public function getName(): string {
- return $this->l10n->t('Checking for PHP default charset');
+ return $this->l10n->t('PHP default charset');
}
public function getCategory(): string {
@@ -45,7 +45,7 @@ class PhpDefaultCharset implements ISetupCheck {
public function run(): SetupResult {
if (strtoupper(trim(ini_get('default_charset'))) === 'UTF-8') {
- return SetupResult::success();
+ return SetupResult::success('UTF-8');
} else {
return SetupResult::warning($this->l10n->t('PHP configuration option default_charset should be UTF-8'));
}
diff --git a/apps/settings/lib/SetupChecks/PhpOutdated.php b/apps/settings/lib/SetupChecks/PhpOutdated.php
index 2d161649315..3c749765a0f 100644
--- a/apps/settings/lib/SetupChecks/PhpOutdated.php
+++ b/apps/settings/lib/SetupChecks/PhpOutdated.php
@@ -42,7 +42,7 @@ class PhpOutdated implements ISetupCheck {
}
public function getName(): string {
- return $this->l10n->t('Checking for PHP version');
+ return $this->l10n->t('PHP version');
}
public function run(): SetupResult {
diff --git a/apps/settings/lib/SetupChecks/PhpOutputBuffering.php b/apps/settings/lib/SetupChecks/PhpOutputBuffering.php
index 58321e9f5dc..f8efda8d4ad 100644
--- a/apps/settings/lib/SetupChecks/PhpOutputBuffering.php
+++ b/apps/settings/lib/SetupChecks/PhpOutputBuffering.php
@@ -40,13 +40,13 @@ class PhpOutputBuffering implements ISetupCheck {
}
public function getName(): string {
- return $this->l10n->t('Checking for PHP output_buffering option');
+ return $this->l10n->t('PHP output_buffering option');
}
public function run(): SetupResult {
$value = trim(ini_get('output_buffering'));
if ($value === '' || $value === '0') {
- return SetupResult::success();
+ return SetupResult::success($this->l10n->t('Disabled'));
} else {
return SetupResult::error($this->l10n->t('PHP configuration option output_buffering must be disabled'));
}
diff --git a/apps/settings/lib/SetupChecks/ReadOnlyConfig.php b/apps/settings/lib/SetupChecks/ReadOnlyConfig.php
index 56f86ba9ab4..dc31565ffc2 100644
--- a/apps/settings/lib/SetupChecks/ReadOnlyConfig.php
+++ b/apps/settings/lib/SetupChecks/ReadOnlyConfig.php
@@ -38,7 +38,7 @@ class ReadOnlyConfig implements ISetupCheck {
}
public function getName(): string {
- return $this->l10n->t('Checking for configuration file access rights');
+ return $this->l10n->t('Configuration file access rights');
}
public function getCategory(): string {
diff --git a/apps/settings/lib/SetupChecks/SupportedDatabase.php b/apps/settings/lib/SetupChecks/SupportedDatabase.php
index 3d10798a7da..1a40b218031 100644
--- a/apps/settings/lib/SetupChecks/SupportedDatabase.php
+++ b/apps/settings/lib/SetupChecks/SupportedDatabase.php
@@ -27,13 +27,9 @@ declare(strict_types=1);
*/
namespace OCA\Settings\SetupChecks;
-use Doctrine\DBAL\Platforms\MariaDb1027Platform;
-use Doctrine\DBAL\Platforms\MySQL57Platform;
-use Doctrine\DBAL\Platforms\MySQL80Platform;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\OraclePlatform;
-use Doctrine\DBAL\Platforms\PostgreSQL100Platform;
-use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
+use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use OCP\IDBConnection;
use OCP\IL10N;
@@ -52,45 +48,43 @@ class SupportedDatabase implements ISetupCheck {
}
public function getName(): string {
- return $this->l10n->t('Checking for database version');
+ return $this->l10n->t('Database version');
}
public function run(): SetupResult {
- switch (get_class($this->connection->getDatabasePlatform())) {
- case MySQL80Platform::class: # extends MySQL57Platform
- case MySQL57Platform::class: # extends MySQLPlatform
- case MariaDb1027Platform::class: # extends MySQLPlatform
- case MySQLPlatform::class:
- $result = $this->connection->prepare("SHOW VARIABLES LIKE 'version';");
- $result->execute();
- $row = $result->fetch();
- $version = strtolower($row['Value']);
+ $version = null;
+ $databasePlatform = $this->connection->getDatabasePlatform();
+ if ($databasePlatform instanceof MySQLPlatform) {
+ $result = $this->connection->prepare("SHOW VARIABLES LIKE 'version';");
+ $result->execute();
+ $row = $result->fetch();
+ $version = $row['Value'];
+ $versionlc = strtolower($version);
- if (str_contains($version, 'mariadb')) {
- if (version_compare($version, '10.2', '<')) {
- return SetupResult::warning($this->l10n->t('MariaDB version "%s" is used. Nextcloud 21 and higher do not support this version and require MariaDB 10.2 or higher.', $row['Value']));
- }
- } else {
- if (version_compare($version, '8', '<')) {
- return SetupResult::warning($this->l10n->t('MySQL version "%s" is used. Nextcloud 21 and higher do not support this version and require MySQL 8.0 or MariaDB 10.2 or higher.', $row['Value']));
- }
+ if (str_contains($versionlc, 'mariadb')) {
+ if (version_compare($versionlc, '10.2', '<')) {
+ return SetupResult::warning($this->l10n->t('MariaDB version "%s" is used. Nextcloud 21 and higher do not support this version and require MariaDB 10.2 or higher.', $version));
}
- break;
- case SqlitePlatform::class:
- break;
- case PostgreSQL100Platform::class: # extends PostgreSQL94Platform
- case PostgreSQL94Platform::class:
- $result = $this->connection->prepare('SHOW server_version;');
- $result->execute();
- $row = $result->fetch();
- if (version_compare($row['server_version'], '9.6', '<')) {
- return SetupResult::warning($this->l10n->t('PostgreSQL version "%s" is used. Nextcloud 21 and higher do not support this version and require PostgreSQL 9.6 or higher.', $row['server_version']));
+ } else {
+ if (version_compare($versionlc, '8', '<')) {
+ return SetupResult::warning($this->l10n->t('MySQL version "%s" is used. Nextcloud 21 and higher do not support this version and require MySQL 8.0 or MariaDB 10.2 or higher.', $version));
}
- break;
- case OraclePlatform::class:
- break;
+ }
+ } elseif ($databasePlatform instanceof PostgreSQLPlatform) {
+ $result = $this->connection->prepare('SHOW server_version;');
+ $result->execute();
+ $row = $result->fetch();
+ $version = $row['server_version'];
+ if (version_compare(strtolower($version), '9.6', '<')) {
+ return SetupResult::warning($this->l10n->t('PostgreSQL version "%s" is used. Nextcloud 21 and higher do not support this version and require PostgreSQL 9.6 or higher.', $version));
+ }
+ } elseif ($databasePlatform instanceof OraclePlatform) {
+ $version = 'Oracle';
+ } elseif ($databasePlatform instanceof SqlitePlatform) {
+ $version = 'Sqlite';
+ } else {
+ return SetupResult::error($this->l10n->t('Unknown database plaform'));
}
- // TODO still show db and version on success?
- return SetupResult::success();
+ return SetupResult::success($version);
}
}
diff --git a/apps/user_ldap/lib/SetupChecks/LdapInvalidUuids.php b/apps/user_ldap/lib/SetupChecks/LdapInvalidUuids.php
index d6de11d35b9..8b6bf859142 100644
--- a/apps/user_ldap/lib/SetupChecks/LdapInvalidUuids.php
+++ b/apps/user_ldap/lib/SetupChecks/LdapInvalidUuids.php
@@ -46,13 +46,13 @@ class LdapInvalidUuids implements ISetupCheck {
}
public function getName(): string {
- return $this->l10n->t('Checking for invalid LDAP UUIDs');
+ return $this->l10n->t('Invalid LDAP UUIDs');
}
public function run(): SetupResult {
if (count($this->userMapping->getList(0, 1, true)) === 0
&& count($this->groupMapping->getList(0, 1, true)) === 0) {
- return SetupResult::success();
+ return SetupResult::success($this->l10n->t('None found'));
} else {
return SetupResult::warning($this->l10n->t('Invalid UUIDs of LDAP users or groups have been found. Please review your "Override UUID detection" settings in the Expert part of the LDAP configuration and use "occ ldap:update-uuid" to update them.'));
}