-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
1,316 additions
and
1,004 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,36 +3,53 @@ import com.typesafe.sbt.packager.docker.{Cmd, ExecCmd} | |
|
||
version in Docker := { | ||
version.value match { | ||
case stableVersion(_, _) => version.value | ||
case betaVersion(v1, v2) => v1 + "-0.1RC" + v2 | ||
case snapshotVersion(_, _) => version.value + "-SNAPSHOT" | ||
case _ => sys.error("Invalid version: " + version.value) | ||
case stableVersion(_, _) ⇒ version.value | ||
case betaVersion(v1, v2) ⇒ v1 + "-0.1RC" + v2 | ||
case snapshotVersion(_, _) ⇒ version.value + "-SNAPSHOT" | ||
case _ ⇒ sys.error("Invalid version: " + version.value) | ||
} | ||
} | ||
defaultLinuxInstallLocation in Docker := "/opt/thehive" | ||
dockerRepository := Some("thehiveproject") | ||
dockerUpdateLatest := !version.value.toUpperCase.contains("RC") && !version.value.contains("SNAPSHOT") | ||
dockerEntrypoint := Seq("/opt/thehive/entrypoint") | ||
dockerExposedPorts := Seq(9000) | ||
daemonUser in Docker := "thehive" | ||
daemonGroup in Docker := "thehive" | ||
mappings in Docker ++= Seq( | ||
file("package/docker/entrypoint") -> "/opt/thehive/entrypoint", | ||
file("package/logback.xml") -> "/etc/thehive/logback.xml", | ||
file("package/empty") -> "/var/log/thehive/application.log") | ||
file("package/docker/entrypoint") → "/opt/thehive/entrypoint", | ||
file("package/logback.xml") → "/etc/thehive/logback.xml", | ||
file("package/empty") → "/var/log/thehive/application.log" | ||
) | ||
mappings in Docker ~= (_.filterNot { | ||
case (_, filepath) => filepath == "/opt/thehive/conf/application.conf" | ||
case (_, filepath) ⇒ filepath == "/opt/thehive/conf/application.conf" | ||
}) | ||
dockerCommands ~= { dc => | ||
val (dockerInitCmds, dockerTailCmds) = dc | ||
.collect { | ||
case ExecCmd("RUN", "chown", _*) => ExecCmd("RUN", "chown", "-R", "daemon:root", ".") | ||
case other => other | ||
} | ||
.splitAt(4) | ||
dockerInitCmds ++ | ||
Seq( | ||
Cmd("ADD", "var", "/var"), | ||
Cmd("ADD", "etc", "/etc"), | ||
ExecCmd("RUN", "chown", "-R", "daemon:root", "/var/log/thehive"), | ||
ExecCmd("RUN", "chmod", "+x", "/opt/thehive/bin/thehive", "/opt/thehive/entrypoint")) ++ | ||
dockerTailCmds | ||
} | ||
dockerCommands := Seq( | ||
Cmd("FROM", "openjdk:8"), | ||
Cmd("LABEL", "MAINTAINER=\"TheHive Project <[email protected]>\"", "repository=\"https://github.com/TheHive-Project/TheHive\""), | ||
Cmd("WORKDIR", "/opt/thehive"), | ||
// format: off | ||
Cmd("RUN", | ||
"apt", "update", "&&", | ||
"apt", "upgrade", "-y", "&&", | ||
"apt", "autoclean", "-y", "-q", "&&", | ||
"apt", "autoremove", "-y", "-q", "&&", | ||
"rm", "-rf", "/var/lib/apt/lists/*", "&&", | ||
"(", "type", "groupadd", "1>/dev/null", "2>&1", "&&", | ||
"groupadd", "-g", "1000", "thehive", "||", | ||
"addgroup", "-g", "1000", "-S", "thehive", | ||
")", "&&", | ||
"(", "type", "useradd", "1>/dev/null", "2>&1", "&&", | ||
"useradd", "--system", "--uid", "1000", "--gid", "1000", "thehive", "||", | ||
"adduser", "-S", "-u", "1000", "-G", "thehive", "thehive", | ||
")"), | ||
//format: on | ||
Cmd("ADD", "--chown=root:root", "opt", "/opt"), | ||
Cmd("ADD", "--chown=thehive:thehive", "var", "/var"), | ||
Cmd("ADD", "--chown=thehive:thehive", "etc", "/etc"), | ||
ExecCmd("RUN", "chmod", "+x", "/opt/thehive/bin/thehive", "/opt/thehive/entrypoint"), | ||
Cmd("EXPOSE", "9000"), | ||
Cmd("USER", "thehive"), | ||
ExecCmd("ENTRYPOINT", "/opt/thehive/entrypoint"), | ||
ExecCmd("CMD") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
version: "2" | ||
services: | ||
elasticsearch: | ||
image: elasticsearch:6.8.0 | ||
image: elasticsearch:6.8.8 | ||
environment: | ||
- http.host=0.0.0.0 | ||
- cluster.name=hive | ||
- thread_pool.index.queue_size=100000 | ||
- thread_pool.search.queue_size=100000 | ||
- thread_pool.bulk.queue_size=100000 | ||
- discovery.type=single-node | ||
ulimits: | ||
nofile: | ||
soft: 65536 | ||
hard: 65536 | ||
cortex: | ||
image: thehiveproject/cortex:3.0.1 | ||
image: thehiveproject/cortex:latest | ||
depends_on: | ||
- elasticsearch | ||
ports: | ||
- "0.0.0.0:9001:9001" | ||
thehive: | ||
image: thehiveproject/thehive:3.4.0 | ||
image: thehiveproject/thehive:latest | ||
depends_on: | ||
- elasticsearch | ||
- cortex | ||
ports: | ||
- "0.0.0.0:9000:9000" | ||
command: --cortex-port 9001 |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.