From 613ac448da37290ae8e9b1e804bff279f02f7ef9 Mon Sep 17 00:00:00 2001 From: Jakub Onderka Date: Fri, 21 Jan 2022 20:09:51 +0100 Subject: [PATCH] new: [CLI] admin configLint --- app/Console/Command/AdminShell.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/Console/Command/AdminShell.php b/app/Console/Command/AdminShell.php index 645251e68..b84c0dbcd 100644 --- a/app/Console/Command/AdminShell.php +++ b/app/Console/Command/AdminShell.php @@ -74,6 +74,9 @@ class AdminShell extends AppShell $parser->addSubcommand('securityAuditTls', [ 'help' => __('Run security audit to test TLS connections.'), ]); + $parser->addSubcommand('configLint', [ + 'help' => __('Check if settings has correct value.'), + ]); return $parser; } @@ -1126,4 +1129,18 @@ class AdminShell extends AppShell $this->out("$type: $result"); } } + + public function configLint() + { + $serverSettings = $this->Server->serverSettingsRead(); + foreach ($serverSettings as $setting) { + if (!isset($setting['error'])) { + continue; + } + if ($setting['errorMessage'] === 'Value not set.') { + continue; // Skip not set values. + } + $this->out($setting['setting'] . ': ' . $setting['errorMessage']); + } + } }