From a8e9ecb8ba6442fcecf42d4378541fee79bae1df Mon Sep 17 00:00:00 2001 From: Santeri Hurnanen Date: Fri, 29 Nov 2024 13:29:17 +0200 Subject: [PATCH 1/3] UHF-10549: Accept self-signed certificates from elasticsearch --- public/sites/default/all.settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/sites/default/all.settings.php b/public/sites/default/all.settings.php index d638f605..1088e4f1 100644 --- a/public/sites/default/all.settings.php +++ b/public/sites/default/all.settings.php @@ -10,7 +10,7 @@ $config['search_api.server.elastic_kymp']['backend_config']['connector_config']['url'] = getenv('ELASTICSEARCH_URL'); if (getenv('ELASTIC_USER') && getenv('ELASTIC_PASSWORD')) { - $config['search_api.server.elastic_kymp']['backend_config']['connector'] = 'basicauth'; + $config['search_api.server.elastic_kymp']['backend_config']['connector'] = 'helfi_connector'; $config['search_api.server.elastic_kymp']['backend_config']['connector_config']['username'] = getenv('ELASTIC_USER'); $config['search_api.server.elastic_kymp']['backend_config']['connector_config']['password'] = getenv('ELASTIC_PASSWORD'); } From 876698991eabdd7ca1900cca13de58f54e76b520 Mon Sep 17 00:00:00 2001 From: Santeri Hurnanen Date: Mon, 2 Dec 2024 12:00:07 +0200 Subject: [PATCH 2/3] UHF-10549: Rename config --- conf/cmi/search_api.index.districts.yml | 4 ++-- conf/cmi/search_api.index.districts_for_filters.yml | 4 ++-- conf/cmi/search_api.index.project_phases.yml | 4 ++-- conf/cmi/search_api.index.project_themes.yml | 4 ++-- conf/cmi/search_api.index.project_types.yml | 4 ++-- conf/cmi/search_api.index.projects.yml | 4 ++-- conf/cmi/search_api.index.street_data.yml | 4 ++-- ...ver.elastic_kymp.yml => search_api.server.default.yml} | 2 +- public/sites/default/all.settings.php | 8 ++++---- 9 files changed, 19 insertions(+), 19 deletions(-) rename conf/cmi/{search_api.server.elastic_kymp.yml => search_api.server.default.yml} (95%) diff --git a/conf/cmi/search_api.index.districts.yml b/conf/cmi/search_api.index.districts.yml index f85482ed..4f68889e 100644 --- a/conf/cmi/search_api.index.districts.yml +++ b/conf/cmi/search_api.index.districts.yml @@ -7,7 +7,7 @@ dependencies: - field.storage.node.field_district_image - field.storage.node.field_district_search_metatags - field.storage.node.field_subdistricts - - search_api.server.elastic_kymp + - search_api.server.default module: - helfi_react_search - media @@ -174,4 +174,4 @@ options: cron_limit: 50 index_directly: false track_changes_in_references: true -server: elastic_kymp +server: default diff --git a/conf/cmi/search_api.index.districts_for_filters.yml b/conf/cmi/search_api.index.districts_for_filters.yml index 46373707..4e733ef0 100644 --- a/conf/cmi/search_api.index.districts_for_filters.yml +++ b/conf/cmi/search_api.index.districts_for_filters.yml @@ -3,7 +3,7 @@ langcode: en status: true dependencies: config: - - search_api.server.elastic_kymp + - search_api.server.default module: - helfi_react_search - node @@ -60,4 +60,4 @@ options: cron_limit: 50 index_directly: false track_changes_in_references: true -server: elastic_kymp +server: default diff --git a/conf/cmi/search_api.index.project_phases.yml b/conf/cmi/search_api.index.project_phases.yml index 69943d07..86076981 100644 --- a/conf/cmi/search_api.index.project_phases.yml +++ b/conf/cmi/search_api.index.project_phases.yml @@ -3,7 +3,7 @@ langcode: en status: true dependencies: config: - - search_api.server.elastic_kymp + - search_api.server.default module: - helfi_react_search - taxonomy @@ -62,4 +62,4 @@ options: cron_limit: 50 index_directly: false track_changes_in_references: true -server: elastic_kymp +server: default diff --git a/conf/cmi/search_api.index.project_themes.yml b/conf/cmi/search_api.index.project_themes.yml index f881db60..84c0feba 100644 --- a/conf/cmi/search_api.index.project_themes.yml +++ b/conf/cmi/search_api.index.project_themes.yml @@ -3,7 +3,7 @@ langcode: en status: true dependencies: config: - - search_api.server.elastic_kymp + - search_api.server.default module: - helfi_react_search - taxonomy @@ -60,4 +60,4 @@ options: cron_limit: 50 index_directly: false track_changes_in_references: true -server: elastic_kymp +server: default diff --git a/conf/cmi/search_api.index.project_types.yml b/conf/cmi/search_api.index.project_types.yml index 6a06ccd7..07fd424e 100644 --- a/conf/cmi/search_api.index.project_types.yml +++ b/conf/cmi/search_api.index.project_types.yml @@ -3,7 +3,7 @@ langcode: en status: true dependencies: config: - - search_api.server.elastic_kymp + - search_api.server.default module: - helfi_react_search - taxonomy @@ -60,4 +60,4 @@ options: cron_limit: 50 index_directly: false track_changes_in_references: true -server: elastic_kymp +server: default diff --git a/conf/cmi/search_api.index.projects.yml b/conf/cmi/search_api.index.projects.yml index 09ed78a8..b11b6082 100644 --- a/conf/cmi/search_api.index.projects.yml +++ b/conf/cmi/search_api.index.projects.yml @@ -11,7 +11,7 @@ dependencies: - field.storage.node.field_project_search_metatags - field.storage.node.field_project_theme - field.storage.node.field_project_type - - search_api.server.elastic_kymp + - search_api.server.default module: - helfi_react_search - media @@ -230,4 +230,4 @@ options: cron_limit: 50 index_directly: false track_changes_in_references: true -server: elastic_kymp +server: default diff --git a/conf/cmi/search_api.index.street_data.yml b/conf/cmi/search_api.index.street_data.yml index 00f7a31e..9dce89f6 100644 --- a/conf/cmi/search_api.index.street_data.yml +++ b/conf/cmi/search_api.index.street_data.yml @@ -3,7 +3,7 @@ langcode: en status: true dependencies: config: - - search_api.server.elastic_kymp + - search_api.server.default module: - helfi_kymp_content - helfi_react_search @@ -52,4 +52,4 @@ options: cron_limit: 50 index_directly: false track_changes_in_references: true -server: elastic_kymp +server: default diff --git a/conf/cmi/search_api.server.elastic_kymp.yml b/conf/cmi/search_api.server.default.yml similarity index 95% rename from conf/cmi/search_api.server.elastic_kymp.yml rename to conf/cmi/search_api.server.default.yml index 160fa6f6..d17fc5cc 100644 --- a/conf/cmi/search_api.server.elastic_kymp.yml +++ b/conf/cmi/search_api.server.default.yml @@ -4,7 +4,7 @@ status: true dependencies: module: - elasticsearch_connector -id: elastic_kymp +id: default name: 'Elastic KYMP' description: '' backend: elasticsearch diff --git a/public/sites/default/all.settings.php b/public/sites/default/all.settings.php index 1088e4f1..66c90a0d 100644 --- a/public/sites/default/all.settings.php +++ b/public/sites/default/all.settings.php @@ -7,12 +7,12 @@ // Elasticsearch settings. if (getenv('ELASTICSEARCH_URL')) { - $config['search_api.server.elastic_kymp']['backend_config']['connector_config']['url'] = getenv('ELASTICSEARCH_URL'); + $config['search_api.server.default']['backend_config']['connector_config']['url'] = getenv('ELASTICSEARCH_URL'); if (getenv('ELASTIC_USER') && getenv('ELASTIC_PASSWORD')) { - $config['search_api.server.elastic_kymp']['backend_config']['connector'] = 'helfi_connector'; - $config['search_api.server.elastic_kymp']['backend_config']['connector_config']['username'] = getenv('ELASTIC_USER'); - $config['search_api.server.elastic_kymp']['backend_config']['connector_config']['password'] = getenv('ELASTIC_PASSWORD'); + $config['search_api.server.default']['backend_config']['connector'] = 'helfi_connector'; + $config['search_api.server.default']['backend_config']['connector_config']['username'] = getenv('ELASTIC_USER'); + $config['search_api.server.default']['backend_config']['connector_config']['password'] = getenv('ELASTIC_PASSWORD'); } } // Elastic proxy URL. From e2a3ca637421afcce9aef2855e4453ecebcf625f Mon Sep 17 00:00:00 2001 From: Santeri Hurnanen Date: Mon, 2 Dec 2024 12:23:10 +0200 Subject: [PATCH 3/3] UHF-10549: Move elasticsearch settings to settings.php --- public/sites/default/all.settings.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/public/sites/default/all.settings.php b/public/sites/default/all.settings.php index 66c90a0d..c42a35ee 100644 --- a/public/sites/default/all.settings.php +++ b/public/sites/default/all.settings.php @@ -5,16 +5,6 @@ * Contains site specific overrides. */ -// Elasticsearch settings. -if (getenv('ELASTICSEARCH_URL')) { - $config['search_api.server.default']['backend_config']['connector_config']['url'] = getenv('ELASTICSEARCH_URL'); - - if (getenv('ELASTIC_USER') && getenv('ELASTIC_PASSWORD')) { - $config['search_api.server.default']['backend_config']['connector'] = 'helfi_connector'; - $config['search_api.server.default']['backend_config']['connector_config']['username'] = getenv('ELASTIC_USER'); - $config['search_api.server.default']['backend_config']['connector_config']['password'] = getenv('ELASTIC_PASSWORD'); - } -} // Elastic proxy URL. $config['elastic_proxy.settings']['elastic_proxy_url'] = getenv('ELASTIC_PROXY_URL'); // Sentry DSN for React.