1.2.3 • Published 1 year ago

@digital-blueprint/greenlight-app v1.2.3

Weekly downloads
-
License
LGPL-2.1-or-later
Repository
github
Last release
1 year ago

Greenlight Application

GitHub Repository | npmjs package | Unpkg CDN | Greenlight Bundle | Project documentation

Build and Test

Creates an entrance ticket and imports your evidence of a low epidemiological risk on the working device to validate it for admission even before attending a course or exam. The ticket then enables you to access the university premises quickly and efficiently.

Prerequisites

Local development

# get the source
git clone git@github.com:digital-blueprint/greenlight-frontend.git
cd greenlight
git submodule update --init

# install dependencies
yarn install

# constantly build dist/bundle.js and run a local web-server on port 8001 
yarn run watch

# run tests
yarn test

Jump to https://localhost:8001, and you should get a Single Sign On login page.

Using this app as pre-built package

Install app

If you want to install the dbp greenlight app in a new folder greenlight-app you can call:

npx @digital-blueprint/cli@latest install-app greenlight greenlight-app /

Warning: There may be issues when you run these commands as root user, best use a non-root user, like www-data. To do this you can for example open a shell with runuser -u www-data -- bash.

Afterwards you can point your Apache web-server to greenlight-app/public.

Make sure you are allowing .htaccess files in your Apache configuration.

Also make sure to add all of your resources you are using (like your API and Keycloak servers) to the Content-Security-Policy in your greenlight-app/public/.htaccess, so the browser allows access to those sites.

You can also use this app directly from the Unpkg CDN for example like this: dbp-greenlight/index.html

Note that you will need a Keycloak server along with a client id for the domain you are running this html on.

Update app

If you want to update the dbp greenlight app in the current folder you can call:

npx @digital-blueprint/cli@latest update-app greenlight

Warning: After the update the trust data has to be restored, see below.

Warning: There may be issues when you run these commands as root user, best use a non-root user, like www-data. To do this you can for example open a shell with runuser -u www-data -- bash.

Cron job for Updating the Trust Data

The app depends on the official trust list, value sets and business rules which are provided via https://github.com/Federal-Ministry-of-Health-AT/green-pass-overview

In addition it depends on a set of business rules which are maintained at https://github.com/digital-blueprint/dcc-at-rule-sets

Both data sets need to be updated regularly via a cron job.

0    *    *    *    *     /<my-path>/greenlight-app/public/app/update.sh TUGRAZ

The first argument passed to update.sh defines the rule set which should be downloaded. The script depends on curl being installed.

You will find the certificates downloaded in /<my-path>/greenlight-app/public/app/local/@digital-blueprint/greenlight-app/dgc-trust/prod.

NOTE: Failing to update the data will result in signatures expiring after 2 days which breaks the core functionality of the app.

Activities

This app has the following activities:

  • dbp-acquire-3g-ticket
  • dbp-show-active-tickets
  • dbp-show-reference-ticket

You can find the documentation of these activities in the greenlight activities documentation.

Adapt app

Functionality

You can add multiple attributes to the <dbp-greenlight> tag.

attribute namevalueLink to description
provider-rootBooleanapp-shell
langStringlanguage-select
entry-point-urlStringapp-shell
keycloak-configObjectapp-shell
base-pathStringapp-shell
srcStringapp-shell
html-overridesStringcommon
themesArraytheme-switcher
darkModeThemeOverrideStringtheme-switcher
gp-search-hash-stringStringgreenlight activities
gp-search-self-test-string-arrayStringgreenlight activities
gp-self-test-validBooleangreenlight activities
ticket-typesObjectgreenlight activities
show-preselectedBooleangreenlight activities
preselected-optionStringgreenlight activities
file-handling-enabled-targetsStringfile-handling
nextcloud-web-app-password-urlStringfile-handling
nextcloud-web-dav-urlStringfile-handling
nextcloud-file-urlStringfile-handling
nextcloud-auth-infoStringfile-handling
nextcloud-nameStringfile-handling

Mandatory attributes

If you are not using the provider-root attribute to "terminate" all provider attributes you need to manually add these attributes so that the topic will work properly:

<dbp-greenlight
    auth
    requested-login-status
    analytics-event
>
</dbp-greenlight>

Design

For frontend design customizations, such as logo, colors, font, favicon, and more, take a look at the theming documentation.

"dbp-greenlight" slots

These are common slots for the app-shell. You can find the documentation of these slots in the app-shell documentation. For the app specific slots take a look at the greenlight activities.