27 Configuration
Kurdey edited this page 2 years ago


Backend main configuration

The main configuration of the backend server is in the file /server.config.production.json, which contains the following entries:

  • "AUTHOR": Your Name
  • "SITE_NAME" : Name of the page, default "Lerntools",
  • "URL_PROTO": Protocol used to call, i. "https://" or "http://"
  • "URL_HOST": Host name under which the app is externally available, e.g. "www.my-domain.club"
  • "URL_PREFIX": Usually empty (→ ""), if necessary, insert reverse proxy directory, e.g. "/learntools"
  • "INFO_MAIL": Sender address of the info mails, format "NAME" ADDRESS
  • "INFO_MAIL_APPS": true/false Allow Apps to send email notifications to users (might be detected as spam)
  • "MODULE_DIR": Default value "modules"
  • "UPLOAD_DIR": Default value "upload" - where to store uploaded files
  • "MONGO_URL": URL of the DB-connection, should contain password and username if configured in the DB
  • "JWT": Configure Access- and Refresh-Tokens
    • "SECRET": Long random string to secure the session
    • "REFRESH_EXPIRES": Maximum length of a session (in seconds, recommended > 3600 s)
    • "ACCESS_EXPIRES": Expire time for access tokens (recommended < 600s)
    • "RESTRICT_IP": Boolean value, if IP-Adress should be included in JWT secret (security improvement, but might lead to problems on changing IP-Adresses)
  • "API_URL": Default value "/", change for reverse proxy
  • "CORS_SITES": Array of sites allowed to access the backend
  • "USER_ADMIN_MAIL": E-Mail used to receive notifications on new or deleted users
  • "TAN_EXPIRES": timeout of transaction codes, default 300
  • "TAN_IGNORE": wether to skip verification of transaction codes never do that in production!!!
  • "REGISTRATION": Setup of self registration
    • "ALLOWED": General switch for self registration on this server
    • "MAX_USERS": Maximum number of users on this server
    • "DEFAULT_ROLES": Roles assigned to new users after registration
  • "ACCOUNT_CLEANUP": Setup for automatic deletion of unused accounts
    • "ENABLED": true/false - turn feature on or off
    • "EXPIRE_PERIOD": Number of inactive days until account is deleted
    • "GRACE_WEEKS": Number of weeks the user is given time to login after time is expired. user will receive one mail per week (on Sunday at 5 to 12...)
  • "SMTP_CONF": Configure a SMTP server to send messages, please see config.example for details

Client main configuration

The configuration of the client app is possible in the file /app.config.js.

  • author: Name of the site-author, displayed in the bottom bar
  • pageTitle: title of the html-page
  • defaultLocale: "de" / "en"
  • fixNavbar: true / false (Always display top navbar at fixed position)

If you decide to separate client and backend you also have to adapt:

  • urlBackend: url of backend api, leave as '/' when running your own backend
  • urlImprint: url of your imprint (other server)
  • urlTerms: url of your terms of usage (other server)
  • urlPrivacy: url of your privacy info (other server)

All required modules have to be imported (see import lines) and added to the array allModules

Module configuration (usually not required)

The specific configuration of the modules is possible via the file config.json (in the subfolder of the module). In addition to a unique ID, these configuration files initially contain a META block with the following variables:

  • "title": Title displayed in the menu or navigation
  • "text": Description displayed in the menu
  • "to": Entry route for the module
  • "adminto": Entry router for the administrator (optional)
  • "icon": Displayed icon in SVG format
  • "index": Flag, whether module should be displayed on the start page
  • "role": Role name used to limit access to the module

All other entries refer to special parameters of the modules.

Index page

The contents of config/main.json and the META blocks of the individual modules generate the navigation and main page.

Terms of use, Imprint, Privacy

You have two possibilites to provide this information:

  1. Create markdownfiles imprint.md, terms.md and privacy.md as described in Install
  2. Provide links to external pages by defining the parameters urlImprint, urlTerms, urlPrivacy in the client configuration file app.config.js.