Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package icingaweb2-module-director for
openSUSE:Factory checked in at 2022-11-03 19:59:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/icingaweb2-module-director (Old)
and /work/SRC/openSUSE:Factory/.icingaweb2-module-director.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "icingaweb2-module-director"
Thu Nov 3 19:59:32 2022 rev:19 rq:1033146 version:1.10.2
Changes:
--------
---
/work/SRC/openSUSE:Factory/icingaweb2-module-director/icingaweb2-module-director.changes
2022-10-08 01:26:20.362383008 +0200
+++
/work/SRC/openSUSE:Factory/.icingaweb2-module-director.new.2275/icingaweb2-module-director.changes
2022-11-03 19:59:38.480067752 +0100
@@ -1,0 +2,24 @@
+Thu Nov 3 15:46:35 UTC 2022 - ecsos <[email protected]>
+
+- Update to 1.10.2
+ * Fixed issues
+ - You can find issues and feature requests related to this release on our
roadmap
+ * UI
+ - FEATURE: improve Service Set table layout (#2648)
+ - FIX: modifying single time-period ranges had no effect (#2525)
+ - FIX: activity log pagination is now on a single line (#2649)
+ * Import and Sync
+ - FIX: triggering Sync manually produced an error on PostgreSQL (#2636)
+ - FIX: purge stopped working for objects with uppercase characters (#2627)
+ - FIX: Notification Apply rule is now possible (wasn't since v1.8) (#2142,
#2634)
+ - FIX: nested property access with intermediate NULL values now gives NULL
(#2474, #2584)
+ - FIX: automated Sync jobs stopped working (#2633)
+ * Configuration Baskets
+ - FEATURE: more details shown in error messages related to invalid
characters (#2646)
+ - FIX: snapshots for Baskets containing Baskets failed since v1.10 (#2644)
+ * REST API
+ - FIX: Self Service API returned invalid JSON on PHP 8.1 (#2614)
+ * Internals
+ - FIX: issue with empty activity log, deprecate outdated method (#2630)
+
+-------------------------------------------------------------------
Old:
----
icingaweb2-module-director-1.10.1.tar.gz
New:
----
icingaweb2-module-director-1.10.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ icingaweb2-module-director.spec ++++++
--- /var/tmp/diff_new_pack.PHODvk/_old 2022-11-03 19:59:38.944070467 +0100
+++ /var/tmp/diff_new_pack.PHODvk/_new 2022-11-03 19:59:38.948070491 +0100
@@ -19,7 +19,7 @@
# See also http://en.opensuse.org/openSUSE:Specfile_guidelines
Name: icingaweb2-module-director
-Version: 1.10.1
+Version: 1.10.2
Release: 0
Summary: Config module for Icinga Web 2
License: GPL-2.0-or-later
++++++ icingaweb2-module-director-1.10.1.tar.gz ->
icingaweb2-module-director-1.10.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/icingaweb2-module-director-1.10.1/application/controllers/BranchController.php
new/icingaweb2-module-director-1.10.2/application/controllers/BranchController.php
---
old/icingaweb2-module-director-1.10.1/application/controllers/BranchController.php
2022-10-07 12:59:52.000000000 +0200
+++
new/icingaweb2-module-director-1.10.2/application/controllers/BranchController.php
2022-11-03 13:34:07.000000000 +0100
@@ -72,7 +72,8 @@
return null;
}
$object = DbObjectTypeRegistry::newObject($activity->getObjectTable(),
[], $this->db());
- foreach ($activity->getFormerProperties()->jsonSerialize() as $key =>
$value) {
+ $properties =
$this->objectTypeFirst($activity->getFormerProperties()->jsonSerialize());
+ foreach ($properties as $key => $value) {
$object->set($key, $value);
}
@@ -90,13 +91,26 @@
$object->set($key, $value);
}
}
- foreach ($activity->getModifiedProperties()->jsonSerialize() as $key
=> $value) {
+ $properties =
$this->objectTypeFirst($activity->getModifiedProperties()->jsonSerialize());
+ foreach ($properties as $key => $value) {
$object->set($key, $value);
}
return $object;
}
+ protected function objectTypeFirst($properties)
+ {
+ $properties = (array) $properties;
+ if (isset($properties['object_type'])) {
+ $type = $properties['object_type'];
+ unset($properties['object_type']);
+ $properties = ['object_type' => $type] + $properties;
+ }
+
+ return $properties;
+ }
+
protected function showActivity(BranchActivity $activity)
{
$left = $this->leftFromActivity($activity);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/icingaweb2-module-director-1.10.1/application/controllers/SelfServiceController.php
new/icingaweb2-module-director-1.10.2/application/controllers/SelfServiceController.php
---
old/icingaweb2-module-director-1.10.1/application/controllers/SelfServiceController.php
2022-10-07 12:59:52.000000000 +0200
+++
new/icingaweb2-module-director-1.10.2/application/controllers/SelfServiceController.php
2022-11-03 13:34:07.000000000 +0100
@@ -275,7 +275,7 @@
// PluginsUrl => framework_plugins_url
];
$username = $settings->get('self-service/icinga_service_user');
- if (strlen($username)) {
+ if ($username !== null && strlen($username) > 0) {
$params['icinga_service_user'] = $username;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/icingaweb2-module-director-1.10.1/doc/02-Installation.md
new/icingaweb2-module-director-1.10.2/doc/02-Installation.md
--- old/icingaweb2-module-director-1.10.1/doc/02-Installation.md
2022-10-07 12:59:52.000000000 +0200
+++ new/icingaweb2-module-director-1.10.2/doc/02-Installation.md
2022-11-03 13:34:07.000000000 +0100
@@ -1,151 +1,75 @@
-<a id="Installation"></a>Installation
-=====================================
+<!-- {% if index %} -->
+# Installing Icinga Director
-These are the instructions for manual Director installations. You can
-learn more about how to automate this in the [automation](03-Automation.md)
section
-of this documentation. In case you already installed Director and want to
upgrade
-to the latest version, please [read on here](05-Upgrading.md).
-
-Requirements
-------------
-
-* Icinga 2 (>= 2.8.0)
- * It is recommended to use the latest feature release of Icinga 2
- * All versions since 2.4.3 should also work fine, but
- we do no longer test and support them.
- * Some features require newer Icinga 2 releases
- * Flapping requires 2.8 for the thresholds to work - and at least 2.7 on
all
- nodes
-* Icinga Web 2 (>= 2.8.0). All versions since 2.2 should also work fine, but
- might show smaller UI bugs and are not actively tested
-* The following Icinga modules must be installed and enabled:
- * [incubator](https://github.com/Icinga/icingaweb2-module-incubator)
(>=0.18.0)
- * If you are using Icinga Web < 2.9.0, the following modules are also
required
- * [ipl](https://github.com/Icinga/icingaweb2-module-ipl) (>=0.5.0)
- * [reactbundle](https://github.com/Icinga/icingaweb2-module-reactbundle)
(>=0.9.0)
-* A database: MariaDB (>= 10.1), MySQL (>= 5.7), PostgreSQL (>= 9.6).
Other
- forks and older versions might work, but are neither tested not supported
-* PHP (>= 7.3)
- * Director v1.10 is the last version with support for PHP v5.6
-* php-pdo-mysql and/or php-pdo-pgsql
-* php-curl
-* php-iconv
-* php-pcntl (might already be built into your PHP binary)
-* php-posix (on RHEL/CentOS this is php-process, or rh-php7x-php-process)
-* php-sockets (might already be built into your PHP binary)
-* php-mbstring and php-json (already required by Icinga Web 2)
-
-Optional Requirements
----------------------
-* For IBM DB2 Imports: php-pdo-ibm
-* For MSSQL Imports: php-mssql or php-pdo-dblib (or -sybase on some platforms)
-* For Oracle DB Imports: php-oci8 or php-pdo-oci
-* For Sqlite Imports: php-pdo-sqlite
-
-Database
---------
-
-### Create an empty Icinga Director database
-
-HINT: You should replace `some-password` with a secure custom password.
-
-#### MySQL (or MariaDB)
-
- mysql -e "CREATE DATABASE director CHARACTER SET 'utf8';
- CREATE USER director@localhost IDENTIFIED BY 'some-password';
- GRANT ALL ON director.* TO director@localhost;"
-
-In case your MySQL root user is password-protected, please add `-p` to this
-command.
-
-#### PostgreSQL
-
- psql -q -c "CREATE DATABASE director WITH ENCODING 'UTF8';"
- psql director -q -c "CREATE USER director WITH PASSWORD 'some-password';
- GRANT ALL PRIVILEGES ON DATABASE director TO director;
- CREATE EXTENSION pgcrypto;"
-
-Web-based Configuration
------------------------
-
-The following steps should guide you through the web-based Kickstart wizard.
-In case you prefer automated configuration, you should check the dedicated
-[documentation section](03-Automation.md).
-
-### Create a Database resource
-
-In your web frontend please go to `Configuration / Application / Resources`
-and create a new database resource pointing to your newly created database.
-Please make sure that you choose `utf8` as an encoding.
-
-
-### Install the Director module
-
-As with any Icinga Web 2 module, installation is pretty straight-forward. In
-case you're installing it from source all you have to do is to drop the
director
-module in one of your module paths. You can examine (and set) the module
path(s)
-in `Configuration / Application`. In a typical environment you'll probably
drop the
-module to `/usr/share/icingaweb2/modules/director`. Please note that the
directory
-name MUST be `director` and not `icingaweb2-module-director` or anything else.
-
-#### Installation from release tarball
-
-Download the [latest
version](https://github.com/Icinga/icingaweb2-module-director/releases)
-and extract it to a folder named `director` in one of your Icinga Web 2 module
path directories.
-
-You might want to use a script as follows for this task:
-
-```shell
-MODULE_VERSION="1.10.1"
-ICINGAWEB_MODULEPATH="/usr/share/icingaweb2/modules"
-REPO_URL="https://github.com/icinga/icingaweb2-module-director"
-TARGET_DIR="${ICINGAWEB_MODULEPATH}/director"
-URL="${REPO_URL}/archive/v${MODULE_VERSION}.tar.gz"
-
-useradd -r -g icingaweb2 -d /var/lib/icingadirector -s /bin/false
icingadirector
-install -d -o icingadirector -g icingaweb2 -m 0750 /var/lib/icingadirector
-install -d -m 0755 "${TARGET_DIR}"
-wget -q -O - "$URL" | tar xfz - -C "${TARGET_DIR}" --strip-components 1
-cp "${TARGET_DIR}/contrib/systemd/icinga-director.service" /etc/systemd/system/
-
-icingacli module enable director
-systemctl daemon-reload
-systemctl enable icinga-director.service
-systemctl start icinga-director.service
-```
+The recommended way to install Icinga Director and its dependencies is to use
prebuilt packages for
+all supported platforms from our official release repository.
+Please note that [Icinga Web](https://icinga.com/docs/icinga-web) is required
to run Icinga Director
+and if it is not already set up, it is best to do this first.
+
+The following steps will guide you through installing and setting up Icinga
Director.
+
+To upgrade an existing Icinga Director installation to a newer version,
+see the [upgrading](05-Upgrading.md) documentation for the necessary steps.
+
+If you want to automate the installation, configuration and upgrade,
+you can learn more about it in the [automation](03-Automation.md) section of
this documentation.
+
+## Optional Requirements
+
+The following requirements are not necessary for installation,
+but may be needed later if you want to import from one of the listed sources:
+
+* For **IBM Db2** imports: `php-pdo-ibm`
+* For **Microsoft SQL Server** imports: `php-mssql`, `php-pdo-dblib` or
`php-sybase` depending on your platform
+* For **Oracle Database** imports: `php-oci8` or `php-pdo-oci` depending on
your platform
+* For **SQLite** imports: `php-pdo-sqlite`
+<!-- {% else %} -->
+<!-- {% if not icingaDocs %} -->
+
+## Installing Icinga Director Package
-Proceed to running the kickstart wizard.
+If the [repository](https://packages.icinga.com) is not configured yet, please
add it first.
+Then use your distribution's package manager to install the `icinga-director`
package
+or install [from source](02-Installation.md.d/From-Source.md).
+<!-- {% endif %} -->
-#### Installation from GIT repository
+## Setting up the Database
-Another convenient method is the installation directly from our GIT repository.
-Just clone the repository to one of your Icinga Web 2 module path directories.
-It will be immediately ready for use:
-
-```shell
-MODULE_VERSION="1.10.1"
-ICINGAWEB_MODULEPATH="/usr/share/icingaweb2/modules"
-REPO_URL="https://github.com/icinga/icingaweb2-module-director"
-TARGET_DIR="${ICINGAWEB_MODULEPATH}/director"
-
-useradd -r -g icingaweb2 -d /var/lib/icingadirector -s /bin/false
icingadirector
-install -d -o icingadirector -g icingaweb2 -m 0750 /var/lib/icingadirector
-git clone "${REPO_URL}" "${TARGET_DIR}" --branch v${MODULE_VERSION}
-cp "${TARGET_DIR}/contrib/systemd/icinga-director.service" /etc/systemd/system/
-
-icingacli module enable director
-systemctl daemon-reload
-systemctl enable icinga-director.service
-systemctl start icinga-director.service
+A MySQL (???5.7), MariaDB (???10.1), or PostgreSQL (???9.6) database is
required to run Icinga Director.
+Please follow the steps listed for your target database, to set up the
database and the user.
+The schema will be imported later via the web interface.
+
+### Setting up a MySQL or MariaDB Database
+
+> **Warning**
+> Make sure to replace `CHANGEME` with a secure password.
+
+```
+mysql -e "CREATE DATABASE director CHARACTER SET 'utf8';
+ CREATE USER director@localhost IDENTIFIED BY 'CHANGEME';
+ GRANT ALL ON director.* TO director@localhost;"
```
-Proceed to running the kickstart wizard.
+### Setting up a PostgreSQL Database
+
+> **Warning**
+> Make sure to replace `CHANGEME` with a secure password.
+
+```
+psql -q -c "CREATE DATABASE director WITH ENCODING 'UTF8';"
+psql director -q -c "CREATE USER director WITH PASSWORD 'CHANGEME';
+GRANT ALL PRIVILEGES ON DATABASE director TO director;
+CREATE EXTENSION pgcrypto;"
+```
-### Run the graphical kickstart wizard
+## Configuring Icinga Director
-Choose either `Icinga Director` directly from the main menu or
-navigate into `Configuration / Modules / director` and select the
`Configuration`
-tab.
+Log in to your running Icinga Web setup with a privileged user
+and follow the steps below to configure Icinga Director:
-Either way you'll reach the kickstart wizards. Follow the instructions, and
-you're all done!
+1. Create a new resource for the Icinga Director
[database](#setting-up-the-database) via the
+ `Configuration ??? Application ??? Resources` menu.
+ Please make sure that you configure `utf8` as encoding.
+2. Select `Icinga Director` directly from the main menu
+ and you will be taken to the kickstart wizard. Follow the instructions and
you are done!
+<!-- {% endif %} --><!-- {# end else if index #} -->
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/icingaweb2-module-director-1.10.1/doc/02-Installation.md.d/From-Source.md
new/icingaweb2-module-director-1.10.2/doc/02-Installation.md.d/From-Source.md
---
old/icingaweb2-module-director-1.10.1/doc/02-Installation.md.d/From-Source.md
1970-01-01 01:00:00.000000000 +0100
+++
new/icingaweb2-module-director-1.10.2/doc/02-Installation.md.d/From-Source.md
2022-11-03 13:34:07.000000000 +0100
@@ -0,0 +1,83 @@
+# Installing Icinga Director from Source
+
+These are the instructions for manual Director installations.
+
+Please see the Icinga Web documentation on
+[how to install
modules](https://icinga.com/docs/icinga-web-2/latest/doc/08-Modules/#installation)
from source.
+Make sure you use `director` as the module name. The following requirements
must also be met.
+
+## Requirements
+
+* PHP (???7.3)
+ * Director v1.10 is the last version with support for PHP v5.6
+* [Icinga 2](https://github.com/Icinga/icinga2) (???2.8.0)
+ * It is recommended to use the latest feature release of Icinga 2
+ * All versions since 2.4.3 should also work fine, but
+ we do no longer test and support them.
+ * Some features require newer Icinga 2 releases
+ * Flapping requires 2.8 for the thresholds to work - and at least 2.7
on all
+ nodes
+* [Icinga Web](https://github.com/Icinga/icingaweb2) (???2.8.0). All versions
since 2.2 should also work fine, but
+ might show smaller UI bugs and are not actively tested
+* The following Icinga modules must be installed and enabled:
+ * [incubator](https://github.com/Icinga/icingaweb2-module-incubator)
(???0.18.0)
+ * If you are using Icinga Web <2.9.0, the following modules are also
required
+ * [ipl](https://github.com/Icinga/icingaweb2-module-ipl) (???0.5.0)
+ *
[reactbundle](https://github.com/Icinga/icingaweb2-module-reactbundle)
(???0.9.0)
+* A database: MariaDB (???10.1), MySQL (???5.7), PostgreSQL (???9.6). Other
+ forks and older versions might work, but are neither tested nor supported
+* `php-pdo-mysql` and/or `php-pdo-pgsql`
+* `php-curl`
+* `php-iconv`
+* `php-pcntl` (might already be built into your PHP binary)
+* `php-posix` or `php-process` depending on your platform
+* `php-sockets` (might already be built into your PHP binary)
+
+## Installing from Release Tarball
+
+Download the [latest
version](https://github.com/Icinga/icingaweb2-module-director/releases)
+and extract it to a folder named `director` in one of your Icinga Web module
path directories.
+
+You might want to use a script as follows for this task:
+
+```shell
+MODULE_VERSION="1.10.2"
+ICINGAWEB_MODULEPATH="/usr/share/icingaweb2/modules"
+REPO_URL="https://github.com/icinga/icingaweb2-module-director"
+TARGET_DIR="${ICINGAWEB_MODULEPATH}/director"
+URL="${REPO_URL}/archive/v${MODULE_VERSION}.tar.gz"
+
+install -d -m 0755 "${TARGET_DIR}"
+wget -q -O - "$URL" | tar xfz - -C "${TARGET_DIR}" --strip-components 1
+icingacli module enable director
+```
+
+## Installing from Git Repository
+
+Another convenient method is to install directly from our Git repository.
+Simply clone the repository in one of your Icinga web module path directories.
+
+You might want to use a script as follows for this task:
+
+```shell
+MODULE_VERSION="1.10.2"
+ICINGAWEB_MODULEPATH="/usr/share/icingaweb2/modules"
+REPO_URL="https://github.com/icinga/icingaweb2-module-director"
+TARGET_DIR="${ICINGAWEB_MODULEPATH}/director"
+
+git clone "${REPO_URL}" "${TARGET_DIR}" --branch v${MODULE_VERSION}
+icingacli module enable director
+```
+
+## Setting up the Director Daemon
+
+For manual installations, the daemon user, its directory, and the systemd
service need to be set up:
+
+```shell
+useradd -r -g icingaweb2 -d /var/lib/icingadirector -s /sbin/nologin
icingadirector
+install -d -o icingadirector -g icingaweb2 -m 0750 /var/lib/icingadirector
+install -pm 0644 contrib/systemd/icinga-director.service /etc/systemd/system
+systemctl daemon-reload
+systemctl enable --now icinga-director
+```
+<!-- {% include "02-Installation.md" %} -->
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/icingaweb2-module-director-1.10.1/doc/82-Changelog.md
new/icingaweb2-module-director-1.10.2/doc/82-Changelog.md
--- old/icingaweb2-module-director-1.10.1/doc/82-Changelog.md 2022-10-07
12:59:52.000000000 +0200
+++ new/icingaweb2-module-director-1.10.2/doc/82-Changelog.md 2022-11-03
13:34:07.000000000 +0100
@@ -4,6 +4,43 @@
Please make sure to always read our [Upgrading](05-Upgrading.md) documentation
before switching to a new version.
+v1.10.2
+-------
+
+This is a minor bugfix release, addressing some Sync-related issues: purge for
+objects with uppercase characters now works as expected, automated Sync jobs
run
+again, and manually triggered Sync has been fixed on PostgreSQL.
+
+Some UI glitches have been addressed, and a few problems appearing only in
+certain conditions - related to Configuration Baskets, our Self Service REST
API
+and the Activity Log.
+
+### Fixed issues
+* You can find issues and feature requests related to this release on our
+
[roadmap](https://github.com/Icinga/icingaweb2-module-director/milestone/31?closed=1)
+
+### UI
+* FEATURE: improve Service Set table layout (#2648)
+* FIX: modifying single time-period ranges had no effect (#2525)
+* FIX: activity log pagination is now on a single line (#2649)
+
+### Import and Sync
+* FIX: triggering Sync manually produced an error on PostgreSQL (#2636)
+* FIX: purge stopped working for objects with uppercase characters (#2627)
+* FIX: Notification Apply rule is now possible (wasn't since v1.8) (#2142,
#2634)
+* FIX: nested property access with intermediate NULL values now gives NULL
(#2474, #2584)
+* FIX: automated Sync jobs stopped working (#2633)
+
+### Configuration Baskets
+* FEATURE: more details shown in error messages related to invalid characters
(#2646)
+* FIX: snapshots for Baskets containing Baskets failed since v1.10 (#2644)
+
+### REST API
+* FIX: Self Service API returned invalid JSON on PHP 8.1 (#2614)
+
+### Internals
+* FIX: issue with empty activity log, deprecate outdated method (#2630)
+
v1.10.1
-------
@@ -43,6 +80,39 @@
v1.10.0
-------
+An advanced **Sync Preview** is one of the features I'd love to highlight in
+v1.10.0. We have been able to leverage our Configuration Branch support as
+an underlying technology for this:
+
+
+
+In case you have lots of changes, you can browse all of them - formerly this
+hasn't been possible. Also, this now allows you to inspect every single
upcoming
+change before applying the Sync:
+
+
+
+This has been possible based on the code we implemented to support the
+[Director Branches](https://icinga.com/docs/icinga-director-branches/latest/)
+module. In case you never heard about it,
+[here](https://icinga.com/blog/2022/07/21/releasing-icinga-director-branches/)
+you can find the related announcement.
+
+This release also contains a lot of related fixes and new Features. It is now
+possible to deal with **Service Sets** in Configuration Branches, the **commit
+remark** can be proposed with a merge request, and the Activity Log shows not
+only who has merged the change, but also the **original author**.
+
+Powerful new features have been implemented for those who love to orchestrate
+the Director from the outside. Please check our
+[CLI](https://github.com/Icinga/icingaweb2-module-director/blob/v1.10.0/doc/60-CLI.md)
+and [REST
API](https://github.com/Icinga/icingaweb2-module-director/blob/v1.10.0/doc/70-REST-API.md)
+documentation for related details, especially look for --with-services
(withServices)
+and --allow-overrides (allowOverrides).
+
+CLI now supports **JSON on STDIN**, REST API can request detailed stack traces
+in case an error occurs.
+
### Breaking Changes
* Module and system dependencies have been raised, [Upgrading](05-Upgrading.md)
and [Installation](02-Installation.md) documentations contain related details
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/icingaweb2-module-director-1.10.1/library/Director/Data/Db/DbConnection.php
new/icingaweb2-module-director-1.10.2/library/Director/Data/Db/DbConnection.php
---
old/icingaweb2-module-director-1.10.1/library/Director/Data/Db/DbConnection.php
2022-10-07 12:59:52.000000000 +0200
+++
new/icingaweb2-module-director-1.10.2/library/Director/Data/Db/DbConnection.php
2022-11-03 13:34:07.000000000 +0100
@@ -3,6 +3,7 @@
namespace Icinga\Module\Director\Data\Db;
use Icinga\Data\Db\DbConnection as IcingaDbConnection;
+use Icinga\Module\Director\Db\DbUtil;
use RuntimeException;
use Zend_Db_Expr;
@@ -18,21 +19,14 @@
return $this->getDbType() === 'pgsql';
}
+ /**
+ * @deprecated
+ * @param ?string $binary
+ * @return Zend_Db_Expr|Zend_Db_Expr[]|null
+ */
public function quoteBinary($binary)
{
- if ($binary === '') {
- return '';
- }
-
- if (is_array($binary)) {
- return array_map([$this, 'quoteBinary'], $binary);
- }
-
- if ($this->isPgsql()) {
- return new Zend_Db_Expr("'\\x" . bin2hex($binary) . "'");
- }
-
- return new Zend_Db_Expr('0x' . bin2hex($binary));
+ return DbUtil::quoteBinaryLegacy($binary, $this->getDbAdapter());
}
public function binaryDbResult($value)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/icingaweb2-module-director-1.10.1/library/Director/Data/Db/DbObjectStore.php
new/icingaweb2-module-director-1.10.2/library/Director/Data/Db/DbObjectStore.php
---
old/icingaweb2-module-director-1.10.1/library/Director/Data/Db/DbObjectStore.php
2022-10-07 12:59:52.000000000 +0200
+++
new/icingaweb2-module-director-1.10.2/library/Director/Data/Db/DbObjectStore.php
2022-11-03 13:34:07.000000000 +0100
@@ -9,6 +9,7 @@
use Icinga\Module\Director\Db\Branch\MergeErrorDeleteMissingObject;
use Icinga\Module\Director\Db\Branch\MergeErrorModificationForMissingObject;
use Icinga\Module\Director\Db\Branch\MergeErrorRecreateOnMerge;
+use Icinga\Module\Director\Db\DbUtil;
use Icinga\Module\Director\Objects\IcingaObject;
use Ramsey\Uuid\UuidInterface;
@@ -67,6 +68,7 @@
$query = $db->select()->from($tableName)->order($arrayIdx);
$result = [];
foreach ($db->fetchAll($query) as $row) {
+ $row->uuid = DbUtil::binaryResult($row->uuid);
$result[$row->uuid] = $class::create((array) $row,
$this->connection);
$result[$row->uuid]->setBeingLoadedFromDb();
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/icingaweb2-module-director-1.10.1/library/Director/Data/Exporter.php
new/icingaweb2-module-director-1.10.2/library/Director/Data/Exporter.php
--- old/icingaweb2-module-director-1.10.1/library/Director/Data/Exporter.php
2022-10-07 12:59:52.000000000 +0200
+++ new/icingaweb2-module-director-1.10.2/library/Director/Data/Exporter.php
2022-11-03 13:34:07.000000000 +0100
@@ -248,6 +248,7 @@
$props['settings'] = (object) $object->getSettings(); //
Already sorted
}
}
+ unset($props['uuid']); // Not yet
if (! $this->showDefaults) {
foreach ($props as $key => $value) {
// We assume NULL as a default value for all non-IcingaObject
properties
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/icingaweb2-module-director-1.10.1/library/Director/Db/Branch/BranchedObject.php
new/icingaweb2-module-director-1.10.2/library/Director/Db/Branch/BranchedObject.php
---
old/icingaweb2-module-director-1.10.1/library/Director/Db/Branch/BranchedObject.php
2022-10-07 12:59:52.000000000 +0200
+++
new/icingaweb2-module-director-1.10.2/library/Director/Db/Branch/BranchedObject.php
2022-11-03 13:34:07.000000000 +0100
@@ -267,14 +267,14 @@
if ($this->object->hasProperty('object_type')) {
$branched->set('object_type',
$this->object->get('object_type'));
}
+ $branched->set('id', $this->object->get('id'));
+ $branched->set('uuid', $this->object->get('uuid'));
foreach ((array) $this->object->toPlainObject(false, true) as $key
=> $value) {
if ($key === 'object_type') {
continue;
}
$branched->set($key, $value);
}
- $branched->set('id', $this->object->get('id'));
- $branched->set('uuid', $this->object->get('uuid'));
} else {
$branched = DbObjectTypeRegistry::newObject($this->objectTable,
[], $connection);
$branched->setUniqueId($this->objectUuid);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/icingaweb2-module-director-1.10.1/library/Director/DirectorObject/Automation/BasketSnapshot.php
new/icingaweb2-module-director-1.10.2/library/Director/DirectorObject/Automation/BasketSnapshot.php
---
old/icingaweb2-module-director-1.10.1/library/Director/DirectorObject/Automation/BasketSnapshot.php
2022-10-07 12:59:52.000000000 +0200
+++
new/icingaweb2-module-director-1.10.2/library/Director/DirectorObject/Automation/BasketSnapshot.php
2022-11-03 13:34:07.000000000 +0100
@@ -2,6 +2,8 @@
namespace Icinga\Module\Director\DirectorObject\Automation;
+use gipfl\Json\JsonEncodeException;
+use gipfl\Json\JsonString;
use Icinga\Module\Director\Core\Json;
use Icinga\Module\Director\Data\Exporter;
use Icinga\Module\Director\Db;
@@ -418,7 +420,30 @@
return $this->getContent()->get('content');
}
- return Json::encode($this->objects, JSON_PRETTY_PRINT);
+ try {
+ return JsonString::encode($this->objects, JSON_PRETTY_PRINT);
+ } catch (JsonEncodeException $e) {
+ foreach ($this->objects as $type => $objects) {
+ foreach ($objects as $object) {
+ try {
+ JsonString::encode($object);
+ } catch (JsonEncodeException $singleError) {
+ $dump = var_export($object, 1);
+ if (function_exists('iconv')) {
+ $dump = iconv('UTF-8', 'UTF-8//IGNORE', $dump);
+ }
+ throw new JsonEncodeException(sprintf(
+ 'Failed to encode object ot type "%s": %s, %s',
+ $type,
+ $dump,
+ $singleError->getMessage()
+ ), $singleError->getCode());
+ }
+ }
+ }
+
+ throw $e;
+ }
}
protected function addAll($typeName)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/icingaweb2-module-director-1.10.1/library/Director/Import/Sync.php
new/icingaweb2-module-director-1.10.2/library/Director/Import/Sync.php
--- old/icingaweb2-module-director-1.10.1/library/Director/Import/Sync.php
2022-10-07 12:59:52.000000000 +0200
+++ new/icingaweb2-module-director-1.10.2/library/Director/Import/Sync.php
2022-11-03 13:34:07.000000000 +0100
@@ -690,6 +690,7 @@
$noAction = [];
$purgeAction = $this->rule->get('purge_action');
foreach ($this->rule->purgeStrategy()->listObjectsToPurge() as $key) {
+ $key = strtolower($key);
if (array_key_exists($key, $newObjects)) {
// Object has been touched, do not delete
continue;
@@ -883,7 +884,7 @@
}
$this->run->setProperties($runProperties);
- if (!$this->store->getBranch()->isBranch()) {
+ if (!$this->store || !$this->store->getBranch()->isBranch()) {
$this->run->store();
}
$this->notifyResolvers();
@@ -895,7 +896,7 @@
$this->run->set('duration_ms', (int) round(
(microtime(true) - $this->runStartTime) * 1000
));
- if (!$this->store->getBranch()->isBranch()) {
+ if (!$this->store || !$this->store->getBranch()->isBranch()) {
$this->run->store();
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/icingaweb2-module-director-1.10.1/library/Director/Import/SyncUtils.php
new/icingaweb2-module-director-1.10.2/library/Director/Import/SyncUtils.php
--- old/icingaweb2-module-director-1.10.1/library/Director/Import/SyncUtils.php
2022-10-07 12:59:52.000000000 +0200
+++ new/icingaweb2-module-director-1.10.2/library/Director/Import/SyncUtils.php
2022-11-03 13:34:07.000000000 +0100
@@ -91,6 +91,9 @@
if (! property_exists($row, $main)) {
return null;
}
+ if ($row->$main === null) {
+ return null;
+ }
if (! is_object($row->$main)) {
throw new InvalidArgumentException(sprintf(
@@ -107,12 +110,12 @@
/**
* Fill variables in the given string pattern
*
- * This replaces all occurances of ${var_name} with the corresponding
+ * This replaces all occurrences of ${var_name} with the corresponding
* property $row->var_name of the given row object. Missing variables are
* replaced by an empty string. This works also fine in case there are
* multiple variables to be found in your string.
*
- * @param string $string String with opional variables/placeholders
+ * @param string $string String with optional variables/placeholders
* @param object $row stdClass object providing property values
*
* @return string
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/icingaweb2-module-director-1.10.1/library/Director/Objects/IcingaNotification.php
new/icingaweb2-module-director-1.10.2/library/Director/Objects/IcingaNotification.php
---
old/icingaweb2-module-director-1.10.1/library/Director/Objects/IcingaNotification.php
2022-10-07 12:59:52.000000000 +0200
+++
new/icingaweb2-module-director-1.10.2/library/Director/Objects/IcingaNotification.php
2022-11-03 13:34:07.000000000 +0100
@@ -192,7 +192,7 @@
if ($this->isApplyRule()) {
if (($to = $this->get('apply_to')) === null) {
throw new RuntimeException(sprintf(
- 'Applied notification "%s" has no valid object type',
+ 'No "apply_to" object type has been set for Applied
notification "%s"',
$this->getObjectName()
));
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/icingaweb2-module-director-1.10.1/library/Director/Objects/IcingaObject.php
new/icingaweb2-module-director-1.10.2/library/Director/Objects/IcingaObject.php
---
old/icingaweb2-module-director-1.10.1/library/Director/Objects/IcingaObject.php
2022-10-07 12:59:52.000000000 +0200
+++
new/icingaweb2-module-director-1.10.2/library/Director/Objects/IcingaObject.php
2022-11-03 13:34:07.000000000 +0100
@@ -497,9 +497,14 @@
$type = get_class($this);
}
+ if ($type === null) {
+ throw new LogicException(
+ 'Cannot set assign_filter unless object_type has been set'
+ );
+ }
throw new LogicException(sprintf(
'I can only assign for applied objects or objects with native'
- . ' support for assigments, got %s',
+ . ' support for assignments, got %s',
$type
));
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/icingaweb2-module-director-1.10.1/library/Director/Objects/IcingaRanges.php
new/icingaweb2-module-director-1.10.2/library/Director/Objects/IcingaRanges.php
---
old/icingaweb2-module-director-1.10.1/library/Director/Objects/IcingaRanges.php
2022-10-07 12:59:52.000000000 +0200
+++
new/icingaweb2-module-director-1.10.2/library/Director/Objects/IcingaRanges.php
2022-11-03 13:34:07.000000000 +0100
@@ -141,7 +141,7 @@
} else {
$class = $this->getRangeClass();
$this->ranges[$range] = $class::create([
- $this->objectIdColumn => $this->object->id,
+ $this->objectIdColumn => $this->object->get('id'),
'range_key' => $range,
'range_value' => $value,
]);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/icingaweb2-module-director-1.10.1/library/Director/Web/Table/ObjectSetTable.php
new/icingaweb2-module-director-1.10.2/library/Director/Web/Table/ObjectSetTable.php
---
old/icingaweb2-module-director-1.10.1/library/Director/Web/Table/ObjectSetTable.php
2022-10-07 12:59:52.000000000 +0200
+++
new/icingaweb2-module-director-1.10.2/library/Director/Web/Table/ObjectSetTable.php
2022-11-03 13:34:07.000000000 +0100
@@ -9,6 +9,7 @@
use gipfl\IcingaWeb2\Url;
use Icinga\Module\Director\Db\DbSelectParenthesis;
use Icinga\Module\Director\Restriction\FilterByNameRestriction;
+use ipl\Html\Html;
use Ramsey\Uuid\Uuid;
class ObjectSetTable extends ZfQueryBasedTable
@@ -62,7 +63,7 @@
$row->object_name,
$row->count_services
), $url),
- $row->description ? ': ' . $row->description : null
+ $row->description ? [Html::tag('br'), Html::tag('i',
$row->description)] : null
])
]);
if (! empty($classes)) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/icingaweb2-module-director-1.10.1/module.info
new/icingaweb2-module-director-1.10.2/module.info
--- old/icingaweb2-module-director-1.10.1/module.info 2022-10-07
12:59:52.000000000 +0200
+++ new/icingaweb2-module-director-1.10.2/module.info 2022-11-03
13:34:07.000000000 +0100
@@ -1,5 +1,5 @@
Name: Icinga Director
-Version: 1.10.1
+Version: 1.10.2
Depends: reactbundle (>=0.9.0), ipl (>=0.5.0), incubator (>=0.18.0)
Description: Director - Config tool for Icinga 2
Icinga Director is a configuration tool that has been designed to make
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/icingaweb2-module-director-1.10.1/public/css/module.less
new/icingaweb2-module-director-1.10.2/public/css/module.less
--- old/icingaweb2-module-director-1.10.1/public/css/module.less
2022-10-07 12:59:52.000000000 +0200
+++ new/icingaweb2-module-director-1.10.2/public/css/module.less
2022-11-03 13:34:07.000000000 +0100
@@ -49,6 +49,14 @@
margin-right: 1em;
}
+.controls > .pagination-control li > a {
+ padding: 0.5em 0 0.5em 0;
+}
+
+.controls > .pagination-control > ul {
+ float: right;
+}
+
div.action-bar {
.pagination-control {
float: none;