diff --git a/composer.lock b/composer.lock index e5db9aae..16a8d8f8 100644 --- a/composer.lock +++ b/composer.lock @@ -2030,16 +2030,16 @@ }, { "name": "drupal/core", - "version": "9.5.7", + "version": "9.5.8", "source": { "type": "git", "url": "https://github.com/drupal/core.git", - "reference": "bf51aa8ed6ab733fcaf60d0860aefd3918140fe3" + "reference": "a9a1e4e1fe23fb8c83fd6aeafb740c1462a218fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core/zipball/bf51aa8ed6ab733fcaf60d0860aefd3918140fe3", - "reference": "bf51aa8ed6ab733fcaf60d0860aefd3918140fe3", + "url": "https://api.github.com/repos/drupal/core/zipball/a9a1e4e1fe23fb8c83fd6aeafb740c1462a218fc", + "reference": "a9a1e4e1fe23fb8c83fd6aeafb740c1462a218fc", "shasum": "" }, "require": { @@ -2191,9 +2191,9 @@ ], "description": "Drupal is an open source content management platform powering millions of websites and applications.", "support": { - "source": "https://github.com/drupal/core/tree/9.5.7" + "source": "https://github.com/drupal/core/tree/9.5.8" }, - "time": "2023-03-24T16:54:38+00:00" + "time": "2023-04-19T16:14:39+00:00" }, { "name": "drupal/core-composer-scaffold", @@ -3740,16 +3740,16 @@ }, { "name": "drupal/hdbt", - "version": "5.0.15", + "version": "5.0.21", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-hdbt.git", - "reference": "65d144fe8ae6d655549ea1fb5616e9b78fe60422" + "reference": "ccc8c1cb500df43c95e1f6b2c7fac42c8f954eea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-hdbt/zipball/65d144fe8ae6d655549ea1fb5616e9b78fe60422", - "reference": "65d144fe8ae6d655549ea1fb5616e9b78fe60422", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-hdbt/zipball/ccc8c1cb500df43c95e1f6b2c7fac42c8f954eea", + "reference": "ccc8c1cb500df43c95e1f6b2c7fac42c8f954eea", "shasum": "" }, "require": { @@ -3767,10 +3767,10 @@ "Drupal" ], "support": { - "source": "https://github.com/City-of-Helsinki/drupal-hdbt/tree/5.0.15", + "source": "https://github.com/City-of-Helsinki/drupal-hdbt/tree/5.0.21", "issues": "https://github.com/City-of-Helsinki/drupal-hdbt/issues" }, - "time": "2023-04-13T13:46:48+00:00" + "time": "2023-04-19T11:08:29+00:00" }, { "name": "drupal/hdbt_admin", @@ -3858,23 +3858,23 @@ }, { "name": "drupal/helfi_api_base", - "version": "2.4.0", + "version": "2.4.2", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base.git", - "reference": "9fef0cb03d5d0e31dba160331bc5365d0b424be4" + "reference": "7cbeef9a7a7d158c103c9fdc88ebf05dc8e82700" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-api-base/zipball/9fef0cb03d5d0e31dba160331bc5365d0b424be4", - "reference": "9fef0cb03d5d0e31dba160331bc5365d0b424be4", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-api-base/zipball/7cbeef9a7a7d158c103c9fdc88ebf05dc8e82700", + "reference": "7cbeef9a7a7d158c103c9fdc88ebf05dc8e82700", "shasum": "" }, "require": { "drupal/entity": "^1.0", "drupal/filelog": "^2.1", "drupal/health_check": "^3.0", - "php": "^8.0", + "php": "^8.1", "t4web/composer-lock-parser": "^1.0" }, "conflict": { @@ -3891,10 +3891,10 @@ ], "description": "Helfi - API Base", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/tree/2.4.0", + "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/tree/2.4.2", "issues": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/issues" }, - "time": "2023-02-15T04:42:26+00:00" + "time": "2023-04-20T08:24:46+00:00" }, { "name": "drupal/helfi_azure_fs", @@ -5609,8 +5609,12 @@ "authors": [ { "name": "Christian Fritsch", - "homepage": "https://www.drupal.org/user/2103716", + "homepage": "https://www.drupal.org/user/157725", "email": "christian.fritsch@burda.com" + }, + { + "name": "chr.fritsch", + "homepage": "https://www.drupal.org/user/2103716" } ], "description": "Integration with the select2 JavaScript library.", @@ -6170,26 +6174,26 @@ }, { "name": "drupal/view_unpublished", - "version": "1.0.0", + "version": "1.1.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/view_unpublished.git", - "reference": "8.x-1.0" + "reference": "8.x-1.1" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/view_unpublished-8.x-1.0.zip", - "reference": "8.x-1.0", - "shasum": "74ebdf1b4f6963f7bb63192bc314014c0132d03c" + "url": "https://ftp.drupal.org/files/projects/view_unpublished-8.x-1.1.zip", + "reference": "8.x-1.1", + "shasum": "f9f5e88cbaf1a1e71952d94cf67ef2f180e292be" }, "require": { - "drupal/core": "^8 || ^9" + "drupal/core": "^9.4 || ^10" }, "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.0", - "datestamp": "1597688978", + "version": "8.x-1.1", + "datestamp": "1681757575", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -7088,22 +7092,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.5.0", + "version": "7.5.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba" + "reference": "b964ca597e86b752cd994f27293e9fa6b6a95ed9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b50a2a1251152e43f6a37f0fa053e730a67d25ba", - "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b964ca597e86b752cd994f27293e9fa6b6a95ed9", + "reference": "b964ca597e86b752cd994f27293e9fa6b6a95ed9", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/promises": "^1.5", - "guzzlehttp/psr7": "^1.9 || ^2.4", + "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -7196,7 +7200,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.5.0" + "source": "https://github.com/guzzle/guzzle/tree/7.5.1" }, "funding": [ { @@ -7212,7 +7216,7 @@ "type": "tidelift" } ], - "time": "2022-08-28T15:39:27+00:00" + "time": "2023-04-17T16:30:08+00:00" }, { "name": "guzzlehttp/promises", @@ -7300,16 +7304,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.9.0", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318" + "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", - "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b", + "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b", "shasum": "" }, "require": { @@ -7328,11 +7332,6 @@ "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, "autoload": { "files": [ "src/functions_include.php" @@ -7390,7 +7389,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.9.0" + "source": "https://github.com/guzzle/psr7/tree/1.9.1" }, "funding": [ { @@ -7406,7 +7405,7 @@ "type": "tidelift" } ], - "time": "2022-06-20T21:43:03+00:00" + "time": "2023-04-17T16:00:37+00:00" }, { "name": "http-interop/http-factory-guzzle", @@ -7527,16 +7526,16 @@ }, { "name": "laminas/laminas-diactoros", - "version": "2.25.1", + "version": "2.25.2", "source": { "type": "git", "url": "https://github.com/laminas/laminas-diactoros.git", - "reference": "13f45e5ba09c9b27752247d3be186fc49c2ca3a5" + "reference": "9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/13f45e5ba09c9b27752247d3be186fc49c2ca3a5", - "reference": "13f45e5ba09c9b27752247d3be186fc49c2ca3a5", + "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e", + "reference": "9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e", "shasum": "" }, "require": { @@ -7620,7 +7619,7 @@ "type": "community_bridge" } ], - "time": "2023-04-08T00:31:34+00:00" + "time": "2023-04-17T15:44:17+00:00" }, { "name": "laminas/laminas-escaper", @@ -9036,16 +9035,16 @@ }, { "name": "pear/pear-core-minimal", - "version": "v1.10.11", + "version": "v1.10.13", "source": { "type": "git", "url": "https://github.com/pear/pear-core-minimal.git", - "reference": "68d0d32ada737153b7e93b8d3c710ebe70ac867d" + "reference": "aed862e95fd286c53cc546734868dc38ff4b5b1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/68d0d32ada737153b7e93b8d3c710ebe70ac867d", - "reference": "68d0d32ada737153b7e93b8d3c710ebe70ac867d", + "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/aed862e95fd286c53cc546734868dc38ff4b5b1d", + "reference": "aed862e95fd286c53cc546734868dc38ff4b5b1d", "shasum": "" }, "require": { @@ -9080,7 +9079,7 @@ "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=PEAR", "source": "https://github.com/pear/pear-core-minimal" }, - "time": "2021-08-10T22:31:03+00:00" + "time": "2023-04-19T19:15:47+00:00" }, { "name": "pear/pear_exception", @@ -15291,16 +15290,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.18.1", + "version": "1.19.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "22dcdfd725ddf99583bfe398fc624ad6c5004a0f" + "reference": "f545fc30978190a056832aa7ed995e36a66267f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/22dcdfd725ddf99583bfe398fc624ad6c5004a0f", - "reference": "22dcdfd725ddf99583bfe398fc624ad6c5004a0f", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/f545fc30978190a056832aa7ed995e36a66267f3", + "reference": "f545fc30978190a056832aa7ed995e36a66267f3", "shasum": "" }, "require": { @@ -15330,9 +15329,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.18.1" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.19.1" }, - "time": "2023-04-07T11:51:11+00:00" + "time": "2023-04-18T11:30:56+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/conf/cmi/core.extension.yml b/conf/cmi/core.extension.yml index 325d07a0..aa62d7c4 100644 --- a/conf/cmi/core.extension.yml +++ b/conf/cmi/core.extension.yml @@ -5,6 +5,7 @@ module: admin_toolbar: 0 admin_toolbar_tools: 0 allowed_formats: 0 + basic_auth: 0 block: 0 breakpoint: 0 ckeditor: 0 diff --git a/conf/cmi/language/fi/hdbt_admin_tools.site_settings.yml b/conf/cmi/language/fi/hdbt_admin_tools.site_settings.yml index 866da865..a15c7eb9 100644 --- a/conf/cmi/language/fi/hdbt_admin_tools.site_settings.yml +++ b/conf/cmi/language/fi/hdbt_admin_tools.site_settings.yml @@ -1,6 +1,6 @@ footer_settings: footer_color: dark site_settings: - theme_color: silver default_icon: group koro: basic + theme_color: silver diff --git a/conf/cmi/language/sv/hdbt_admin_tools.site_settings.yml b/conf/cmi/language/sv/hdbt_admin_tools.site_settings.yml index 866da865..a15c7eb9 100644 --- a/conf/cmi/language/sv/hdbt_admin_tools.site_settings.yml +++ b/conf/cmi/language/sv/hdbt_admin_tools.site_settings.yml @@ -1,6 +1,6 @@ footer_settings: footer_color: dark site_settings: - theme_color: silver default_icon: group koro: basic + theme_color: silver diff --git a/conf/cmi/rest.resource.helfi_debug_data.yml b/conf/cmi/rest.resource.helfi_debug_data.yml index 5838f2a8..a958d898 100644 --- a/conf/cmi/rest.resource.helfi_debug_data.yml +++ b/conf/cmi/rest.resource.helfi_debug_data.yml @@ -3,6 +3,7 @@ langcode: en status: true dependencies: module: + - basic_auth - helfi_api_base - serialization - user @@ -18,3 +19,4 @@ configuration: - json authentication: - cookie + - basic_auth diff --git a/conf/cmi/rest.resource.helfi_debug_package_version.yml b/conf/cmi/rest.resource.helfi_debug_package_version.yml index 5ddf9468..3109fd8f 100644 --- a/conf/cmi/rest.resource.helfi_debug_package_version.yml +++ b/conf/cmi/rest.resource.helfi_debug_package_version.yml @@ -3,6 +3,9 @@ langcode: en status: true dependencies: module: + - basic_auth + - helfi_api_base + - serialization - user id: helfi_debug_package_version plugin_id: helfi_debug_package_version @@ -14,3 +17,4 @@ configuration: - json authentication: - cookie + - basic_auth diff --git a/docker/openshift/entrypoints/20-deploy.sh b/docker/openshift/entrypoints/20-deploy.sh index e7dc298d..d71b89c1 100644 --- a/docker/openshift/entrypoints/20-deploy.sh +++ b/docker/openshift/entrypoints/20-deploy.sh @@ -13,20 +13,44 @@ if [ ! -n "$OPENSHIFT_BUILD_NAME" ]; then exit 1 fi +function get_deploy_id { + echo $(drush state:get deploy_id) +} + # Generate twig caches. if [ ! -d "/tmp/twig" ]; then drush twig:compile || true fi +# Attempt to set deploy ID in case this is the first deploy. +if [[ -z "$(get_deploy_id)" ]]; then + drush state:set deploy_id $OPENSHIFT_BUILD_NAME +fi + +# Exit early if deploy ID is still not set. This usually means either Redis or +# something else is down. +if [[ -z "$(get_deploy_id)" ]]; then + echo "Could not fetch deploy ID. Something is probably wrong. Exiting early." + exit 1 +fi + # This script is run every time a container is spawned and certain environments might # start more than one Drupal container. This is used to make sure we run deploy # tasks only once per deploy. -if [ "$(drush state:get deploy_id)" != "$OPENSHIFT_BUILD_NAME" ]; then +if [ "$(get_deploy_id)" != "$OPENSHIFT_BUILD_NAME" ]; then drush state:set deploy_id $OPENSHIFT_BUILD_NAME - # Put site in maintenance mode during deploy + # Put site in maintenance mode drush state:set system.maintenance_mode 1 --input-format=integer + # Run helfi specific pre-deploy tasks. Allow this to fail in case + # the environment is not using the 'helfi_api_base' module. + # @see https://github.com/City-of-Helsinki/drupal-module-helfi-api-base + drush helfi:pre-deploy || true # Run maintenance tasks (config import, database updates etc) drush deploy + # Run helfi specific post deploy tasks. Allow this to fail in case + # the environment is not using the 'helfi_api_base' module. + # @see https://github.com/City-of-Helsinki/drupal-module-helfi-api-base + drush helfi:post-deploy || true # Disable maintenance mode drush state:set system.maintenance_mode 0 --input-format=integer fi diff --git a/public/sites/default/settings.php b/public/sites/default/settings.php index 0c1ebff5..0e41a605 100755 --- a/public/sites/default/settings.php +++ b/public/sites/default/settings.php @@ -63,19 +63,16 @@ } $routes[] = 'http://127.0.0.1'; +if ($drush_options_uri = getenv('DRUSH_OPTIONS_URI')) { + $routes[] = $drush_options_uri; +} + foreach ($routes as $route) { $host = parse_url($route, PHP_URL_HOST); $trusted_host = str_replace('.', '\.', $host); $settings['trusted_host_patterns'][] = '^' . $trusted_host . '$'; } -$drush_options_uri = getenv('DRUSH_OPTIONS_URI'); - -if ($drush_options_uri && !in_array($drush_options_uri, $routes)) { - $host = str_replace('.', '\.', parse_url($drush_options_uri)['host']); - $settings['trusted_host_patterns'][] = '^' . $host . '$'; -} - $settings['config_sync_directory'] = '../conf/cmi'; $settings['file_public_path'] = getenv('DRUPAL_FILES_PUBLIC') ?: 'sites/default/files'; $settings['file_private_path'] = getenv('DRUPAL_FILES_PRIVATE'); @@ -171,6 +168,12 @@ $config['stage_file_proxy.settings']['use_imagecache_root'] = FALSE; } +// Map API accounts. The value should be a base64 encoded JSON string. +// @see https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/blob/main/documentation/api-accounts.md. +if ($api_accounts = getenv('DRUPAL_API_ACCOUNTS')) { + $config['helfi_api_base.api_accounts']['accounts'] = json_decode(base64_decode($api_accounts), TRUE); +} + // Override session suffix when present. if ($session_suffix = getenv('DRUPAL_SESSION_SUFFIX')) { $config['helfi_proxy.settings']['session_suffix'] = $session_suffix;