From 8c483d15e15901949e08b9a00c6ec7ff25c9bdb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Garn=C3=A6s?= Date: Wed, 3 Jan 2024 08:49:24 +0100 Subject: [PATCH 1/4] Add liip/monitor-bundle to add support for health checks This seems to be the most popular package for handling health checks with support for many of the services that we use e.g. Redis, RabbitMQ etc. Health checks are important for supporting external monitoring. This is the result of running composer require liip/monitor-bundle and executing the related recipe. --- cover-api/composer.json | 1 + cover-api/composer.lock | 772 ++++++++++++++++++++++++- cover-api/config/bundles.php | 1 + cover-api/config/packages/monitor.yaml | 3 + cover-api/symfony.lock | 12 + 5 files changed, 788 insertions(+), 1 deletion(-) create mode 100644 cover-api/config/packages/monitor.yaml diff --git a/cover-api/composer.json b/cover-api/composer.json index 6837347a..68ab174c 100644 --- a/cover-api/composer.json +++ b/cover-api/composer.json @@ -16,6 +16,7 @@ "api-platform/core": "^2.6", "danskernesdigitalebibliotek/agency-auth-bundle": "^3.0", "itk-dev/metrics-bundle": "^1.0", + "liip/monitor-bundle": "^2.22", "nelmio/cors-bundle": "^2.1", "predis/predis": "^1.1", "ruflin/elastica": "^7.1", diff --git a/cover-api/composer.lock b/cover-api/composer.lock index f41fce36..eb3f6869 100644 --- a/cover-api/composer.lock +++ b/cover-api/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8ef9960fca63fefc241dd66d46a85229", + "content-hash": "4e7c6fbfba699bbc7bc110cd6a52a795", "packages": [ { "name": "api-platform/core", @@ -576,6 +576,72 @@ ], "time": "2022-09-30T12:28:55+00:00" }, + { + "name": "enlightn/security-checker", + "version": "v1.11.0", + "source": { + "type": "git", + "url": "https://github.com/enlightn/security-checker.git", + "reference": "68df5c7256c84b428bf8fcff0d249de06ce362d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/enlightn/security-checker/zipball/68df5c7256c84b428bf8fcff0d249de06ce362d2", + "reference": "68df5c7256c84b428bf8fcff0d249de06ce362d2", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/guzzle": "^6.3|^7.0", + "php": ">=5.6", + "symfony/console": "^3.4|^4|^5|^6|^7", + "symfony/finder": "^3|^4|^5|^6|^7", + "symfony/process": "^3.4|^4|^5|^6|^7", + "symfony/yaml": "^3.4|^4|^5|^6|^7" + }, + "require-dev": { + "ext-zip": "*", + "friendsofphp/php-cs-fixer": "^2.18|^3.0", + "phpunit/phpunit": "^5.5|^6|^7|^8|^9" + }, + "bin": [ + "security-checker" + ], + "type": "library", + "autoload": { + "psr-4": { + "Enlightn\\SecurityChecker\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paras Malhotra", + "email": "paras@laravel-enlightn.com" + }, + { + "name": "Miguel Piedrafita", + "email": "soy@miguelpiedrafita.com" + } + ], + "description": "A PHP dependency vulnerabilities scanner based on the Security Advisories Database.", + "keywords": [ + "package", + "php", + "scanner", + "security", + "security advisories", + "vulnerability scanner" + ], + "support": { + "issues": "https://github.com/enlightn/security-checker/issues", + "source": "https://github.com/enlightn/security-checker/tree/v1.11.0" + }, + "time": "2023-11-17T07:53:29+00:00" + }, { "name": "ezimuel/guzzlestreams", "version": "3.1.0", @@ -768,6 +834,331 @@ ], "time": "2023-01-30T10:40:19+00:00" }, + { + "name": "guzzlehttp/guzzle", + "version": "7.8.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "41042bc7ab002487b876a0683fc8dce04ddce104" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104", + "reference": "41042bc7ab002487b876a0683fc8dce04ddce104", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5.3 || ^2.0.1", + "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-curl": "*", + "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.36 || ^9.6.15", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.8.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2023-12-03T20:35:24+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", + "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.36 || ^9.6.15" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2023-12-03T20:19:20+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.6.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", + "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.36 || ^9.6.15" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.6.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2023-12-03T20:05:35+00:00" + }, { "name": "itk-dev/metrics-bundle", "version": "1.0.1", @@ -887,6 +1278,181 @@ ], "time": "2022-12-08T02:08:23+00:00" }, + { + "name": "laminas/laminas-diagnostics", + "version": "1.25.0", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-diagnostics.git", + "reference": "7a6d553342a97ef5213752d4a0a7ff47210d3ab3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-diagnostics/zipball/7a6d553342a97ef5213752d4a0a7ff47210d3ab3", + "reference": "7a6d553342a97ef5213752d4a0a7ff47210d3ab3", + "shasum": "" + }, + "require": { + "enlightn/security-checker": "^1.10", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0" + }, + "conflict": { + "guzzlehttp/ringphp": "<1.1.1", + "symfony/finder": "<5.3.7", + "symfony/process": "<5.3.7", + "zendframework/zenddiagnostics": "*" + }, + "require-dev": { + "doctrine/migrations": "^2.0 || ^3.5.2", + "guzzlehttp/guzzle": "^7.5.0", + "laminas/laminas-coding-standard": "~2.5.0", + "laminas/laminas-loader": "^2.9", + "mikey179/vfsstream": "^1.6.11", + "php-amqplib/php-amqplib": "^2.0 || ^3.4", + "phpunit/phpunit": "^9.5.26", + "predis/predis": "^2.0.3", + "psalm/plugin-phpunit": "^0.18.3", + "symfony/yaml": "^6.0.14 || ^7.0.0", + "vimeo/psalm": "^4.29.0" + }, + "suggest": { + "doctrine/migrations": "Required by Check\\DoctrineMigration", + "ext-bcmath": "Required by Check\\CpuPerformance", + "guzzlehttp/guzzle": "Required by Check\\GuzzleHttpService", + "php-amqplib/php-amqplib": "Required by Check\\RabbitMQ", + "predis/predis": "Required by Check\\Redis", + "symfony/yaml": "Required by Check\\YamlFile" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev", + "dev-develop": "1.7.x-dev" + } + }, + "autoload": { + "files": [ + "src/autoload.php" + ], + "psr-4": { + "Laminas\\Diagnostics\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "A set of components for performing diagnostic tests in PHP applications", + "homepage": "https://laminas.dev", + "keywords": [ + "diagnostics", + "laminas", + "php", + "test" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-diagnostics/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-diagnostics/issues", + "rss": "https://github.com/laminas/laminas-diagnostics/releases.atom", + "source": "https://github.com/laminas/laminas-diagnostics" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2023-12-12T11:34:11+00:00" + }, + { + "name": "liip/monitor-bundle", + "version": "2.22.0", + "source": { + "type": "git", + "url": "https://github.com/liip/LiipMonitorBundle.git", + "reference": "7e9cbadc7d3a4ff4d82a0bb0ddc4b1fa66eeb8e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/liip/LiipMonitorBundle/zipball/7e9cbadc7d3a4ff4d82a0bb0ddc4b1fa66eeb8e8", + "reference": "7e9cbadc7d3a4ff4d82a0bb0ddc4b1fa66eeb8e8", + "shasum": "" + }, + "require": { + "laminas/laminas-diagnostics": "^1.9", + "php": "^7.3 || ^8.0", + "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0" + }, + "require-dev": { + "doctrine/doctrine-migrations-bundle": "^2.0 || ^3.0 || ^7.0", + "doctrine/migrations": "^2.0 || ^3.0", + "doctrine/persistence": "^1.3.3 || ^2.0 || ^3.0", + "enlightn/security-checker": "^1.11", + "friendsofphp/php-cs-fixer": "^3.4", + "guzzlehttp/guzzle": "^5.3.2 || ^6.3.3 || ^7.0.1", + "matthiasnoback/symfony-dependency-injection-test": "^4.3 || ^5.0", + "phpunit/phpunit": "^9.0", + "swiftmailer/swiftmailer": "^5.4 || ^6.1 || ^7.0", + "symfony/asset": "^5.4 || ^6.0 || ^7.0", + "symfony/browser-kit": "^5.4 || ^6.0 || ^7.0", + "symfony/expression-language": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/mailer": "^5.4 || ^6.0 || ^7.0", + "symfony/messenger": "^5.4 ||^6.0 || ^7.0", + "symfony/templating": "^5.4 || ^6.0 || ^7.0", + "symfony/twig-bundle": "^5.4 || ^6.0 || ^7.0" + }, + "suggest": { + "symfony/expression-language": "To use the Expression check" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Liip\\MonitorBundle\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alvaro Videla", + "email": "alvaro.videla@liip.ch" + }, + { + "name": "Kevin Bond", + "homepage": "https://zenstruck.com/" + }, + { + "name": "Liip AG", + "homepage": "https://www.liip.ch/" + }, + { + "name": "Symfony Community", + "homepage": "https://github.com/liip/LiipMonitorBundle/contributors" + } + ], + "description": "Liip Monitor Bundle", + "keywords": [ + "check", + "health", + "monitor", + "monitoring" + ], + "support": { + "issues": "https://github.com/liip/LiipMonitorBundle/issues", + "source": "https://github.com/liip/LiipMonitorBundle/tree/2.22.0" + }, + "time": "2024-01-02T14:38:46+00:00" + }, { "name": "monolog/monolog", "version": "3.3.1", @@ -1395,6 +1961,166 @@ }, "time": "2019-01-08T18:20:26+00:00" }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "e616d01114759c4c489f93b099585439f795fe35" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", + "reference": "e616d01114759c4c489f93b099585439f795fe35", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + }, + "time": "2023-04-10T20:10:41+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + }, { "name": "psr/link", "version": "2.0.1", @@ -1501,6 +2227,50 @@ }, "time": "2021-07-14T16:46:02+00:00" }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, { "name": "react/promise", "version": "v2.9.0", diff --git a/cover-api/config/bundles.php b/cover-api/config/bundles.php index 7e053de4..eac30f26 100644 --- a/cover-api/config/bundles.php +++ b/cover-api/config/bundles.php @@ -13,4 +13,5 @@ DanskernesDigitaleBibliotek\AgencyAuthBundle\DanskernesDigitaleBibliotekAgencyAuthBundle::class => ['all' => true], ItkDev\MetricsBundle\ItkDevMetricsBundle::class => ['all' => true], Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true], + Liip\MonitorBundle\LiipMonitorBundle::class => ['all' => true], ]; diff --git a/cover-api/config/packages/monitor.yaml b/cover-api/config/packages/monitor.yaml new file mode 100644 index 00000000..cc6b6673 --- /dev/null +++ b/cover-api/config/packages/monitor.yaml @@ -0,0 +1,3 @@ +liip_monitor: + # enabling the controller requires that `assets` are enabled in the framework bundle + enable_controller: false diff --git a/cover-api/symfony.lock b/cover-api/symfony.lock index 3f7ad60f..1c832e52 100644 --- a/cover-api/symfony.lock +++ b/cover-api/symfony.lock @@ -134,6 +134,18 @@ "laminas/laminas-code": { "version": "4.4.0" }, + "liip/monitor-bundle": { + "version": "2.22", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "2.6", + "ref": "02c7cd93304dead890f9042fc2670dd9b0e0c091" + }, + "files": [ + "config/packages/monitor.yaml" + ] + }, "monolog/monolog": { "version": "1.25.3" }, From 9f11e10514a4daf476aa717909b131b04e346f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Garn=C3=A6s?= Date: Wed, 3 Jan 2024 12:13:55 +0100 Subject: [PATCH 2/4] Add initial access to health with monitoring of Redis --- cover-api/config/packages/monitor.yaml | 8 +++++++- cover-api/config/routes/monitor.yaml | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 cover-api/config/routes/monitor.yaml diff --git a/cover-api/config/packages/monitor.yaml b/cover-api/config/packages/monitor.yaml index cc6b6673..aaa171ed 100644 --- a/cover-api/config/packages/monitor.yaml +++ b/cover-api/config/packages/monitor.yaml @@ -1,3 +1,9 @@ liip_monitor: # enabling the controller requires that `assets` are enabled in the framework bundle - enable_controller: false + enable_controller: true + checks: + groups: + default: + redis: + cache: + dsn: "%env(REDIS_CACHE_DSN)%" diff --git a/cover-api/config/routes/monitor.yaml b/cover-api/config/routes/monitor.yaml new file mode 100644 index 00000000..7c743bc1 --- /dev/null +++ b/cover-api/config/routes/monitor.yaml @@ -0,0 +1,3 @@ +_monitor: + resource: "@LiipMonitorBundle/Resources/config/routing.xml" + prefix: /monitor/health \ No newline at end of file From d3ec6c6e885ab80cefcdc173dc1f605b2902add9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Garn=C3=A6s?= Date: Wed, 3 Jan 2024 12:15:32 +0100 Subject: [PATCH 3/4] Add monitoring of OpenSearch We simply query the cluster health endpoint for the index. Wait for yellow status and set a low timeout to let it return somewhat quickly and allow for some leniency. --- cover-api/config/packages/monitor.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cover-api/config/packages/monitor.yaml b/cover-api/config/packages/monitor.yaml index aaa171ed..43084ad0 100644 --- a/cover-api/config/packages/monitor.yaml +++ b/cover-api/config/packages/monitor.yaml @@ -7,3 +7,12 @@ liip_monitor: redis: cache: dsn: "%env(REDIS_CACHE_DSN)%" + guzzle_http_service: + opensearch: + url: "%env(INDEXING_URL)%/_cluster/health/%env(INDEXING_INDEX)%?wait_for_status=yellow&timeout=5s" + headers: [] + options: [] + status_code: 200 + content: null + method: GET + body: null From 86a03fe0a466358f6d240007d7269cba6facf541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Garn=C3=A6s?= Date: Wed, 3 Jan 2024 12:16:17 +0100 Subject: [PATCH 4/4] Add support for monitoring RabbitMQ We need to add the php-amqplib package even though we have the PHP AMPQ extension enabled. --- cover-api/composer.json | 1 + cover-api/composer.lock | 260 ++++++++++++++++++++++++- cover-api/config/packages/monitor.yaml | 3 + 3 files changed, 263 insertions(+), 1 deletion(-) diff --git a/cover-api/composer.json b/cover-api/composer.json index 68ab174c..cc04857d 100644 --- a/cover-api/composer.json +++ b/cover-api/composer.json @@ -18,6 +18,7 @@ "itk-dev/metrics-bundle": "^1.0", "liip/monitor-bundle": "^2.22", "nelmio/cors-bundle": "^2.1", + "php-amqplib/php-amqplib": "^3.6", "predis/predis": "^1.1", "ruflin/elastica": "^7.1", "sensio/framework-extra-bundle": "^6.2", diff --git a/cover-api/composer.lock b/cover-api/composer.lock index eb3f6869..f37c40ae 100644 --- a/cover-api/composer.lock +++ b/cover-api/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4e7c6fbfba699bbc7bc110cd6a52a795", + "content-hash": "a22fc2395978ec6242d4822ed48996ce", "packages": [ { "name": "api-platform/core", @@ -1676,6 +1676,264 @@ ], "time": "2021-11-18T09:23:29+00:00" }, + { + "name": "paragonie/constant_time_encoding", + "version": "v2.6.3", + "source": { + "type": "git", + "url": "https://github.com/paragonie/constant_time_encoding.git", + "reference": "58c3f47f650c94ec05a151692652a868995d2938" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/58c3f47f650c94ec05a151692652a868995d2938", + "reference": "58c3f47f650c94ec05a151692652a868995d2938", + "shasum": "" + }, + "require": { + "php": "^7|^8" + }, + "require-dev": { + "phpunit/phpunit": "^6|^7|^8|^9", + "vimeo/psalm": "^1|^2|^3|^4" + }, + "type": "library", + "autoload": { + "psr-4": { + "ParagonIE\\ConstantTime\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com", + "role": "Maintainer" + }, + { + "name": "Steve 'Sc00bz' Thomas", + "email": "steve@tobtu.com", + "homepage": "https://www.tobtu.com", + "role": "Original Developer" + } + ], + "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", + "keywords": [ + "base16", + "base32", + "base32_decode", + "base32_encode", + "base64", + "base64_decode", + "base64_encode", + "bin2hex", + "encoding", + "hex", + "hex2bin", + "rfc4648" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/constant_time_encoding/issues", + "source": "https://github.com/paragonie/constant_time_encoding" + }, + "time": "2022-06-14T06:56:20+00:00" + }, + { + "name": "php-amqplib/php-amqplib", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/php-amqplib/php-amqplib.git", + "reference": "fb84e99589de0904a25861451b0552f806284ee5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/fb84e99589de0904a25861451b0552f806284ee5", + "reference": "fb84e99589de0904a25861451b0552f806284ee5", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-sockets": "*", + "php": "^7.2||^8.0", + "phpseclib/phpseclib": "^2.0|^3.0" + }, + "conflict": { + "php": "7.4.0 - 7.4.1" + }, + "replace": { + "videlalvaro/php-amqplib": "self.version" + }, + "require-dev": { + "ext-curl": "*", + "nategood/httpful": "^0.2.20", + "phpunit/phpunit": "^7.5|^9.5", + "squizlabs/php_codesniffer": "^3.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpAmqpLib\\": "PhpAmqpLib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-or-later" + ], + "authors": [ + { + "name": "Alvaro Videla", + "role": "Original Maintainer" + }, + { + "name": "Raúl Araya", + "email": "nubeiro@gmail.com", + "role": "Maintainer" + }, + { + "name": "Luke Bakken", + "email": "luke@bakken.io", + "role": "Maintainer" + }, + { + "name": "Ramūnas Dronga", + "email": "github@ramuno.lt", + "role": "Maintainer" + } + ], + "description": "Formerly videlalvaro/php-amqplib. This library is a pure PHP implementation of the AMQP protocol. It's been tested against RabbitMQ.", + "homepage": "https://github.com/php-amqplib/php-amqplib/", + "keywords": [ + "message", + "queue", + "rabbitmq" + ], + "support": { + "issues": "https://github.com/php-amqplib/php-amqplib/issues", + "source": "https://github.com/php-amqplib/php-amqplib/tree/v3.6.0" + }, + "time": "2023-10-22T15:02:02+00:00" + }, + { + "name": "phpseclib/phpseclib", + "version": "3.0.35", + "source": { + "type": "git", + "url": "https://github.com/phpseclib/phpseclib.git", + "reference": "4b1827beabce71953ca479485c0ae9c51287f2fe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/4b1827beabce71953ca479485c0ae9c51287f2fe", + "reference": "4b1827beabce71953ca479485c0ae9c51287f2fe", + "shasum": "" + }, + "require": { + "paragonie/constant_time_encoding": "^1|^2", + "paragonie/random_compat": "^1.4|^2.0|^9.99.99", + "php": ">=5.6.1" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-dom": "Install the DOM extension to load XML formatted public keys.", + "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", + "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", + "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", + "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." + }, + "type": "library", + "autoload": { + "files": [ + "phpseclib/bootstrap.php" + ], + "psr-4": { + "phpseclib3\\": "phpseclib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jim Wigginton", + "email": "terrafrost@php.net", + "role": "Lead Developer" + }, + { + "name": "Patrick Monnerat", + "email": "pm@datasphere.ch", + "role": "Developer" + }, + { + "name": "Andreas Fischer", + "email": "bantu@phpbb.com", + "role": "Developer" + }, + { + "name": "Hans-Jürgen Petrich", + "email": "petrich@tronic-media.com", + "role": "Developer" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "role": "Developer" + } + ], + "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", + "homepage": "http://phpseclib.sourceforge.net", + "keywords": [ + "BigInteger", + "aes", + "asn.1", + "asn1", + "blowfish", + "crypto", + "cryptography", + "encryption", + "rsa", + "security", + "sftp", + "signature", + "signing", + "ssh", + "twofish", + "x.509", + "x509" + ], + "support": { + "issues": "https://github.com/phpseclib/phpseclib/issues", + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.35" + }, + "funding": [ + { + "url": "https://github.com/terrafrost", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpseclib", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", + "type": "tidelift" + } + ], + "time": "2023-12-29T01:59:53+00:00" + }, { "name": "predis/predis", "version": "v1.1.10", diff --git a/cover-api/config/packages/monitor.yaml b/cover-api/config/packages/monitor.yaml index 43084ad0..16661d60 100644 --- a/cover-api/config/packages/monitor.yaml +++ b/cover-api/config/packages/monitor.yaml @@ -7,6 +7,9 @@ liip_monitor: redis: cache: dsn: "%env(REDIS_CACHE_DSN)%" + rabbit_mq: + queue: + dsn: "%env(MESSENGER_TRANSPORT_DSN)%" guzzle_http_service: opensearch: url: "%env(INDEXING_URL)%/_cluster/health/%env(INDEXING_INDEX)%?wait_for_status=yellow&timeout=5s"