diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2020-03-20 14:00:34 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-20 14:00:34 +0900 |
| commit | 5bbd4ae703f12b20e1f308f430b65f9e30bfff21 (patch) | |
| tree | aee132c07f013cb3eb0c0d4f2a5347aebff65892 /src/db | |
| parent | use username if name was empty (#6166) (diff) | |
| download | sharkey-5bbd4ae703f12b20e1f308f430b65f9e30bfff21.tar.gz sharkey-5bbd4ae703f12b20e1f308f430b65f9e30bfff21.tar.bz2 sharkey-5bbd4ae703f12b20e1f308f430b65f9e30bfff21.zip | |
ElasticSearchで認証ができるように (#6158)
Diffstat (limited to 'src/db')
| -rw-r--r-- | src/db/elasticsearch.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/db/elasticsearch.ts b/src/db/elasticsearch.ts index b62e17461a..048e399bdf 100644 --- a/src/db/elasticsearch.ts +++ b/src/db/elasticsearch.ts @@ -33,6 +33,10 @@ const index = { // Init ElasticSearch connection const client = config.elasticsearch ? new elasticsearch.Client({ node: `${config.elasticsearch.ssl ? 'https://' : 'http://'}${config.elasticsearch.host}:${config.elasticsearch.port}`, + auth: (config.elasticsearch.user && config.elasticsearch.pass) ? { + username: config.elasticsearch.user, + password: config.elasticsearch.pass + } : undefined, pingTimeout: 30000 }) : null; |