From cb324e4337605066aa87c52384e5eec903ff3c42 Mon Sep 17 00:00:00 2001 From: actions-bot Date: Mon, 9 Oct 2023 10:06:51 +0000 Subject: [PATCH] Update configuration --- composer.lock | 175 ++++++++++++++---- conf/cmi/core.extension.yml | 1 + ...ternal_entity_type.helfi_announcements.yml | 6 +- .../cmi/views.view.editoria11y_dismissals.yml | 1 + conf/cmi/views.view.editoria11y_results.yml | 1 + conf/cmi/views.view.service_list.yml | 2 +- docker-compose.yml | 52 +++++- public/sites/default/settings.php | 48 +++++ 8 files changed, 248 insertions(+), 38 deletions(-) diff --git a/composer.lock b/composer.lock index 4722e360..52aacf53 100644 --- a/composer.lock +++ b/composer.lock @@ -2650,17 +2650,17 @@ }, { "name": "drupal/editoria11y", - "version": "2.1.0", + "version": "2.1.2", "source": { "type": "git", "url": "https://git.drupalcode.org/project/editoria11y.git", - "reference": "2.1.0" + "reference": "2.1.2" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/editoria11y-2.1.0.zip", - "reference": "2.1.0", - "shasum": "f19d1078e2ffe911e404000604bbcde7c879a271" + "url": "https://ftp.drupal.org/files/projects/editoria11y-2.1.2.zip", + "reference": "2.1.2", + "shasum": "ebd77063566def30be1c7c2fa684c5b05aaa7112" }, "require": { "drupal/core": "^9 || ^10" @@ -2668,8 +2668,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "2.1.0", - "datestamp": "1696446269", + "version": "2.1.2", + "datestamp": "1696531334", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -3313,6 +3313,10 @@ "GPL-2.0-or-later" ], "authors": [ + { + "name": "Anybody", + "homepage": "https://www.drupal.org/user/291091" + }, { "name": "Hydra", "homepage": "https://www.drupal.org/user/647364" @@ -3866,16 +3870,16 @@ }, { "name": "drupal/helfi_api_base", - "version": "2.5.6", + "version": "2.5.7", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base.git", - "reference": "d304750c887b039f527299007331d1ea8935fb2d" + "reference": "8f39f1d33757ca36623b4e223138357e39d388c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-api-base/zipball/d304750c887b039f527299007331d1ea8935fb2d", - "reference": "d304750c887b039f527299007331d1ea8935fb2d", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-api-base/zipball/8f39f1d33757ca36623b4e223138357e39d388c6", + "reference": "8f39f1d33757ca36623b4e223138357e39d388c6", "shasum": "" }, "require": { @@ -3901,10 +3905,10 @@ ], "description": "Helfi - API Base", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/tree/2.5.6", + "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/tree/2.5.7", "issues": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/issues" }, - "time": "2023-09-28T05:34:10+00:00" + "time": "2023-10-05T13:06:46+00:00" }, { "name": "drupal/helfi_azure_fs", @@ -3973,16 +3977,16 @@ }, { "name": "drupal/helfi_navigation", - "version": "2.1.2", + "version": "2.1.3", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-module-helfi-navigation.git", - "reference": "d6250383d6d6b1c8fb70f7522737d625d1b6f148" + "reference": "e08ff75ed78ab66622662c3914abb55ba9ccf35f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-navigation/zipball/d6250383d6d6b1c8fb70f7522737d625d1b6f148", - "reference": "d6250383d6d6b1c8fb70f7522737d625d1b6f148", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-navigation/zipball/e08ff75ed78ab66622662c3914abb55ba9ccf35f", + "reference": "e08ff75ed78ab66622662c3914abb55ba9ccf35f", "shasum": "" }, "require": { @@ -4000,23 +4004,23 @@ ], "description": "Helfi - Navigation", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-navigation/tree/2.1.2", + "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-navigation/tree/2.1.3", "issues": "https://github.com/City-of-Helsinki/drupal-module-helfi-navigation/issues" }, - "time": "2023-10-04T11:36:07+00:00" + "time": "2023-10-06T09:42:23+00:00" }, { "name": "drupal/helfi_platform_config", - "version": "3.4.20", + "version": "3.4.23", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config.git", - "reference": "93652814f9f6f0e96c1bb278968b0d4d7742c3e2" + "reference": "3f82733f535cfb08cf497315dd3e58e93f5635e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/93652814f9f6f0e96c1bb278968b0d4d7742c3e2", - "reference": "93652814f9f6f0e96c1bb278968b0d4d7742c3e2", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/3f82733f535cfb08cf497315dd3e58e93f5635e9", + "reference": "3f82733f535cfb08cf497315dd3e58e93f5635e9", "shasum": "" }, "require": { @@ -4061,6 +4065,7 @@ "drupal/simple_sitemap": "^4.1", "drupal/siteimprove": "^2.0", "drupal/social_media": "^2.0", + "drupal/stomp": "^2.0", "drupal/token": "^1.9", "drupal/translatable_menu_link_uri": "^2.0", "drupal/view_unpublished": "^1.0", @@ -4119,10 +4124,10 @@ ], "description": "HELfi platform config", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/3.4.20", + "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/3.4.23", "issues": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/issues" }, - "time": "2023-10-05T12:52:02+00:00" + "time": "2023-10-09T10:03:46+00:00" }, { "name": "drupal/helfi_proxy", @@ -5140,17 +5145,17 @@ }, { "name": "drupal/pathauto", - "version": "1.11.0", + "version": "1.12.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/pathauto.git", - "reference": "8.x-1.11" + "reference": "8.x-1.12" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/pathauto-8.x-1.11.zip", - "reference": "8.x-1.11", - "shasum": "a006fe9e6046a9833711a1ae56aa4752e65bcdc8" + "url": "https://ftp.drupal.org/files/projects/pathauto-8.x-1.12.zip", + "reference": "8.x-1.12", + "shasum": "b7b6432e315e38e59a7c6cc117134326c580de4c" }, "require": { "drupal/core": "^9.3 || ^10", @@ -5163,8 +5168,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.11", - "datestamp": "1660129564", + "version": "8.x-1.12", + "datestamp": "1696776683", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -6131,6 +6136,39 @@ "source": "https://git.drupalcode.org/project/stage_file_proxy" } }, + { + "name": "drupal/stomp", + "version": "2.0.0-alpha1", + "source": { + "type": "git", + "url": "https://github.com/City-of-Helsinki/drupal-module-stomp.git", + "reference": "820e1f3aa23dfdce441ac827e03286528111f497" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-stomp/zipball/820e1f3aa23dfdce441ac827e03286528111f497", + "reference": "820e1f3aa23dfdce441ac827e03286528111f497", + "shasum": "" + }, + "require": { + "php": "^8.1", + "stomp-php/stomp-php": "^5.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "drupal/coder": "^8.3" + }, + "type": "drupal-module", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Integrate Drupal with an external STOMP or AMQP message queue, such as ActiveMQ.", + "support": { + "source": "https://github.com/City-of-Helsinki/drupal-module-stomp/tree/2.0.0-alpha1", + "issues": "https://github.com/City-of-Helsinki/drupal-module-stomp/issues" + }, + "time": "2023-10-06T08:19:03+00:00" + }, { "name": "drupal/token", "version": "1.12.0", @@ -10640,6 +10678,79 @@ }, "time": "2020-01-30T12:17:27+00:00" }, + { + "name": "stomp-php/stomp-php", + "version": "5.1.0", + "source": { + "type": "git", + "url": "https://github.com/stomp-php/stomp-php.git", + "reference": "cf1fbd79cf48b9701909e42205f1d968cec6ff7a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stomp-php/stomp-php/zipball/cf1fbd79cf48b9701909e42205f1d968cec6ff7a", + "reference": "cf1fbd79cf48b9701909e42205f1d968cec6ff7a", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Stomp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Dejan Bosnanac", + "email": "dejan@nighttale.net", + "homepage": "http://www.nighttale.net" + }, + { + "name": "Sören Rohweder", + "email": "s.rohweder@blage.net", + "homepage": "http://www.monofone.de" + }, + { + "name": "Jens Radtke", + "email": "swefl@fin-sn.de", + "homepage": "http://www.fin-sn.de" + } + ], + "description": "stomp support for PHP", + "homepage": "http://github.com/stomp-php/stomp-php", + "keywords": [ + "activeMQ", + "apollomq", + "jms", + "messaging", + "rabbitmq", + "stomp" + ], + "support": { + "issues": "https://github.com/stomp-php/stomp-php/issues", + "source": "https://github.com/stomp-php/stomp-php/tree/5.1.0" + }, + "funding": [ + { + "url": "https://github.com/jmglsn", + "type": "github" + }, + { + "url": "https://github.com/staabm", + "type": "github" + } + ], + "time": "2023-06-19T17:34:28+00:00" + }, { "name": "symfony-cmf/routing", "version": "2.3.4", diff --git a/conf/cmi/core.extension.yml b/conf/cmi/core.extension.yml index 4f7dc0eb..a88e14c0 100644 --- a/conf/cmi/core.extension.yml +++ b/conf/cmi/core.extension.yml @@ -141,6 +141,7 @@ module: social_media: 0 sophron: 0 stage_file_proxy: 0 + stomp: 0 system: 0 taxonomy: 0 telephone: 0 diff --git a/conf/cmi/external_entities.external_entity_type.helfi_announcements.yml b/conf/cmi/external_entities.external_entity_type.helfi_announcements.yml index ca5bf95d..fd7679d1 100644 --- a/conf/cmi/external_entities.external_entity_type.helfi_announcements.yml +++ b/conf/cmi/external_entities.external_entity_type.helfi_announcements.yml @@ -3,13 +3,13 @@ langcode: en status: true dependencies: { } _core: - default_config_hash: ZjzZvHTvsEfBX_dhlTXEZmLbS_ELM5uV7xbXTaR7D7g + default_config_hash: znut8SNGQRsGO4_fUxjvl_SIZqbb0T7hsv98bRKxcM8 id: helfi_announcements label: 'Helfi: Announcements' label_plural: 'Helfi: Announcements' description: '' -read_only: true generate_aliases: null +read_only: true field_mapper_id: jsonpath field_mapper_config: field_mappings: @@ -41,7 +41,7 @@ field_mapper_config: value: '$.attributes["field_announcement_title"]' storage_client_id: helfi_announcements storage_client_config: { } -persistent_cache_max_age: 600 +persistent_cache_max_age: -1 annotation_entity_type_id: null annotation_bundle_id: null annotation_field_name: null diff --git a/conf/cmi/views.view.editoria11y_dismissals.yml b/conf/cmi/views.view.editoria11y_dismissals.yml index 8deffde1..7e62b239 100644 --- a/conf/cmi/views.view.editoria11y_dismissals.yml +++ b/conf/cmi/views.view.editoria11y_dismissals.yml @@ -1,3 +1,4 @@ +uuid: 3936c77d-80cb-4677-b649-d7f5a0f2b2d6 langcode: en status: true dependencies: diff --git a/conf/cmi/views.view.editoria11y_results.yml b/conf/cmi/views.view.editoria11y_results.yml index 7f4f41cc..5aff1528 100644 --- a/conf/cmi/views.view.editoria11y_results.yml +++ b/conf/cmi/views.view.editoria11y_results.yml @@ -1,3 +1,4 @@ +uuid: 28d88ca0-5773-4ddd-815b-e522da1fc79d langcode: en status: true dependencies: diff --git a/conf/cmi/views.view.service_list.yml b/conf/cmi/views.view.service_list.yml index 6c486770..5b6ba000 100644 --- a/conf/cmi/views.view.service_list.yml +++ b/conf/cmi/views.view.service_list.yml @@ -360,13 +360,13 @@ display: display_plugin: block position: 1 display_options: - display_extenders: { } pager: type: none options: offset: 0 defaults: pager: false + display_extenders: { } cache_metadata: max-age: -1 contexts: diff --git a/docker-compose.yml b/docker-compose.yml index c9be64c7..821ef00b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,6 +13,7 @@ services: STAGE_FILE_PROXY_ORIGIN: "${STAGE_FILE_PROXY_ORIGIN}" STAGE_FILE_PROXY_ORIGIN_DIR: "${STAGE_FILE_PROXY_ORIGIN_DIR}" APP_ENV: "${APP_ENV:-local}" + ELASTIC_PROXY_URL: ${ELASTIC_PROXY_URL:-""} DRUPAL_ROUTES: "https://varnish-${DRUPAL_HOSTNAME},https://helfi-proxy.docker.so,http://${COMPOSE_PROJECT_NAME}-varnish" DRUPAL_REVERSE_PROXY_ADDRESS: helfi-proxy.docker.so DRUSH_OPTIONS_URI: "https://${DRUPAL_HOSTNAME}" @@ -21,8 +22,8 @@ services: # xdebug by default (like /etc/environments, ~/.bashrc, or ~/.zshrc). XDEBUG_ENABLE: "${XDEBUG_ENABLE:-false}" # DOCKERHOST: host.docker.internal - # Use drush server to run functional tests so we don't have to care about - # permission issues. + # Use drush server to run functional tests, so we don't have to care about + # permission or SSL issues. SIMPLETEST_BASE_URL: "http://127.0.0.1:8888" SIMPLETEST_DB: "mysql://drupal:drupal@db:3306/drupal" BROWSERTEST_OUTPUT_BASE_URL: "https://${DRUPAL_HOSTNAME}" @@ -82,6 +83,53 @@ services: - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-varnish.tls=true" - "traefik.http.services.${COMPOSE_PROJECT_NAME}-varnish.loadbalancer.server.port=6081" - "traefik.docker.network=stonehenge-network" + elastic: + image: docker.elastic.co/elasticsearch/elasticsearch:8.4.0 + container_name: "${COMPOSE_PROJECT_NAME}-elastic" + environment: + - node.name="${COMPOSE_PROJECT_NAME}-elastic" + - discovery.seed_hosts=elastic + - cluster.name=es-docker-cluster + - cluster.initial_master_nodes="${COMPOSE_PROJECT_NAME}-elastic" + - bootstrap.memory_lock=true + - "ES_JAVA_OPTS=-Xms512m -Xmx512m" + - "http.cors.allow-origin=\"*\"" + - "http.cors.enabled=true" + - "http.cors.allow-headers=X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization" + - "http.cors.allow-credentials=true" + - xpack.security.enabled=false + ulimits: + memlock: + soft: -1 + hard: -1 + ports: + - 9200-9220:9200 + networks: + - internal + - stonehenge-network + labels: + - "traefik.enable=true" + - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-elastic.entrypoints=https" + - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-elastic.rule=Host(`elastic-${DRUPAL_HOSTNAME}`)" + - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-elastic.tls=true" + - "traefik.http.services.${COMPOSE_PROJECT_NAME}-elastic.loadbalancer.server.port=9200" + - "traefik.docker.network=stonehenge-network" + - "traefik.port=9200" + profiles: + - search + artemis: + container_name: "${COMPOSE_PROJECT_NAME}-artemis" + image: quay.io/artemiscloud/activemq-artemis-broker + ports: + - "8161:8161" + - "61616:61616" + - "5672:5672" + environment: + AMQ_EXTRA_ARGS: "--nio --user admin --password admin" + networks: + - internal + profiles: + - queue networks: internal: external: false diff --git a/public/sites/default/settings.php b/public/sites/default/settings.php index fb6e9839..2fbf9661 100644 --- a/public/sites/default/settings.php +++ b/public/sites/default/settings.php @@ -12,6 +12,31 @@ ini_set('zend.enable_gc', 'Off'); } + +if (!function_exists('drupal_get_env')) { + /** + * Gets the value of given environment variable. + * + * @param string|array $variables + * The variables to scan. + * + * @return mixed + * The value. + */ + function drupal_get_env(string|array $variables) : mixed { + if (!is_array($variables)) { + $variables = [$variables]; + } + + foreach ($variables as $var) { + if ($value = getenv($var)) { + return $value; + } + } + return NULL; + } +} + if ($simpletest_db = getenv('SIMPLETEST_DB')) { $parts = parse_url($simpletest_db); putenv(sprintf('DRUPAL_DB_NAME=%s', substr($parts['path'], 1))); @@ -205,6 +230,29 @@ $config['helfi_proxy.settings']['robots_header_enabled'] = (bool) $robots_header_enabled; } +$artemis_destination = drupal_get_env(['ARTEMIS_DESTINATION', 'NON_EXISTENT_TEST']); + +if ($artemis_brokers = getenv('ARTEMIS_BROKERS') && $artemis_destination) { + $settings['stomp']['default'] = [ + 'clientId' => getenv('ARTEMIS_CLIENT_ID') ?: 'artemis', + 'login' => getenv('ARTEMIS_LOGIN'), + 'passcode' => getenv('ARTEMIS_PASSCODE'), + 'destination' => sprintf('/queue/%s', $artemis_destination), + 'brokers' => $artemis_brokers, + 'timeout' => ['read' => 15000], + 'heartbeat' => [ + 'send' => 12000, + 'receive' => 0, + 'observers' => [ + [ + 'class' => '\Stomp\Network\Observer\HeartbeatEmitter', + ], + ], + ], + ]; + $settings['queue_default'] = 'queue.stomp.default'; +} + $config['filelog.settings']['rotation']['schedule'] = 'never'; if (