Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

chore(release): merge release-22.04.next into 22.04.x #11821

Merged
merged 61 commits into from
Sep 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
23da75b
fix(git): resync 22.04.x to dev-22.04.x (#11503)
chgautier Aug 4, 2022
8e2622a
fix(cron): Escape database name in CentACL 22.04.x (#11510)
hyahiaoui-ext Aug 4, 2022
8caceb8
fix(test): wait 8s before checking downtime is active in rest api v1 …
kduret Aug 5, 2022
5de9f39
fix(UI): Include host_id when selecting ServiceGroups on dashreports …
emabassi-ext Aug 5, 2022
906de85
fix(Resources/Graph): export graph image after selecting png (#11491)
Noha-ElAbrouki Aug 5, 2022
f850b2b
Fix(platform): Removing appkey key (#11511)
hyahiaoui-ext Aug 5, 2022
6e01506
fix(trap): Removal of the restriction on the uniqueness of the OID of…
callapa Aug 5, 2022
7a46d37
fix(pendo): correctly set locale when language is detection by browse…
jeremyjaouen Aug 5, 2022
5d0c218
fix(test): fix random fails on virtual metric test (#11523)
kduret Aug 5, 2022
5f24edd
fix(autoload): Add classmap to fix autoload with legacy classes (#114…
callapa Aug 8, 2022
cea8936
fix(ldap): small refacto of ldap authentication and log failures (#11…
kduret Aug 8, 2022
9bf6e43
fix(api): allow api platform updates from installed 22.04.0 (#11495) …
kduret Aug 8, 2022
e3d0a8c
fix(api): fix call to api on fresh install (#11536) (#11537)
kduret Aug 8, 2022
3e3fde6
doc(ack): acknowledge Hakaï security (#11540)
sc979 Aug 8, 2022
5308ae2
fix(api): do not init db connection in event subscriber (#11543) (#11…
kduret Aug 9, 2022
dc637bf
fix(web): fix the comment deletion for host monitored by poller (#111…
kduret Aug 10, 2022
5f578e3
SNYK: Sanitize and bind ACL actions queries (#11547)
hyahiaoui-ext Aug 11, 2022
a10cda4
SNYK: Sanitize and bind Broker listing queries (#11550)
hyahiaoui-ext Aug 11, 2022
ea8fc8f
fix(conf) fix encoding in template service listing (#11558) (#11564)
a-launois Aug 11, 2022
72cde99
SNYK: Sanitize and bind generateImage queries (#11561)
hyahiaoui-ext Aug 11, 2022
816e82e
MON-14501 - sanitize query in centreonXmlbgRequest class (#11570)
emabassi-ext Aug 11, 2022
288518a
SNYK: Sanitize and bind Meta-Services dependency queries (#11567)
emabassi-ext Aug 11, 2022
10d1f83
chore(release):rebase dev-22.04.x on 22.04.x (#11627)
chgautier Aug 26, 2022
c14ad3b
fix(partition): adapt control of database version (#11609) (#11610)
jeremyjaouen Aug 26, 2022
51dc751
fix(openid): correctly set contact_location while creating session (#…
jeremyjaouen Aug 26, 2022
0220a7f
fix(lang): Fixed FR typo (#11621)
lpinsivy Aug 26, 2022
824bd01
enh(UI): Add a “Parent alias“ column on the monitoring resources sta…
Jordan91 Aug 29, 2022
4aaa37c
query sanitized in listServiceCategoriesà (#11597) (#11632)
emabassi-ext Aug 29, 2022
d9b07e3
MON-14797 reorganizes dependencies (#11612)
lgcosta Aug 30, 2022
003259b
Fix encoding issue on status serviceXML (#11581)
TamazC Aug 30, 2022
9c8ae3f
sanitize and bind in centreon connector query (#11635)
emabassi-ext Aug 31, 2022
1b20575
sanitize insrert queries in db-func (#11650)
emabassi-ext Aug 31, 2022
8cd13ee
chore(git): update codeowners (#11594)
sc979 Sep 5, 2022
cee229f
chore(release):rebase dev-22.04.x on 22.04.x (#11688)
chgautier Sep 5, 2022
6e36e23
fix(details): remove dead code (#11672) (#11686)
adr-mo Sep 5, 2022
0efdce8
fix(conf) fix parent template display in service template listing (#1…
a-launois Sep 5, 2022
8f82149
fix(poller): fix remote server duplication (#11552) (#11674)
kduret Sep 5, 2022
3a14208
fix translation for host and service category (#11626)
Noha-ElAbrouki Sep 5, 2022
d86b34b
fix(clapi): Check that user is admin to use clapi (#11631) (#11640)
jeremyjaouen Sep 5, 2022
391dd57
Sanitized and bound queries in service argumentsXml fil (#11653)
emabassi-ext Sep 5, 2022
07e5cc1
Sanitize and bind listVirtualMetrics queries (#11647)
emabassi-ext Sep 5, 2022
48cc207
sanitize and bind host categories queries (#11645)
emabassi-ext Sep 5, 2022
c93212e
Ãbind queries an fix array binding(#11656)
emabassi-ext Sep 5, 2022
0cec318
fix(ui): fix svg display in legacy monitoring pages (#11659) (#11690)
kduret Sep 5, 2022
10a5d6b
Sanitize and bind service group dependecies queries 22.04.x (#11665)
hyahiaoui-ext Sep 5, 2022
e31d6a9
MON-14425 fix centreon.ini and autoconfigure timezone (#11608)
lgcosta Sep 6, 2022
3b1eab2
enh(Resources/header): Display the 2 access pictograms logs and repor…
Noha-ElAbrouki Sep 6, 2022
033ee10
fix(resource-status): add missing alias to Host detail factory (#11642)
adr-mo Sep 6, 2022
1d4ebde
fix(widgets): retrieve possibility to not select poller in pref (#116…
kduret Sep 6, 2022
1137f9b
fix(install): fix source install with quiet mode related to gorgone v…
kduret Sep 6, 2022
43b13e8
Fix: In Acces group the second select not working [ACL] 22.04.x (#11709)
hyahiaoui-ext Sep 7, 2022
62198b1
fix(details): second part of code cleanup for "tools" (#11718) (#11721)
adr-mo Sep 8, 2022
98a1bc4
fix (#11724)
Noha-ElAbrouki Sep 12, 2022
d78b88b
FIX: Sanitize and bind graph configuration queries 22.04.x (#11729)
hyahiaoui-ext Sep 12, 2022
31482f6
[Fix]:Sanitize and bind queries in template of service listing (#11746)
emabassi-ext Sep 13, 2022
0df5876
fix(resource): Fix bad SQL request (#11702) (#11749)
callapa Sep 13, 2022
2aebf3e
FIX: Sanitize and bind Meta Service configuration 22.04.x (#11733)
hyahiaoui-ext Sep 13, 2022
9e28662
Fix: Sanitize and bind CLAPI poller configuration 22.04.x (#11731)
hyahiaoui-ext Sep 13, 2022
18febd4
FIX: Sanitize and bind command configuration queries 22.04.x (#11754)
hyahiaoui-ext Sep 13, 2022
0180c02
fix(partition): fix condition for database version (#11657) (#11756)
kduret Sep 13, 2022
3ec2ec6
Merge branch '22.04.x' into release-22.04.next
jeremyjaouen Sep 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
/project/ @centreon/centreon-devops
*.sh @centreon/centreon-devops

/.snyk @centreon/centreon-security
/sonar-project.properties @centreon/centreon-security

*.po @centreon/centreon-documentation

/src/ @centreon/centreon-php
Expand Down
2 changes: 1 addition & 1 deletion bin/registerServerTopology.sh
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ function request_to_remote() {
fi

# Prepare Remote Payload
REMOTE_PAYLOAD='{"isRemote":true,"platformName":"'"${CURRENT_NODE_NAME}"'","centralServerAddress":"'"${PARSED_URL[HOST]}"'","apiUsername":"'"${API_USERNAME}"'","apiCredentials":"'"${API_TARGET_PASSWORD}"'","apiScheme":"'"${PARSED_URL[SCHEME]}"'","apiPort":'"${PARSED_URL[PORT]}"',"apiPath":"'"${CENTREON_BASE_URI}"'",'"${PEER_VALIDATION}"
REMOTE_PAYLOAD='{"isRemote":true,"address":"'${PARSED_CURRENT_NODE_URL[HOST]}'","platformName":"'"${CURRENT_NODE_NAME}"'","centralServerAddress":"'"${PARSED_URL[HOST]}"'","apiUsername":"'"${API_USERNAME}"'","apiCredentials":"'"${API_TARGET_PASSWORD}"'","apiScheme":"'"${PARSED_URL[SCHEME]}"'","apiPort":'"${PARSED_URL[PORT]}"',"apiPath":"'"${CENTREON_BASE_URI}"'",'"${PEER_VALIDATION}"
if [[ -n PROXY_PAYLOAD ]]; then
REMOTE_PAYLOAD="${REMOTE_PAYLOAD}""${PROXY_PAYLOAD}"
fi
Expand Down
13 changes: 13 additions & 0 deletions ci/debian/centreon-web.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,17 @@ if [ -n "$2" ]; then
su - www-data -s /bin/bash -c "/usr/share/centreon/bin/console cache:clear --no-warmup"
fi

# Try auto configure timezone for php
timezone=$(/usr/bin/php -r '
$timezoneName = timezone_name_from_abbr(trim(shell_exec("date \"+%Z\"")));
if (preg_match("/Time zone: (\S+)/", shell_exec("timedatectl"), $matches)) {
$timezoneName = $matches[1];
}
if (date_default_timezone_set($timezoneName) === false) {
$timezoneName = "UTC";
}
echo $timezoneName;
' 2>/dev/null)
sed -i "s#^date.timezone = .*#date.timezone = ${timezone}#" /etc/php/8.0/mods-available/centreon.ini

exit 0
11 changes: 4 additions & 7 deletions ci/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ Package: centreon
Architecture: all
Depends:
centreon-central (>= ${centreon:version}~),
centreon-database (>= ${centreon:version}~),
sudo
centreon-database (>= ${centreon:version}~)
Description: Centreon is a network, system, applicative supervision and monitoring tool,
it is based upon the most effective Open Source monitoring engine : Nagios.
Centreon provides a new frontend and new functionnalities to Nagios.
Expand Down Expand Up @@ -124,11 +123,9 @@ Depends:
php8.0-readline,
php8.0-sqlite3,
php-pear,
ntp,
rrdtool,
bsd-mailx,
sudo,
nagios-images
rrdtool
Recommends: ntp | bsd-mailx
Suggests: nagios-images
Description: This package contains WebUI files.

Package: centreon-perl-libs
Expand Down
6 changes: 5 additions & 1 deletion ci/debian/extra/centreon-web/centreon.ini
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
date.timezone = UTC
max_execution_time = 300
session.use_strict_mode = 1
session.gc_maxlifetime = 7200
expose_php = Off
date.timezone = UTC
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"isRemote": {
"type": "boolean"
},
"address": {
"type": "string"
},
"centralServerAddress": {
"type": "string"
},
Expand Down
4 changes: 4 additions & 0 deletions doc/API/centreon-api-v22.04.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6730,6 +6730,10 @@ components:
type: boolean
example: true
description: "Platform is a remote server"
address:
type: string
example: "10.0.0.1"
description: "The address of the platform"
centralServerAddress:
type: string
example: "192.168.0.1"
Expand Down
28 changes: 15 additions & 13 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -210,19 +210,21 @@ for binary in $BINARIES; do
fi
done

###### Mandatory step
# ask if gorgone is already installed
echo -e "\n$line"
echo -e "\t$(gettext "Check mandatory gorgone service status")"
echo -e "$line"

yes_no_default "$(gettext "Is the Gorgone module already installed?")"
if [ "$?" -ne 0 ] ; then
echo_failure "\n$(gettext "Gorgone is required.\nPlease install it before launching this script")" "$fail"
echo -e "\n\t$(gettext "Please read the documentation to manage the Gorgone daemon installation")"
echo -e "\t$(gettext "Available on github") : https://github.com/centreon/centreon-gorgone"
echo -e "\t$(gettext "or on the centreon documentation") : https://documentation.centreon.com/\n"
exit 1
if [ "$silent_install" -ne 1 ] ; then
###### Mandatory step
# ask if gorgone is already installed
echo -e "\n$line"
echo -e "\t$(gettext "Check mandatory gorgone service status")"
echo -e "$line"

yes_no_default "$(gettext "Is the Gorgone module already installed?")"
if [ "$?" -ne 0 ] ; then
echo_failure "\n$(gettext "Gorgone is required.\nPlease install it before launching this script")" "$fail"
echo -e "\n\t$(gettext "Please read the documentation to manage the Gorgone daemon installation")"
echo -e "\t$(gettext "Available on github") : https://github.com/centreon/centreon-gorgone"
echo -e "\t$(gettext "or on the centreon documentation") : https://documentation.centreon.com/\n"
exit 1
fi
fi

# Script stop if one binary wasn't found
Expand Down
12 changes: 8 additions & 4 deletions lang/es_ES.UTF-8/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -13125,11 +13125,11 @@ msgstr "cubo de basura"
#~ msgid "No downtime scheduled for services"
#~ msgstr "No hay tiempo de inactividad planificado para los servicios"

#~ msgid "Host category"
#~ msgstr "Categoría de anfitriones"
msgid "Host category"
msgstr "Categoría de anfitriones"

#~ msgid "Service category"
#~ msgstr "Categorias de servicio"
msgid "Service category"
msgstr "Categoria de servicio"

#~ msgid "Inclusion"
#~ msgstr "Inclusión"
Expand Down Expand Up @@ -15162,3 +15162,7 @@ msgstr ""

# msgid "Warning, maximum size exceeded for input '%s' (max: %d), it will be truncated upon saving"
# msgstr ""

# msgid "Parent alias"
# msgstr ""

10 changes: 5 additions & 5 deletions lang/fr_FR.UTF-8/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -4408,7 +4408,7 @@ msgstr "Sauvegarde du mot de passe LDAP"

#: centreon-web/www/include/Administration/parameters/ldap/form.php:78
msgid "Auto import users"
msgstr "Import automatiques des utilisateurs"
msgstr "Import automatique des utilisateurs"

#: centreon-web/www/include/Administration/parameters/ldap/form.php:96
msgid "Use service DNS"
Expand Down Expand Up @@ -13649,11 +13649,11 @@ msgstr "Configurer une plage de maintenance pour les services des hôtes"
#~ msgid "No downtime scheduled for services"
#~ msgstr "Aucune plage de maintenance planifiée pour les services"

#~ msgid "Host category"
#~ msgstr "Catégorie d'hôtes"
msgid "Host category"
msgstr "Catégorie d'hôtes"

#~ msgid "Service category"
#~ msgstr "Catégories de service"
msgid "Service category"
msgstr "Catégorie de service"

#~ msgid "Inclusion"
#~ msgstr "Inclusion"
Expand Down
6 changes: 5 additions & 1 deletion lang/pt_BR.UTF-8/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -11796,7 +11796,7 @@ msgstr "Escala"

#: centreon-web/www/install/smarty_translate.php:414
msgid "Service category"
msgstr "Categoria do Serviço"
msgstr "Categoria de Serviço"

#: centreon-web/www/install/smarty_translate.php:438
msgid "Service Scheduling Options"
Expand Down Expand Up @@ -15613,3 +15613,7 @@ msgstr ""

# msgid "Warning, maximum size exceeded for input '%s' (max: %d), it will be truncated upon saving"
# msgstr ""
# msgid "Parent alias"
# msgstr ""


6 changes: 5 additions & 1 deletion lang/pt_PT.UTF-8/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -11781,7 +11781,7 @@ msgstr "Grupo de traps SNMP"

#: centreon-web/www/install/smarty_translate.php:387
msgid "Host category"
msgstr "Categoria do Host"
msgstr "Categoria de Host"

#: centreon-web/www/install/smarty_translate.php:393
msgid "Informations"
Expand Down Expand Up @@ -15601,3 +15601,7 @@ msgstr ""

# msgid "Warning, maximum size exceeded for input '%s' (max: %d), it will be truncated upon saving"
# msgstr ""

# msgid "Parent alias
# msgstr ""

10 changes: 5 additions & 5 deletions src/Centreon/Application/ApiPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,27 @@
class ApiPlatform
{
/**
* @var float
* @var string
*/
private $version;

/**
* Get the API version
*
* @return float
* @return string
*/
public function getVersion(): float
public function getVersion(): string
{
return $this->version;
}

/**
* Set the API version
*
* @param float $version
* @param string $version
* @return $this
*/
public function setVersion(float $version): self
public function setVersion(string $version): self
{
$this->version = $version;
return $this;
Expand Down
24 changes: 24 additions & 0 deletions src/Centreon/Domain/Contact/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ class Contact implements UserInterface, ContactInterface
*/
private $timezone;

/**
* @var int
*/
private int $timezoneId;

/**
* @var string|null $locale locale of the user
*/
Expand Down Expand Up @@ -189,6 +194,25 @@ class Contact implements UserInterface, ContactInterface
*/
private $theme;

/**
* @param int $timezoneId
* @return self
*/
public function setTimezoneId(int $timezoneId): self
{
$this->timezoneId = $timezoneId;

return $this;
}

/**
* @return int
*/
public function getTimezoneId(): int
{
return $this->timezoneId;
}

/**
* @return int
*/
Expand Down
5 changes: 5 additions & 0 deletions src/Centreon/Domain/Contact/Interfaces/ContactInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@

interface ContactInterface
{
/**
* @return int Returns the timezone id
*/
public function getTimezoneId(): int;

/**
* @return int Returns the contact id
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class PlatformInformation
*/
private $platformName;

/**
* @var string server address
*/
private string $address = '127.0.0.1';

/**
* @var string|null central's address
*/
Expand Down Expand Up @@ -126,6 +131,25 @@ public function setPlatformName(?string $name): self
return $this;
}

/**
* @return string
*/
public function getAddress(): string
{
return $this->address;
}

/**
* @param string $address
* @return $this
*/
public function setAddress(string $address): self
{
$this->address = $address;

return $this;
}

/**
* @return string|null
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public function createRemoteInformation(array $information): PlatformInformation
$platformInformation = new PlatformInformation($isRemote);
foreach ($information as $key => $value) {
switch ($key) {
case 'address':
$platformInformation->setAddress($value);
break;
case 'centralServerAddress':
$platformInformation->setCentralServerAddress($value);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ private function convertCentralToRemote(
$platformInformationToUpdate,
$currentPlatformInformation
);

$this->remoteServerService->convertCentralToRemote(
$platformInformationToUpdate
);
Expand Down
14 changes: 6 additions & 8 deletions src/Centreon/Domain/PlatformTopology/Model/PlatformPending.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,11 @@ private function checkIpAddress(?string $address): ?string
{
// Check for valid IPv4 or IPv6 IP
// or not sent address (in the case of Central's "parent_address")
if (null === $address || false !== filter_var($address, FILTER_VALIDATE_IP)) {
return $address;
}

// check for DNS to be resolved
$addressResolved = filter_var(gethostbyname($address), FILTER_VALIDATE_IP);
if (false === $addressResolved) {
if (
$address !== null
&& ! filter_var($address, FILTER_VALIDATE_IP)
&& ! filter_var($address, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)
) {
throw new \InvalidArgumentException(
sprintf(
_("The address '%s' of '%s' is not valid or not resolvable"),
Expand All @@ -212,7 +210,7 @@ private function checkIpAddress(?string $address): ?string
);
}

return $addressResolved;
return $address;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,11 @@ public function setHostname(?string $hostname): PlatformInterface
*/
private function checkIpAddress(?string $address): ?string
{
// Check for valid IPv4 or IPv6 IP
// or not sent address (in the case of Central's "parent_address")
if (null === $address || false !== filter_var($address, FILTER_VALIDATE_IP)) {
return $address;
}

// check for DNS to be resolved
if (false === filter_var(gethostbyname($address), FILTER_VALIDATE_IP)) {
if (
$address !== null
&& ! filter_var($address, FILTER_VALIDATE_IP)
&& ! filter_var($address, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)
) {
throw new \InvalidArgumentException(
sprintf(
_("The address '%s' of '%s' is not valid or not resolvable"),
Expand Down
Loading