diff --git a/apps/dashboard-app/src/main/resources/reference.conf b/apps/dashboard-app/src/main/resources/reference.conf index 1b9192dc0..e83618176 100644 --- a/apps/dashboard-app/src/main/resources/reference.conf +++ b/apps/dashboard-app/src/main/resources/reference.conf @@ -1,77 +1,77 @@ shrine { dashboard { gruntWatch = false //false for production, true for mvn tomcat7:run . Allows the client javascript and html files to be loaded via gruntWatch . happyBaseUrl = "https://localhost:6443/shrine/rest/happy" statusBaseUrl = "https://localhost:6443/shrine/rest/internalstatus" database { dataSourceFrom = "JNDI" //Can be JNDI or testDataSource . Use testDataSource for tests, JNDI everywhere else jndiDataSourceName = "java:comp/env/jdbc/problemDB" //or leave out for tests slickProfileClassName = "slick.driver.MySQLDriver$" // Can be // slick.driver.H2Driver$ // slick.driver.MySQLDriver$ // slick.driver.PostgresDriver$ // slick.driver.SQLServerDriver$ // slick.driver.JdbcDriver$ // freeslick.OracleProfile$ // freeslick.MSSQLServerProfile$ // // (Yes, with the $ on the end) // For testing without JNDI // testDataSource { //typical test settings for unit tests //driverClassName = "org.h2.Driver" //url = "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1" //H2 embedded in-memory for unit tests //url = "jdbc:h2:~/stewardTest.h2" //H2 embedded on disk at ~/test // } createTablesOnStart = false //for testing with H2 in memory, when not running unit tests. Set to false normally } } pmEndpoint { // url = "http://example.com/i2b2/services/PMService/getServices" //set to the right pm endpoint acceptAllCerts = true timeout { seconds = 10 } } authenticate { realm = "SHRINE Steward API" usersource { type = "PmUserSource" //Must be ConfigUserSource (for isolated testing) or PmUserSource (for everything else) domain = "set shrine.authenticate.usersource.domain to the PM authentication domain in dashboard.conf" //"i2b2demo" } } // If the pmEndpoint acceptAllCerts = false then you need to supply a keystore // Or if you would like dashboard-to-dashboard comms to work. // keystore { // file = "shrine.keystore" // password = "chiptesting" // privateKeyAlias = "test-cert" // keyStoreType = "JKS" // caCertAliases = [carra ca] // } } //todo typesafe config precedence seems to do the right thing, but I haven't found the rules that say this reference.conf should override others akka { loglevel = INFO // log-config-on-start = on loggers = ["akka.event.slf4j.Slf4jLogger"] // logging-filter = "akka.event.slf4j.Slf4jLoggingFilter" // Toggles whether the threads created by this ActorSystem should be daemons or not daemonic = on } spray.servlet { - boot-class = "net.shrine.dashboard.metadata.Boot" + boot-class = "net.shrine.dashboard.net.shrine.metadata.Boot" request-timeout = 30s } diff --git a/apps/meta-app/src/main/resources/reference.conf b/apps/meta-app/src/main/resources/reference.conf new file mode 100644 index 000000000..5b22fe2c1 --- /dev/null +++ b/apps/meta-app/src/main/resources/reference.conf @@ -0,0 +1,21 @@ +shrine { + metaData { + ping = "pong" + } +} + +//todo typesafe config precedence seems to do the right thing, but I haven't found the rules that say this reference.conf should override others +akka { + loglevel = INFO + + // log-config-on-start = on + loggers = ["akka.event.slf4j.Slf4jLogger"] + // logging-filter = "akka.event.slf4j.Slf4jLoggingFilter" + // Toggles whether the threads created by this ActorSystem should be daemons or not + daemonic = on +} + +spray.servlet { + boot-class = "net.shrine.metadata.Boot" + request-timeout = 30s +} diff --git a/apps/meta-app/src/main/scala/metadata/Boot.scala b/apps/meta-app/src/main/scala/net/shrine/metadata/Boot.scala similarity index 98% rename from apps/meta-app/src/main/scala/metadata/Boot.scala rename to apps/meta-app/src/main/scala/net/shrine/metadata/Boot.scala index 75aeef02b..f775360bf 100644 --- a/apps/meta-app/src/main/scala/metadata/Boot.scala +++ b/apps/meta-app/src/main/scala/net/shrine/metadata/Boot.scala @@ -1,43 +1,43 @@ -package metadata +package net.shrine.metadata import akka.actor.{ActorRef, ActorSystem, Props} import net.shrine.problem.{ProblemConfigSource, ProblemHandler} import spray.servlet.WebBoot import scala.util.control.NonFatal /** * Created by ty on 11/8/16. */ // this class is instantiated by the servlet initializer // it needs to have a default constructor and implement // the spray.servlet.WebBoot trait class Boot extends WebBoot { // we need an ActorSystem to host our application in override val system = startActorSystem() // the service actor replies to incoming HttpRequests override val serviceActor: ActorRef = startServiceActor() def startActorSystem() = try ActorSystem("MetaDataActors",MetaConfigSource.config) catch { case NonFatal(x) => CannotStartMetaData(x); throw x case x: ExceptionInInitializerError => CannotStartMetaData(x); throw x } def startServiceActor() = try { //TODO: create a common interface for Problems to hide behind, so that it doesn't exist anywhere in the code //TODO: except for when brought into scope by a DatabaseProblemHandler val handler:ProblemHandler = ProblemConfigSource.getObject("shrine.problem.problemHandler", ProblemConfigSource.config) handler.warmUp() // the service actor replies to incoming HttpRequests system.actorOf(Props[MetaDataActor]) } catch { case NonFatal(x) => CannotStartMetaData(x); throw x case x: ExceptionInInitializerError => CannotStartMetaData(x); throw x } } diff --git a/apps/meta-app/src/main/scala/metadata/CannotStartMetaData.scala b/apps/meta-app/src/main/scala/net/shrine/metadata/CannotStartMetaData.scala similarity index 93% rename from apps/meta-app/src/main/scala/metadata/CannotStartMetaData.scala rename to apps/meta-app/src/main/scala/net/shrine/metadata/CannotStartMetaData.scala index 48ed4a306..690cfa0f6 100644 --- a/apps/meta-app/src/main/scala/metadata/CannotStartMetaData.scala +++ b/apps/meta-app/src/main/scala/net/shrine/metadata/CannotStartMetaData.scala @@ -1,14 +1,14 @@ -package metadata +package net.shrine.metadata import net.shrine.problem.{AbstractProblem, ProblemSources} /** * Created by ty on 11/8/16. */ case class CannotStartMetaData(ex:Throwable) extends AbstractProblem(ProblemSources.Dsa) { override def summary: String = "The MetaData API could not start due to an exception." override def description: String = s"The MetaData API could not start due to ${throwable.get}" override def throwable = Some(ex) } diff --git a/apps/meta-app/src/main/scala/metadata/MetaConfigSource.scala b/apps/meta-app/src/main/scala/net/shrine/metadata/MetaConfigSource.scala similarity index 81% rename from apps/meta-app/src/main/scala/metadata/MetaConfigSource.scala rename to apps/meta-app/src/main/scala/net/shrine/metadata/MetaConfigSource.scala index 5f83e9662..817862662 100644 --- a/apps/meta-app/src/main/scala/metadata/MetaConfigSource.scala +++ b/apps/meta-app/src/main/scala/net/shrine/metadata/MetaConfigSource.scala @@ -1,8 +1,8 @@ -package metadata +package net.shrine.metadata import net.shrine.source.ConfigSource /** * Created by ty on 11/8/16. */ object MetaConfigSource extends ConfigSource diff --git a/apps/meta-app/src/main/scala/metadata/MetaDataActor.scala b/apps/meta-app/src/main/scala/net/shrine/metadata/MetaDataActor.scala similarity index 91% rename from apps/meta-app/src/main/scala/metadata/MetaDataActor.scala rename to apps/meta-app/src/main/scala/net/shrine/metadata/MetaDataActor.scala index 3e972d735..5e7326ea6 100644 --- a/apps/meta-app/src/main/scala/metadata/MetaDataActor.scala +++ b/apps/meta-app/src/main/scala/net/shrine/metadata/MetaDataActor.scala @@ -1,13 +1,13 @@ -package metadata +package net.shrine.metadata import akka.actor.{Actor, ActorRefFactory} /** * A super simple API that provides access to the MetaData section of SHRINE's configuration */ class MetaDataActor extends Actor with MetaDataService { override def receive: Receive = runRoute(route) override def actorRefFactory: ActorRefFactory = context } diff --git a/apps/meta-app/src/main/scala/metadata/MetaDataService.scala b/apps/meta-app/src/main/scala/net/shrine/metadata/MetaDataService.scala similarity index 97% rename from apps/meta-app/src/main/scala/metadata/MetaDataService.scala rename to apps/meta-app/src/main/scala/net/shrine/metadata/MetaDataService.scala index 094729644..6ff85ba58 100644 --- a/apps/meta-app/src/main/scala/metadata/MetaDataService.scala +++ b/apps/meta-app/src/main/scala/net/shrine/metadata/MetaDataService.scala @@ -1,33 +1,33 @@ -package metadata +package net.shrine.metadata import com.typesafe.config.ConfigRenderOptions import net.shrine.log.Loggable import spray.http.{StatusCode, StatusCodes} import spray.routing.{HttpService, _} import scala.util.Try /** * Created by ty on 11/8/16. */ trait MetaDataService extends HttpService with Loggable { lazy val config = MetaConfigSource.config.getConfig("shrine.metaData") lazy val route: Route = get { pathPrefix("ping") { complete("pong")} ~ pathPrefix("data") { parameter("key") { (key: String) => complete(handleKey(key)) } ~ complete(handleAll) }} def handleAll:(StatusCode, String) = { StatusCodes.OK -> config.root.render(ConfigRenderOptions.concise()) } def handleKey(key: String): (StatusCode, String) = { Try(StatusCodes.OK -> config.getValue(key).render(ConfigRenderOptions.concise())) .getOrElse(StatusCodes.NotFound -> s"Could not find a value for the specified path `$key`") } } diff --git a/apps/meta-app/src/test/scala/metadata/MetaDataServiceTest.scala b/apps/meta-app/src/test/scala/net/shrine/metadata/MetaDataServiceTest.scala similarity index 82% rename from apps/meta-app/src/test/scala/metadata/MetaDataServiceTest.scala rename to apps/meta-app/src/test/scala/net/shrine/metadata/MetaDataServiceTest.scala index 1f0de3b04..a4b9eb123 100644 --- a/apps/meta-app/src/test/scala/metadata/MetaDataServiceTest.scala +++ b/apps/meta-app/src/test/scala/net/shrine/metadata/MetaDataServiceTest.scala @@ -1,59 +1,59 @@ -package metadata +package net.shrine.metadata import akka.actor.ActorRefFactory import org.json4s.DefaultFormats import org.json4s.native.JsonMethods.parse import org.junit.runner.RunWith import org.scalatest.FlatSpec import org.scalatest.junit.JUnitRunner import spray.testkit.ScalatestRouteTest @RunWith(classOf[JUnitRunner]) class MetaDataServiceTest extends FlatSpec with ScalatestRouteTest with MetaDataService { override def actorRefFactory: ActorRefFactory = system import scala.concurrent.duration._ implicit val routeTestTimeout = RouteTestTimeout(10.seconds) import spray.http.StatusCodes._ - "metadata.MetaDataService" should "return an OK and pong for a ping" in { + "MetaDataService" should "return an OK and pong for a ping" in { Get(s"/ping") ~> route ~> check { implicit val formats = DefaultFormats val result = new String(body.data.toByteArray) assertResult(OK)(status) assertResult(result)("pong") } } - "metadata.MetaDataService" should "return an OK and pong for a data" in { + "MetaDataService" should "return an OK and pong for a data" in { Get(s"/data?key=ping") ~> route ~> check { implicit val formats = DefaultFormats val result = new String(body.data.toByteArray) assertResult(OK)(status) assertResult(result)("\"pong\"") } } - "metadata.MetaDataService" should "return an OK for all data" in { + "MetaDataService" should "return an OK for all data" in { Get(s"/data") ~> route ~> check { implicit val formats = DefaultFormats val result = parse(new String(body.data.toByteArray)) assertResult(OK)(status) } } - "metadata.MetaDataService" should "return an Ok and a list for a data" in { + "MetaDataService" should "return an Ok and a list for a data" in { Get("/data?key=list") ~> route ~> check { implicit val formats = DefaultFormats val result = new String(body.data.toByteArray) assertResult(OK)(status) assertResult(parse(result).extract[List[String]])(Seq("list", "list", "list")) } } } diff --git a/apps/meta-war/src/main/resources/log4j.properties b/apps/meta-war/src/main/resources/log4j.properties new file mode 100644 index 000000000..4c66d4b5c --- /dev/null +++ b/apps/meta-war/src/main/resources/log4j.properties @@ -0,0 +1,19 @@ +# LOG Pattern Layouts are covered here: http://logging.apache.org/log4j/docs/api/org/apache/log4j/PatternLayout.html + +# ROOT CONFIGURATION +log4j.rootLogger=info, R +log4j.appender.R=org.apache.log4j.DailyRollingFileAppender +log4j.appender.R.DatePattern='.'yyyy-MM-dd +log4j.appender.R.File=${catalina.base}/logs/shrine-dashboard.log +log4j.appender.R.layout=net.shrine.log.CustomPatternLayout +log4j.appender.R.layout.ConversionPattern=%d{yyyy-MMM-dd-HH:mm:ss.SSS} %p [ROOT][%c{1}][%t] %m %n %throwable + +# Shrine +log4j.logger.net.shrine=debug, shrine +log4j.additivity.net.shrine=false +log4j.appender.shrine=org.apache.log4j.DailyRollingFileAppender +log4j.appender.shrine.DatePattern='.'yyyy-MM-dd +log4j.appender.shrine.File=${catalina.base}/logs/shrine-dashboard.log +log4j.appender.shrine.layout=net.shrine.log.CustomPatternLayout +log4j.appender.shrine.layout.ConversionPattern=%d{yyyy-MMM-dd-HH:mm:ss.SSS} %p [DASHBOARD][%c{1}][%t] %m %n %throwable + diff --git a/apps/steward-app/src/main/resources/reference.conf b/apps/steward-app/src/main/resources/reference.conf index 1678b008c..f0a860a82 100644 --- a/apps/steward-app/src/main/resources/reference.conf +++ b/apps/steward-app/src/main/resources/reference.conf @@ -1,108 +1,108 @@ shrine { steward { createTopicsMode = Pending //Can be Pending, Approved, or TopcisIgnoredJustLog //Pending - new topics start in the Pending state; researchers must wait for the Steward to approve them //Approved - new topics start in the Approved state; researchers can use them immediately //TopicsIgnoredJustLog - all queries are logged and approved; researchers don't need to create topics emailDataSteward { sendAuditEmails = true //false will turn off the whole of emailing the data steward interval = "1 day" //Audit researchers daily maxQueryCountBetweenAudits = 30 //If a researcher runs more than this many queries since the last audit audit her minTimeBetweenAudits = "30 days" //If a researcher runs at least one query, audit those queries if this much time has passed //You must provide the email address of the shrine node system admin, to handle bounces and invalid addresses //from = "shrine-admin@example.com" //You must provide the email address of the data steward //to = "shrine-steward@example.com" subject = "Audit SHRINE researchers" //The baseUrl for the data steward to be substituted in to email text. Must be supplied if it is used in the email text. //stewardBaseUrl = "https://example.com:8443/steward/" //Text to use for the email audit. // AUDIT_LINES will be replaced by a researcherLine for each researcher to audit. // STEWARD_BASE_URL will be replaced by the value in stewardBaseUrl if available. emailBody = """Please audit the following users at STEWARD_BASE_URL at your earliest convinience: AUDIT_LINES"""//note that this can be a multiline message //Text to use per researcher to audit. //FULLNAME, USERNAME, COUNT and LAST_AUDIT_DATE will be replaced with appropriate text. researcherLine = "FULLNAME (USERNAME) has run COUNT queries since LAST_AUDIT_DATE." } database { dataSourceFrom = "JNDI" //Can be JNDI or testDataSource . Use testDataSource for tests, JNDI everywhere else jndiDataSourceName = "java:comp/env/jdbc/stewardDB" //or leave out for tests slickProfileClassName = "slick.driver.MySQLDriver$" // Can be // slick.driver.H2Driver$ // slick.driver.MySQLDriver$ // slick.driver.PostgresDriver$ // slick.driver.SQLServerDriver$ // slick.driver.JdbcDriver$ // freeslick.OracleProfile$ // freeslick.MSSQLServerProfile$ // // (Yes, with the $ on the end) // For testing without JNDI // testDataSource { //typical test settings for unit tests //driverClassName = "org.h2.Driver" //url = "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1" //H2 embedded in-memory for unit tests //url = "jdbc:h2:~/stewardTest.h2" //H2 embedded on disk at ~/test // } createTablesOnStart = false //for testing with H2 in memory, when not running unit tests. Set to false normally } gruntWatch = false //false for production, true for mvn tomcat7:run . Allows the client javascript and html files to be loaded via gruntWatch . } pmEndpoint { url = "http://example.com/i2b2/services/PMService/getServices" //"http://services.i2b2.org/i2b2/services/PMService/getServices" acceptAllCerts = true timeout { seconds = 10 } } authenticate { realm = "SHRINE Steward API" usersource { type = "PmUserSource" //Must be ConfigUserSource (for isolated testing) or PmUserSource (for everything else) domain = "set shrine.authenticate.usersource.domain to the PM authentication domain in steward.conf" //"i2b2demo" } } // If the pmEndpoint acceptAllCerts = false then you need to supply a keystore // keystore { // file = "shrine.keystore" // password = "chiptesting" // privateKeyAlias = "test-cert" // keyStoreType = "JKS" // caCertAliases = [carra ca] // } } //todo typesafe config precedence seems to do the right thing, but I haven't found the rules that say this reference.conf should override others akka { loglevel = INFO // log-config-on-start = on loggers = ["akka.event.slf4j.Slf4jLogger"] // logging-filter = "akka.event.slf4j.Slf4jLoggingFilter" // Toggles whether the threads created by this ActorSystem should be daemons or not daemonic = on } spray.servlet { - boot-class = "net.shrine.steward.metadata.Boot" + boot-class = "net.shrine.steward.net.shrine.metadata.Boot" request-timeout = 30s } diff --git a/apps/steward-war/src/main/resources/reference.conf b/apps/steward-war/src/main/resources/reference.conf index 2d52e479a..bea74cd82 100644 --- a/apps/steward-war/src/main/resources/reference.conf +++ b/apps/steward-war/src/main/resources/reference.conf @@ -1,109 +1,109 @@ shrine { steward { createTopicsMode = Pending //Can be Pending, Approved, or TopcisIgnoredJustLog //Pending - new topics start in the Pending state; researchers must wait for the Steward to approve them //Approved - new topics start in the Approved state; researchers can use them immediately //TopicsIgnoredJustLog - all queries are logged and approved; researchers don't need to create topics emailDataSteward { sendAuditEmails = true interval = "1 day" //Audit researchers daily timeAfterMidnight = "6 hours" //Audit researchers at 6 am. If the interval is less than 1 day then this delay is ignored. maxQueryCountBetweenAudits = 30 //If a researcher runs more than this many queries since the last audit audit her minTimeBetweenAudits = "30 days" //If a researcher runs at least one query, audit those queries if this much time has passed //provide the email address of the shrine node system admin, to handle bounces and invalid addresses //from = "shrine-admin@example.com" //provide the email address of the shrine node system admin, to handle bounces and invalid addresses //to = "shrine-steward@example.com" subject = "Audit SHRINE researchers" //The baseUrl for the data steward to be substituted in to email text. Must be supplied if it is used in the email text. //stewardBaseUrl = "https://example.com:8443/steward/" //Text to use for the email audit. // AUDIT_LINES will be replaced by a researcherLine for each researcher to audit. // STEWARD_BASE_URL will be replaced by the value in stewardBaseUrl if available. emailBody = """Please audit the following users at STEWARD_BASE_URL at your earliest convinience: AUDIT_LINES""" //Text to use per researcher to audit. //FULLNAME, USERNAME, COUNT and LAST_AUDIT_DATE will be replaced with appropriate text. researcherLine = "FULLNAME (USERNAME) has run COUNT queries since LAST_AUDIT_DATE." } database { dataSourceFrom = "JNDI" //Can be JNDI or testDataSource . Use testDataSource for tests, JNDI everywhere else jndiDataSourceName = "java:comp/env/jdbc/stewardDB" //or leave out for tests slickProfileClassName = "slick.driver.MySQLDriver$" // Can be // slick.driver.H2Driver$ // slick.driver.MySQLDriver$ // slick.driver.PostgresDriver$ // slick.driver.SQLServerDriver$ // slick.driver.JdbcDriver$ // freeslick.OracleProfile$ // freeslick.MSSQLServerProfile$ // // (Yes, with the $ on the end) // For testing without JNDI // testDataSource { //typical test settings for unit tests //driverClassName = "org.h2.Driver" //url = "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1" //H2 embedded in-memory for unit tests //url = "jdbc:h2:~/stewardTest.h2" //H2 embedded on disk at ~/test // } createTablesOnStart = false //for testing with H2 in memory, when not running unit tests. Set to false normally } gruntWatch = false //false for production, true for mvn tomcat7:run . Allows the client javascript and html files to be loaded via gruntWatch . } pmEndpoint { url = "http://example.com/i2b2/services/PMService/getServices" //"http://services.i2b2.org/i2b2/services/PMService/getServices" acceptAllCerts = true timeout { seconds = 10 } } authenticate { realm = "SHRINE Steward API" usersource { type = "PmUserSource" //Must be ConfigUserSource (for isolated testing) or PmUserSource (for everything else) domain = "set shrine.authenticate.usersource.domain to the PM authentication domain in steward.conf" //"i2b2demo" } } // If the pmEndpoint acceptAllCerts = false then you need to supply a keystore // keystore { // file = "shrine.keystore" // password = "chiptesting" // privateKeyAlias = "test-cert" // keyStoreType = "JKS" // caCertAliases = [carra ca] // } } //todo typesafe config precedence seems to do the right thing, but I haven't found the rules that say this reference.conf should override others akka { loglevel = INFO // log-config-on-start = on loggers = ["akka.event.slf4j.Slf4jLogger"] // logging-filter = "akka.event.slf4j.Slf4jLoggingFilter" // Toggles whether the threads created by this ActorSystem should be daemons or not daemonic = on } spray.servlet { - boot-class = "net.shrine.steward.metadata.Boot" + boot-class = "net.shrine.steward.net.shrine.metadata.Boot" request-timeout = 30s } diff --git a/install/src/main/resources/shrine.conf b/install/src/main/resources/shrine.conf index ea3644dde..2b53de8e1 100644 --- a/install/src/main/resources/shrine.conf +++ b/install/src/main/resources/shrine.conf @@ -1,342 +1,342 @@ shrine { pmEndpoint { // url = "http://shrine-dev1.catalyst/i2b2/services/PMService/getServices" //use your i2b2 pm url } ontEndpoint { // url = "http://shrine-dev1.catalyst/i2b2/rest/OntologyService/" //use your i2b2 ontology url } hiveCredentials { //use your i2b2 hive credentials // domain = "i2b2demo" // username = "demo" // password = "demouser" // crcProjectId = "Demo" // ontProjectId = "SHRINE" } breakdownResultOutputTypes { //use breakdown values appropriate for your shrine network // PATIENT_AGE_COUNT_XML { // description = "Age patient breakdown" // } // PATIENT_RACE_COUNT_XML { // description = "Race patient breakdown" // } // PATIENT_VITALSTATUS_COUNT_XML { // description = "Vital Status patient breakdown" // } // PATIENT_GENDER_COUNT_XML { // description = "Gender patient breakdown" // } } queryEntryPoint { // create = true //false for no qep // audit { // collectQepAudit = true //false to not use the 1.20 audit db tables // database { // dataSourceFrom = "JNDI" //Can be JNDI or testDataSource . Use testDataSource for tests, JNDI everywhere else // jndiDataSourceName = "java:comp/env/jdbc/qepAuditDB" //or leave out for tests // slickProfileClassName = "slick.driver.MySQLDriver$" // Can be // slick.driver.H2Driver$ // slick.driver.MySQLDriver$ // slick.driver.PostgresDriver$ // slick.driver.SQLServerDriver$ // slick.driver.JdbcDriver$ // freeslick.OracleProfile$ // freeslick.MSSQLServerProfile$ // // (Yes, with the $ on the end) // For testing without JNDI // testDataSource { //typical test settings for unit tests //driverClassName = "org.h2.Driver" //url = "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1" //H2 embedded in-memory for unit tests //url = "jdbc:h2:~/stewardTest.h2" //H2 embedded on disk at ~/test // } // timeout = 30 //time to wait before db gives up, in seconds. // createTablesOnStart = false //for testing with H2 in memory, when not running unit tests. Set to false normally // } // } // trustModelIsHub = true // False for P2P networks. // authenticationType = "pm" //can be none, pm, or ecommons // authorizationType = "shrine-steward" //can be none, shrine-steward, or hms-steward //hms-steward config // sheriffEndpoint { // url = "http://localhost:8080/shrine-hms-authorization/queryAuthorization" // acceptAllCerts = true // timeout { // seconds = 1 // } // } // sheriffCredentials { // username = "sheriffUsername" // password = "sheriffPassword" // } //shrine-steward config // shrineSteward { // qepUserName = "qep" // qepPassword = "trustme" // stewardBaseUrl = "https://localhost:6443" // } // includeAggregateResults = false // // maxQueryWaitTime { // minutes = 5 //must be longer than the hub's maxQueryWaitTime // } // broadcasterServiceEndpoint { // url = "http://example.com/shrine/rest/broadcaster/broadcast" //url for the hub // acceptAllCerts = true // timeout { // seconds = 1 // } // } } hub { // create = false //change to true to start a hub maxQueryWaitTime { // minutes = 4.5 //Needs to be longer than the adapter's maxQueryWaitTime, but shorter than the qep's } downstreamNodes { //Add your downstream nodes here // shrine-dev2 = "https://shrine-dev2.catalyst:6443/shrine/rest/adapter/requests" } shouldQuerySelf = false //true if there is an adapter at the hub , or just add a loopback address to downstreamNodes } adapter { // create = true by default. False to not create an adapter. // audit { // collectAdapterAudit = true by default. False to not fill in the audit database // database { // dataSourceFrom = "JNDI" //Can be JNDI or testDataSource . Use testDataSource for tests, JNDI everywhere else // jndiDataSourceName = "java:comp/env/jdbc/adapterAuditDB" //or leave out for tests // slickProfileClassName = "slick.driver.MySQLDriver$" // Can be // slick.driver.H2Driver$ // slick.driver.MySQLDriver$ // slick.driver.PostgresDriver$ // slick.driver.SQLServerDriver$ // slick.driver.JdbcDriver$ // freeslick.OracleProfile$ // freeslick.MSSQLServerProfile$ // // (Yes, with the $ on the end) // For testing without JNDI // testDataSource { //typical test settings for unit tests //driverClassName = "org.h2.Driver" //url = "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1" //H2 embedded in-memory for unit tests //url = "jdbc:h2:~/stewardTest.h2" //H2 embedded on disk at ~/test // } // createTablesOnStart = false //for testing with H2 in memory, when not running unit tests. Set to false normally // } // obfuscation { // binSize = 5 by default //Round to the nearest binSize. Use 1 for no effect (to match SHRINE 1.21 and earlier). // sigma = 6.5 by default //Noise to inject. Use 0 for no effect. (Use 1.33 to match SHRINE 1.21 and earlier). // clamp = 10 by default //Maximum ammount of noise to inject. (Use 3 to match SHRINE 1.21 and earlier). // } // adapterLockoutAttemptsThreshold = 10 by default // Number of allowed queries with the same actual result that can exist before a researcher is locked out of the adapter. Set to '0' to never lock out. In 1.23 the default will change to 0. In 1.24 the lockout code and this config value will be removed // botDefense { // countsAndMilliseconds = [ //to turn off, use an empty json list // {count = 10, milliseconds = 60000}, //allow up to 10 queries in one minute by default // {count = 200, milliseconds = 36000000} //allow up to 4 queries in 10 hours by default // ] // } crcEndpoint { //must be filled in url = "http://shrine-dev1.catalyst/i2b2/services/QueryToolService/" } setSizeObfuscation = true //must be set. false turns off obfuscation adapterMappingsFileName = "AdapterMappings.xml" maxSignatureAge { minutes = 5 //must be longer than the hub's maxQueryWaitTime } immediatelyRunIncomingQueries = true } networkStatusQuery = "\\\\SHRINE\\SHRINE\\Demographics\\Gender\\Male\\" humanReadableNodeName = "shrine-dev1" shrineDatabaseType = "mysql" keystore { file = "/opt/shrine/shrine.keystore" password = "changeit" privateKeyAlias = "shrine-dev1.catalyst" keyStoreType = "JKS" caCertAliases = [ "shrine-dev-ca" ] } problem { // problemHandler = "net.shrine.problem.LogAndDatabaseProblemHandler$" Can be other specialized problemHandler implementations } dashboard { // gruntWatch = false //false for production, true for mvn tomcat7:run . Allows the client javascript and html files to be loaded via gruntWatch . // happyBaseUrl = "https://localhost:6443/shrine/rest/happy" If the shine servlet is running on a different machime from the dashboard, change this URL to match // statusBaseUrl = "https://localhost:6443/shrine/rest/internalstatus" If the shine servlet is running on a different machime from the dashboard, change this URL to match // database { // dataSourceFrom = "JNDI" //Can be JNDI or testDataSource . Use testDataSource for tests, JNDI everywhere else // jndiDataSourceName = "java:comp/env/jdbc/problemDB" // slickProfileClassName = "slick.driver.MySQLDriver$" // Can be // slick.driver.H2Driver$ // slick.driver.MySQLDriver$ // slick.driver.PostgresDriver$ // slick.driver.SQLServerDriver$ // slick.driver.JdbcDriver$ // freeslick.OracleProfile$ // freeslick.MSSQLServerProfile$ // // (Yes, with the $ on the end) // For testing without JNDI // testDataSource { //typical test settings for unit tests //driverClassName = "org.h2.Driver" //url = "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1" //H2 embedded in-memory for unit tests //url = "jdbc:h2:~/stewardTest.h2" //H2 embedded on disk at ~/test // } // createTablesOnStart = false //for testing with H2 in memory, when not running unit tests. Set to false normally // } // } // status { //permittedHostOfOrigin = "localhost" //If absent then get the host name via java.net.InetAddress.getLocalHost.getHostName . Override to control } //Get the older squerl-basd databases through JNDI (inside of tomcant, using tomcat's db connection pool) or directly via a db config here (for testing squerylDataSource { // database { // dataSourceFrom = "JNDI" //Can be JNDI or testDataSource . Use testDataSource for tests, JNDI everywhere else // jndiDataSourceName = "java:comp/env/jdbc/shrineDB" //or leave out for tests // } } authenticate { usersource { // domain = "i2b2demo" //you must provide your own domain } } steward { // createTopicsMode = Pending //Can be Pending, Approved, or TopcisIgnoredJustLog. Pending by default //Pending - new topics start in the Pending state; researchers must wait for the Steward to approve them //Approved - new topics start in the Approved state; researchers can use them immediately //TopicsIgnoredJustLog - all queries are logged and approved; researchers don't need to create topics emailDataSteward { // sendAuditEmails = true //false to turn off the whole works of emailing the data steward // interval = "1 day" //Audit researchers daily // timeAfterMidnight = "6 hours" //Audit researchers at 6 am. If the interval is less than 1 day then this delay is ignored. // maxQueryCountBetweenAudits = 30 //If a researcher runs more than this many queries since the last audit audit her // minTimeBetweenAudits = "30 days" //If a researcher runs at least one query, audit those queries if this much time has passed //You must provide the email address of the shrine node system admin, to handle bounces and invalid addresses //from = "shrine-admin@example.com" //You must provide the email address of the data steward //to = "shrine-steward@example.com" // subject = "Audit SHRINE researchers" //The baseUrl for the data steward to be substituted in to email text. Must be supplied if it is used in the email text. //stewardBaseUrl = "https://example.com:8443/steward/" //Text to use for the email audit. // AUDIT_LINES will be replaced by a researcherLine for each researcher to audit. // STEWARD_BASE_URL will be replaced by the value in stewardBaseUrl if available. // emailBody = """Please audit the following users at STEWARD_BASE_URL at your earliest convinience: // //AUDIT_LINES""" //note that this can be a multiline message //Text to use per researcher to audit. //FULLNAME, USERNAME, COUNT and LAST_AUDIT_DATE will be replaced with appropriate text. // researcherLine = "FULLNAME (USERNAME) has run COUNT queries since LAST_AUDIT_DATE." } // database { // dataSourceFrom = "JNDI" //Can be JNDI or testDataSource . Use testDataSource for tests, JNDI everywhere else // jndiDataSourceName = "java:comp/env/jdbc/stewardDB" //or leave out for tests // slickProfileClassName = "slick.driver.MySQLDriver$" // Can be // slick.driver.H2Driver$ // slick.driver.MySQLDriver$ // slick.driver.PostgresDriver$ // slick.driver.SQLServerDriver$ // slick.driver.JdbcDriver$ // freeslick.OracleProfile$ // freeslick.MSSQLServerProfile$ // // (Yes, with the $ on the end) // For testing without JNDI // testDataSource { //typical test settings for unit tests //driverClassName = "org.h2.Driver" //url = "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1" //H2 embedded in-memory for unit tests //url = "jdbc:h2:~/stewardTest.h2" //H2 embedded on disk at ~/test // } // createTablesOnStart = false // true for testing with H2 in memory, when not running unit tests. Set to false normally // } // gruntWatch = false //false for production, true for mvn tomcat7:run . Allows the client javascript and html files to be loaded via gruntWatch . } email { //add javax mail properties from https://www.tutorialspoint.com/javamail_api/javamail_api_smtp_servers.htm here // javaxmail { // mail { // smtp { //for postfix on localhost // host = localhost // port = 25 //for AWS SES - See http://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-using-smtp-java.html // host = email-smtp.us-east-1.amazonaws.com // port = 25 // transport.protocol = smtps // auth = true // starttls.enable = true // starttls.required = true // } // } // } //Must be set for AWS SES. See http://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-using-smtp-java.html // authenticator { // username = yourUsername // password = yourPassword // } } } //Default settings for akka //akka { // loglevel = INFO // log-config-on-start = on // loggers = ["akka.event.slf4j.Slf4jLogger"] // Toggles whether the threads created by this ActorSystem should be daemons or not. Use daemonic inside of tomcat to support shutdown // daemonic = on //} //You'll see these settings for spray, baked into the .war files. //spray.servlet { -// boot-class = "net.shrine.dashboard.metadata.Boot" //Don't change this one. It'll start the wrong (or no) application if you change it. +// boot-class = "net.shrine.dashboard.net.shrine.metadata.Boot" //Don't change this one. It'll start the wrong (or no) application if you change it. // request-timeout = 30s //}