Skip to content

Commit

Permalink
#623 Update docker entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jun 5, 2019
1 parent 2fb5f57 commit 2ef0838
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
5 changes: 1 addition & 4 deletions docker/thehive/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
version: "2"
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.0

This comment has been minimized.

Copy link
@milesflo

milesflo Oct 10, 2019

Hey, why did you change this? The docs say that ElasticSearch 5.X is used for storage. Did you test this?

This comment has been minimized.

Copy link
@milesflo
image: elasticsearch:6.8.0
environment:
- http.host=0.0.0.0
- transport.host=0.0.0.0
- xpack.security.enabled=false
- cluster.name=hive
- script.inline=true
- thread_pool.index.queue_size=100000
- thread_pool.search.queue_size=100000
- thread_pool.bulk.queue_size=100000
Expand Down
20 changes: 11 additions & 9 deletions package/docker/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function usage {
--no-config | do not try to configure TheHive (add secret and elasticsearch)
--no-config-secret | do not add random secret to configuration
--no-config-es | do not add elasticsearch hosts to configuration
--es-hosts <esconfig> | use this string to configure elasticsearch hosts (format: ["host1:9300","host2:9300"])
--es-uri <uri> | use this string to configure elasticsearch hosts (format: http(s)://host:port,host:port(/prefix)?querystring)
--es-hostname <host> | resolve this hostname to find elasticseach instances
--secret <secret> | secret to secure sessions
--cortex-proto <proto> | define protocol to connect to Cortex (default: http)
Expand All @@ -38,7 +38,9 @@ do
"--no-config-secret") CONFIG_SECRET=0;;
"--secret") shift; SECRET=$1;;
"--no-config-es") CONFIG_ES=0;;
"--es-hosts") shift; ES_HOSTS=$1;;
"--es-hosts") echo "--es-hosts is deprecated, please use --es-uri"
usage;;
"--es-uri") shift; ES_URI=$1;;
"--es-hostname") shift; ES_HOSTNAME=$1;;
"--no-config-cortex") CONFIG_CORTEX=0;;
"--cortex-proto") shift; CORTEX_PROTO=$1;;
Expand Down Expand Up @@ -67,26 +69,26 @@ then

if test $CONFIG_ES = 1
then
if test -z "$ES_HOSTS"
if test -z "$ES_URI"
then
function join_es_hosts {
echo -n "[\"$1"
echo -n $1:9200
shift
printf "%s:9300\"]" "${@/#/:9300\",\"}"
printf "%s," "${@/#/:9200}"
}

ES=$(getent ahostsv4 $ES_HOSTNAME | awk '{ print $1 }' | sort -u)
if test -z "$ES"
then
echo "Warning automatic elasticsearch host config fails"
else
ES_HOSTS=$(join_es_hosts $ES)
ES_URI=http://$(join_es_hosts $ES)
fi
fi
if test -n "$ES_HOSTS"
if test -n "$ES_URI"
then
echo Using elasticsearch host: $ES_HOSTS
echo search.host=$ES_HOSTS >> $CONFIG_FILE
echo Using elasticsearch uri: $ES_URI
echo search.uri=\"$ES_URI\" >> $CONFIG_FILE
else
echo elasticsearch host not configured
fi
Expand Down

0 comments on commit 2ef0838

Please sign in to comment.