14033 Commits

Author SHA1 Message Date
Yonas Habteab
9d4625e1ec ApiListener: Log connection attempts from an already connected client
Something is definitely going wrong if a client tries to reconnect to
this endpoint while it still has an active connection to that client. So
we shouldn't hide this, but at least log it at info level. Apart from
that, I've added some additional information about the currently active
client, such as when the last message was sent and received.
2024-10-30 11:26:21 +01:00
Alexander Aleksandrovič Klimov
73e992da81
openSUSE install docs: remove false info
No packages to be installed according to these instructions require the given repo.
2024-10-28 12:12:35 +01:00
Alexander Aleksandrovič Klimov
4ca68e444e
Merge pull request #10204 from Icinga/an-HA
doc/: fix "a HA" -> "an HA"
2024-10-24 11:30:24 +02:00
Alexander Aleksandrovič Klimov
fb8badfd2e
Merge pull request #10187 from Icinga/state-before-suppression
Fix lost recovery notifications after recovery outside of notification time period
2024-10-24 10:07:59 +02:00
Alexander Aleksandrovič Klimov
7df6baf146
Merge pull request #10176 from Icinga/ICINGA2_UNITY_BUILD=OFF-ICINGA2_WITH_LIVESTATUS=ON
Fix build on Mac with -DICINGA2_UNITY_BUILD=OFF -DICINGA2_WITH_LIVESTATUS=ON
2024-10-24 10:03:57 +02:00
Alexander A. Klimov
e889528b14 Document how to enable/disable Debug Output on the fly
This is a good alternative to `icinga2 feature enable debuglog`:

* Object creation/deletion via API happens immediately and requires no restart
* Hence, the debug log is enabled exactly as long as desired

Co-authored-by: alvar <8402811+oxzi@users.noreply.github.com>
2024-10-24 09:49:55 +02:00
Alexander A. Klimov
095e5982f4 doc/: fix "a HA" -> "an HA" 2024-10-24 09:44:36 +02:00
Alvar Penning
98f60fd78e
Icinga DB: Support Redis username authentication
The Redis ACL system was introduced with Redis 6.0. It introduced users
with precisely granular permissions. This change allows Icinga 2 to use
the Icinga DB feature against a Redis with an ACL user.

This was reflected in the documentation, next to the already
implemented, but undocumented Redis database.

Closes #9536.
2024-10-24 09:18:19 +02:00
Alvar Penning
57fab7f39e
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.
2024-10-24 09:18:09 +02:00
Yonas Habteab
09d102aeed
Merge pull request #10200 from Icinga/Al2Klimov-patch-11
GHA: Linux: include Ubuntu 24.10
2024-10-23 16:34:50 +02:00
Yonas Habteab
a7bc5ee29c
Merge pull request #10198 from Icinga/wingha-gitlab
GHA: Windows: don't require git.icinga.com/packaging/windows-icinga2
2024-10-23 14:48:47 +02:00
Alexander Aleksandrovič Klimov
8db62744cf
GHA: Linux: include Ubuntu 24.10 2024-10-23 14:42:15 +02:00
Alexander A. Klimov
7a4ba59961 Remove redundant "Validation failed" prefix from ValidationError exceptions
ValidationError#ValidationError() already prefixes #m_What,
which #what() returns, with "Validation failed for object".
2024-10-23 13:06:12 +02:00
Alexander A. Klimov
b95858d4d1 GHA: Windows: don't require git.icinga.com/packaging/windows-icinga2
"A little copying is better than a little dependency."
- https://www.youtube.com/watch?v=PAAkCSZUG1c&t=9m28s
(Gopherfest 2015 | Go Proverbs with Rob Pike)
2024-10-23 10:33:23 +02:00
Julian Brost
869a7d6f0f Security: fix TLS certificate validation bypass
The previous validation in set_verify_callback() could be bypassed, tricking
Icinga 2 into treating invalid certificates as valid. To fix this, the
validation checks were moved into the IsVerifyOK() function.

This is tracked as CVE-2024-49369, more details will be published at a later time.
2024-10-22 10:36:58 +02:00
Yonas Habteab
c6de69cfe4
Merge pull request #10194 from Icinga/docs-extend-ecape-characters
docs: Add $ to the escape sequences section
2024-10-21 14:19:35 +02:00
Yonas Habteab
9fa438c956 docs: Add missing space 2024-10-21 12:41:32 +02:00
Yonas Habteab
39337fbeae docs: Add $ to the escape sequences section
feat: Add the `$` character to the escape sequences table.
2024-10-21 12:41:32 +02:00
Yonas Habteab
f4e61ef9bd
Merge pull request #10177 from Icinga/log-noop-fix
Log: fix some parts of messages not being discarded early
2024-10-21 09:31:19 +02:00
Julian Brost
7d0a43f926 Use Checkable::GetStateBeforeSuppression() only where relevant
This fixes an issue where recovery notifications get lost if they happen
outside of a notification time period.

Not all calls to `Checkable::NotificationReasonApplies()` need
`GetStateBeforeSuppression()` to be checked. In fact, for one caller,
`FireSuppressedNotifications()` in
`lib/notification/notificationcomponent.cpp`, the state before suppression may
not even be initialized properly, so that the default value of OK is used which
can lead to incorrect return values. Note the difference between suppressions
happening on the level of the `Checkable` object level and the `Notification`
object level. Only the first sets the state before suppression in the
`Checkable` object, but so far, also the latter used that value incorrectly.

This commit moves the check of `GetStateBeforeSuppression()` from
`Checkable::NotificationReasonApplies()` to the one place where it's actually
relevant: `Checkable::FireSuppressedNotifications()`. This made the existing
call to `NotificationReasonApplies()` unneccessary as it would always return
true: the `type` argument is computed based on the current check result, so
there's no need to check it against the current check result.
2024-10-11 13:21:10 +02:00
Alexander A. Klimov
c6f9de5933 Ido*sqlConnection#FieldToEscapedString(): don't write out of range time
MySQL's FROM_UNIXTIME() NULLs ts <1970, errors for >2038.
Postgres' TO_TIMESTAMP() errors for all ts not between 4713BC - 294276AD.
2024-10-02 11:52:25 +02:00
Julian Brost
5e9e0bbcdf
Merge pull request #10059 from Icinga/IcingaDB-TimestampToMilliseconds-limit
IcingaDB::TimestampToMilliseconds(): limit output to four year digits
2024-10-02 09:19:03 +02:00
Alexander A. Klimov
ad6fcda6df Ido*sqlConnection#FieldToEscapedString(): don't overflow timestamps > long 2024-10-01 17:38:52 +02:00
Alexander A. Klimov
dc4869c3aa IcingaDB::TimestampToMilliseconds(): limit output to four year digits
Too high timestamps may overflow uint64_t (and the YYYY format) and negative
ones don't fit into uint64_t. Those may crash our Go daemon.
2024-09-30 16:54:40 +02:00
Julian Brost
f0e084d530 Log: fix some parts of messages not being discarded early
`m_IsNoOp` was introduced to avoid building up log messages that will later be
discarded, like debug messages if no debug logging is configured. However, it
looks like the template operator<< implemented in the header file was forgotten
when adding this feature, all other places writing into `m_Buffer` already have
an if guard like added by this commit.
2024-09-27 14:23:05 +02:00
Alexander A. Klimov
2bbeaec916 Fix build on Mac with -DICINGA2_UNITY_BUILD=OFF -DICINGA2_WITH_LIVESTATUS=ON
error: no matching function for call to 'intrusive_ptr_release'
...
candidate function not viable: cannot convert argument of incomplete type 'icinga::Notification *' to 'Object *' for 1st argument
void intrusive_ptr_release(Object *object);
2024-09-27 12:41:11 +02:00
Julian Brost
b6b1506bda
Merge pull request #10140 from Icinga/drop-cpu-bound-work-usage-from-ifwapi
Don't use thread-local var in coroutine & drop superfluous `CpuBoundWork` usage
2024-09-27 11:31:58 +02:00
Yonas Habteab
92df9ef8c3
Merge pull request #10148 from Icinga/enhanced-sort-types-by-load-dependencies
Sort config types by their load dependencies once
2024-09-26 15:27:41 +02:00
Yonas Habteab
0fff4153ef
Merge pull request #10174 from open-i-gmbh/fix/influxdbwriter-validator-add-closing-quotation-marks
Add closing quotationmarks in Validator for influxdb writer config
2024-09-26 11:46:11 +02:00
Sebastian Grund
90c76ad89c
Update Authors 2024-09-26 10:04:02 +02:00
Sebastian Grund
8c68c6e9d8
Add closing quotationmarks in Validator for influxdb writer config 2024-09-25 13:03:00 +02:00
Yonas Habteab
01d3a1d382
Merge pull request #10170 from Icinga/OpenSSL3015
Bump OpenSSL shipped for Windows to v3.0.15
2024-09-24 12:43:56 +02:00
Alexander A. Klimov
7216220de1 Bump OpenSSL shipped for Windows to v3.0.15 2024-09-20 17:39:26 +02:00
Yonas Habteab
eb97676d69 Add basic test cases for Type::GetConfigTypesSortedByLoadDependencies() 2024-09-20 16:18:12 +02:00
Yonas Habteab
467e8b18e7 Type: Simplify sort by load dependencies algorithm 2024-09-20 16:18:12 +02:00
Alexander A. Klimov
31f3acaa13 ConfigItem::CommitNewItems(): pre-sort types by their load dependencies once
to avoid complicated nested loops, iterating over the same types and
checking dependencies over and over, skipping already completed ones.
2024-09-20 16:18:12 +02:00
Alexander A. Klimov
b848934d57 Introduce Type::GetConfigTypesSortedByLoadDependencies() 2024-09-20 16:18:12 +02:00
Yonas Habteab
4f690a6fde
Merge pull request #10169 from Icinga/Type-GetLoadDependencies-ConfigObject
Type#GetLoadDependencies(): VERIFY() that only config object types are returned
2024-09-20 16:11:17 +02:00
Alexander A. Klimov
b6517c6973 Type#GetLoadDependencies(): VERIFY() that only config object types are returned 2024-09-20 14:35:19 +02:00
Alexander A. Klimov
4b20121dcf Type#GetLoadDependencies(): group operations by type 2024-09-20 14:35:19 +02:00
Yonas Habteab
dac747f9d4
Merge pull request #10155 from Icinga/Type-GetLoadDependencies-nullptr
Type#GetLoadDependencies(): VERIFY() that no nullptr is returned
2024-09-20 12:29:48 +02:00
Alexander A. Klimov
c24713ac10 Type#GetLoadDependencies(): VERIFY() that no nullptr is returned 2024-09-19 16:43:00 +02:00
Alexander A. Klimov
36742c27b9 Don't override Type#GetLoadDependencies() if latter is sufficient
If a specific type shall return no deps, the base method already does that.
2024-09-19 15:47:25 +02:00
Yonas Habteab
e678f0977d
Merge pull request #10151 from Icinga/bugfix/do-not-sync-partially-initialised-objects
IcingaDB: Don't sync partially initialised objects
2024-09-18 15:48:42 +02:00
Yonas Habteab
3ffec77ae5
Merge pull request #10135 from Icinga/centos
doc/: don't mention CentOS
2024-09-18 10:22:09 +02:00
Yonas Habteab
7b12a8feeb
Merge pull request #10156 from Icinga/Al2Klimov-patch-7
Linux Dev Environment: fix /usr/local/icinga2/etc ownership
2024-09-16 17:51:34 +02:00
Alexander A. Klimov
6da948c830 doc/: don't mention CentOS
It's EOL.
2024-09-16 17:08:42 +02:00
Alexander Aleksandrovič Klimov
f3ed85171e
Linux Dev Environment: fix /usr/local/icinga2/etc ownership
We instruct the users to build as root and chown just /usr/local/icinga2/var, but at least `icinga2 api setup` also needs to modify /usr/local/icinga2/etc.
2024-09-16 16:13:02 +02:00
Yonas Habteab
0b8f70bbba
Merge pull request #10152 from Josef-Friedrich/remove-trailing-whitespaces
Remove trailing whitespaces in the markdown files of the documentation
2024-09-13 10:06:45 +02:00
Julian Brost
b62326d30c
Merge pull request #10153 from Josef-Friedrich/typo-api-docs
Fix typo in the api documentation
2024-09-12 10:37:06 +02:00