diff --git a/build.sbt b/build.sbt index 247d46066a..96d2bfee54 100644 --- a/build.sbt +++ b/build.sbt @@ -49,6 +49,7 @@ lazy val rpmPackageRelease = (project in file("package/rpm-release")) )) ) + Release.releaseVersionUIFile := baseDirectory.value / "ui" / "package.json" Release.changelogFile := baseDirectory.value / "CHANGELOG.md" @@ -79,24 +80,31 @@ mappings in Universal ~= { maintainer := "TheHive Project " packageSummary := "Scalable, Open Source and Free Security Incident Response Solutions" packageDescription := - """TheHive is a scalable 3-in-1 open source and free security incident response platform designed to make life easier - | for SOCs, CSIRTs, CERTs and any information security practitioner dealing with security incidents that need to be - | investigated and acted upon swiftly.""".stripMargin + """TheHive is a scalable 3-in-1 open source and free security incident response + | platform designed to make life easier for SOCs, CSIRTs, CERTs and any + | information security practitioner dealing with security incidents that need to + | be investigated and acted upon swiftly.""".stripMargin defaultLinuxInstallLocation := "/opt" linuxPackageMappings ~= { _.map { pm => val mappings = pm.mappings.filterNot { case (_, path) => path.startsWith("/opt/thehive/package") || path.startsWith("/opt/thehive/conf") } - com.typesafe.sbt.packager.linux.LinuxPackageMapping(mappings, pm.fileData).withConfig() - } :+ packageMapping( - file("package/thehive.service") -> "/etc/systemd/system/thehive.service", + com.typesafe.sbt.packager.linux.LinuxPackageMapping(mappings, pm.fileData) + } +} +linuxPackageMappings ++= Seq( + packageMapping( + file("package/thehive.service") -> "/usr/lib/systemd/system/thehive.service" + ).withPerms("644"), + packageMapping( file("package/thehive.conf") -> "/etc/init/thehive.conf", - file("package/thehive") -> "/etc/init.d/thehive", file("conf/application.sample") -> "/etc/thehive/application.conf", file("conf/logback.xml") -> "/etc/thehive/logback.xml" - ).withConfig() -} + ).withPerms("644").withConfig(), + packageMapping( + file("package/thehive") -> "/etc/init.d/thehive" + ).withPerms("755").withConfig()) packageBin := { (packageBin in Universal).value @@ -104,6 +112,7 @@ packageBin := { (packageBin in Rpm).value } // DEB // +linuxPackageMappings in Debian += packageMapping(file("LICENSE") -> "/usr/share/doc/thehive/copyright").withPerms("644") version in Debian := version.value + "-1" debianPackageRecommends := Seq("elasticsearch") debianPackageDependencies += "openjdk-8-jre-headless" diff --git a/package/thehive b/package/thehive index ba27b8cf3e..7e5a726bb9 100755 --- a/package/thehive +++ b/package/thehive @@ -113,6 +113,11 @@ case "$1" in start ;; + force-reload) + stop + start + ;; + *) log_action_msg "Usage: /etc/init.d/thehive {start|stop|restart|status}" || true exit 1 diff --git a/package/thehive.conf-perso b/package/thehive.conf-perso deleted file mode 100644 index a0d9d46088..0000000000 --- a/package/thehive.conf-perso +++ /dev/null @@ -1,49 +0,0 @@ -# thehive - a FOSS Information Security Incident Management Platform -# - -description "TheHive" - -start on runlevel [2345] -stop on runlevel [!2345] - -respawn -respawn limit 10 5 -umask 022 - - -env DAEMON=/opt/thehive/bin/thehive -env PIDFILE=/var/run/thehive.pid -env DAEMONUSER=thehive -env CONFIGFILE=/etc/thehive/application.conf -env LISTENPORT=9000 -env DAEMON_OPTS= -env DEFAULTFILE=/etc/default/thehive - - -pre-start script - echo Starting TheHive - if [ -f "$DEFAULTFILE" ]; then - . "$DEFAULTFILE" - fi - - if test ! -e $CONFIGFILE - then - mkdir -p $(dirname $CONFIGFILE) 2>/dev/null || true - cat >> $CONFIGFILE <<- _EOF_ - # Secret key - # ~~~~~ - # The secret key is used to secure cryptographics functions. - # If you deploy your application to several instances be sure to use the same key! - play.crypto.secret="$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1)" -_EOF_ - chown $DAEMONUSER $CONFIGFILE - chmod o-rwx $CONFIGFILE - fi - - test -x $DAEMON || { echo $DAEMON not found; stop; exit 0; } -end script - -script - cd $(dirname $DAEMON)/.. - $DAEMON -Dconfig.file=$CONFIGFILE -Dhttp.port=$LISTENPORT -Dpidfile.path=$PIDFILE $DAEMON_OPTS -end script