Some of the initial configuration and startup steps of bootstrapping LabKey Server, i.e. launching a new server on a new database, can be skipped by creating a properties file that is applied at startup. Configuration steps which can be provided via the bootstrap properties file include, but are not limited to:
  • Some site settings, such as file root and base server URL
  • Script engine definitions, such as automatically enabling R scripting
  • User groups and permission roles
  • Custom content for the home page

Using Bootstrap Property Files

Bootstrap property files are named with a .properties extention and placed in the /trunk/build/deploy/startup directory. Create this directory in your enlistment if it does not exist.

One or more properties files can be defined and placed in this startup directory. The files are applied in alphabetical order, meaning a property defined in two such files will retain the "last" setting applied. To control specific ordering among files, it is good practice to name your files with sequential numbers such as "01default.properties" "02application.properties", etc. In this example, without the numbers, the default properties would override specific application properties.

Bootstrap Properties File Format

The properties file is a list of lines setting various properties. The format of a given line is:

<optional scope>.<name>;<optional modifier> = <value>

For example, to emulate going to the "Look and Feel Settings", then setting the "initial" "systemEmailAddress" to be "support@labkey.com", you would include this line:

LookAndFeelSettings.systemEmailAddress:bootstrap=support@labkey.com

Modifier Options

The "<optional modifier>" can be one of the following:

  • bootstrap: (default) Apply the properties only when the server first starts on a new database.
  • startup: Apply the properties every time the server starts.
  • immutable: Set and never change.

Create and Apply Property Files

As an example scenario, you might want to bypass the default "first login" UI by preconfiguring your login and password.

  • If it does not exist, create the directory: /trunk/build/deploy/startup
  • Create a .properties file, such as 01default.properties
  • Paste this content, substituting your own email address:
    • "LookAndFeelSettings.systemEmailAddress:initial=MYEMAIL@YOUR_DOMAIN.com"
  • Save the file, ensuring it maintains a .properties extension.
  • Restart your server on a new database.
  • Instead of the traditional new log in steps, the example property is prefilled.

Minimal Set of Properties to Bootstrap LabKey Server

SiteSettings.systemEmailAddress = {systemEmail} SiteSettings.defaultDomain = {defaultDomain} SiteSettings.baseServerURL = {baseServerUrl} SiteSettings.exceptionReportingLevel = HIGH SiteSettings.usageReportingLevel = MEDIUM SiteSettings.sslRequired = true

#Initial User, we may also want to define a site admin user UserRoles.{email} = org.labkey.api.security.roles.ApplicationAdminRole

#Script Engine Definition, not required for bootstrap but required for scenario: ScriptEngineDefinition.R.name;bootstrap = R Scripting Engine ScriptEngineDefinition.R.languageName = R ScriptEngineDefinition.R.languageVersion = {version} ScriptEngineDefinition.R.extensions = R,r ScriptEngineDefinition.R.exePath = {exePath} ScriptEngineDefinition.R.exeCommand = CMD BATCH --slave ScriptEngineDefinition.R.outputFileName = ${scriptName}.Rout

Related Topics

For more about options that can be controlled with a startup properties file:

Discussion

Was this content helpful?

Log in or register an account to provide feedback


previousnext
 
expand all collapse all