Skip to content

Commit

Permalink
Update configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-bot authored Feb 27, 2024
1 parent c0361c5 commit 752bf4f
Show file tree
Hide file tree
Showing 18 changed files with 243 additions and 182 deletions.
246 changes: 123 additions & 123 deletions composer.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
config:
- paragraphs.paragraphs_type.accordion_item
_core:
default_config_hash: 7N37krPnWHQwmRjb9_0yq6TseyB-RZ-qkVpklV7rR98
default_config_hash: f3ncPjM7WKsN-bLZVQXMbSKIUMZYRk51A9j1Yly5XsE
id: paragraph.accordion_item.default
targetEntityType: paragraph
bundle: accordion_item
Expand Down
6 changes: 4 additions & 2 deletions conf/cmi/editor.editor.full_html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:
module:
- ckeditor5
_core:
default_config_hash: yobPkyFHZ_T4qFbTwAFPEgpYYtGpRMfUOE4xTRUVREk
default_config_hash: 6rE3ZrnVZlyWJ666VxrZAjXyipoRfxSuvcgxoWduDKQ
format: full_html
editor: ckeditor5
settings:
Expand Down Expand Up @@ -131,7 +131,9 @@ settings:
search: '<a name="[^"]*">(.*?)<\/a>'
replace: $1
ckeditor5_sourceEditing:
allowed_tags: { }
allowed_tags:
- '<figure tabindex>'
- '<figcaption>'
helfi_ckeditor_helfi_link:
helfi_link_attributes:
- '<a data-hds-icon-start data-is-external data-protocol data-hds-component data-hds-variant rel target="_blank">'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ third_party_settings:
allowed_formats:
- minimal
_core:
default_config_hash: gVzq6qdbsUyvmWQ8IChMyCFTZU-X4iYXHPs6DJJhHeg
default_config_hash: kOxXsJuDVcymIAy7jnni6GM5q5SPGSrxwmWJiJ4Sr7c
id: paragraph.accordion.field_accordion_description
field_name: field_accordion_description
entity_type: paragraph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ dependencies:
module:
- options
_core:
default_config_hash: r0RWH_0f6SuVDi0TYIGH_OquoPDpwrqZzSqRcFS3Mcg
default_config_hash: HZVr6AVX7ihLKrsewEHabJxkhrHFUugKszp7Z_B1slk
id: paragraph.accordion.field_accordion_heading_level
field_name: field_accordion_heading_level
entity_type: paragraph
bundle: accordion
label: 'Items heading level'
description: 'Select the heading level of the accordion so that they are semantically correct with the rest of the content.'
label: 'Accordion item title level'
description: "If the accordion has a title, the level for accordion item titles should be one level lower. If the accordion doesn't have a title, the level of the accordion title will be used for accordion item titles."
required: true
translatable: false
default_value:
-
value: '2'
value: '3'
default_value_callback: ''
settings: { }
field_type: list_string
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
config:
- paragraphs.paragraphs_type.accordion_item
_core:
default_config_hash: PCUbQBrVhsW-yyr2nuJTneoebeVthz457CEgW9QDdMk
default_config_hash: Nx_3yq3vNPc667kG9nez6rTv_w54aS3h3rnbAmt7kZ4
id: paragraph.accordion.field_accordion_items
field_name: field_accordion_items
entity_type: paragraph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ dependencies:
- field.storage.paragraph.field_accordion_title
- paragraphs.paragraphs_type.accordion
_core:
default_config_hash: WZxryNwlw3rxyo34KM7HrRApzz92Anm7WVJ24RGZaJ4
default_config_hash: TqiIVq0xav9ieDerAH8CFF0bSAAeZxPsNXWyqpBPm_U
id: paragraph.accordion.field_accordion_title
field_name: field_accordion_title
entity_type: paragraph
bundle: accordion
label: Title
label: 'Accordion title'
description: ''
required: false
translatable: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ dependencies:
module:
- options
_core:
default_config_hash: Njd4TsBh_iVsjSjzTPokGFk04Ud5veMBNxkgZ4nSoNw
default_config_hash: O1itPj2x6F-IUHyrssTSWUsnWXk5ljT5U3jjQrxd0cY
id: paragraph.accordion.field_accordion_title_level
field_name: field_accordion_title_level
entity_type: paragraph
bundle: accordion
label: 'Accordion title level'
description: 'Select the title level of the accordion so that they are semantically correct with the rest of the content.'
description: 'Choose the appropriate level for the accordion title in the page title hierarchy. Typically, the accordion title level is H2.'
required: true
translatable: false
default_value:
Expand Down
4 changes: 2 additions & 2 deletions conf/cmi/filter.format.full_html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:
- helfi_api_base
- linkit
_core:
default_config_hash: cg0rnV0ZUaA2jwkBl-DZrGfjFIk-La0SU7GAtL6vwGI
default_config_hash: b1oU0qRmI0LdV1sazHQHpTgk64EjNss5_RdX8BAHdno
name: HTML
format: full_html
weight: 0
Expand Down Expand Up @@ -42,7 +42,7 @@ filters:
status: true
weight: -50
settings:
allowed_html: '<br> <p data-helfi-quote-text> <h2> <h3> <h4> <h5> <h6> <blockquote data-helfi-quote> <span dir> <ul> <ol start> <li> <strong> <em> <s> <sub> <sup> <a href data-entity-type data-entity-uuid data-entity-substitution data-hds-icon-start data-is-external data-protocol data-hds-component data-hds-variant rel target="_blank"> <table> <tr> <td> <th> <thead> <tbody> <footer data-helfi-quote-author> <cite>'
allowed_html: '<br> <p data-helfi-quote-text> <h2> <h3> <h4> <h5> <h6> <blockquote data-helfi-quote> <span dir> <ul> <ol start> <li> <strong> <em> <s> <sub> <sup> <a href data-entity-type data-entity-uuid data-entity-substitution data-hds-icon-start data-is-external data-protocol data-hds-component data-hds-variant rel target="_blank"> <table> <tr> <td> <th> <thead> <tbody> <footer data-helfi-quote-author> <cite> <figure tabindex> <figcaption>'
filter_html_help: true
filter_html_nofollow: false
filter_html_escape:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
label: 'Sisällön pääotsikoiden taso'
description: 'Valitse sisällön pääotsikoiden taso siten että ne ovat semanttisesti oikealla tasolla muun sisällön suhteen.'
label: 'Haitarikohtien otsikkojen taso'
description: 'Jos haitarilla on otsikko, pitää haitarikohtien otsikkojen tason olla yhtä tasoa alempana. Jos haitarilla ei ole otsikkoa, käyttää Drupal haitarikohtien otsikkotasona haitarin otsikon tasoa.'
Original file line number Diff line number Diff line change
@@ -1 +1 @@
label: Otsikko
label: 'Haitarin otsikko'
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
label: 'Haitarin otsikon taso'
description: 'Valitse haitarin otsikon taso niin, että se on semanttisesti oikein muun sisällön kanssa.'
description: 'Valitse haitarin otsikolle sivun otsikkohierarkiaan sopiva taso. Yleensä haitarin otsikon taso on H2.'
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
label: 'Haitarin sisältökohta'
label: Haitarikohta
description: 'Yksittäinen haitarin sisältökohta, jossa on otsikko ja sisältö.'
6 changes: 6 additions & 0 deletions conf/cmi/purge.logger_channels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ channels:
- 0
- 2
- 3
-
id: purger_varnish_assets
grants:
- 0
- 2
- 3
4 changes: 4 additions & 0 deletions conf/cmi/purge.plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ purgers:
instance_id: varnish_purge_all
plugin_id: varnish
order_index: 3
-
instance_id: assets
plugin_id: varnish
order_index: 4
processors:
-
plugin_id: drush_purge_queue_work
Expand Down
30 changes: 30 additions & 0 deletions conf/cmi/varnish_purger.settings.assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
uuid: dd59b0e5-5291-4a2c-9ae5-fb489872c1c3
langcode: en
status: true
dependencies: { }
_core:
default_config_hash: W2iqfgCjeJZBrD986D1BhZ_gCyDeusZz5ahWyiDDLsM
id: assets
name: Assets
invalidationtype: regex
hostname: localhost
port: 6081
path: '/[invalidation:expression]'
request_method: BAN
scheme: http
verify: '1'
headers:
-
field: X-VC-Purge-Method
value: regex
-
field: Host
value: localhost
body: null
body_content_type: null
runtime_measurement: true
timeout: 1.0
connect_timeout: 1.0
cooldown_time: 0.0
max_requests: 100
http_errors: true
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ services:
image: druidfi/varnish:6-drupal
environment:
VARNISH_BACKEND_HOST: "${COMPOSE_PROJECT_NAME}-app"
VARNISH_CACHE_STATIC_FILES: "1"
depends_on:
- app
networks:
Expand Down
96 changes: 57 additions & 39 deletions public/sites/default/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,6 @@ function drupal_get_env(string|array $variables) : mixed {
}


if ($varnish_host = getenv('DRUPAL_VARNISH_HOST')) {
$config['varnish_purger.settings.default']['hostname'] = $varnish_host;
$config['varnish_purger.settings.varnish_purge_all']['hostname'] = $varnish_host;

if (!isset($config['system.performance']['cache']['page']['max_age'])) {
$config['system.performance']['cache']['page']['max_age'] = 86400;
}
}

if ($varnish_port = getenv('DRUPAL_VARNISH_PORT')) {
$config['varnish_purger.settings.default']['port'] = $varnish_port;
$config['varnish_purger.settings.varnish_purge_all']['port'] = $varnish_port;
}

if ($navigation_authentication_key = getenv('DRUPAL_NAVIGATION_API_KEY')) {
$config['helfi_navigation.api']['key'] = $navigation_authentication_key;
}
Expand All @@ -182,34 +168,66 @@ function drupal_get_env(string|array $variables) : mixed {
$config['helfi_api_base.environment_resolver.settings']['environment_name'] = getenv('APP_ENV');
$config['helfi_api_base.environment_resolver.settings']['project_name'] = getenv('PROJECT_NAME');

// settings.php doesn't know about existing configuration yet so we can't
// just append new headers to an already existing headers array here.
// If you have configured any extra headers in your purge settings
// you must add them in your all.settings.php as well.
// @todo Replace this with config override service?
$config['varnish_purger.settings.default']['headers'] = [
[
'field' => 'Cache-Tags',
'value' => '[invalidation:expression]',
],
];
if ($varnish_host = getenv('DRUPAL_VARNISH_HOST')) {
// Cache everything for 1 year by default.
$config['system.performance']['cache']['page']['max_age'] = 31536000;

$config['varnish_purger.settings.varnish_purge_all']['headers'] = [
[
'field' => 'X-VC-Purge-Method',
'value' => 'regex',
],
];
$varnish_backend = parse_url($drush_options_uri, PHP_URL_HOST);

if ($varnish_purge_key = getenv('VARNISH_PURGE_KEY')) {
$config['varnish_purger.settings.default']['headers'][] = [
'field' => 'X-VC-Purge-Key',
'value' => $varnish_purge_key,
];
$config['varnish_purger.settings.varnish_purge_all']['headers'][] = [
'field' => 'X-VC-Purge-Key',
'value' => $varnish_purge_key,
if (getenv('APP_ENV') === 'local') {
// Varnish backend is something like varnish-helfi-kymp.docker.so on
// local env.
$varnish_backend = 'varnish-' . $varnish_backend;
}

// settings.php doesn't know about existing configuration yet so we can't
// just append new headers to an already existing headers array here.
// If you have configured any extra headers in your purge settings
// you must add them in your all.settings.php as well.
// @todo Replace this with config override service?
$varnishConfiguration = [
'default' => [
[
'field' => 'Cache-Tags',
'value' => '[invalidation:expression]',
],
],
'assets' => [
[
'field' => 'X-VC-Purge-Method',
'value' => 'regex',
],
[
'field' => 'Host',
'value' => $varnish_backend,
],
],
'varnish_purge_all' => [
[
'field' => 'X-VC-Purge-Method',
'value' => 'regex',
],
],
];

foreach ($varnishConfiguration as $name => $headers) {
$config['varnish_purger.settings.' . $name]['hostname'] = $varnish_host;

if ($varnish_port = getenv('DRUPAL_VARNISH_PORT')) {
$config['varnish_purger.settings.' . $name]['port'] = $varnish_port;
}

foreach ($headers as $header) {
$config['varnish_purger.settings.' . $name]['headers'][] = $header;
}

if ($varnish_purge_key = getenv('VARNISH_PURGE_KEY')) {
$config['varnish_purger.settings.' . $name]['headers'][] = [
'field' => 'X-VC-Purge-Key',
'value' => $varnish_purge_key,
];
}
}
}

if ($stage_file_proxy_origin = getenv('STAGE_FILE_PROXY_ORIGIN')) {
Expand Down

0 comments on commit 752bf4f

Please sign in to comment.