14364 Commits

Author SHA1 Message Date
Alexander A. Klimov
2c5de4192b Fix compiler warnings by removing unused variables 2025-08-29 16:37:41 +02:00
Julian Brost
87df80d322
Merge pull request #10516 from Icinga/http-handlers-stream-refactor
Refactor HTTP connection handling and some handlers to stream responses
2025-08-29 11:33:34 +02:00
Johannes Schmidt
7373f36cc5 Add unit-tests for HttpServerConnection and HTTP message classes 2025-08-28 13:22:18 +02:00
Johannes Schmidt
4782ea8a75 Make inherited protected functions of ApiListener public
This is needed so it's possible to manually add an ApiListener object
for the purpose of unit-testing.
2025-08-28 13:22:18 +02:00
Johannes Schmidt
bb75d73012 Refactor ObjectQueryHandler to use new JSON stream encoder 2025-08-28 13:22:18 +02:00
Johannes Schmidt
62b2dadbac Remove extra parameters from HTTP handler signature
These parameters are no longer needed since they were only used
by EventsHandler which was refactored in an earlier commit.
2025-08-28 13:22:18 +02:00
Johannes Schmidt
d32f04a863 Refactor EventsHandler to stream responses via chunked encoding 2025-08-28 13:22:18 +02:00
Johannes Schmidt
3832bb4296 Use new HTTP message classes in HttpServerConnection and Handlers 2025-08-28 13:22:18 +02:00
Johannes Schmidt
37df843700 Add HttpRequest and HttpResponse classes 2025-08-28 13:22:15 +02:00
Julian Brost
0c2fd00383
Merge pull request #10538 from Icinga/allow-uid-gid-icinga-user-and-group
Allow UID/GID in ICINGA2_(USER|GROUP) environment variables
2025-08-27 11:00:50 +02:00
Johannes Schmidt
3ebe95ba8c Allow UID/GID in ICINGA2_(USER|GROUP) environment variables 2025-08-25 14:31:19 +02:00
Alexander Aleksandrovič Klimov
9905e9af32
Merge pull request #10389 from Icinga/zone-endpoint-order
Zone#GetEndpoints(): return endpoints in the specified order, not randomly🎲
2025-08-22 10:11:51 +02:00
Alexander Aleksandrovič Klimov
5f2ee6e119
Merge pull request #10393 from Icinga/zone-endpoint-log
ApiListener#RelayMessageOne(): log🪵 to which Endpoint messages are relayed
2025-08-22 10:11:25 +02:00
Lorenz Kästle
a218ba8d92
Remove clear variable from disk CheckCommand
This commit removes the -C parameter from the disk CheckCommand
since there is no possible way to use it in any functional capacity.

-C (or --clear) would reset the thresholds given previously
to allow for setting different thresholds for following filesystmes.
As an example:

check_disk -w 50% -c 5% -p / -C -w 1%  -p /home

would only set the warning threshold for /home.

Since there is no way to use it reasonably with the Icinga 2
implementation of check_disk (since thresholds can only be
given once and the order is undefined), the clear flag
has no worth here.

My suggestion is to remove it avoid suggesting that it might
be used, but I left it as a comment in the ITL to prevent
the next person from "adding a missing parameter".
2025-08-19 10:58:48 +00:00
Alvar
d1582766ec
Merge pull request #10526 from Tqnsls/patch-1
add "--long-output" to ssl_cert command
2025-08-18 12:47:18 +00:00
Silas
124d191afa
add "--long-output" to ssl_cert command
Co-Authored-By: Julian Brost <julian.brost@icinga.com>
2025-08-18 12:06:40 +02:00
Alexander A. Klimov
17b49bd5b6 ApiListener#RelayMessageOne(): log to which Endpoint messages are relayed
if they're for our parent Zone.
2025-08-15 11:03:55 +02:00
Alexander Aleksandrovič Klimov
20d9af0d32
Merge pull request #10536 from Icinga/Al2Klimov-patch-3
GHA: add Debian 13
2025-08-15 10:39:33 +02:00
Alexander Aleksandrovič Klimov
0ecbfa93dd
Merge pull request #10537 from Icinga/Boost1.89
Bump Boost shipped for Windows to v1.89
2025-08-15 10:06:00 +02:00
Alexander A. Klimov
5a83f153b7 Bump Boost shipped for Windows to v1.89 2025-08-14 11:06:37 +02:00
Alexander A. Klimov
76fa0d9e80 Boost: don't require "system" component
It's vanished in v1.89.
2025-08-14 11:06:37 +02:00
Alexander Aleksandrovič Klimov
00295cb64b
GHA: add Debian 13 2025-08-13 12:19:16 +02:00
Alexander Aleksandrovič Klimov
26c526b3dd
Merge pull request #10534 from Icinga/dependabot/github_actions/actions/checkout-5
Bump actions/checkout from 4 to 5
2025-08-12 19:51:32 +02:00
dependabot[bot]
fdb471a09b
Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-12 15:18:20 +00:00
Yonas Habteab
1f92ec656b
Merge pull request #10523 from Icinga/dependency-eval-complexity
Prevent worst-case exponential complexity in dependency evaluation
2025-08-05 11:57:47 +02:00
Julian Brost
9601468674 Document current dependency recursion limit 2025-08-04 10:42:20 +02:00
Julian Brost
63e9ef58ba Prevent worst-case exponential complexity in dependency evaluation
So far, calling Checkable::IsReachable() traversed all possible paths to it's
parents. In case a parent is reachable via multiple paths, all it's parents
were evaluated multiple times, result in a worst-case exponential complexity.

With this commit, the implementation keeps track of which checkables were
already visited and uses the already-computed reachability instead of repeating
the computation, ensuring a worst-case linear runtime within the graph size.
2025-08-04 10:42:20 +02:00
Julian Brost
43f1e6f3a1 Move code involved in recursive dependency evaluation to helper class
Checkable::IsReachable() and DependencyGroup::GetState() call each other
recursively. Moving them to a common helper class allows adding caching to them
in a later commit without having to pass a cache between the functions (through
a public interface) or resorting to thread_local variables.
2025-08-04 10:42:20 +02:00
Julian Brost
370f96bcd5
Merge pull request #10504 from Icinga/log-optimization
Small code and performance optimizations in `Log` class
2025-08-04 10:39:22 +02:00
Julian Brost
a49ec1015d Allow intrusive_ptr<const T> for objects
This allows using ref-counted pointers to const objects. Adds a second typedef
so that T::ConstPtr can be used similar to how T::Ptr currently is.
2025-07-30 16:42:27 +02:00
Alvar
d98caf2e3b
Merge pull request #10514 from martialblog/docs/fix-links
docs: Fix some dead/old links
2025-07-29 09:00:50 +00:00
Julian Brost
ebd4fd1933 Log: don't construct std::ostringstream for no-op messages
This commit removes the existing m_IsNoOp bool and instead wraps the m_Buffer
std::ostringstream into std::optional. Functionally, this is pretty much the
same, with the exception that std::ostringstream is no longer constructed for
messages that will be discarded later.
2025-07-29 10:27:38 +02:00
Julian Brost
6487497665 Log: use std::forward in operator<< and remove overload for const char*
There already is a template operator<< implemented, so far only for const
references though. Changing this to perfectly forward the argument to the
corresponding operator in the underlying std::ostringstring allows handling all
the cases there, removing the need for a separate overload for const char*.
2025-07-29 10:27:38 +02:00
Markus Opolka
45721dcfc7
docs: Fix some dead/old links 2025-07-29 08:35:53 +02:00
Alvar
0a08fcc0e1
Merge pull request #10513 from martialblog/docs/elastic-perfdata
docs: Mention field mapping issue with ElasticsearchWriter
2025-07-25 12:39:50 +00:00
Markus Opolka
5605316850 docs: Update ElasticsearchWriter flush_threshold note format 2025-07-25 09:51:25 +02:00
Markus Opolka
e86dd0d28e docs: Mention field mapping issue with ElasticsearchWriter 2025-07-25 09:51:19 +02:00
Julian Brost
1a94c2c98d
Merge pull request #10476 from Icinga/broken-config-stage-updates
Handle concurrent config package updates gracefully
2025-07-25 09:42:42 +02:00
Yonas Habteab
ce3275d27f Disallow stage deletions during reload
Once the new worker process has read the config, it also includes a
`include */include.conf` statement within the config packages root
directory, and from there on we must not allow to delete any stage
directory from the config package. Otherwise, when the worker actually
evaluates that include statement, it will fail to find the directory
where the include file is located, or the `active.conf` file, which is
included from each stage's `include.conf` file, thus causing the worker
fail.

Co-Authored-By: Johannes Schmidt <johannes.schmidt@icinga.com>
2025-07-24 16:02:30 +02:00
Yonas Habteab
1ac4d83963 Use AtomicFile where applicable in ConfigPackageUtility 2025-07-24 10:54:39 +02:00
Yonas Habteab
35f42fa5a3 Handle concurrent config package updates gracefully
Previously, we used a simple boolean to track the state of the package updates,
and didn't reset it back when the config validation was successful because it was
assumed that if we successfully validated the config beforehand, then the worker
would also successfully reload the config afterwards, and that the old worker would
be terminated. However, this assumption is not always true due to a number of reasons
that I can't even think of right now, but the most obvious one is that after we successfully
validated the config, the config  might have changed again before the worker was able
to reload it. If that happens, then the new worker might fail to successfully validate
the config due to the recent changes, in which case the old worker would remain active,
and this flag would still be set to true, causing any subsequent requests to fail with a
`423` until you manually restart the Icinga 2 service.

So, in order to prevent such a situation, we are additionally tracking the last time a reload
failed and allow to bypass the `m_RunningPackageUpdates` flag only if the last reload failed
time was changed since the previous request.
2025-07-24 10:54:39 +02:00
Julian Brost
c28076a45b
Merge pull request #10507 from Icinga/RHEL10
GHA: add Rocky Linux 10 as an approximation of RHEL 10
2025-07-23 10:15:04 +02:00
Alexander A. Klimov
37f8e7ec01 GHA: add RHEL 10 2025-07-22 16:36:37 +02:00
Julian Brost
aeb2550ccb
Merge pull request #10508 from Icinga/SLES15.7
GHA: add SLES 15.7
2025-07-22 13:53:32 +02:00
Julian Brost
91faf28106
Merge pull request #10509 from Icinga/Ubuntu25.04
GHA: add Ubuntu 25.04
2025-07-22 13:52:55 +02:00
Julian Brost
00901192df Merge pull request #10506 from Icinga/Fedora42
GHA: add Fedora 42
2025-07-22 13:52:31 +02:00
Alexander Aleksandrovič Klimov
1197672aad
GHA: add Ubuntu 25.04 2025-07-22 10:59:45 +02:00
Alexander Aleksandrovič Klimov
5c5785acb8
GHA: add SLES 15.7 2025-07-22 10:59:34 +02:00
Alexander Aleksandrovič Klimov
054149fe08
GHA: add Fedora 42 2025-07-22 10:59:19 +02:00
Julian Brost
827f85c327
Merge pull request #10387 from Icinga/cnt-msg
Introduce Endpoint#messages_received_per_type
2025-07-16 17:29:24 +02:00