Configuration

Settings

Settings are in-app administration interface for changing various behavior and look. An adminitrator can navigate to settings from the main (left) menu. (since 2.2.0)

It allows to configure (among others):

  • toggle optional DSW features including registration or configurable questionnaire visibility by users

  • external authentication using OpenID standard

  • set up information texts and dashboard shown in the client (before login, after login, etc.)

  • connection to registry

  • feedback and support links and repository

  • organization details (such as name, ID, and pre-configured affiliations)

OpenID

To configure OpenID service for external authentication, you need to have the following

  • Client ID and Client secret for the service

  • Root URL of the service (you can verify it that this returns valid JSON: <URL>/.well-known/openid-configuration

You can test the OpenID service using official OpenID Connect Playground

Configuration files

Files are used for setting the server-side configuration.

Server

Server configuration is done using YAML format. We provide examples directly in config folder of the repository https://github.com/ds-wizard/engine-backend. For tests there exist special versions suffixed by -test.

Build Info

A build configuration (build-info.yml file) contains information for the build of the application. This configuration can be created simply by running a prepared script build-info.sh. Normally this script is run by a CI Tool (Travis CI) during build process.

Important

If you build server app locally, you should also run build-info.sh otherwise your app will show bad build information and version.

Application

The mail configuration file that provide a lot of options and contains necessary settings for server to be running properly. You can see the example application.yml below. Next, all options are described in detail.

application.yml
 1general:
 2  environment: Production
 3  serverPort: 3000
 4  secret: TteM1a0QkGe6ED5OvihPkA82LmwkWU6f
 5  clientUrl: http://localhost:8080
 6  serviceToken: NlQSNbGvh7EtcpinGnHE9g91
 7  integrationConfig: config/integration.yml
 8
 9database:
10  host: mongo
11  databaseName: dsw-server
12  port: 27017
13  authEnabled: false
14  username:
15  password:
16
17messaging:
18  host: rabbitmq
19  port: 5672
20  username: rabbit
21  password: password
22  vhost: /
23
24mail:
25  enabled: false
26  name:
27  email:
28  host:
29  port:
30  ssl:
31  authEnabled:
32  username:
33  password:
34
35analytics:
36  enabled: false
37  email:

Section aside General may be omitted and default values will be used for whole sections (typically disabled, see below).

General

Configuration related to general operations of the server application.

environment
Type

Enumeration [Production, Staging, Development, Test]

Default

Production

Environment that your deployment is using. This affects which migrations are used and other minor things can be different in various environments.

serverPort
Type

Integer [0-65535]

Default

3000

Port that will be the web server listening on.

secret
Type

String

Secret string of 32 characters for encrypting configuration in database and JWT tokens.

clientUrl
Type

URI

Default

"" (empty)

Address of client application (e.g. https://localhost:8080).

serviceToken
Type

String

Default

"" (empty)

Randomly generated string for API authentication of service endpoints.

integrationConfig
Type

String

Default

"engine-wizard/config/integration.yml"

Filename or whole path of integration configuration file (see Integration). The path is relative to the working directory from where the Wizard runs.

Database

Configuration of connection to MongoDB database.

host
Type

String

Default

"mongo"

Hostname or IP address of the server running MongoDB.

port
Type

Integer [0-65535]

Default

27017

Port that is used for MongoDB on the server (usually 27017).

databaseName
Type

String

Default

"dsw-server"

Name of the database for DS Wizard within MongoDB.

authEnabled
Type

Boolean

Default

false

Whether authentication is enabled on MongoDB server and is required to connect to the database.

username
Type

String

Default

"" (empty)

Username for authentication to database connection (if authEnabled is true).

password
Type

String

Default

"" (empty)

Password for authentication to database connection (if authEnabled is true).

RabbitMQ

Configuration of connection to RabbitMQ.

host
Type

String

Default

"rabbitmq"

Hostname or IP address of the server running RabbitMQ.

port
Type

Integer [0-65535]

Default

5672

Port that is used for RabbitMQ on the server (usually 5672).

username
Type

String

Default

"guest"

Username for authentication to RabbitMQ connection.

password
Type

String

Default

"guest"

Password for authentication to RabbitMQ connection.

vhost
Type

String

Default

"/"

Virtual host on RabbitMQ server (see RabbitMQ docs).

Mail

Configuration for sending emails (such as registration activation or for forgotten password mechanism) from the DS Wizard using SMTP connection.

Tip

You should enable emails unless you test the application for yourself only. It is used for email confirmations and mechanism of resetting password.

enabled
Type

Boolean

Default

true

If emails will be sent and SMTP configured.

name
Type

String

Name of the DS Wizard instance that will be used as “senders name” in email headers.

email
Type

String

Default

"" (empty)

Email address from which the emails will be sent.

host
Type

String

Default

"" (empty)

Hostname or IP address of SMTP server.

port
Type

Integer [0-65535]

Default

465 (or 25 based on ssl option)

Port that is used for SMTP on the server (usually 25 for plain or 465 for SSL).

ssl
Type

Boolean

Default

false

If SMTP connection is encrypted via SSL (we highly recommend this).

authEnabled
Type

Boolean

Default

false

If authentication using username and password should be used for SMTP.

username
Type

String

Default

"" (empty)

Username for the SMTP connection.

password
Type

String

Default

"" (empty)

Password for the SMTP connection.

Analytics

Configuration of analytic/informational emails for administrators, e.g., that a new user registered into the DS Wizard.

enabled
Type

Boolean

Default

false

If analytic emails should be sent.

email
Type

String

Default

"" (empty)

Target email address where analytics to which will be sent.

Integration

Integrations in the DS Wizard are using external APIs and you might need some configured variables such as API keys or endpoints. For example, integration with ID dbase might use following configuration.

integration.yml
1dbase:
2  apiKey: topSecretDBaseApiKey
3  apiUrl: https://api.dbase.example:10666
4  someConfig: someValue4Integration

There can be multiple integrations configured in single file. These can be used then when setting up the integration in the Editor as ${apiKey}, ${apiUrl}, etc. More about integrations can be found in separate integrations documentation.

Note

Different knowledge models may use different variable naming, please read the information in README to find out what is required. We recommend authors to stick with apiKey and apiUrl variables as our convention.

Client

If you are running the client app using “With Docker”, the all you need is to specify API_URL environment variable inside docker-compose.yml. In case you want to run the client locally, you need to create a config.js file in the project root:

config.js
1window.dsw = {
2    apiUrl: 'http://localhost:3000'
3}

Client also provides wide variety of style customizations using SASS variables. Then you can mount it as volumes in case Docker as well:

volumes:
  # mount SCSS file
  - /path/to/extra.scss:/src/scss/customizations/_extra.scss
  - /path/to/overrides.scss:/src/scss/customizations/_overrides.scss
  - /path/to/variables.scss:/src/scss/customizations/_variables.scss
  # mount other assets, you can then refere them from scss using '/assets/...'
  - /path/to/assets:/usr/share/nginx/html/assets
  • _extra.scss = This file is loaded before all other styles. You can use it, for example, to define new styles or import fonts.

  • _overrides.scss = This file is loaded after all other styles. You can use it to override existing styles.

  • _variables.scss = A lot of values related to styles are defined as variables. The easiest way to customize the style is to define new values for these variables using this file.

For more information about variables and assets, visit Theming Bootstrap. The color of illustrations can be adjusted using $illustrations-color variable.

Document Worker

Configuration of document worker must match with server configuration. In docker, the default moint point is set to /app/config.yml but it can be overriden using environment variable DOCWORKER_CONFIG. Similarly, working directory can be changed from the default /tmp/docworker using DOCWORKER_WORKDIR.

docworker.yml
 1mongo:
 2  host: localhost
 3  port: 27017
 4  database: test_db
 5  collection: documents
 6  fs_collection: documentFs
 7  auth:
 8    username:
 9    password:
10    database: (database)
11    mechanism: SCRAM-SHA-256
12
13mq:
14  host: localhost
15  port: 5672
16  vhost: /
17  queue: test_queue
18  auth:
19    username:
20    password:
21
22logging:
23  level: INFO
24
25externals:
26  pandoc:
27    executable: pandoc
28    args: --standalone
29    timeout:
30  wkhtmltopdf:
31    executable: wkhtmltopdf
32    args:
33    timeout:

mongo

host
Type

String

Default

"localhost"

Hostname or IP address of the server running MongoDB.

port
Type

Integer [0-65535]

Default

27017

Port that is used for MongoDB on the server (usually 27017).

database
Type

String

Name of the database for DS Wizard within MongoDB.

collection
Type

String

Default

documents (optional)

Name of the collection for documents.

fs_collection
Type

String

Default

documentFs (optional)

Name of the collection for files.

templates_collection
Type

String

Default

templates (optional)

Name of the collection for templates.

assets_fs_collection
Type

String

Default

templateAssetFs (optional)

Name of the collection for template assets.

auth.username
Type

String

Default

None (optional)

Username for authentication to database connection (will be used if set).

auth.password
Type

String

Default

None (optional)

Password for authentication to database connection (will be used if set).

auth.database
Type

String

Default

<database> (optional)

Authentication database used for MongoDB, defaults to the same value provided in database option.

auth.mechanism
Type

String

Default

"SCRAM-SHA-256" (optional)

Authentication mechanism used for MongoDB.

mq

host
Type

String

Default

"localhost"

Hostname or IP address of the server running RabbitMQ.

port
Type

Integer [0-65535]

Default

5672

Port that is used for RabbitMQ on the server (usually 5672).

vhost
Type

String

Default

"/"

Virtual host on RabbitMQ server (see RabbitMQ docs).

queue
Type

String

Name of queue used for passing document jobs (typically document.generation).

auth.username
Type

String

Default

None (optional)

Username for authentication to RabbitMQ connection (if any).

auth.password
Type

String

Default

None (optional)

Password for authentication to RabbitMQ connection (if any).

logging

level
Type

String

Default

"WARNING"

Name of logging level (use names of Python logging levels).

pandoc

executable
Type

String

Default

"pandoc"

Executable command for running Pandoc (can be aliased or defined with absolute path).

args
Type

String

Default

"--standalone"

Default arguments used for all Pandoc calls.

timeout
Type

Float

Default

None (optional)

Timeout for Pandoc subprocess call.

wkhtmltopdf

executable
Type

String

Default

"pandoc"

Executable command for running WkHtmlToPdf (can be aliased or defined with absolute path).

args
Type

String

Default

"" (empty)

Default arguments used for all WkHtmlToPdf calls.

timeout
Type

Float

Default

None (optional)

Timeout for WkHtmlToPdf subprocess call.

DMP templates

You can freely customize and style templates of documents (DMPs). HTML and CSS knowledge is required and for doing more complex templates that use some conditions, loops, or macros, knowledge of Jinja templating language (pure Python implementation) is useful.

For further information, read Template Development.

Email templates

Similarly to DMP templates, you can customize templates for emails sent by the Wizard located in templates/mail folder. It also uses Jinja templating language (for email templates we use its implementation called Ginger). And you can create HTML template, Plain Text template, add attachments, and add inline images (which can be used inside the HTML using Content-ID equal to the filename).

Templates structure

The structure is following:

  • templates/mail/_common = layout, styles, common files

  • templates/mail/_common/attachments = attachments for all emails

  • templates/mail/_common/images = inline images for all emails

  • templates/mail/<name> = templates specific for this email type, should contain message.html.j2 and message.txt.j2 files (or at least one of them, mail servers prefer both variants)

  • templates/mail/<name>/attachments = attachments specific for email type

  • templates/mail/<name>/images = inline images specific for email type

All attachments are loaded from the template-specific and common folders and included to email with detected MIME type. It similarly works for inline images but those are not displayed as attachments just as related part to HTML part (if present). We highly recommend to use ASCII-only names without whitespaces and with standard extensions. Also, sending minimum amount of data via email is suggested.

Templates variables

All templates are provided also with variables:

  • appTitle = from the configuration appTitle

  • clientAddress = from the configuration clientUrl

  • mailName = from the configuration name

  • user = user (subject of an email), structure with attributes accessible via . (dot, e.g. user.name)

Email types

Currently, there are following types of mail:

  • registrationConfirmation = email sent to user after registration to verify email address, contains activationLink variable

  • registrationCreatedAnalytics = email sent to address specified in the configuration about registration of a new user (see Analytics config)

  • resetPassword = email sent to user when requests resetting a password, contains resetLink variable

Docker deployment

Including own email templates while using dockerized Wizard is practically the same as for DMP templates. You can also bind whole templates/mail folder (or even templates if want to change both):

server:
  image: datastewardshipwizard/wizard-server
  restart: always
  ports:
    - 3000:3000
  volumes:
    - /dsw/application.yml:/application/engine-wizard/config/application.yml
    - /dsw/templates/mail:/application/engine-wizard/templates/mail:ro
# ... (continued)