Add EL auth config
This commit is contained in:
parent
9d977fd31c
commit
c29e7f02df
|
@ -10,6 +10,9 @@ webserver:
|
|||
elastic-search:
|
||||
# https or http
|
||||
http: 'http'
|
||||
auth:
|
||||
username: null
|
||||
password: null
|
||||
ssl:
|
||||
# Specificy a custom CA
|
||||
ca: null
|
||||
|
|
|
@ -17,6 +17,15 @@ if (CONFIG.ELASTIC_SEARCH.SSL.CA) {
|
|||
})
|
||||
}
|
||||
|
||||
if (CONFIG.ELASTIC_SEARCH.AUTH.USERNAME) {
|
||||
Object.assign(elasticOptions, {
|
||||
auth: {
|
||||
username: CONFIG.ELASTIC_SEARCH.AUTH.USERNAME,
|
||||
password: CONFIG.ELASTIC_SEARCH.AUTH.PASSWORD
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const elasticSearch = new Client(elasticOptions)
|
||||
|
||||
function buildSort (value: string) {
|
||||
|
|
|
@ -14,6 +14,10 @@ const CONFIG = {
|
|||
},
|
||||
ELASTIC_SEARCH: {
|
||||
HTTP: config.get<string>('elastic-search.http'),
|
||||
AUTH: {
|
||||
USERNAME: config.get<string>('elastic-search.auth.username'),
|
||||
PASSWORD: config.get<string>('elastic-search.auth.password')
|
||||
},
|
||||
SSL: {
|
||||
CA: config.get<string>('elastic-search.ssl.ca')
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue