new: [CLI] admin configLint

pull/8107/head
Jakub Onderka 2022-01-21 20:09:51 +01:00
parent 067e04fcf6
commit 613ac448da
1 changed files with 17 additions and 0 deletions

View File

@ -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']);
}
}
}