3.12.0 • Published 1 day ago

@educandu/educandu v3.12.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 day ago

educandu

codecov

The educandu framework

Prerequisites

  • node.js ^18.0.0
  • Docker
  • optional: globally installed gulp: npm i -g gulp-cli

The output of this repository is an npm package (@educandu/educandu).

Configuration options

OptionDescriptionTypeRequired
appNameThe name of the application using educandustringyes
portPort on which the project is runnumber, mininum 1no, defaults to 80
trustProxyWhether to trust proxies at all or how many maximum consecutive proxy hubs to trustboolean or number (mininum 0)no, defaults to false
mongoConnectionStringThe URI for the project's MongoDBstringyes
skipMaintenanceWhether or not to run MongoDB migrations and checks on startupbooleanno, defaults to false
cdnEndpointThe URL of the AWS-hosted CDNstringyes
cdnRegionThe region of the AWS-hosted CDNstringyes
cdnAccessKeyThe access key of the AWS-hosted CDNstringyes
cdnSecretKeyThe secret key of the AWS-hosted CDNstringyes
cdnBucketNameThe name of the AWS S3 bucket storing the CDN datastringyes
cdnRootUrlThe root url of the CDNstringyes
customResolversThe same object that is also used to hydrate the app on the client side{ resolveCustomPageTemplate, resolveCustomHomePageTemplate, resolveCustomSiteLogo, resolveCustomPluginInfos }yes, accepts null for either property and it will default to the internal setup
publicFoldersThe project-specific public folders that need to be accesible on the project domainarray of { publicPath: <string>, destination: <string>, setHeaders: <function(res, path){}> }no, also setHeaders is optional
resourcesURLs to additional resource bundles, e.g. extra translationsarray of stringno
themeFileURL to overrides of educandu LESS variables, through which the AntDesign theme is setstringno
additionalControllersCustom controllersarrayOfControllers: []no, defaults to []
additionalHeadHtmlCustom HTML to inject in the <head> of the documentstringno
sessionSecretThe unique ID of the user sessionstringno, defaults to a generated unique id
sessionCookieDomainThe domain attribute to be set on the session cookiestringno, defaults to the request's host header domain
sessionCookieNameThe name to be used for the session cookiestringyes
sessionCookieSecureThe value of the cookie's "secure" flag. Note: When set to true, the cookie only gets set over an HTTPS connectionboolean, defaults to falseno
sessionDurationInMinutesThe validity of the user session in minutesnumber, minumum 1no, defaults to 60
consentCookieNamePrefixPrefix for the consent cookie namestringyes
uploadLiabilityCookieNameName for the public storage upload liability cookiestringyes
announcementCookieNamePrefixPrefix for the admin-set announcement cookiestringyes
xFrameOptionsValue for the x-frame-options header set on pages responsestring ('DENY' or 'SAMEORIGIN')no, by default the header is not set
xRoomsAuthSecretValue for the x-rooms-auth-secret header expected from rooms-auth-lambda authorization requests upon accessing rooms CDN resourcesstringno, when not provided the effect of the request is an automatic session cookie invalidation/regeneration
smtpOptionsThe SMTP setup for sending emails to users upon registration or password resetanythingyes
emailSenderAddressThe email address from which emails are sentstringyes
adminEmailAddressThe email address to show to users as the admin email addressstringno
emailAddressIgnorePatternA RegExp pattern to match receiver addresses of emails that should not be sent, defaults to ^.+@test\.com$stringno
initialUserThe first user account, with admin role{ email, password, displayName } or nullno
basicAuthUsersWhen provided, the web pages become protected by a basic auth layer through which the provided users can authenticate. This way non-production environments can be protected.object with usernames as keys and passwords as valuesno
pluginsList of plugins available to platform users when they create website contentarray of stringno, defaults to ['markdown', 'image']
allowedLicensesA list of SPDX license names that should be usable inside the app (defaults to the whole currently "known" list)string[]no
disabledFeaturesA list of names of disabled featuresstring[]no
exposeErrorDetailsWhether or not to expose details of thrown errors (e.g. stack trace)booleanno, defaults to false
disableSchedulingWhether or not to run job schedulersbooleanno, defaults to false
ambConfigConfiguration for the AMB endpoint (https://dini-ag-kim.github.io/amb/){ apiKey: <string>, image: <string>, publisher: [{ type: <'Organization'/'Person'>, name: <string> }], about: [{ id: <category URL from https://skohub.io/dini-ag-kim/hochschulfaechersystematik/heads/master/w3id.org/kim/hochschulfaechersystematik/scheme.en.html>}] }no, however if provided, apiKey is mandatory
samlAuthConfiguration for SAML authentication{ decryption: { pvk: <string>, cert: <string> }, identityProviders: [{ key: <string>, displayName: <string>, entryPoint: <string>, cert: <string>, logoUrl: <string>, expiryTimeoutInDays: <number> }] }no, however if provided, decryption.pvk, decryption.cert, identityProviders.key, identityProviders.displayName, identityProviders.entryPoint and identityProviders.cert are mandatory, while identityProviders.logoUrl defaults to null and identityProviders.expiryTimeoutInDays defaults to 180 days

How to use

$ yarn add @educandu/educandu

Use it in code as follows:

import educandu from '@educandu/educandu';

educandu({
  appName: 'My educandu app',
  port: 3000,
  mongoConnectionString: 'mongodb://root:rootpw@localhost:27017/dev-educandu-db?replicaSet=educandurs&authSource=admin',
  skipMaintenance: false,
  cdnEndpoint: 'http://localhost:9000',
  cdnRegion: 'eu-central-1',
  cdnAccessKey: 'UVDXF41PYEAX0PXD8826',
  cdnSecretKey: 'SXtajmM3uahrQ1ALECh3Z3iKT76s2s5GBJlbQMZx',
  cdnBucketName: 'dev-educandu-cdn',
  cdnRootUrl: 'http://localhost:9000/dev-educandu-cdn',
  customResolvers: {
    resolveCustomPageTemplate: null,
    resolveCustomHomePageTemplate: null,
    resolveCustomSiteLogo: null,
    resolveCustomPluginInfos: null
  }).required(),
  publicFolders: [{ publicPath: '/', destination: path.resolve(thisDir, '../static') }],
  resources: ['./test-app/resource-overrides.json'].map(x => path.resolve(x)),
  themeFile: path.resolve('./test-app/theme.less'),
  additionalControllers: [MyCustomPageController],
  additionalHeadHtml: '<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"/apple-touch-icon.png?v=cakfaagbe\">\n<link rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/favicon-32x32.png?v=cakfaagbe\">',
  sessionSecret: 'd4340515fa834498b3ab1aba1e4d9013',
  sessionCookieDomain: 'localhost',
  sessionCookieName: 'APP_SESSION_ID',
  sessionCookieSecure: false,
  sessionDurationInMinutes: 60,
  consentCookieNamePrefix: 'APP_CONSENT_COOKIE_NAME',
  uploadLiabilityCookieName: 'APP_UPLOAD_LIABILITY_COOKIE_NAME',
  announcementCookieNamePrefix: 'APP_ANNOUNCEMENT_COOKIE_NAME',
  xFrameOptions: 'SAMEORIGIN',
  smtpOptions: 'smtp://localhost:8025/?ignoreTLS=true',
  emailSenderAddress: 'educandu-test-app@test.com',
  initialUser: {
    email: 'test@test.com',
    password: 'test',
    displayName: 'Testibus'
  },
  basicAuthUsers: {
    gatekeeper: 'gatekeeperPassword'
  },
  plugins: ['markdown', 'image', 'table', 'audio', 'video'],
  allowedLicenses: ['CC0-1.0', 'CC-BY-4.0', 'MIT'],
  exposeErrorDetails: true,
  disableScheduling: false,
  ambConfig {
    apiKey: 'C36CAD3A805A11EDA1EB0242AC120002',
    image: './test-app/images/app-logo.png',
    publisher: [
      {
        type: 'Organization',
        name: 'My educandu app'
      }
    ],
    about: [
      {
        id: 'https://w3id.org/kim/hochschulfaechersystematik/n78'
      }
    ]
  },
  samlAuth: {
    decryption: {
      pvk: '<private_key>',
      cert: '<certificate>',
    },
    identityProviders: [
      {
        key: 'panda',
        displayName: 'The Panda University',
        entryPoint: 'https://en.wikipedia.org/wiki/Giant_panda',
        cert: 'nonsense',
        logoUrl: '/images/panda-logo.svg',
        expiryTimeoutInDays: 4 * 30
      }
    ]
  }
});

This should run the entire application and provide you with an admin user as defined on the initialUser setting.

How to override the styles

In order to override the styles provided by educandu you need to import the main.less of the educandu project and override the less variables provided. An example override implementation is provided by the test-app in the main.less file. We will keep this file updated so any user will know what can be overriden. Alternatively you can go to the global-variables.less in educandu and consult the list there.

How to run and develop locally

The gulpfile has a number of useful tasks for local development which can be run with gulp {taskName}, most commonly used:

  • (default): build and start up the test app (in watch mode), which is set up to use educandu, CLI args:
    • --instances 3 (number of app instances to run, optional, default 1)
    • --tunnel (flag to run using the tunnel proxy, optional, default: no tunneling)
  • test: runs all tests (with coverage)
  • testWatch: runs tests in watch mode
  • lint: runs eslint
  • fix: runs eslint in fixing mode
  • up: starts all the containers (if not already running)
  • down: stops all the containers and deletes them
  • maildev(Up|Down), mongo(Up|Down), minio(Up|Down): starts/stops individual containers
  • createSamlCertificate: creates a self-signed certificate that can be used for SAML de/encryption, CLI args:
    • --domain my-domain.com (common name value, mandatory)
    • --days 365 (expiration time, optional, default: 100 * 365)
    • --dir ./output (output directory, optional, default: ./certificates)

By default the test application requires that the following ports are available to be taken:

  • 3000: the test application or the load balancerin case of load balancing (instances > 1)
  • 400x: the individual test application instances, in case of load balancing (instances > 1)
  • 8000: maildev UI, can be used for debugging emails that would be sent to the users (http://localhost:8000)
  • 8025: maildev SMTP server
  • 9000: minio server and UI (http://localhost:9000)
  • 21017: mongodb server

The ports can be changed in gulpfile.js and need to be reflected in test-app/index.js.

When tunneling is enabled, the following environment variables are required to be set:

  • TUNNEL_TOKEN token used to verify the tunnel connection
  • TUNNEL_WEBSITE_DOMAIN domain of the website served over the tunnel
  • TUNNEL_WEBSITE_CDN_DOMAIN domain of the cdn belonging to the website served over the tunnel
  • TUNNEL_WEBSITE_SAML_AUTH_DECRYPTION certificate pems for SAML en-/decryption in JSON format ({ "pvk": <private_key>, "cert": <cert> })

OER learning platform for music

Funded by 'Stiftung Innovation in der Hochschullehre'

A Project of the 'Hochschule für Musik und Theater München' (University for Music and Performing Arts)

Project owner: Hochschule für Musik und Theater München\ Project management: Ulrich Kaiser

3.12.0

1 day ago

3.11.0

9 days ago

3.10.0

12 days ago

3.9.0

15 days ago

3.8.0

18 days ago

3.7.0

22 days ago

3.6.2

4 months ago

3.6.3

4 months ago

3.6.1

4 months ago

3.6.0

4 months ago

3.5.0

4 months ago

3.4.0

4 months ago

3.3.1

4 months ago

3.3.0

5 months ago

1.18.1

5 months ago

1.18.0

5 months ago

3.2.2

5 months ago

3.2.1

5 months ago

3.2.0

5 months ago

3.1.0

5 months ago

3.0.0

5 months ago

2.0.2

5 months ago

2.0.1

5 months ago

2.0.0

5 months ago

1.17.6

5 months ago

1.17.5

5 months ago

1.17.4

5 months ago

1.6.1

6 months ago

1.6.0

6 months ago

1.5.3

6 months ago

1.5.2

6 months ago

1.5.1

6 months ago

1.5.0

6 months ago

1.4.1

6 months ago

1.4.0

6 months ago

1.3.0

7 months ago

1.9.0

6 months ago

1.8.0

6 months ago

1.7.0

6 months ago

1.11.3

6 months ago

1.11.2

6 months ago

1.11.1

6 months ago

1.10.0

6 months ago

1.12.2

6 months ago

1.12.1

6 months ago

1.12.0

6 months ago

1.11.0

6 months ago

1.13.2

5 months ago

1.13.1

5 months ago

1.13.0

5 months ago

1.2.0

7 months ago

1.14.0

5 months ago

1.15.0

5 months ago

1.1.1

7 months ago

1.1.0

7 months ago

1.16.0

5 months ago

1.17.2

5 months ago

1.17.1

5 months ago

1.17.0

5 months ago

1.17.3

5 months ago

0.114.0

1 year ago

0.102.1

1 year ago

0.102.2

1 year ago

0.102.0

1 year ago

0.113.1

1 year ago

0.113.2

1 year ago

0.113.3

1 year ago

0.113.4

1 year ago

0.113.0

1 year ago

0.101.2

1 year ago

0.101.3

1 year ago

0.101.1

1 year ago

0.116.2

1 year ago

0.99.4

1 year ago

0.116.3

1 year ago

0.99.0

1 year ago

0.99.1

1 year ago

0.116.0

1 year ago

0.99.2

1 year ago

0.116.1

1 year ago

0.99.3

1 year ago

0.104.3

1 year ago

0.104.0

1 year ago

0.104.1

1 year ago

0.104.2

1 year ago

0.115.0

1 year ago

0.103.0

1 year ago

0.118.0

1 year ago

0.118.1

1 year ago

0.118.2

1 year ago

0.118.3

1 year ago

0.118.4

1 year ago

0.106.1

1 year ago

0.106.2

1 year ago

0.106.3

1 year ago

0.106.0

1 year ago

0.117.0

1 year ago

0.105.2

1 year ago

0.105.0

1 year ago

0.105.1

1 year ago

0.108.0

1 year ago

0.108.1

1 year ago

0.108.2

1 year ago

0.108.3

1 year ago

0.108.4

1 year ago

0.108.5

1 year ago

0.119.0

1 year ago

0.119.1

1 year ago

0.119.2

1 year ago

0.107.0

1 year ago

0.109.0

1 year ago

0.109.1

1 year ago

0.110.4

1 year ago

0.110.5

1 year ago

0.110.6

1 year ago

0.97.4

1 year ago

0.110.0

1 year ago

0.110.1

1 year ago

0.110.2

1 year ago

0.110.3

1 year ago

0.98.1

1 year ago

0.98.2

1 year ago

0.98.3

1 year ago

0.98.4

1 year ago

0.98.0

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.112.2

1 year ago

0.112.0

1 year ago

0.112.1

1 year ago

0.100.0

1 year ago

0.111.0

1 year ago

0.93.0

1 year ago

0.94.1

1 year ago

0.94.0

1 year ago

0.87.0

1 year ago

0.91.0

1 year ago

0.91.1

1 year ago

0.88.4

1 year ago

0.88.0

1 year ago

0.88.1

1 year ago

0.88.2

1 year ago

0.88.3

1 year ago

0.92.0

1 year ago

0.92.1

1 year ago

0.89.0

1 year ago

0.85.0

1 year ago

0.85.1

1 year ago

0.85.2

1 year ago

0.97.2

1 year ago

0.97.3

1 year ago

0.97.0

1 year ago

0.97.1

1 year ago

0.86.0

1 year ago

0.90.0

1 year ago

0.87.1

1 year ago

0.87.2

1 year ago

0.95.0

1 year ago

0.95.1

1 year ago

0.95.2

1 year ago

0.95.3

1 year ago

0.84.0

1 year ago

0.96.0

1 year ago

0.96.1

1 year ago

0.96.2

1 year ago

0.85.3

1 year ago

0.81.0

1 year ago

0.81.1

1 year ago

0.78.0

2 years ago

0.78.1

2 years ago

0.70.0

2 years ago

0.67.0

2 years ago

0.82.0

1 year ago

0.79.0

2 years ago

0.71.0

2 years ago

0.68.1

2 years ago

0.68.0

2 years ago

0.76.0

2 years ago

0.65.1

2 years ago

0.80.0

2 years ago

0.80.1

2 years ago

0.77.0

2 years ago

0.66.0

2 years ago

0.74.0

2 years ago

0.75.0

2 years ago

0.83.0

1 year ago

0.72.1

2 years ago

0.72.0

2 years ago

0.69.0

2 years ago

0.73.0

2 years ago

0.55.0

2 years ago

0.56.1

2 years ago

0.56.2

2 years ago

0.56.0

2 years ago

0.64.0

2 years ago

0.53.0

2 years ago

0.53.1

2 years ago

0.65.0

2 years ago

0.54.1

2 years ago

0.54.2

2 years ago

0.54.0

2 years ago

0.62.0

2 years ago

0.59.2

2 years ago

0.59.3

2 years ago

0.59.0

2 years ago

0.59.1

2 years ago

0.59.4

2 years ago

0.51.2

2 years ago

0.51.0

2 years ago

0.48.0

2 years ago

0.48.1

2 years ago

0.63.0

2 years ago

0.63.1

2 years ago

0.52.1

2 years ago

0.52.0

2 years ago

0.49.1

2 years ago

0.49.0

2 years ago

0.60.0

2 years ago

0.57.0

2 years ago

0.61.0

2 years ago

0.58.3

2 years ago

0.58.4

2 years ago

0.58.1

2 years ago

0.58.2

2 years ago

0.58.0

2 years ago

0.58.5

2 years ago

0.50.1

2 years ago

0.50.0

2 years ago

0.47.0

2 years ago

0.43.0

2 years ago

0.44.0

2 years ago

0.45.0

2 years ago

0.41.0

2 years ago

0.42.0

2 years ago

0.46.0

2 years ago

0.38.1

2 years ago

0.38.0

2 years ago

0.39.1

2 years ago

0.39.0

2 years ago

0.39.2

2 years ago

0.40.0

2 years ago

0.36.0

2 years ago

0.37.3

2 years ago

0.37.2

2 years ago

0.37.1

2 years ago

0.37.0

2 years ago

0.37.4

2 years ago

0.33.1

2 years ago

0.33.0

2 years ago

0.34.3

2 years ago

0.34.2

2 years ago

0.34.1

2 years ago

0.34.0

2 years ago

0.35.0

2 years ago

0.32.0

2 years ago

0.31.1

2 years ago

0.20.0

2 years ago

0.17.0

2 years ago

0.17.1

2 years ago

0.29.0

2 years ago

0.7.4

2 years ago

0.21.0

2 years ago

0.18.0

2 years ago

0.10.0

2 years ago

0.22.0

2 years ago

0.8.0

2 years ago

0.30.3

2 years ago

0.15.0

2 years ago

0.15.1

2 years ago

0.15.2

2 years ago

0.30.2

2 years ago

0.30.1

2 years ago

0.30.0

2 years ago

0.27.1

2 years ago

0.27.0

2 years ago

0.16.0

2 years ago

0.16.1

2 years ago

0.28.0

2 years ago

0.13.0

2 years ago

0.25.2

2 years ago

0.25.1

2 years ago

0.25.0

2 years ago

0.14.0

2 years ago

0.26.1

2 years ago

0.26.0

2 years ago

0.19.0

2 years ago

0.19.1

2 years ago

0.11.0

2 years ago

0.23.2

2 years ago

0.23.1

2 years ago

0.23.0

2 years ago

0.9.0

2 years ago

0.12.0

2 years ago

0.24.0

2 years ago

0.7.2

2 years ago

0.7.1

2 years ago

0.7.3

2 years ago

0.7.0

2 years ago

0.4.0-pre.2

2 years ago

0.4.0-pre.3

2 years ago

0.4.0-pre.1

2 years ago

0.4.0-pre.4

2 years ago

0.6.0

2 years ago

0.4.1-pre.5

2 years ago

0.4.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago

0.0.0-test1

2 years ago