From 57fab7f39e4751222340675a118f1193e32ff778 Mon Sep 17 00:00:00 2001 From: Alvar Penning Date: Thu, 19 Sep 2024 16:03:55 +0200 Subject: [PATCH] Icinga DB: Config no_user_modify Each configuration field of an IcingaDB Object was marked with no_user_modify as modifications via the API would not result in an actual change. While the Object would be updated, the internal Redis connection would not be restarted, resulting in an unexpected behavior. The missing db_index was added to the documentation. --- doc/09-object-types.md | 1 + lib/icingadb/icingadb.ti | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/doc/09-object-types.md b/doc/09-object-types.md index 6b5d355ab..44c52da13 100644 --- a/doc/09-object-types.md +++ b/doc/09-object-types.md @@ -1388,6 +1388,7 @@ Configuration Attributes: port | Number | **Optional.** Redis port. Defaults to `6380` since the Redis server provided by the `icingadb-redis` package listens on that port. path | String | **Optional.** Redis unix socket path. Can be used instead of `host` and `port` attributes. password | String | **Optional.** Redis auth password. + db\_index | Number | **Optional.** Redis logical database by its number. Defaults to `0`. enable\_tls | Boolean | **Optional.** Whether to use TLS. cert\_path | String | **Optional.** Path to the certificate. key\_path | String | **Optional.** Path to the private key. diff --git a/lib/icingadb/icingadb.ti b/lib/icingadb/icingadb.ti index 1c649c8e4..2cc54ccc1 100644 --- a/lib/icingadb/icingadb.ti +++ b/lib/icingadb/icingadb.ti @@ -12,36 +12,36 @@ class IcingaDB : ConfigObject { activation_priority 100; - [config] String host { + [config, no_user_modify] String host { default {{{ return "127.0.0.1"; }}} }; - [config] int port { + [config, no_user_modify] int port { default {{{ return 6380; }}} }; - [config] String path; + [config, no_user_modify] String path; [config, no_user_view, no_user_modify] String password; - [config] int db_index; + [config, no_user_modify] int db_index; - [config] bool enable_tls { + [config, no_user_modify] bool enable_tls { default {{{ return false; }}} }; - [config] bool insecure_noverify { + [config, no_user_modify] bool insecure_noverify { default {{{ return false; }}} }; - [config] String cert_path; - [config] String key_path; - [config] String ca_path; - [config] String crl_path; - [config] String cipher_list { + [config, no_user_modify] String cert_path; + [config, no_user_modify] String key_path; + [config, no_user_modify] String ca_path; + [config, no_user_modify] String crl_path; + [config, no_user_modify] String cipher_list { default {{{ return DEFAULT_TLS_CIPHERS; }}} }; - [config] String tls_protocolmin { + [config, no_user_modify] String tls_protocolmin { default {{{ return DEFAULT_TLS_PROTOCOLMIN; }}} }; - [config] double connect_timeout { + [config, no_user_modify] double connect_timeout { default {{{ return DEFAULT_CONNECT_TIMEOUT; }}} };