Commit graph

14289 commits

Author SHA1 Message Date
Johannes Meyer
5478d4a359 Module: Expect user and group backends upon registration
Providing a user or user group backend in configuration.php
now triggers a deprecation or warning. They are expected to
be announced in run.php, just like hooks. Authentication
attempts during a configuration.php run, while Authentication
has not been performed yet, will be also suspended now.
This ensures that the current behavior, being broken or
working, stays the same.

refs #5265
2026-05-04 17:01:41 +02:00
Johannes Meyer
e409241388 Drop obsolete route references
The related controller action is gone since
b6b5caace3
2026-05-04 17:01:41 +02:00
Johannes Meyer
a6a9261899 Manager: Perform module loading asynchronously
So that authentication can suspend it. There are cases,
e.g. cube, where authentication is required in run.php.
During bootstrapping loading modules is mostly required
to load libraries, register routes and hooks. Most of the
time authentication is not required for these, but if
it is, evaluation is now interrupted and continued
after authentication has actually been performed.

I don't see a real risk for any breaking change here,
since authentication happens shortly after. It actually
avoids a breaking change, since without this, cube's
Icinga DB support would break or at least malfunction.

And cube is only a single example.

refs #5265
2026-05-04 17:01:41 +02:00
Johannes Meyer
3a61473301 Auth: Perform authentication only once and not lazily
Since authentication is now performed even for static
resources, there's no reason anymore to support implicit
authentication. This also limits authentication attempts
to a single one, previously failed attempts were repeated.

Requiring authentication during bootstrapping, i.e. before
authentication has been performed, will now throw an error.

refs #5265
2026-05-04 17:01:41 +02:00
Johannes Meyer
e7c5bb33d7 EmbeddedWeb: Explicitly perform authentication
It is nowadays no exception that stylesheet may be dependent
on who's using the app. So to avoid race conditions like
in #5385 authentication is an explicit step during bootstrap
now.

fixes #5385
2026-05-04 16:56:17 +02:00
Johannes Meyer
0a639dbb0a StaticController: Allow to access a lib's js/css assets
Some checks failed
L10n Update / update (push) Has been cancelled
CI / PHP (push) Has been cancelled
2026-05-04 16:47:51 +02:00
Johannes Meyer
48f6617d34 JavaScript: Enhance dependency optimization 2026-05-04 16:17:20 +02:00
Johannes Meyer
570cc5f771 Revert "Provide Icinga to ipl/web behaviors (#5238)"
This reverts commit 1ee08d6180.
2026-04-30 13:18:02 +02:00
Eric Lippmann
229ff3b057
Migrate Less compilation to ipl\Web\Less (#5492)
Because the in-tree Less visitor requires `wikimedia/less.php`, that
dependency has to live in `icinga-php-thirdparty`. `icinga-php-library`
already carries Less-related code with the same dependency, so this PR
consolidates everything into `icinga-php-library` and removes the
duplicate in-tree implementation.

- Remove the in-tree `Icinga\Less\` visitor layer in favor of the shared
`ipl\Web\Less` library, which maintains modernized equivalent CSS var
replacement and light-mode functionality.

- Strip unused variable-export support from `LessCompiler`. The feature
was never used by any our modules or community modules.

- Update `LessCompiler` to delegate to `ipl\Web\Less`, assembling
sources via `@import (less)` directives; pass the `$minify` flag
directly to `render()` instead of via a separate `compress()` call.

- Modernize `LessCompiler` with PHP type declarations, short array
syntax, and tightened PHPDoc.

Here is the test summary:

The stylesheets are nearly identical. Most changes are normalization
noise introduced by the new version of the wikimedia Less parser:

- Decimal canonicalization: `.5` → `0.5`, `2.0em` → `2em`
- Hex color shortening: `#dddddd` → `#ddd`
- Hex color case kept as is: `#535353` → `#535353`, `#c4c4c4` → `#c4c4c4`
- `calc()` math preserved: `calc(14.28571429%)` → `calc(100% / 7)`

Starting with Less.php 5.0, arithmetic is no longer evaluated inside
`calc()`. This required changing one occurrence in our Less files
directly; no other changes were necessary, and no known publicly
available Icinga Web module is affected by similar changes in this
regard.

There is one functional difference: the light-mode background color
gains an extra level of indirection via a new CSS var call (because it
uses `@light-body-bg-color`):

```diff
-  --body-bg-color: #f5f9fa;
+  --body-bg-color: var(--light-body-bg-color, #f5f9fa);
```

The new CSS var replacement visitor from `ipl\Web` runs independently
from the light mode call visitor, and therefore also adds var overrides
to such detached rulesets. Everything else is normalization noise.
2026-04-30 10:58:47 +02:00
Eric Lippmann
a268c46602 Unify file validation in LessCompiler via resolveReadableFile()
Previously, `addLessFile` and `addModuleLessFile` called `realpath()` but
skipped the readability check, silently appending `false` when a path did
not resolve. `setTheme` and `setThemeMode` checked readability but stored
the unresolved path and swallowed errors via `Logger::error`.

`resolveReadableFile()` centralizes both steps: it calls `realpath()` and
verifies the result is a readable file, throwing a `RuntimeException` on
failure so no invalid path can be registered silently.
2026-04-27 16:44:51 +02:00
Sukhwinder Dhillon
4246e4e546 configmenu.less: Fix invalid calc() param
Starting with Less.php version 5.0, arithmetic is no longer evaluated
inside `calc()` the way this code relied on[^1]. Compute the division in
a Less variable first, then use that value in `calc()` and drop the
unnecessary escaping.

[^1]: https://gerrit.wikimedia.org/r/c/mediawiki/libs/less.php/+/1049149
2026-04-27 16:24:51 +02:00
Eric Lippmann
bbaa812835 Modernize LessCompiler with typed properties and method signatures
Add missing PHP type declarations to properties and methods, replace long-form
`array()` syntax with short `[]` syntax, tighten PHPDoc comments, and correct
"LESS" to "Less".
2026-04-27 16:24:51 +02:00
Eric Lippmann
80308bbd75 Migrate Less compilation to ipl\Web\Less
Replace the in-tree `Icinga\Less\` visitor layer with its equivalents
from `ipl\Web\Less`, where the same color-variable and light-mode
functionality is maintained as a shared library.

`LessCompiler` is updated to delegate to `WikimediaLessCompiler`,
assembling source via `@import (less)` directives and accepting a
`$minify` flag directly on `render()` rather than through a separate
`compress()` call.
2026-04-27 16:24:51 +02:00
Eric Lippmann
7ef376df0f Revert "LessCompiler: Add support for variable exports by modules"
This reverts commit 7c58b3ced1.

Remove variable exports as they were never used in our modules or community
modules, and using this feature is discouraged.
2026-04-27 16:24:51 +02:00
Eric Lippmann
a1c67a3913 Evaluate the light mode rules immediately
This is a preparation for using the new Less utils from `ipl\Web` to simplify
the comparison of the old and new stylesheets.
2026-04-27 16:24:51 +02:00
Sukhwinder Dhillon
821f6a4775 doc: Remove monitoring module references
Some checks failed
L10n Update / update (push) Has been cancelled
CI / PHP (push) Has been cancelled
The `monitoring` module was removed in v2.13.0 and its references
remained in the docs. Remove these references and replace them with
`icingadb` where appropriate.
2026-04-24 10:00:09 +02:00
Johannes Meyer
49ed0ac0ac
Move relative time js behavior to ipl-web (#5461)
Some checks failed
L10n Update / update (push) Has been cancelled
CI / PHP (push) Has been cancelled
This PR removes the Javascript function that updates relative times.

refs: https://github.com/Icinga/ipl-web/issues/341

Depends on:
- https://github.com/Icinga/ipl-web/pull/350
(ipl-web handles the time refreshing via javascript now)
2026-04-21 15:52:58 +02:00
Johannes Meyer
d75a83e013 doc: Mention relative time changes in the upgrading section 2026-04-21 10:01:39 +02:00
Johannes Meyer
6cab713031 helpers/format.php: Let time helpers return updated markup
This still doesn't cover other implementations generating
the markup on their own but still using the CSS classes,
but it's a start.
2026-04-21 10:00:20 +02:00
Johannes Meyer
cd426e88f7 ui.js: Remove remaining time counter references 2026-04-21 10:00:00 +02:00
Johannes Meyer
b7e01023ab Update required icinga-php-library version 2026-04-17 15:40:21 +02:00
Jan Schuppik
1df38fd3e3 Revert: creation of the relative-time-behavior
Revert "Fix: add stop method"

This reverts commit 7605c655fd.

Revert "Adjust onRendered method"

This reverts commit ab868e15f8.

Revert "Adjust: html-attribute 'datetime' as update source"

This reverts commit 8bf1b1746d.

Revert "Init: js relative-time behavior"

This reverts commit f17bf24def.
2026-04-17 15:36:36 +02:00
Jan Schuppik
09a004fec1 Fix: add stop method 2026-04-17 15:36:36 +02:00
Jan Schuppik
78f6f5715a Adjust onRendered method 2026-04-17 15:36:36 +02:00
Jan Schuppik
589ee57e32 Remove previous code 2026-04-17 15:36:36 +02:00
Jan Schuppik
d6994dbb58 Adjust: html-attribute 'datetime' as update source 2026-04-17 15:36:36 +02:00
Jan Schuppik
136b5853ab Init: js relative-time behavior 2026-04-17 15:36:36 +02:00
Sukhwinder Dhillon
1ee08d6180
Provide Icinga to ipl/web behaviors (#5238)
Some checks are pending
L10n Update / update (push) Waiting to run
CI / PHP (push) Waiting to run
2026-04-17 15:35:31 +02:00
Johannes Meyer
1d6fa0aabd doc: Mention monitoring removal in upgrading section
Some checks failed
L10n Update / update (push) Has been cancelled
CI / PHP (push) Has been cancelled
2026-04-02 14:41:02 +02:00
Eric Lippmann
67b6c01978
Release version 2.13.0 (#5485)
Some checks failed
L10n Update / update (push) Has been cancelled
CI / PHP (push) Has been cancelled
2026-03-27 01:29:40 +01:00
Eric Lippmann
36fa5377e7 Remove badges from README 2026-03-26 21:31:28 +01:00
Eric Lippmann
cbf20a0065 Add 2.13.0 to CHANGELOG.md 2026-03-26 21:31:28 +01:00
Eric Lippmann
b474b4347d Raise version to 2.13 2026-03-26 21:31:28 +01:00
Eric Lippmann
2402e9bd7a
Relicense to GPL-3.0-only and add SPDX license headers (#5486)
Relicense Icinga Web to GPL-3.0 and add SPDX license headers to source
files:

- Replace the old license file with LICENSE.md (GPL-3.0)
- Update license references in documentation (where applicable)
- Add SPDX headers to source files
- Mark source files as GPL-3.0-or-later

To ensure compatibility with third-party dependencies under licenses
incompatible with GPL-2.0-only (such as Apache-2.0), Icinga Web and its
module ecosystem are being relicensed to GPL-3.0-only.

Source files are labeled GPL-3.0-or-later to preserve the option to
relicense under later GPL versions.
2026-03-26 21:22:04 +01:00
Eric Lippmann
662de28f85 License source files as GPL-3.0-or-later
Add SPDX license headers and mark source files as GPL-3.0-or-later to
preserve the option to relicense under later GPL versions.
2026-03-26 17:49:26 +01:00
Eric Lippmann
1ab32de709 Upgrade license to GPL-3.0-only
To ensure compatibility with third-party dependencies under
licenses incompatible with GPL-2.0-only (such as Apache-2.0),
Icinga Web and its module ecosystem are being relicensed to
GPL-3.0-only.
2026-03-26 17:45:56 +01:00
Eric Lippmann
eb378ca0dc
Replace incubator module with icinga-php-legacy library (#5484)
The `icinga-php-legacy` library is the successor to the standalone
`icingaweb2-module-incubator` module. Modules such as director and
vspheredb that still declare `incubator` as a dependency should load
without a separate incubator installation once `icinga-php-legacy` is
present.

`Module::getRequiredLibraries` now maps an `incubator` module
requirement to an `icinga-php-legacy` library requirement when that
library is available, and `getRequiredModules` drops `incubator` from
the list so the dependency check does not fail. `Manager::loadModule`
skips calling `register()` for the incubator module under the same
condition, folding that guard into the existing `ipl`/`reactbundle`
exclusion to avoid a double-registration.

https://github.com/Icinga/icinga-php-legacy replaces
https://github.com/Icinga/icingaweb2-module-incubator.
2026-03-26 17:23:38 +01:00
Markus Opolka
9774f11c2f
Normalize confirm remove (#5429)
Some checks are pending
L10n Update / update (push) Waiting to run
CI / PHP (push) Waiting to run
This PR normalized the use of the phrase "Confirm Removal" in forms that
confirm removal.

It also normalizes the use of the "cancel" icon.
2026-03-26 16:08:34 +01:00
jrauh01
6ae99807b1
Add RequestHook (#5433) 2026-03-26 14:25:31 +01:00
Alexander Rieß
fce34897ac
Add disabled style to textareas (#5476)
Some checks are pending
L10n Update / update (push) Waiting to run
CI / PHP (push) Waiting to run
Use the same style for disabled textareas as other text input elements.
2026-03-25 15:28:06 +01:00
jrauh01
9f93d01d39
Improve title and label of user menu item in collapsed mode (#5412)
Remove `text-overflow: ellipsis` for user-nav-item link if sidebar is collapsed.
2026-03-25 15:24:09 +01:00
jrauh01
e83434d079
Tactical Overview: Add opacity on hover (#5400)
Add opacity on the big donut label if hovered.
2026-03-25 15:21:56 +01:00
jrauh01
158428fcae
Log user roles (#5311)
Log the roles assigned to a user during login in the debug log.
2026-03-25 15:19:54 +01:00
Eric Lippmann
ad8155431b
Support PHP 8.5 (#5454)
Some checks failed
L10n Update / update (push) Has been cancelled
CI / PHP (push) Has been cancelled
PHP 8.4:

- Change implicit nullable type declaration to explicit
- Only set `session.sid_bits_per_character` for PHP < 8.4 

PHP 8.5:

- Remove no-op `ReflectionProperty::setAccessible()` calls
- Replace backtick operator with `shell_exec()`
- Avoid passing `null` as key in `array_key_exists()`
- Avoid passing `null` to non-nullable parameters in built-in functions
- Use `Pdo\Mysql` driver-specific constants   

Other compatibility fixes:

- Avoid passing `null` as `ipl\Html` form element `$name`
- Use latest PHPUnit version
2026-03-20 15:21:44 +01:00
Bastian Lederer
9bd53accac Clean up and merge PHPStan baselines
Remove errors no longer reported. Since PHP 7.x is no longer supported, remove
the 7.x baseline. It is now no longer necessary to have multiple baseline
files.
2026-03-20 14:52:40 +01:00
Eric Lippmann
298f52456f Use Pdo\Mysql driver-specific constants
Replace deprecated `PDO::MYSQL_*` constant usage with the driver-specific
`Pdo\Mysql::ATTR_*` constants introduced in PHP 8.4.

This prepares the code for PHP 8.5, where accessing MySQL driver constants
through the generic `PDO` class is deprecated.

This change requires a compatibility shim on older PHP versions to provide
`Pdo\Mysql` for runtimes that do not expose the driver-specific class yet.  The
shim is provided in `ipl-sql`. As a consequence, the required version of the
Icinga PHP library has been raised.
2026-03-19 22:27:45 +01:00
Bastian Lederer
007abed960 Avoid passing null to non-nullable parameters in built-in functions
PHP 8.1 deprecated passing `null` to non-nullable parameters in built-in
functions (deprecated in 8.1, will become a `TypeError` in 9.0).
2026-03-19 22:27:45 +01:00
Eric Lippmann
1c4460c67a tests: Use latest PHPUnit version 2026-03-19 22:27:45 +01:00
Bastian Lederer
21b50939e5 Avoid passing null as ipl\Html form element $name
Forward compatibility fix: `ipl\Html` will introduce strict types, which
declares `$name` as string. Passing `null` will result in a `TypeError` once
strict types are enforced.
2026-03-19 22:27:41 +01:00
Bastian Lederer
5b2747e9cd Only set session.sid_bits_per_character for PHP < 8.4
PHP 8.4 has deprecated `session.sid_bits_per_character` along with
`session.sid_length`, as part of a broader effort to standardize session ID
generation for improved security and interoperability.
2026-03-10 16:40:27 +01:00