Skip to main content

Configuration

Structure of Directory

Within the tms/config/ directory containing the configuration files the following items have to be present:

  • production.yml: YAML file containing the general configuration for the server.
  • templates/: Directory containing the Pug template files (see below).

Those files are provided through a docker volume. See the installation guide for more information.

Every release contains either a link to the current sample configuration or a sample configuration itself. If it contains the later the server configuration might need an update according to the Configuration section of the release.

Options

The configuration object is of type ApplicationConfiguration.

ApplicationConfiguration

OptionRequired / DefaultDescription
databaseRequiredDatabaseConfiguration - Configuration of the database. See below for more information.
sessionTimeoutDefault: 120Number - The time of inactivity in minutes after which the session of the user times out and he/she must log in again.
prefix(optional, no default)String - Prefix of the root path the application is hosted on. If the application is hosted on the root path this setting must be omitted. Otherwise it has to be set to the prefix (ie. for the path https://example.org/foo this setting has to be set to foo)
handbookUrl(optional, no default)String - URL to the handbook of the TMS (the sample configuration sets this to the URL of this handbook). You should only have to change this if you want to provide your own version of the handbook.
defaultSettings(optional, defaults see "Settings" page)Settings to initialize parts of the server with. Those settings can also be configured through the client later on. See Settings for more information.

DatabaseConfiguration

The following table contains the options available for the database configuration, a short description and their default value (if they are optional).

OptionRequired / DefaultDescription
hostRequiredString - The name/address of the host (without port) which hosts the database container/server.
portRequiredNumber - The port of the database container/server.
databaseNameRequiredString - The name of the database which holds the data of the TMS. If the database does not exists while the server is starting the database gets created.
maxRetriesDefault: 2Number - Configures how often the server tries to establish a connection to the database while starting the server. If there is no connection after the maximum amount of retries the server is stopped with an error code.
reconnectTimeoutDefault: 10000Number - The time in milliseconds the server waits before retrying to connect to the database on start.

Environment Variables

All the following environment variables are required unless stated otherwise.

VariableDescription
TMS_DB_USERString - Username to log into the MySQL database.
TMS_DB_PASSWORDString - Password to log into the MySQL database.
TMS_SECRETString - Secret to use to encrypt and decrypt sensitive database entries. This secret should be created like a secure password (no easy to guess words, ...).
Keep your secret safe!

If you lose the secret used to encrypt database entries there is no way to recover the data from the database in a decrypted manner.

Pug Templates

The Tutor-Management-System can generate various PDFs. These can be configured using the following templates. The templates must be inside an templates/ folder inside the config/ folder. All templates use the pug template engine and variables which will get substituted by the corresponding value on PDF generation. Every template section contains a description on its usage, the variables used inside and an example. Please note that the templates do NOT need a html, body or head because they will be inserted into a body during PDF generation.

caution

Please note that all template files must be present at the start of the server.

Attendance Template

Filename: attendance.pug

This template gets used on the creation of a PDF containing a list of students of a tutorial. On this list students can leave their signature if they are present.

VariableDescription
tutorialSlotString - The slot of the tutorial which belongs to the sheet.
dateDateTime - Date to which the attendance list belongs. Takes in the format after a comma. For more information on the available functions see the luxon documentation
tutorNameString - Name of the tutor in the format <lastname>, <firstname>.
students{ name: string }[] - Array containing objects of which each holds the name of one student.

Credentials Template

Filename: credentials.pug

VariableDescription
credentials{ name: string; username: string; password: string }[] - Array containing objects which hold information about the user.

Mail Template

Filename: mail.pug

VariableDescription
nameString - Name of the user which gets the email.
usernameString - Username of the user which gets the email.
passwordString - Password of the user which gets the email.

Scheinexam Results Template

Filename: scheinexam.pug

VariableDescription
scheinExamNoNumber - Number of the Scheinexam of this PDF.
statuses{ matriculationNo: string; state: PassedState }[] - Array containing the statuses of each student (with matriculation number) for the exam of the generated PDF. PassedState can be one of the following values: "passed", "notPassed", "notAttended"

Scheinstatus Results Template

Filename: scheinstatus.pug

VariableDescription
statuses{ matriculationNo: string; state: PassedState }[] - Array containing the Schein statuses of each student (with matriculation number). PassedState can be one of the following values: "passed", "notPassed"