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