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 authored and nadouani committed Jun 5, 2019
1 parent 8d554a7 commit d3c15bb
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
image: elasticsearch:6.8.0

This comment has been minimized.

Copy link
@JamesCullum

JamesCullum Jun 26, 2019

ES6.8 is not compatible with the current latest of cortex & thehive, as those are RCs. The docker build will therefore fail.

This comment has been minimized.

Copy link
@nadouani

nadouani Jun 27, 2019

Contributor

The master branch contains the 3.4.0 release which supports ES6. I'm probably not understanding your question.

This comment has been minimized.

Copy link
@JamesCullum

JamesCullum Jun 27, 2019

The docker image tagges as "latest" for cortex and thehive do not contain the 3.4 release, but elasticsearch was upgraded. This means that running this script (at least for me) doesnt work, until the 3.4 version is tagged as latest.

This comment has been minimized.

Copy link
@nadouani

nadouani Jun 28, 2019

Contributor

Oh yes, I got it. Nice catch.

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

1 comment on commit d3c15bb

@JamesCullum
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ES6.8 is not compatible with the current latest of cortex & thehive, as those are RCs. The docker build will therefore fail.

Please sign in to comment.