Allow syslog hooks to be set by lnms config:set (#16302)

Also allow --ignore-checks to work for os settings
This commit is contained in:
Tony Murray 2024-08-19 12:52:49 -05:00 committed by GitHub
parent e5838ebf1f
commit 5748ada02d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 1 deletions

View File

@ -50,7 +50,9 @@ class SetConfigCommand extends LnmsCommand
if (preg_match('/^os\.(?<os>[a-z_\-]+)\.(?<setting>.*)$/', $setting, $matches)) {
$os = $matches['os'];
try {
$this->validateOsSetting($os, $matches['setting'], $value);
if (! $force) {
$this->validateOsSetting($os, $matches['setting'], $value);
}
} catch (ValidationException $e) {
$this->error(trans('commands.config:set.errors.invalid'));
$this->line($e->getMessage());

View File

@ -391,6 +391,22 @@
"type": "integer",
"minimum": 1
},
"syslog_hook": {
"type": "array",
"items": {
"type": "object",
"properties": {
"regex": {
"type": "string"
},
"script": {
"type": "string"
}
},
"required": ["regex", "script"],
"additionalProperties": false
}
},
"ifXmcbc": {
"type": "boolean"
},