From da0bb189bf8e8f3564af8fa84cc6f6ddd6a19257 Mon Sep 17 00:00:00 2001 From: hel-platta-automation <95360595+hel-platta-automation@users.noreply.github.com> Date: Wed, 22 May 2024 06:46:12 +0000 Subject: [PATCH] Update configuration --- compose.yaml | 22 +++++++ composer.lock | 44 +++++++------- conf/cmi/block.block.claro_help.yml | 22 +++++++ conf/cmi/block.block.gin_help.yml | 22 +++++++ conf/cmi/core.extension.yml | 1 + .../language/fi/block.block.claro_help.yml | 2 + conf/cmi/language/fi/block.block.gin_help.yml | 2 + ...s.external_entity_type.helfi_news_tags.yml | 4 +- .../language/sv/block.block.claro_help.yml | 2 + conf/cmi/language/sv/block.block.gin_help.yml | 2 + docker/elastic-proxy/elastic.conf | 26 ++++++++ docker/elastic-proxy/nginx.conf | 60 +++++++++++++++++++ 12 files changed, 185 insertions(+), 24 deletions(-) create mode 100644 conf/cmi/block.block.claro_help.yml create mode 100644 conf/cmi/block.block.gin_help.yml create mode 100644 conf/cmi/language/fi/block.block.claro_help.yml create mode 100644 conf/cmi/language/fi/block.block.gin_help.yml create mode 100644 conf/cmi/language/sv/block.block.claro_help.yml create mode 100644 conf/cmi/language/sv/block.block.gin_help.yml create mode 100644 docker/elastic-proxy/elastic.conf create mode 100644 docker/elastic-proxy/nginx.conf diff --git a/compose.yaml b/compose.yaml index e2bc345c..56202025 100644 --- a/compose.yaml +++ b/compose.yaml @@ -87,6 +87,28 @@ 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-proxy: + container_name: "${COMPOSE_PROJECT_NAME}-elastic-proxy" + image: nginxinc/nginx-unprivileged:alpine-perl + environment: + ELASTICSEARCH_URL: "http://elastic:9200" + volumes: + - ./docker/elastic-proxy/nginx.conf:/etc/nginx/nginx.conf + - ./docker/elastic-proxy/elastic.conf:/etc/nginx/templates/default.conf.template + networks: + - stonehenge-network + - internal + labels: + - "traefik.enable=true" + - "traefik.http.routers.nginx.entrypoints=https" + - "traefik.http.routers.nginx.rule=Host(`elastic-proxy-${DRUPAL_HOSTNAME}`)" + - "traefik.http.services.nginx.loadbalancer.server.port=8080" + - "traefik.http.routers.nginx.tls=true" + - "traefik.docker.network=stonehenge-network" + depends_on: + - elastic + profiles: + - search elastic: image: docker.elastic.co/elasticsearch/elasticsearch:8.4.0 container_name: "${COMPOSE_PROJECT_NAME}-elastic" diff --git a/composer.lock b/composer.lock index 1f5e64d5..edce45f9 100644 --- a/composer.lock +++ b/composer.lock @@ -125,16 +125,16 @@ }, { "name": "chi-teck/drupal-code-generator", - "version": "3.5.0", + "version": "3.6.0", "source": { "type": "git", "url": "https://github.com/Chi-teck/drupal-code-generator.git", - "reference": "74c2dc687e124bfc4001e73e9346b33067e2ec2b" + "reference": "7794c268309a6fd7aeecfd1246a01238c14384c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Chi-teck/drupal-code-generator/zipball/74c2dc687e124bfc4001e73e9346b33067e2ec2b", - "reference": "74c2dc687e124bfc4001e73e9346b33067e2ec2b", + "url": "https://api.github.com/repos/Chi-teck/drupal-code-generator/zipball/7794c268309a6fd7aeecfd1246a01238c14384c4", + "reference": "7794c268309a6fd7aeecfd1246a01238c14384c4", "shasum": "" }, "require": { @@ -179,9 +179,9 @@ "description": "Drupal code generator", "support": { "issues": "https://github.com/Chi-teck/drupal-code-generator/issues", - "source": "https://github.com/Chi-teck/drupal-code-generator/tree/3.5.0" + "source": "https://github.com/Chi-teck/drupal-code-generator/tree/3.6.0" }, - "time": "2024-04-11T11:23:44+00:00" + "time": "2024-05-20T12:50:42+00:00" }, { "name": "commerceguys/addressing", @@ -3852,12 +3852,12 @@ "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-tools.git", - "reference": "7e697414bd03431053cc8d83a8d900452f48ab0c" + "reference": "9b33c808570b6e8daea537fd96885f9fe7246274" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-tools/zipball/7e697414bd03431053cc8d83a8d900452f48ab0c", - "reference": "7e697414bd03431053cc8d83a8d900452f48ab0c", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-tools/zipball/9b33c808570b6e8daea537fd96885f9fe7246274", + "reference": "9b33c808570b6e8daea537fd96885f9fe7246274", "shasum": "" }, "require": { @@ -3929,7 +3929,7 @@ "source": "https://github.com/City-of-Helsinki/drupal-tools/tree/main", "issues": "https://github.com/City-of-Helsinki/drupal-tools/issues" }, - "time": "2024-05-15T04:33:29+00:00" + "time": "2024-05-21T06:26:52+00:00" }, { "name": "drupal/helfi_navigation", @@ -3967,16 +3967,16 @@ }, { "name": "drupal/helfi_platform_config", - "version": "4.3.55", + "version": "4.3.57", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config.git", - "reference": "20d94f8c39b204768df18d4af0e521aa9efb0b37" + "reference": "9ebb3f106cf8e2835cce6f789abb127234af9aab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/20d94f8c39b204768df18d4af0e521aa9efb0b37", - "reference": "20d94f8c39b204768df18d4af0e521aa9efb0b37", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/9ebb3f106cf8e2835cce6f789abb127234af9aab", + "reference": "9ebb3f106cf8e2835cce6f789abb127234af9aab", "shasum": "" }, "require": { @@ -4087,10 +4087,10 @@ ], "description": "HELfi platform config", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/4.3.55", + "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/4.3.57", "issues": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/issues" }, - "time": "2024-05-20T09:41:13+00:00" + "time": "2024-05-22T06:30:57+00:00" }, { "name": "drupal/helfi_proxy", @@ -16067,16 +16067,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.4.0", + "version": "5.4.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "298d2febfe79d03fe714eb871d5538da55205b1a" + "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/298d2febfe79d03fe714eb871d5538da55205b1a", - "reference": "298d2febfe79d03fe714eb871d5538da55205b1a", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", + "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", "shasum": "" }, "require": { @@ -16125,9 +16125,9 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.0" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.1" }, - "time": "2024-04-09T21:13:58+00:00" + "time": "2024-05-21T05:55:05+00:00" }, { "name": "phpdocumentor/type-resolver", diff --git a/conf/cmi/block.block.claro_help.yml b/conf/cmi/block.block.claro_help.yml new file mode 100644 index 00000000..9f231373 --- /dev/null +++ b/conf/cmi/block.block.claro_help.yml @@ -0,0 +1,22 @@ +uuid: a4bafafd-6047-41a3-81ae-c0f5348ce2f3 +langcode: en +status: true +dependencies: + module: + - help + theme: + - claro +_core: + default_config_hash: jccFSSVqV0WCDb6NtML1VWAWTtDbZ-zn5YgTRMgMrIM +id: claro_help +theme: claro +region: help +weight: 0 +provider: null +plugin: help_block +settings: + id: help_block + label: Help + label_display: '0' + provider: help +visibility: { } diff --git a/conf/cmi/block.block.gin_help.yml b/conf/cmi/block.block.gin_help.yml new file mode 100644 index 00000000..e5f3513e --- /dev/null +++ b/conf/cmi/block.block.gin_help.yml @@ -0,0 +1,22 @@ +uuid: 54f6c867-a7d9-460c-a0ae-cdd11df56e66 +langcode: en +status: true +dependencies: + module: + - help + theme: + - gin +_core: + default_config_hash: 8nOAry2oKqJOr0zbrlJ3sZHDFJLIO6j-0vT0K_TYca4 +id: gin_help +theme: gin +region: help +weight: 0 +provider: null +plugin: help_block +settings: + id: help_block + label: Help + label_display: '0' + provider: help +visibility: { } diff --git a/conf/cmi/core.extension.yml b/conf/cmi/core.extension.yml index 193093fb..c391c2d0 100644 --- a/conf/cmi/core.extension.yml +++ b/conf/cmi/core.extension.yml @@ -81,6 +81,7 @@ module: helfi_tpr_config: 0 helfi_tunnistamo: 0 helfi_user_roles: 0 + help: 0 image: 0 image_style_quality: 0 imagecache_external: 0 diff --git a/conf/cmi/language/fi/block.block.claro_help.yml b/conf/cmi/language/fi/block.block.claro_help.yml new file mode 100644 index 00000000..3eee39c5 --- /dev/null +++ b/conf/cmi/language/fi/block.block.claro_help.yml @@ -0,0 +1,2 @@ +settings: + label: Ohje diff --git a/conf/cmi/language/fi/block.block.gin_help.yml b/conf/cmi/language/fi/block.block.gin_help.yml new file mode 100644 index 00000000..3eee39c5 --- /dev/null +++ b/conf/cmi/language/fi/block.block.gin_help.yml @@ -0,0 +1,2 @@ +settings: + label: Ohje diff --git a/conf/cmi/language/fi/external_entities.external_entity_type.helfi_news_tags.yml b/conf/cmi/language/fi/external_entities.external_entity_type.helfi_news_tags.yml index 13ece827..3a0e5707 100644 --- a/conf/cmi/language/fi/external_entities.external_entity_type.helfi_news_tags.yml +++ b/conf/cmi/language/fi/external_entities.external_entity_type.helfi_news_tags.yml @@ -1,2 +1,2 @@ -label: 'Uutisten kaupunginosat' -label_plural: 'Uutisten kaupunginosat' +label: 'Uutisten tagit' +label_plural: 'Uutisten tagit' diff --git a/conf/cmi/language/sv/block.block.claro_help.yml b/conf/cmi/language/sv/block.block.claro_help.yml new file mode 100644 index 00000000..ac934b00 --- /dev/null +++ b/conf/cmi/language/sv/block.block.claro_help.yml @@ -0,0 +1,2 @@ +settings: + label: Hjälp diff --git a/conf/cmi/language/sv/block.block.gin_help.yml b/conf/cmi/language/sv/block.block.gin_help.yml new file mode 100644 index 00000000..ac934b00 --- /dev/null +++ b/conf/cmi/language/sv/block.block.gin_help.yml @@ -0,0 +1,2 @@ +settings: + label: Hjälp diff --git a/docker/elastic-proxy/elastic.conf b/docker/elastic-proxy/elastic.conf new file mode 100644 index 00000000..89203d0c --- /dev/null +++ b/docker/elastic-proxy/elastic.conf @@ -0,0 +1,26 @@ +server { + listen 8080 default_server; + server_name _; + client_max_body_size 50m; + + location /ping { + add_header Content-Type application/json; + return 200 '{"status":"success","result":"Proxy alive"}'; + } + + location ~ ^/([a-z][a-z_-]*)/(_search|_msearch)$ { + limit_except GET POST { + deny all; + } + proxy_pass ${ELASTICSEARCH_URL}; + proxy_redirect off; + proxy_set_header Authorization $elastic_authorization; + proxy_pass_header Authorization; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_pass_header Access-Control-Allow-Origin; + proxy_pass_header Access-Control-Allow-Methods; + proxy_hide_header Access-Control-Allow-Headers; + } +} diff --git a/docker/elastic-proxy/nginx.conf b/docker/elastic-proxy/nginx.conf new file mode 100644 index 00000000..b3eb4c1d --- /dev/null +++ b/docker/elastic-proxy/nginx.conf @@ -0,0 +1,60 @@ +worker_processes auto; + +error_log /var/log/nginx/error.log notice; +pid /tmp/nginx.pid; + +env ELASTICSEARCH_URL; +env ELASTIC_PASSWORD; +env ELASTIC_USER; + +load_module modules/ngx_http_perl_module.so; + +events { + worker_connections 1024; +} + +http { + proxy_temp_path /tmp/proxy_temp; + client_body_temp_path /tmp/client_temp; + fastcgi_temp_path /tmp/fastcgi_temp; + uwsgi_temp_path /tmp/uwsgi_temp; + scgi_temp_path /tmp/scgi_temp; + + include /etc/nginx/mime.types; + default_type application/octet-stream; + perl_set $elastic_authorization ' + sub { + use MIME::Base64; + if (exists($ENV{"ELASTIC_USER"}) && exists($ENV{"ELASTIC_PASSWORD"})) { + return encode_base64($ENV{"ELASTIC_USER"} . ":" . $ENV{"ELASTIC_PASSWORD"}); + } + return ""; + } + '; + + # Log in JSON Format + log_format nginxlog_json escape=json '{ "timestamp": "$time_iso8601", ' + '"remote_addr": "$remote_addr", ' + '"body_bytes_sent": $body_bytes_sent, ' + '"request_time": $request_time, ' + '"response_status": $status, ' + '"request": "$request", ' + '"request_method": "$request_method", ' + '"host": "$host",' + '"upstream_addr": "$upstream_addr",' + '"http_x_forwarded_for": "$http_x_forwarded_for",' + '"http_referrer": "$http_referer", ' + '"http_user_agent": "$http_user_agent", ' + '"http_version": "$server_protocol", ' + '"nginx_access": true }'; + access_log /dev/stdout nginxlog_json; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + include /etc/nginx/conf.d/*.conf; +}