Commit graph

1552 commits

Author SHA1 Message Date
Johannes Meyer
82259c4750 Notifications/V1/Source: Skip binary behavior application 2026-05-11 13:53:26 +02:00
Sukhwinder Dhillon
15cb8d97f8 Fix leading comma in JSON export (#1349)
When exporting JSON with a limit and a page > 1 set, a leading comma is added
before the first item because `$offset !== 0` evaluates to true, resulting in
invalid JSON.

Replace the offset‑based condition with a `$first` flag to track whether any
item has been written yet.

(cherry picked from commit b60448bc77)
2026-04-01 10:40:26 +02:00
Bastian Lederer
fb9c2b65fa Ensure forward compatibility with ipl-orm by adding return types (#1340)
Add explicit return types to `ipl-orm`-derived methods to prepare for strict
typing. These additions are safe, as they only annotate existing methods that
previously lacked return type declarations.

(cherry picked from commit f8d4f92566)
2026-04-01 10:40:13 +02:00
Johannes Meyer
6897a56c1b Revert "ContinueWith: Disable button if the query with filter returns no results (#1300)"
This reverts commit 92a28df146.
2026-03-06 15:41:23 +01:00
Gianluca Piccolo
cf85671053 Fix translated status (#1328)
(cherry picked from commit bdb3861a95)
2026-03-06 15:39:23 +01:00
Johannes Meyer
88db56e17b Optimize restriction application to avoid multiple or needless sub-queries (#1329)
2cd1f96c Fixes that a condition, to keep redundancy groups in the result
(as they cannot be subjected to restrictions), lead to expensive and
irrelevant sub-queries in cases where redundancy groups were not
fetched. (e.g. usergroups)

6cb15efc Changes restriction application so that restrictions of
multiple roles are merged together instead of being processed
individually. This helps the ORM to generate less sub-queries and I
suspect performance will also be improved, even if just slightly.

fixes #1294

(cherry picked from commit 3b77b1c956)
2026-03-02 14:59:35 +01:00
Johannes Meyer
02ddff84f4 SlaReport: Disconnect from the database when done
This hook usually runs isolated and no-one else requires a connection.
Makes only a difference in case of reporting triggering this as part
of a scheduled report and prevents the database connection from being
left open unnecessarily and failing upon re-use.

(cherry picked from commit e56d8a68ca)
2026-03-02 14:48:14 +01:00
Johannes Meyer
514f3cf266 Backend: Also escape …FROM user in case of pgsql
Still hacky, but at least the combined str_replace
should compensate the preg_replace :D

I stopped thinking about a proper fix, as between the
time the original quick fix was implemented and now,
nothing has fundamentally changed in ipl-orm.

fixes #1330

(cherry picked from commit ab5304d4b0)
2026-03-02 14:42:34 +01:00
Sukhwinder Dhillon
92a28df146 ContinueWith: Disable button if the query with filter returns no results (#1300)
fixes #1299

requires https://github.com/Icinga/ipl-web/pull/334

(cherry picked from commit 9cabfd5968)
2026-03-02 14:39:33 +01:00
Johannes Meyer
2963fd60b8 VolatileStateResults: Fetch individual redis results for the actual current item
Previously, only the second and other subsequent item was updated with redis
results. Not sure why this wasn't discovered until recently, as the issue
was already part of the initial fix meant for a very similar issue, affecting
*all* items. Hell, maybe because my initial analysis this time also led me
into the wrong direction, so when reviewing this, proper testing and result
verification is key!

fixes #1318

(cherry picked from commit f70f60bf66)
2026-03-02 14:38:39 +01:00
Bastian Lederer
3c130b73a7
Only include requested columns in CSV/JSON exports when using ?columns=… (#1301)
resolves: #1011
2025-11-19 11:40:44 +01:00
Johannes Meyer
2590556303 Auth: Merge variable denylists and protections from multiple roles 2025-11-19 08:50:39 +01:00
Johannes Meyer
b8c33d6a32 Require Icinga Web 2.12 as minimum now
Some checks failed
L10n Update / update (push) Has been cancelled
PHP Tests / Static analysis for php 8.2 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 8.3 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 8.4 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.2 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.3 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.4 on ubuntu-latest (push) Has been cancelled
We were somewhat *compatible* with 2.9. Though, our packages
never allowed to install Icinga Web < 2.12 together with
Icinga DB Web >= 1.2. The latter requires PHP 8.2 as a minimum
and only Icinga Web 2.12 is compatible with it. It's now time
to hard require Icinga Web 2.12, althoug you might argue that
we should have done that already with v1.2…
2025-11-17 15:46:00 +01:00
Johannes Meyer
601753a76b Drop user, users, usergroup and usergroups endpoints 2025-11-17 13:21:32 +01:00
Johannes Meyer
555f1417bd Drop class Icinga\Module\Icingadb\Model\Behavior\BoolCast 2025-11-17 13:20:36 +01:00
Jan Schuppik
c7cc328bf2
Enhancement/improve column opening behaviour (#1293)
Some checks failed
L10n Update / update (push) Has been cancelled
PHP Tests / Static analysis for php 8.2 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 8.3 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 8.4 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.2 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.3 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.4 on ubuntu-latest (push) Has been cancelled
This PR improves the UX in the IcingaDB Web interface by:
- Enhancing the page opening behavior in column views for smoother
navigation.
- Adding a search bar to the tabs Host Services, Host History and
Service History

## Resolves
- #981
- #1288
2025-11-14 12:36:11 +01:00
Johannes Meyer
6af3c7e595 CommandTransport: Implement chunked transmission handling
Previously, command forms were responsible for this. But they
don't have any notion of fallback handling and are unable to
ensure proper re-submission of failed batches.
2025-11-12 15:15:10 +01:00
Johannes Meyer
d5b1ba7f33 CommandTransport: Do not render failed commands again
Rendering may only be possible once, depending on the
command type.
2025-11-12 15:15:10 +01:00
Johannes Meyer
27f0d0f680 CommandTransportException: Allow to attach the failed command 2025-11-12 15:15:10 +01:00
Johannes Meyer
17b4d96744 ObjectsCommand: Introduce property $chunkSize 2025-11-07 15:12:12 +01:00
Johannes Meyer
2c1b4dd5db ObjectsCommand: Expect instances of Iterator as objects 2025-11-07 14:34:26 +01:00
Johannes Meyer
c2543454b1 migrate: Drop backend selection 2025-11-06 09:04:46 +01:00
Johannes Meyer
a0c9f03a78 Provide integration for Icinga Notifications Web 2025-10-27 11:11:23 +01:00
Johannes Meyer
e906b1d632 ObjectSuggestions: Allow to use a fixed set of columns 2025-10-27 11:11:23 +01:00
Johannes Meyer
5e982dad40
Merge commit from fork
* Auth: Add method `assertColumnRestrictions`

* ObjectSuggestions: Do not suggest protected variables

`assertColumnRestrictions` does not allow to use them
anymore, hence we should not suggest them in searches
as well to not to let the user run into an error by
accepting a suggestion. Though, when fetching values
as well, we still have to obfuscate, otherwise protected
vars won't show up in details anymore.

* Introduce Icinga\Module\Icingadb\Common\Model

Must be used as base for all models, to ensure
column restrictions are asserted on filters.

* Utilize `Icinga\Module\Icingadb\Common\Model` where applicable
2025-10-16 08:42:51 +02:00
Copilot
54702e1271
Fix multiple downtime deletion permission issue (#1257) 2025-07-15 16:00:33 +02:00
Johannes Meyer
93869319b3 Auth: Apply filter/hosts and filter/services to dependency queries
refs #1242
2025-07-14 15:49:14 +02:00
Johannes Meyer
0148f4f510 db: Use an alias for *_customvar through tables
fixes #1162
2025-07-14 15:47:45 +02:00
Johannes Meyer
67baaf528c Comment|DowntimeDetail: Use correct filter for removal
Since #1060, comments/delete and downtimes/delete try to use
`ObjectAuthorization`'s cache properly and override `CommandAction`'s
`isGrantedOnType()`. Though, the filter is applied to the host
and service model as a result, and not to the downtime model. This
way, downtime filters MUST be absolute, just like filters provided
by the search bar. Otherwise `name=downtime-name` will be translated
to e.g. `host.name=downtime-name` which obviously cannot match.

fixes #1245
2025-07-14 09:39:17 +02:00
Sukhwinder Dhillon
24fceca424 DependencyNode: Use static call to avoid unnecessary columns in case of summary query 2025-07-10 13:12:37 +02:00
Sukhwinder Dhillon
eed9a3bc04 Move the HostController::joinFix() method to DependecyNode
- Centerlize the method
2025-07-10 09:17:50 +02:00
Sukhwinder Dhillon
844a54a418 Host|Service: Add missing relation unreachable_parent
- Remove obsolete property php-doc
2025-07-07 11:59:27 +02:00
Sukhwinder Dhillon
32b31f3e44 RedundancyGroupDetail: Eliminate duplicate nodes
This change was missing in: e5b499bbdb
2025-07-07 10:02:04 +02:00
Alvar Penning
3e0bd96ec6 IcingaHealth: Fix version comparison
There are multiple possible outputs for an Icinga DB version. The
package version contain the git tag, with a leading "v". The development
version mimics git-describe(1), including a commit hash separated by a
dash after the semantic version.

The current version comparison uses PHP's builtin version_compare().

This results in leading "v"s to return invalid results. Furthermore, it
treats everything behind the version as an "any string"[^0], which is
smaller than dev, alpha, beta, and so on. Thus, any git-describe(1)
version of Icinga DB 1.4.0 would be considered smaller as 1.4.0.

Fixes #1230.

[^0]: https://www.php.net/manual/en/function.version-compare.php
2025-06-20 10:13:00 +02:00
Johannes Meyer
3a583811a3 IcingaHealth: Switch to critical in case Icinga DB is too old
The old redis schema is incompatible with v1.2.0 hence the
health check should report a critical incident instead.

Also updates the health view to show a proper message.
2025-06-18 11:12:19 +02:00
Sukhwinder Dhillon
d5682944ab RedundancyGroupSummary: Add missing @property phpDoc annotation 2025-06-17 15:08:48 +02:00
Sukhwinder Dhillon
eb7179ffd8 RedundancyGroupSummary: Use DepenedecyNode as base to apply restrictions correctly
* RedundancyGroupSummary:
  - Columns are same as in DependencyNodeSummary. Column `redundancy_group.state.failed` excluded because not required here.
  - Don't sort by default. Sorting the summary is not necessary and even fails for PostgreSQL as it would require adding the column to the GROUP BY clause.
  - Introduce new method for(), to easily get the summary query for given group id. Adjust filter. The summary is always for parent (member).
2025-06-17 15:08:48 +02:00
Sukhwinder Dhillon
0e7c4fcc2d
Change column defination labels of user and usergroup (#1224) 2025-06-17 15:05:39 +02:00
Sukhwinder Dhillon
34f584f2d2 DependencyEdgeState: Remove column defination
This defination is (1) showing technical relation path (2) not usefull.
2025-06-16 17:28:59 +02:00
Ravi Kumar Kempapura Srinivasa
d0ffba3d91
ObjectSuggestions: Prioritze Column suggestions and best suggestions (#1215)
Show custom variable suggestions only if the column suggestions have not
consumed all the slots (50).

fixes #1206
2025-06-13 13:23:48 +02:00
Sukhwinder Dhillon
b5040b2fae EventRenderer: Fix soft_state event visual
- Only the CheckAttempt visual must be skipped in case $layout is minimal|header, not the whole condition body.
2025-06-13 08:13:12 +02:00
Sukhwinder Dhillon
223de33df3 ObjectList: Don't add multiselect url to member/childen list items of RedundancyGroup
- These lists do not support multiselect
2025-06-13 08:07:43 +02:00
Sukhwinder Dhillon
5655f095f8 IcingaRedis: Remove now obsolete code 2025-06-11 14:25:58 +02:00
Sukhwinder Dhillon
e26db03e19 Deprecate Icingadb\Model\Behavior\BoolCast and use \ipl\Orm\Behavior\BoolCast instead 2025-06-11 14:25:56 +02:00
Sukhwinder Dhillon
2459655739 IcingaRedis: state_type is now a string 2025-06-11 14:24:36 +02:00
Sukhwinder Dhillon
9283135144 Support new column is_sticky_acknowledgement 2025-06-11 14:24:36 +02:00
Johannes Meyer
de86ca168a RedisHealth: Serve Server infos as metrics 2025-06-11 12:13:51 +02:00
Johannes Meyer
6bf94ada9d RedisHealth: Include version in message 2025-06-11 12:13:51 +02:00
Johannes Meyer
ccb9756bc3 IcingaHealth: Show icingadb version in message…
…and show a warning if <1.4
2025-06-11 12:13:51 +02:00
Johannes Meyer
2a3531033e health: Show icingadb version 2025-06-11 12:13:51 +02:00