Page tree
Skip to end of metadata
Go to start of metadata

To configure the Data Steward, you must first make sure that you have created a user with Data Steward privileges. To create a Data Steward, please follow the instructions here:


8.3 - Setting up the Data Steward user


After setting up the Data Steward user, you will need to configure the steward section within SHRINE's configuration file - shrine.conf. You must first enable the authorization type to be "shrine-steward" within the queryEntryPoint section and then configure the shrineSteward block as well.

Note

Note that we have used the 'qep' user that we have created in Chapter 8.1

authorizationType = "shrine-steward"

    shrineSteward {
      qepUserName = "qep"
      qepPassword = "password"
      stewardBaseUrl = "https://localhost:6443"
    }

After templating that section, proceed further down in shrine.conf until you reach the steward section {}. This section governs how the steward application behaves and contains the ability to send audit emails to the Data Steward. Here, please make sure you have a valid email address in the 'From' and 'To' fields. 


steward {    
    createTopicsMode = Approved
 
    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://localhost: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 convenience: 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"
      jndiDataSourceName = "java:comp/env/jdbc/stewardDB"
      slickProfileClassName = "slick.jdbc.MySQLDriver$"
                                //slick.driver.MySQLDriver$
                                //slick.driver.PostgresDriver$
                                //slick.driver.SQLServerDriver$
                                //slick.driver.OracleDriver$
                                //slick.driver.MSSQLServerProfile$
    }
  } // end steward

If you wish to not send emails, you can simply switch sendAuditEmails = false in this section.


Also, please make sure that you have the email {} section populated in shrine.conf. SHRINE sends emails from postfix on port 25 by default, but you can use another service if you want. For example, we have listed AWS SES as an alternative way:

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
		  //comment out if you want to use an alternative host and port
          //host = localhost
          //port = 25

          //for AWS SES - See http://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-using-smtp-java.html
		  //comment out if you want to just use postfix over port 25
          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 = yourSESUsername
          password = yourSESPassword
    }
  }
} //end email section