Skip to content
Snippets Groups Projects
Unverified Commit 5bbd4ae7 authored by MeiMei's avatar MeiMei Committed by GitHub
Browse files

ElasticSearchで認証ができるように (#6158)

parent f2f7f532
No related branches found
No related tags found
No related merge requests found
......@@ -88,7 +88,9 @@ redis:
#elasticsearch:
# host: localhost
# port: 9200
# pass: null
# ssl: false
# user:
# pass:
# ┌───────────────┐
#───┘ ID generation └───────────────────────────────────────────
......
......@@ -27,9 +27,10 @@ export type Source = {
elasticsearch: {
host: string;
port: number;
pass: string;
index?: string;
ssl?: boolean;
user?: string;
pass?: string;
index?: string;
};
proxy?: string;
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment