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 60 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 Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ try {
checkout scm
}
sh 'rm -rf *.deb'
sh 'docker run -i --entrypoint /src/centreon/ci/scripts/centreon-deb-package.sh -w "/src" -v "$PWD:/src" -e DISTRIB="bullseye" -e VERSION=$VERSION -e RELEASE=$RELEASE registry.centreon.com/centreon-debian11-dependencies:22.04'
sh 'docker run -i --entrypoint /src/centreon/ci/scripts/centreon-deb-package.sh -w "/src" -v "$PWD:/src" -e DISTRIB="bullseye" -e VERSION=$VERSION -e RELEASE=$RELEASE registry.centreon.com/mon-build-dependencies-22.04:debian11'
stash name: 'Debian11', includes: '*.deb'
archiveArtifacts artifacts: "*"
sh 'rm -rf *.deb'
Expand Down
1 change: 1 addition & 0 deletions SECURITY_ACK.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Centreon reserves the right to make final decisions regarding publishing acknowl

<h3> 2022 </h3>

* 2022/05/23 - Lucas Carmo and Daniel França Lima from [Hakaï Security](https://www.hakaioffensivesecurity.com/)
* 2022/02/16 - Anonymous working with Trend Micro Zero Day Initiative

<h3> 2021 </h3>
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
2 changes: 1 addition & 1 deletion ci/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ override_dh_clean:

override_dh_auto_build:
composer install --no-dev --optimize-autoloader -n
npm ci
npm ci --legacy-peer-deps
npm run build
find . -type f | \
grep -v debian/extra/centreon-web/centreon-macroreplacement.txt | \
Expand Down
5 changes: 2 additions & 3 deletions ci/scripts/centreon-deb-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ done
rm -rf lang

# Generate API documentation.
apt install -y npm && sleep 30
npm install -g redoc-cli
/usr/local/bin/redoc-cli bundle --options.hideDownloadButton=true doc/API/centreon-api-v${MAJOR_VERSION}.yaml -o ../centreon-api-v${MAJOR_VERSION}.html
npm i -g redoc-cli
redoc-cli build --options.hideDownloadButton=true doc/API/centreon-api-v${MAJOR_VERSION}.yaml -o ../centreon-api-v${MAJOR_VERSION}.html

# Make tar with original content
cd ..
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"symfony/framework-bundle": "5.4.*",
"symfony/http-client": "5.4.*",
"symfony/http-kernel": "5.4.*",
"symfony/lock": "5.4.*",
"symfony/maker-bundle": "^1.11",
"symfony/monolog-bundle": "^3.7",
"symfony/options-resolver": "5.4.*",
Expand All @@ -85,7 +86,7 @@
"Tests\\": "tests/php/",
"Centreon\\Test\\Api\\": "tests/api/"
},
"classmap": ["www/class/"],
"classmap": ["www/class/", "lib/Centreon"],
"files" : [
"GPL_LIB/smarty-plugins/function.eval.php",
"www/api/exceptions.php",
Expand Down
91 changes: 85 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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
40 changes: 40 additions & 0 deletions config/packages/Centreon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,42 @@ services:
class: Core\Infrastructure\Platform\Repository\FileReadPlatformRepository
arguments: ['%centreon_etc_path%', '%centreon_install_path%']

Core\Platform\Application\Validator\RequirementValidatorsInterface:
class: Core\Platform\Infrastructure\Validator\RequirementValidators
arguments:
$requirementValidators: !tagged_iterator 'platform.requirement.validators'

Core\Platform\Infrastructure\Validator\RequirementValidators\DatabaseRequirementValidator:
arguments:
$dbRequirementValidators: !tagged_iterator 'platform.requirement.database.validators'

Core\Platform\Infrastructure\Validator\RequirementValidators\PhpRequirementValidator:
arguments:
$requiredPhpVersion: '%required_php_version%'

Core\Platform\Infrastructure\Validator\RequirementValidators\DatabaseRequirementValidators\MariaDbRequirementValidator:
arguments:
$requiredMariaDbMinVersion: '%required_mariadb_min_version%'

Core\Platform\Application\Repository\ReadVersionRepositoryInterface:
class: Core\Platform\Infrastructure\Repository\DbReadVersionRepository
public: true

Core\Platform\Application\Repository\ReadUpdateRepositoryInterface:
class: Core\Platform\Infrastructure\Repository\FsReadUpdateRepository
arguments:
$installDir: '%centreon_install_path%'
public: true

Core\Platform\Application\Repository\UpdateLockerRepositoryInterface:
class: Core\Platform\Infrastructure\Repository\SymfonyUpdateLockerRepository
public: true

Core\Platform\Application\Repository\WriteUpdateRepositoryInterface:
class: Core\Platform\Infrastructure\Repository\DbWriteUpdateRepository
arguments: ['%centreon_var_lib%', '%centreon_install_path%']
public: true

# Monitoring resources
_instanceof:
Centreon\Infrastructure\Monitoring\Resource\Provider\ProviderInterface:
Expand All @@ -238,6 +274,10 @@ services:
tags: ['authentication.provider.responses']
Core\Security\Infrastructure\Api\FindProviderConfigurations\ProviderPresenter\ProviderPresenterInterface:
tags: ['authentication.provider.presenters']
Core\Platform\Application\Validator\RequirementValidatorInterface:
tags: ['platform.requirement.validators']
Core\Platform\Infrastructure\Validator\RequirementValidators\DatabaseRequirementValidatorInterface:
tags: ['platform.requirement.database.validators']

Centreon\Domain\Monitoring\Interfaces\ResourceRepositoryInterface:
factory: ['@Centreon\Infrastructure\Monitoring\Resource\ResourceRepositoryFactory', 'createResourceRepository']
Expand Down
6 changes: 6 additions & 0 deletions config/routes/Centreon/platform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ centreon_application_platform_getversion:
controller: 'Centreon\Application\Controller\PlatformController::getVersions'
condition: "request.attributes.get('version') >= 21.10"

centreon_application_platform_updateversions:
methods: PATCH
path: /platform/updates
controller: 'Core\Platform\Infrastructure\Api\UpdateVersions\UpdateVersionsController'
condition: "request.attributes.get('version') >= 22.04"

centreon_application_platformtopology_addplatformtotopology:
methods: POST
path: /platform/topology
Expand Down
5 changes: 5 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ parameters:
media_path: "img/media"
redirect_default_page: "/monitoring/resources"
session_expiration_delay: 120
required_php_version: "%env(_CENTREON_PHP_VERSION_)%"
required_mariadb_min_version: "%env(_CENTREON_MARIA_DB_MIN_VERSION_)%"

services:
# Default configuration for services in *this* file
Expand Down Expand Up @@ -66,6 +68,9 @@ services:
decorates: router
arguments: ['@.inner']

Symfony\Component\Finder\Finder:
shared: false


# Security
Security\Domain\Authentication\Interfaces\AuthenticationRepositoryInterface:
Expand Down
10 changes: 5 additions & 5 deletions cron/centAcl.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,15 @@
* Remove data from old groups (deleted groups)
*/
$aclGroupToDelete = "SELECT DISTINCT acl_group_id
FROM " . $centreonDbName . ".acl_groups WHERE acl_group_activate = '1'";
$aclGroupToDelete2 = "SELECT DISTINCT acl_group_id FROM " . $centreonDbName . ".acl_res_group_relations";
$pearDB->beginTransaction();
FROM `" . $centreonDbName . "`.acl_groups WHERE acl_group_activate = '1'";
$aclGroupToDelete2 = "SELECT DISTINCT acl_group_id FROM `" . $centreonDbName . "`.acl_res_group_relations";
$pearDBO->beginTransaction();
try {
$pearDBO->query("DELETE FROM centreon_acl WHERE group_id NOT IN (" . $aclGroupToDelete . ")");
$pearDBO->query("DELETE FROM centreon_acl WHERE group_id NOT IN (" . $aclGroupToDelete2 . ")");
$pearDB->commit();
$pearDBO->commit();
} catch (\PDOException $e) {
$pearDB->rollBack();
$pearDBO->rollBack();
$centreonLog->insertLog(
2,
"CentACL CRON: failed to delete old groups relations"
Expand Down
8 changes: 7 additions & 1 deletion doc/API/centreon-api-v22.04.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3528,6 +3528,8 @@ paths:
moduleName:
type: object
$ref: '#/components/schemas/Platform.Versions'
/platform/updates:
$ref: "./v22.04/Administration/updates.yaml"
/platform/installation/status:
get:
tags:
Expand All @@ -3541,7 +3543,7 @@ paths:
application/json:
schema:
type: object
required: ["installed_version", "has_upgrade_available"]
required: ["is_installed", "has_upgrade_available"]
properties:
is_installed:
type: boolean
Expand Down Expand Up @@ -6728,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
Loading