From ae21b75687df9f85a7d4c3176ca591b3c63e85e7 Mon Sep 17 00:00:00 2001 From: Caipira Date: Sat, 6 May 2023 04:02:34 +0900 Subject: [PATCH] fix(backend): Use SSL option for Meilisearch (#10772) --- .config/docker_example.yml | 1 + .config/example.yml | 1 + .devcontainer/devcontainer.yml | 1 + chart/files/default.yml | 1 + packages/backend/src/GlobalModule.ts | 2 +- packages/backend/src/config.ts | 1 + 6 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.config/docker_example.yml b/.config/docker_example.yml index 6946954ce..39682e154 100644 --- a/.config/docker_example.yml +++ b/.config/docker_example.yml @@ -102,6 +102,7 @@ redis: # host: meilisearch # port: 7700 # apiKey: '' +# ssl: true # ┌───────────────┐ #───┘ ID generation └─────────────────────────────────────────── diff --git a/.config/example.yml b/.config/example.yml index 586117667..ef8373c4d 100644 --- a/.config/example.yml +++ b/.config/example.yml @@ -102,6 +102,7 @@ redis: # host: localhost # port: 7700 # apiKey: '' +# ssl: true # ┌───────────────┐ #───┘ ID generation └─────────────────────────────────────────── diff --git a/.devcontainer/devcontainer.yml b/.devcontainer/devcontainer.yml index e1b89c25b..1d761ae75 100644 --- a/.devcontainer/devcontainer.yml +++ b/.devcontainer/devcontainer.yml @@ -102,6 +102,7 @@ redis: # host: meilisearch # port: 7700 # apiKey: '' +# ssl: true # ┌───────────────┐ #───┘ ID generation └─────────────────────────────────────────── diff --git a/chart/files/default.yml b/chart/files/default.yml index f50c38d57..342c6091f 100644 --- a/chart/files/default.yml +++ b/chart/files/default.yml @@ -123,6 +123,7 @@ redis: # host: localhost # port: 7700 # apiKey: '' +# ssl: true # ┌───────────────┐ #───┘ ID generation └─────────────────────────────────────────── diff --git a/packages/backend/src/GlobalModule.ts b/packages/backend/src/GlobalModule.ts index 2f4862285..5fb4e8ef3 100644 --- a/packages/backend/src/GlobalModule.ts +++ b/packages/backend/src/GlobalModule.ts @@ -28,7 +28,7 @@ const $meilisearch: Provider = { useFactory: (config) => { if (config.meilisearch) { return new MeiliSearch({ - host: `http://${config.meilisearch.host}:${config.meilisearch.port}`, + host: `${config.meilisearch.ssl ? 'https' : 'http' }://${config.meilisearch.host}:${config.meilisearch.port}`, apiKey: config.meilisearch.apiKey, }); } else { diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts index 7354268a4..b41fb603b 100644 --- a/packages/backend/src/config.ts +++ b/packages/backend/src/config.ts @@ -61,6 +61,7 @@ export type Source = { host: string; port: string; apiKey: string; + ssl?: boolean; }; proxy?: string;